コンパイラ警告対策
warning: "REFKNOWNFOLDERID" redefined
warning: left operand of comma operator has no effect
warning: unused variable ‘r’
warning: suggest parentheses around ‘&&’ within ‘||’
@@ -175,11 +175,13 @@ | ||
175 | 175 | // shell32.dll |
176 | 176 | #if !defined(NTDDI_VERSION) || !defined(NTDDI_VISTA) || (NTDDI_VERSION < NTDDI_VISTA) |
177 | 177 | typedef GUID KNOWNFOLDERID; |
178 | +#if !defined(REFKNOWNFOLDERID) | |
178 | 179 | #ifdef __cplusplus |
179 | 180 | #define REFKNOWNFOLDERID const KNOWNFOLDERID & |
180 | 181 | #else // !__cplusplus |
181 | 182 | #define REFKNOWNFOLDERID const KNOWNFOLDERID * const |
182 | 183 | #endif // __cplusplus |
184 | +#endif | |
183 | 185 | |
184 | 186 | #include "ttknownfolders.h" |
185 | 187 |
@@ -379,6 +379,9 @@ | ||
379 | 379 | { |
380 | 380 | char class_name[32]; |
381 | 381 | int r = GetClassNameA(hwnd, class_name, _countof(class_name)); |
382 | + if (r == 0) { | |
383 | + return; | |
384 | + } | |
382 | 385 | if (strcmp(class_name, "Button") == 0) { |
383 | 386 | SendMessage(hwnd, BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)icon); |
384 | 387 | } |
@@ -386,7 +389,8 @@ | ||
386 | 389 | SendMessage(hwnd, STM_SETICON, (WPARAM)icon, 0); |
387 | 390 | } |
388 | 391 | else { |
389 | - assert(("not support", FALSE)); | |
392 | + // not support | |
393 | + assert(FALSE); | |
390 | 394 | } |
391 | 395 | } |
392 | 396 |
@@ -79,7 +79,7 @@ | ||
79 | 79 | nullptr); |
80 | 80 | pseudoPtr = nullptr; |
81 | 81 | if (hWnd == nullptr) { |
82 | - OutputDebugPrintf("CreateWindow %d\n", GetLastError()); | |
82 | + OutputDebugPrintf("CreateWindow %ld\n", GetLastError()); | |
83 | 83 | return FALSE; |
84 | 84 | } else { |
85 | 85 | m_hWnd = hWnd; |
@@ -1298,7 +1298,7 @@ | ||
1298 | 1298 | */ |
1299 | 1299 | BOOL IsRelativePathW(const wchar_t *path) |
1300 | 1300 | { |
1301 | - if (path[0] == '\\' || path[0] == '/' || path[0] != '\0' && path[1] == ':') { | |
1301 | + if (path[0] == '\\' || path[0] == '/' || (path[0] != '\0' && path[1] == ':')) { | |
1302 | 1302 | return FALSE; |
1303 | 1303 | } |
1304 | 1304 | return TRUE; |
@@ -1306,7 +1306,7 @@ | ||
1306 | 1306 | |
1307 | 1307 | BOOL IsRelativePathA(const char *path) |
1308 | 1308 | { |
1309 | - if (path[0] == '\\' || path[0] == '/' || path[0] != '\0' && path[1] == ':') { | |
1309 | + if (path[0] == '\\' || path[0] == '/' || (path[0] != '\0' && path[1] == ':')) { | |
1310 | 1310 | return FALSE; |
1311 | 1311 | } |
1312 | 1312 | return TRUE; |