[ttssh2-commit] [9522] コンパイラ警告対策

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2021年 11月 10日 (水) 22:02:28 JST


Revision: 9522
          https://osdn.net/projects/ttssh2/scm/svn/commits/9522
Author:   zmatsuo
Date:     2021-11-10 22:02:28 +0900 (Wed, 10 Nov 2021)
Log Message:
-----------
コンパイラ警告対策

warning: "REFKNOWNFOLDERID" redefined
warning: left operand of comma operator has no effect
warning: unused variable ‘r’
warning: suggest parentheses around ‘&&’ within ‘||’

Modified Paths:
--------------
    trunk/teraterm/common/compat_win.h
    trunk/teraterm/common/dlglib_cpp.cpp
    trunk/teraterm/common/tmfc_frame.cpp
    trunk/teraterm/common/ttlib_static_cpp.cpp

-------------- next part --------------
Modified: trunk/teraterm/common/compat_win.h
===================================================================
--- trunk/teraterm/common/compat_win.h	2021-11-10 13:02:18 UTC (rev 9521)
+++ trunk/teraterm/common/compat_win.h	2021-11-10 13:02:28 UTC (rev 9522)
@@ -175,11 +175,13 @@
 // shell32.dll
 #if !defined(NTDDI_VERSION) || !defined(NTDDI_VISTA) || (NTDDI_VERSION < NTDDI_VISTA)
 typedef GUID KNOWNFOLDERID;
+#if !defined(REFKNOWNFOLDERID)
 #ifdef __cplusplus
 #define REFKNOWNFOLDERID const KNOWNFOLDERID &
 #else // !__cplusplus
 #define REFKNOWNFOLDERID const KNOWNFOLDERID * const
 #endif // __cplusplus
+#endif
 
 #include "ttknownfolders.h"
 

Modified: trunk/teraterm/common/dlglib_cpp.cpp
===================================================================
--- trunk/teraterm/common/dlglib_cpp.cpp	2021-11-10 13:02:18 UTC (rev 9521)
+++ trunk/teraterm/common/dlglib_cpp.cpp	2021-11-10 13:02:28 UTC (rev 9522)
@@ -379,6 +379,9 @@
 {
 	char class_name[32];
 	int r = GetClassNameA(hwnd, class_name, _countof(class_name));
+	if (r == 0) {
+		return;
+	}
 	if (strcmp(class_name, "Button") == 0) {
 		SendMessage(hwnd, BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)icon);
 	}
@@ -386,7 +389,8 @@
 		SendMessage(hwnd, STM_SETICON, (WPARAM)icon, 0);
 	}
 	else {
-		assert(("not support", FALSE));
+		// not support
+		assert(FALSE);
 	}
 }
 

Modified: trunk/teraterm/common/tmfc_frame.cpp
===================================================================
--- trunk/teraterm/common/tmfc_frame.cpp	2021-11-10 13:02:18 UTC (rev 9521)
+++ trunk/teraterm/common/tmfc_frame.cpp	2021-11-10 13:02:28 UTC (rev 9522)
@@ -79,7 +79,7 @@
 		nullptr);
 	pseudoPtr = nullptr;
 	if (hWnd == nullptr) {
-		OutputDebugPrintf("CreateWindow %d\n", GetLastError());
+		OutputDebugPrintf("CreateWindow %ld\n", GetLastError());
 		return FALSE;
 	} else {
 		m_hWnd = hWnd;

Modified: trunk/teraterm/common/ttlib_static_cpp.cpp
===================================================================
--- trunk/teraterm/common/ttlib_static_cpp.cpp	2021-11-10 13:02:18 UTC (rev 9521)
+++ trunk/teraterm/common/ttlib_static_cpp.cpp	2021-11-10 13:02:28 UTC (rev 9522)
@@ -1298,7 +1298,7 @@
  */
 BOOL IsRelativePathW(const wchar_t *path)
 {
-	if (path[0] == '\\' || path[0] == '/' || path[0] != '\0' && path[1] == ':') {
+	if (path[0] == '\\' || path[0] == '/' || (path[0] != '\0' && path[1] == ':')) {
 		return FALSE;
 	}
 	return TRUE;
@@ -1306,7 +1306,7 @@
 
 BOOL IsRelativePathA(const char *path)
 {
-	if (path[0] == '\\' || path[0] == '/' || path[0] != '\0' && path[1] == ':') {
+	if (path[0] == '\\' || path[0] == '/' || (path[0] != '\0' && path[1] == ':')) {
 		return FALSE;
 	}
 	return TRUE;


ttssh2-commit メーリングリストの案内
Back to archive index