[ttssh2-commit] [9373] コンパイラの警告で簡単なものを修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2021年 8月 19日 (木) 00:45:39 JST


Revision: 9373
          https://osdn.net/projects/ttssh2/scm/svn/commits/9373
Author:   zmatsuo
Date:     2021-08-19 00:45:39 +0900 (Thu, 19 Aug 2021)
Log Message:
-----------
コンパイラの警告で簡単なものを修正

- teraterm/common/codeconv.cpp
  - warning: unused variable 'flags' [-Wunused-variable]
- teraterm/teraterm/teraterm/ftdlg.cpp
  - warning: unused variable 'fuLoad' [-Wunused-variable]
- teraterm/teraterm/teraterm/commlib.c
  - warning: variable 'ErrMsg' set but not used [-Wunused-but-set-variable]
- teraterm/teraterm/filesys_proto.cpp
  - warning: unused variable 'UILanguageFile' [-Wunused-variable]
- teraterm/teraterm/common/win32helper.cpp:
  - warning: unused variable 'r' [-Wunused-variable]
  - 代入する変数を誤っていた
  - free() 追加
- teraterm/teraterm/ttpdlg/ttdlg.c
  - warning: 'static' is not at beginning of declaration [-Wold-style-declaration]

Modified Paths:
--------------
    trunk/teraterm/common/codeconv.cpp
    trunk/teraterm/common/win32helper.cpp
    trunk/teraterm/teraterm/commlib.c
    trunk/teraterm/teraterm/filesys_proto.cpp
    trunk/teraterm/teraterm/ftdlg.cpp
    trunk/teraterm/ttpdlg/ttdlg.c

-------------- next part --------------
Modified: trunk/teraterm/common/codeconv.cpp
===================================================================
--- trunk/teraterm/common/codeconv.cpp	2021-08-17 13:53:05 UTC (rev 9372)
+++ trunk/teraterm/common/codeconv.cpp	2021-08-18 15:45:39 UTC (rev 9373)
@@ -1067,7 +1067,6 @@
  */
 size_t ACPToWideChar_t(const char *str_ptr, wchar_t *wstr_ptr, size_t wstr_len)
 {
-	const DWORD flags = 0;
 	size_t out_len = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS,
 										 str_ptr, -1,
 										 wstr_ptr, wstr_len);

Modified: trunk/teraterm/common/win32helper.cpp
===================================================================
--- trunk/teraterm/common/win32helper.cpp	2021-08-17 13:53:05 UTC (rev 9372)
+++ trunk/teraterm/common/win32helper.cpp	2021-08-18 15:45:39 UTC (rev 9373)
@@ -176,8 +176,9 @@
 		return GetLastError();
 	}
 	wchar_t *d = (wchar_t *)malloc(sizeof(wchar_t) * len);
-	DWORD r = GetCurrentDirectoryW(len, d);
+	len = GetCurrentDirectoryW(len, d);
 	if (len == 0) {
+		free(d);
 		*dir = NULL;
 		return GetLastError();
 	}

Modified: trunk/teraterm/teraterm/commlib.c
===================================================================
--- trunk/teraterm/teraterm/commlib.c	2021-08-17 13:53:05 UTC (rev 9372)
+++ trunk/teraterm/teraterm/commlib.c	2021-08-18 15:45:39 UTC (rev 9373)
@@ -676,7 +676,6 @@
 
 void CommStart(PComVar cv, LONG lParam, PTTSet ts)
 {
-	char ErrMsg[31];
 	wchar_t ErrMsgW[31];
 	char Temp[20];
 	wchar_t UIMsgW[MAX_UIMSG];
@@ -695,7 +694,6 @@
 
 	switch (cv->PortType) {
 		case IdTCPIP:
-			ErrMsg[0] = 0;
 			switch (HIWORD(lParam)) {
 				case WSAECONNREFUSED:
 					get_lang_msgW("MSG_COMM_REFUSE_ERROR", UIMsgW, _countof(UIMsgW), L"Connection refused", ts->UILanguageFile);

Modified: trunk/teraterm/teraterm/filesys_proto.cpp
===================================================================
--- trunk/teraterm/teraterm/filesys_proto.cpp	2021-08-17 13:53:05 UTC (rev 9372)
+++ trunk/teraterm/teraterm/filesys_proto.cpp	2021-08-18 15:45:39 UTC (rev 9373)
@@ -797,7 +797,6 @@
 	};
 	PFileVarProto fv;
 	wchar_t TempFull[MAX_PATH];
-	const char *UILanguageFile = ts.UILanguageFile;
 	const wchar_t *UILanguageFileW = ts.UILanguageFileW;
 
 	switch (Message) {

Modified: trunk/teraterm/teraterm/ftdlg.cpp
===================================================================
--- trunk/teraterm/teraterm/ftdlg.cpp	2021-08-17 13:53:05 UTC (rev 9372)
+++ trunk/teraterm/teraterm/ftdlg.cpp	2021-08-18 15:45:39 UTC (rev 9373)
@@ -67,7 +67,6 @@
 BOOL CFileTransDlg::Create(HINSTANCE hInstance, CFileTransDlg::Info *info)
 {
 	BOOL Ok;
-	int fuLoad = LR_DEFAULTCOLOR;
 	HWND hwnd;
 
 	UILanguageFile = info->UILanguageFile;

Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2021-08-17 13:53:05 UTC (rev 9372)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2021-08-18 15:45:39 UTC (rev 9373)
@@ -694,7 +694,7 @@
 				}
 				ShowDlgItem(Dialog,IDC_WINATTRTEXT,IDC_WINATTR);
 				{
-					const static I18nTextInfo infos[] = {
+					static const I18nTextInfo infos[] = {
 						{ "DLG_WIN_NORMAL", L"Normal" },
 						{ "DLG_WIN_BOLD", L"Bold" },
 						{ "DLG_WIN_BLINK", L"Blink" },


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