[Ttssh2-commit] [8726] VS2005でビルドできなくなっていたので修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2020年 4月 13日 (月) 01:41:52 JST


Revision: 8726
          https://osdn.net/projects/ttssh2/scm/svn/commits/8726
Author:   zmatsuo
Date:     2020-04-13 01:41:52 +0900 (Mon, 13 Apr 2020)
Log Message:
-----------
VS2005でビルドできなくなっていたので修正

Modified Paths:
--------------
    branches/unicode_buf_2/teraterm/teraterm/buffer.c

-------------- next part --------------
Modified: branches/unicode_buf_2/teraterm/teraterm/buffer.c
===================================================================
--- branches/unicode_buf_2/teraterm/teraterm/buffer.c	2020-04-12 16:41:45 UTC (rev 8725)
+++ branches/unicode_buf_2/teraterm/teraterm/buffer.c	2020-04-12 16:41:52 UTC (rev 8726)
@@ -1713,10 +1713,10 @@
  */
 static size_t MatchOneStringPtr(const buff_char_t *b, const wchar_t *str, size_t len)
 {
+	int match_pos = 0;
 	if (len == 0) {
 		return 0;
 	}
-	int match_pos = 0;
 	if (b->wc2[1] == 0) {
 		// \x83T\x83\x8D\x83Q\x81[\x83g\x83y\x83A\x82ł͂Ȃ\xA2
 		if (str[match_pos] != b->wc2[0]) {
@@ -1788,12 +1788,13 @@
 	}
 	GetPosFromPtr(b, &x, &y);
 	for(;;) {
+		size_t match_len;
 		if (IsBuffPadding(b)) {
 			b++;
 			continue;
 		}
 		// 1\x95\xB6\x8E\x9A\x93\xAF\x88ꂩ\x92\xB2\x82ׂ\xE9
-		size_t match_len = MatchOneString(x, y, str, len);
+		match_len = MatchOneString(x, y, str, len);
 		if (match_len == 0) {
 			result = FALSE;
 			break;
@@ -2107,10 +2108,11 @@
 				const buff_char_t *b = &CodeBuffW[TmpPtr + i];
 
 				for (k = 0; k < count; b++,k++) {
+					unsigned short c;
 					if (IsBuffPadding(b)) {
 						continue;
 					}
-					unsigned short c = b->ansi_char;
+					c = b->ansi_char;
 					*p++ = (c & 0xff);
 					if (c >= 0x100) {
 						*p++ = ((c >> 8) & 0xff);
@@ -2673,6 +2675,9 @@
  */
 static unsigned short ConvertACPChar(const buff_char_t *b)
 {
+	char *strA;
+	unsigned short chA;
+	size_t lenA;
 	size_t pool_lenW = 128;
 	wchar_t *strW = (wchar_t *)malloc(pool_lenW * sizeof(wchar_t));
 	BOOL too_small = FALSE;
@@ -2699,9 +2704,8 @@
 			strW[1] = 0;
 		}
 	}
-	size_t lenA;
-	char *strA = _WideCharToMultiByte(strW, lenW, CP_ACP, &lenA);
-	unsigned short chA = *(unsigned char *)strA;
+	strA = _WideCharToMultiByte(strW, lenW, CP_ACP, &lenA);
+	chA = *(unsigned char *)strA;
 	if (!IsDBCSLeadByte((BYTE)chA)) {
 		// 1byte\x95\xB6\x8E\x9A
 		chA = strA[0];
@@ -5188,11 +5192,12 @@
 	copysize = min(NumOfColumns, bufsize - 1);
 	idx = 0;
 	for (i = 0; i<copysize; i++) {
+		unsigned short c;
 		buff_char_t *b = &CodeBuffW[Ptr];
 		if (IsBuffPadding(b)) {
 			continue;
 		}
-		unsigned short c = b->ansi_char;
+		c = b->ansi_char;
 		buf[idx++] = c & 0xff;
 		if (c >= 0x100) {
 			buf[idx++] = (c >> 8) & 0xff;
@@ -5275,8 +5280,11 @@
 	BOOL Right;
 	wchar_t *str_ptr;
 	const buff_char_t *b;
+	wchar_t *pos_str;
+	wchar_t *attr_str;
+	wchar_t *ansi_str;
+    wchar_t *unicode_str;
 
-
 	DispConvWinToScreen(Xw, Yw, &X, &ScreenY, &Right);
 	Y = PageStart + ScreenY;
 
@@ -5293,13 +5301,11 @@
 	LockBuffer();
 	b = &CodeBuffW[TmpPtr+X];
 
-	wchar_t *pos_str;
 	aswprintf(&pos_str,
 			  L"ch(%d,%d(%d)) px(%d,%d)\n",
 			  X, ScreenY, Y,
 			  Xw, Yw);
 
-	wchar_t *attr_str;
 	{
 		const unsigned char attr = b->attr;
 		wchar_t *attr1_1_str;
@@ -5357,7 +5363,6 @@
 		free(attr2_str);
 	}
 
-	wchar_t *ansi_str;
 	{
 		unsigned char mb[4];
 		unsigned short c = b->ansi_char;
@@ -5380,7 +5385,6 @@
 				  L" 0x%04x\n", mb, c);
 	}
 
-    wchar_t *unicode_str;
 	{
 		wchar_t *wcs = GetWCS(b);
 		wchar_t *codes_ptr;


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