[Ttssh2-commit] [7395] コンパイラの警告対策

scmno****@osdn***** scmno****@osdn*****
2019年 1月 17日 (木) 23:02:30 JST


Revision: 7395
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7395
Author:   zmatsuo
Date:     2019-01-17 23:02:29 +0900 (Thu, 17 Jan 2019)
Log Message:
-----------
コンパイラの警告対策

Modified Paths:
--------------
    branches/cmake/.gitignore
    branches/cmake/CMakeLists.txt
    branches/cmake/TTProxy/YCL/include/YCL/Window.h
    branches/cmake/teraterm/teraterm/sizetip.c
    branches/cmake/teraterm/teraterm/tekwin.cpp
    branches/cmake/teraterm/teraterm/ttwsk.c
    branches/cmake/teraterm/teraterm/vtwin.cpp
    branches/cmake/teraterm/teraterm/winjump.c

-------------- next part --------------
Modified: branches/cmake/.gitignore
===================================================================
--- branches/cmake/.gitignore	2019-01-17 14:02:15 UTC (rev 7394)
+++ branches/cmake/.gitignore	2019-01-17 14:02:29 UTC (rev 7395)
@@ -1,27 +1,31 @@
-*.obj
-*.db
-*.exe
-*.dll
-*.suo
-*.opendb
-*.pdb
-*.ilk
-*.lib
-*.exp
-*.log
-*.tlog
-*.aps
-.vs/
-**/Debug/*
-**/Release/*
-*.vcxproj.user
-*.c~
-*.cpp~
-*.h~
-CMakeLists.txt~
-GPATH
-GRTAGS
-GTAGS
-**/build*/*
-*.vcproj.*.user
-teraterm/ttpdlg/svnversion.h
+*.obj
+*.db
+*.exe
+*.dll
+*.suo
+*.opendb
+*.pdb
+*.ilk
+*.lib
+*.exp
+*.log
+*.tlog
+*.aps
+*.ncb
+.vs/
+**/Debug/*
+**/Release/*
+**/*.Debug/*
+**/*.Release/*
+*.vcxproj.user
+*.c~
+*.cpp~
+*.h~
+CMakeLists.txt~
+GPATH
+GRTAGS
+GTAGS
+**/build*/*
+*.vcproj.*.user
+teraterm/ttpdlg/svnversion.h
+HTML/

Modified: branches/cmake/CMakeLists.txt
===================================================================
--- branches/cmake/CMakeLists.txt	2019-01-17 14:02:15 UTC (rev 7394)
+++ branches/cmake/CMakeLists.txt	2019-01-17 14:02:29 UTC (rev 7395)
@@ -1,53 +1,54 @@
-
-cmake_minimum_required(VERSION 3.6)
-
-project(teraterm_all)
-
-option(ENABLE_TTXSAMPLES "TTXSamples" ON)
-option(USE_UNICODE_API "unicode" ON)
-option(LINK_UNICOWS "unicode APIs for 9x" OFF)
-
-set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-
-set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-
-if(MSVC)
-  string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
-  string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
-  string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
-  string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_DEPRECATE /W3")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_CRT_SECURE_NO_DEPRECATE /W3")
-  # _WIN32_WINNT_WIN10 0x0A00
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_WIN32_WINNT=0x0a00")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_WIN32_WINNT=0x0a00")
-  if(${CMAKE_GENERATOR} MATCHES "Visual Studio 15 2017")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
-    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI")
-    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /ZI")
-    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
-  endif()
-elseif(MINGW)
-  set(C_CXX_COMMON_FLAGS "")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -static -ffunction-sections -fdata-sections ${C_ONLY_FLAGS} ${C_CXX_COMMON_FLAGS}")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -static -ffunction-sections -fdata-sections ${C_CXX_COMMON_FLAGS}")
-  if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
-	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc -static-libstdc++")
-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
-  endif()
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -s -Wl,--gc-sections")
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -s -Wl,--gc-sections")
-endif()
-
-add_subdirectory(teraterm)
-add_subdirectory(ttpmenu)
-add_subdirectory(TTProxy)
-add_subdirectory(ttssh2)
-add_subdirectory(TTXKanjiMenu)
-if(${ENABLE_TTXSAMPLES})
-  add_subdirectory(TTXSamples)
-endif()
+
+cmake_minimum_required(VERSION 3.6)
+
+project(teraterm_all)
+
+option(ENABLE_TTXSAMPLES "TTXSamples" ON)
+option(USE_UNICODE_API "unicode" ON)
+option(LINK_UNICOWS "unicode APIs for 9x" OFF)
+
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+
+set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+
+if(MSVC)
+  string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
+  string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
+  string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+  string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_DEPRECATE /W3")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_CRT_SECURE_NO_DEPRECATE /W3")
+  # _WIN32_WINNT_WIN10 0x0A00
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_WIN32_WINNT=0x0a00")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_WIN32_WINNT=0x0a00")
+  if(${CMAKE_GENERATOR} MATCHES "Visual Studio 15 2017")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI")
+    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /ZI")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
+  endif()
+elseif(MINGW)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0a00")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=0x0a00")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -static -ffunction-sections -fdata-sections ${C_ONLY_FLAGS}")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -static -ffunction-sections -fdata-sections")
+  if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc -static-libstdc++")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
+  endif()
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -s -Wl,--gc-sections")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -s -Wl,--gc-sections")
+endif()
+
+add_subdirectory(teraterm)
+add_subdirectory(ttpmenu)
+add_subdirectory(TTProxy)
+add_subdirectory(ttssh2)
+add_subdirectory(TTXKanjiMenu)
+if(${ENABLE_TTXSAMPLES})
+  add_subdirectory(TTXSamples)
+endif()

Modified: branches/cmake/TTProxy/YCL/include/YCL/Window.h
===================================================================
--- branches/cmake/TTProxy/YCL/include/YCL/Window.h	2019-01-17 14:02:15 UTC (rev 7394)
+++ branches/cmake/TTProxy/YCL/include/YCL/Window.h	2019-01-17 14:02:29 UTC (rev 7395)
@@ -54,10 +54,10 @@
 	bool SetWindowText(const TCHAR* text) {
 		return ::SetWindowText(window, text) != FALSE;
 	}
-	long SendMessage(int message, int wparam = 0, long lparam = 0)const {
+	long SendMessage(UINT message, WPARAM wparam = 0, LPARAM lparam = 0)const {
 		return ::SendMessage(window, message, wparam, lparam);
 	}
-	long PostMessage(int message, int wparam = 0, long lparam = 0)const {
+	long PostMessage(UINT message, WPARAM wparam = 0, LPARAM lparam = 0)const {
 		return ::PostMessage(window, message, wparam, lparam);
 	}
 	HWND GetParent()const {

Modified: branches/cmake/teraterm/teraterm/sizetip.c
===================================================================
--- branches/cmake/teraterm/teraterm/sizetip.c	2019-01-17 14:02:15 UTC (rev 7394)
+++ branches/cmake/teraterm/teraterm/sizetip.c	2019-01-17 14:02:29 UTC (rev 7395)
@@ -135,7 +135,7 @@
 				HDC hdc = CreateCompatibleDC(NULL);
 
 				SelectObject(hdc, tip_font);
-				GetTextExtentPoint32(hdc, str, _tcslen(str), &sz);
+				GetTextExtentPoint32(hdc, str, (int)_tcslen(str), &sz);
 
 				SetWindowPos(hWnd, NULL, 0, 0, sz.cx + 6, sz.cy + 6,
 				             SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
@@ -210,7 +210,7 @@
 		/* calculate the tip's size */
 
 		hdc = CreateCompatibleDC(NULL);
-		GetTextExtentPoint32(hdc, str, _tcslen(str), &sz);
+		GetTextExtentPoint32(hdc, str, (int)_tcslen(str), &sz);
 		DeleteDC(hdc);
 
 		GetWindowRect(src, &wr);

Modified: branches/cmake/teraterm/teraterm/tekwin.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/tekwin.cpp	2019-01-17 14:02:15 UTC (rev 7394)
+++ branches/cmake/teraterm/teraterm/tekwin.cpp	2019-01-17 14:02:29 UTC (rev 7395)
@@ -81,7 +81,6 @@
 	}
 
 	wc.style = CS_HREDRAW | CS_VREDRAW;
-//	wc.lpfnWndProc = (WNDPROC)AfxWndProc;
 	wc.lpfnWndProc = (WNDPROC)ProcStub;
 	wc.cbClsExtra = 0;
 	wc.cbWndExtra = 0;
@@ -202,7 +201,7 @@
 		WinMenu = CreatePopupMenu();
 		get_lang_msgT("TEKMENU_WINDOW", uimsg, _countof(uimsg), _T("&Window"), ts.UILanguageFile);
 		::InsertMenu(*Menu,4,MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION,
-		             (int)WinMenu, uimsg);
+		             (UINT_PTR)WinMenu, uimsg);
 	}
 }
 
@@ -411,13 +410,13 @@
 		PopupBase = CreatePopupMenu();
 		get_lang_msgT("MENU_CONTROL", uimsg, _countof(uimsg), _T("&File"), ts.UILanguageFile);
 		AppendMenu(PopupBase, MF_STRING | MF_ENABLED | MF_POPUP,
-		           (UINT)GetSubMenu(PopupMenu,0), uimsg);
+		           (UINT_PTR)GetSubMenu(PopupMenu,0), uimsg);
 		get_lang_msgT("TEKMENU_EDIT", uimsg, _countof(uimsg), _T("&Edit"), ts.UILanguageFile);
 		AppendMenu(PopupBase, MF_STRING | MF_ENABLED | MF_POPUP,
-		           (UINT)EditMenu, uimsg);
+		           (UINT_PTR)EditMenu, uimsg);
 		get_lang_msgT("TEKMENU_SETUP", uimsg, _countof(uimsg), _T("&Setup"), ts.UILanguageFile);
 		AppendMenu(PopupBase, MF_STRING | MF_ENABLED | MF_POPUP,
-		           (UINT)GetSubMenu(PopupMenu,2), uimsg);
+		           (UINT_PTR)GetSubMenu(PopupMenu,2), uimsg);
 		get_lang_msgT("TEKMENU_VTWIN", uimsg, _countof(uimsg), _T("VT-Wind&ow"), ts.UILanguageFile);
 		AppendMenu(PopupBase, MF_STRING | MF_ENABLED,
 		           ID_TEKVTWIN, uimsg);
@@ -424,11 +423,11 @@
 		if (WinMenu!=NULL) {
 			get_lang_msgT("TEKMENU_WINDOW", uimsg, _countof(uimsg), _T("&Window"), ts.UILanguageFile);
 			AppendMenu(PopupBase, MF_STRING | MF_ENABLED | MF_POPUP,
-			           (UINT)WinMenu, uimsg);
+			           (UINT_PTR)WinMenu, uimsg);
 		}
 		get_lang_msgT("TEKMENU_HELP", uimsg, _countof(uimsg), _T("&Help"), ts.UILanguageFile);
 		AppendMenu(PopupBase, MF_STRING | MF_ENABLED | MF_POPUP,
-		           (UINT)GetSubMenu(PopupMenu,4), uimsg);
+		           (UINT_PTR)GetSubMenu(PopupMenu,4), uimsg);
 		::ClientToScreen(tk.HWin, &p);
 		TrackPopupMenu(PopupBase,TPM_LEFTALIGN | TPM_LEFTBUTTON,
 		               p.x,p.y,0,tk.HWin,NULL);
@@ -486,7 +485,6 @@
 void CTEKWindow::OnPaint()
 {
 	PAINTSTRUCT ps;
-//	CDC *cdc;
 	HDC PaintDC;
 
 	PaintDC = BeginPaint(&ps);
@@ -654,7 +652,7 @@
 			get_lang_msgT("TEKMENU_WINDOW", uimsg, _countof(uimsg), _T("&Window"), ts.UILanguageFile);
 			::InsertMenu(MainMenu,4,
 			             MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION,
-			             (int)WinMenu, uimsg);
+			             (UINT_PTR)WinMenu, uimsg);
 		}
 		else {
 			RemoveMenu(MainMenu,4,MF_BYPOSITION);

Modified: branches/cmake/teraterm/teraterm/ttwsk.c
===================================================================
--- branches/cmake/teraterm/teraterm/ttwsk.c	2019-01-17 14:02:15 UTC (rev 7394)
+++ branches/cmake/teraterm/teraterm/ttwsk.c	2019-01-17 14:02:29 UTC (rev 7395)
@@ -32,7 +32,7 @@
 #undef _UNICODE
 #include "teraterm.h"
 #include "ttwsk.h"
-#include <Wspiapi.h>
+#include <wspiapi.h>
 #include "WSAAsyncGetAddrInfo.h"
 
 static HANDLE HWinsock = NULL;

Modified: branches/cmake/teraterm/teraterm/vtwin.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/vtwin.cpp	2019-01-17 14:02:15 UTC (rev 7394)
+++ branches/cmake/teraterm/teraterm/vtwin.cpp	2019-01-17 14:02:29 UTC (rev 7395)
@@ -4542,9 +4542,11 @@
 		CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT |
 		CF_SHOWHELP | CF_NOVERTFONTS |
 		CF_ENABLEHOOK;
-	if (ts.ListHiddenFonts) {
+#if (WINVER >= _WIN32_WINNT_WIN7) && defined(CF_INACTIVEFONTS)
+	if (IsWindows7OrLater() && ts.ListHiddenFonts) {
 		cf.Flags |= CF_INACTIVEFONTS;
 	}
+#endif
 	cf.lpfnHook = (LPCFHOOKPROC)(&TFontHook);
 	cf.nFontType = REGULAR_FONTTYPE;
 	cf.hInstance = hInst;

Modified: branches/cmake/teraterm/teraterm/winjump.c
===================================================================
--- branches/cmake/teraterm/teraterm/winjump.c	2019-01-17 14:02:15 UTC (rev 7394)
+++ branches/cmake/teraterm/teraterm/winjump.c	2019-01-17 14:02:29 UTC (rev 7395)
@@ -395,7 +395,7 @@
     0x000214ee, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}
 };
 #endif
-#if __MINGW64_VERSION_MAJOR < 7
+#if (NTDDI_VERSION < NTDDI_WIN7)
 static const IID IID_ICustomDestinationList = {
     0x6332debf, 0x87b5, 0x4670, {0x90,0xc0,0x5e,0x57,0xb4,0x08,0xa4,0x9e}
 };


Ttssh2-commit メーリングリストの案内