version 4.5.0

PIThread::stopAndWait now returns bool
PIKbdListener on Linux now use piwaitevent_p and can immediately stop
new base method piZeroMemory, also migrate all "memset 0" to piZeroMemory
This commit is contained in:
2024-12-29 11:48:24 +03:00
parent 49713ddc57
commit 15548de79c
27 changed files with 121 additions and 89 deletions

View File

@@ -167,7 +167,7 @@ PIInit::PIInit() {
for (l = 0; l < MAX_PATH; ++l)
if (cpinfo.CodePageName[l] == '\0' || cpinfo.CodePageName[l] == ' ') break;
__sysoemname__ = new char[256];
memset(__sysoemname__, 0, 256);
piZeroMemory(__sysoemname__, 256);
memcpy(__sysoemname__, "ibm-", 4);
memcpy(&(__sysoemname__[4]), cpinfo.CodePageName, l);
# else
@@ -190,7 +190,7 @@ PIInit::PIInit() {
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &__pi_mac_clock);
# endif
char cbuff[1024];
memset(cbuff, 0, 1024);
piZeroMemory(cbuff, 1024);
if (gethostname(cbuff, 1023) == 0) {
sinfo->hostname = cbuff;
}
@@ -210,7 +210,7 @@ PIInit::PIInit() {
wchar_t ** argv_ = CommandLineToArgvW(GetCommandLineW(), &argc_);
if (argc_ > 0 && argv_ != 0) sinfo->execCommand = argv_[0];
LocalFree(argv_);
memset(cbuff, 0, 1024);
piZeroMemory(cbuff, 1024);
ulong unlen = 1023;
if (GetUserNameA(cbuff, &unlen) != 0) sinfo->user = cbuff;
# else // WINDOWS
@@ -219,7 +219,7 @@ PIInit::PIInit() {
if (ps)
sinfo->user = ps->pw_name;
else {
memset(cbuff, 0, 1024);
piZeroMemory(cbuff, 1024);
char * l = getlogin();
if (l) sinfo->user = l;
}