[ttssh2-commit] [9628] 変数のスコープを狭くした

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2021年 12月 24日 (金) 23:42:51 JST


Revision: 9628
          https://osdn.net/projects/ttssh2/scm/svn/commits/9628
Author:   zmatsuo
Date:     2021-12-24 23:42:51 +0900 (Fri, 24 Dec 2021)
Log Message:
-----------
変数のスコープを狭くした

- warning C4456: 'ParamFileNameW' を宣言すると、以前のローカル宣言が隠蔽されます

Modified Paths:
--------------
    trunk/teraterm/teraterm/ttdde.c

-------------- next part --------------
Modified: trunk/teraterm/teraterm/ttdde.c
===================================================================
--- trunk/teraterm/teraterm/ttdde.c	2021-12-24 14:42:41 UTC (rev 9627)
+++ trunk/teraterm/teraterm/ttdde.c	2021-12-24 14:42:51 UTC (rev 9628)
@@ -387,7 +387,6 @@
 {
 	char Command[MaxStrLen + 1];
 	int i;
-	wchar_t *ParamFileNameW;
 	BOOL r;
 
 	memset(Command, 0, sizeof(Command));
@@ -435,8 +434,8 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
-	case CmdBPlusSend:
-		ParamFileNameW = ToWcharU8(ParamFileName);
+	case CmdBPlusSend: {
+		wchar_t *ParamFileNameW = ToWcharU8(ParamFileName);
 		r = BPStartSend(ParamFileNameW);
 		free(ParamFileNameW);
 		if (r) {
@@ -445,6 +444,7 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
+	}
 	case CmdChangeDir:
 		strncpy_s(ts.FileDir, sizeof(ts.FileDir),ParamFileName, _TRUNCATE);
 		break;
@@ -530,8 +530,8 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
-	case CmdKmtGet:
-		ParamFileNameW = ToWcharU8(ParamFileName);
+	case CmdKmtGet: {
+		wchar_t *ParamFileNameW = ToWcharU8(ParamFileName);
 		r = KermitGet(ParamFileNameW);
 		free(ParamFileNameW);
 		if (r) {
@@ -540,8 +540,9 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
-	case CmdKmtSend:
-		ParamFileNameW = ToWcharU8(ParamFileName);
+	}
+	case CmdKmtSend: {
+		wchar_t *ParamFileNameW = ToWcharU8(ParamFileName);
 		r = KermitStartSend(ParamFileNameW);
 		free(ParamFileNameW);
 		if (r) {
@@ -550,6 +551,7 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
+	}
 	case CmdLoadKeyMap:
 		strncpy_s(ts.KeyCnfFN, sizeof(ts.KeyCnfFN),ParamFileName, _TRUNCATE);
 		PostMessage(HVTWin,WM_USER_ACCELCOMMAND,IdCmdLoadKeyMap,0);
@@ -612,8 +614,8 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
-	case CmdQVSend:
-		ParamFileNameW = ToWcharU8(ParamFileName);
+	case CmdQVSend: {
+		wchar_t *ParamFileNameW = ToWcharU8(ParamFileName);
 		r = QVStartSend(ParamFileNameW);
 		free(ParamFileNameW);
 		if (r) {
@@ -622,6 +624,7 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
+	}
 	case CmdRestoreSetup:
 		strncpy_s(ts.SetupFName, sizeof(ts.SetupFName),ParamFileName, _TRUNCATE);
 		PostMessage(HVTWin,WM_USER_ACCELCOMMAND,IdCmdRestoreSetup,0);
@@ -691,8 +694,8 @@
 			break;
 		}
 		break;
-	case CmdXmodemRecv:
-		ParamFileNameW = ToWcharU8(ParamFileName);
+	case CmdXmodemRecv: {
+		wchar_t *ParamFileNameW = ToWcharU8(ParamFileName);
 		r = XMODEMStartSend(ParamFileNameW, ParamXmodemOpt);
 		free(ParamFileNameW);
 		if (r) {
@@ -701,8 +704,9 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
-	case CmdXmodemSend:
-		ParamFileNameW = ToWcharU8(ParamFileName);
+	}
+	case CmdXmodemSend: {
+		wchar_t *ParamFileNameW = ToWcharU8(ParamFileName);
 		r = XMODEMStartReceive(ParamFileNameW, ParamBinaryFlag, ParamXmodemOpt);
 		free(ParamFileNameW);
 		if (r) {
@@ -711,6 +715,7 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
+	}
 	case CmdZmodemRecv:
 		if (ZMODEMStartReceive(TRUE, FALSE)) {
 			DdeCmnd = TRUE;
@@ -718,8 +723,8 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
-	case CmdZmodemSend:
-		ParamFileNameW = ToWcharU8(ParamFileName);
+	case CmdZmodemSend: {
+		wchar_t *ParamFileNameW = ToWcharU8(ParamFileName);
 		r = ZMODEMStartSend(ParamFileNameW, ParamBinaryFlag, FALSE);
 		free(ParamFileNameW);
 		if (r) {
@@ -728,7 +733,7 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
-
+	}
 	case CmdYmodemRecv:
 		if (YMODEMStartReceive(TRUE))
 		{
@@ -737,8 +742,8 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
-	case CmdYmodemSend:
-		ParamFileNameW = ToWcharU8(ParamFileName);
+	case CmdYmodemSend: {
+		wchar_t *ParamFileNameW = ToWcharU8(ParamFileName);
 		r = YMODEMStartSend(ParamFileNameW);
 		if (r) {
 			DdeCmnd = TRUE;
@@ -746,7 +751,7 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
-
+	}
 		// add 'callmenu' (2007.11.18 maya)
 	case CmdCallMenu:
 		i = atoi(ParamFileName);


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