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:
@@ -326,7 +326,7 @@ PIVector<PIFile::FileInfo> PIDir::entries() {
|
||||
}
|
||||
} else {
|
||||
WIN32_FIND_DATAA fd;
|
||||
memset(&fd, 0, sizeof(fd));
|
||||
piZeroMemory(fd);
|
||||
p += "\\*";
|
||||
void * hf = FindFirstFileA((LPCSTR)(p.data()), &fd);
|
||||
if (!hf) return l;
|
||||
@@ -335,7 +335,7 @@ PIVector<PIFile::FileInfo> PIDir::entries() {
|
||||
PIString fn(fd.cFileName);
|
||||
if (fn == "..") hdd = true;
|
||||
l << PIFile::fileInfo(dp + fn);
|
||||
memset(&fd, 0, sizeof(fd));
|
||||
piZeroMemory(fd);
|
||||
} while (FindNextFileA(hf, &fd) != 0);
|
||||
FindClose(hf);
|
||||
l.sort(sort_compare);
|
||||
@@ -440,7 +440,7 @@ PIDir PIDir::current() {
|
||||
char rc[1024];
|
||||
#endif
|
||||
#ifdef WINDOWS
|
||||
memset(rc, 0, 1024);
|
||||
piZeroMemory(rc, 1024);
|
||||
if (GetCurrentDirectory(1024, (LPTSTR)rc) == 0) return PIString();
|
||||
PIString ret(rc);
|
||||
ret.replaceAll("\\", PIDir::separator);
|
||||
@@ -463,13 +463,13 @@ PIDir PIDir::home() {
|
||||
#endif
|
||||
#ifdef WINDOWS
|
||||
rc = new char[1024];
|
||||
memset(rc, 0, 1024);
|
||||
piZeroMemory(rc, 1024);
|
||||
if (ExpandEnvironmentStrings((LPCTSTR) "%HOMEPATH%", (LPTSTR)rc, 1024) == 0) {
|
||||
delete[] rc;
|
||||
return PIDir();
|
||||
}
|
||||
PIString hp(rc);
|
||||
memset(rc, 0, 1024);
|
||||
piZeroMemory(rc, 1024);
|
||||
if (ExpandEnvironmentStrings((LPCTSTR) "%HOMEDRIVE%", (LPTSTR)rc, 1024) == 0) {
|
||||
delete[] rc;
|
||||
return PIDir();
|
||||
@@ -495,7 +495,7 @@ PIDir PIDir::temporary() {
|
||||
char * rc = nullptr;
|
||||
#ifdef WINDOWS
|
||||
rc = new char[1024];
|
||||
memset(rc, 0, 1024);
|
||||
piZeroMemory(rc, 1024);
|
||||
int ret = GetTempPath(1024, (LPTSTR)rc);
|
||||
if (ret == 0) {
|
||||
delete[] rc;
|
||||
|
||||
Reference in New Issue
Block a user