[Ttssh2-commit] [8466] tmfc.cpp,h で tchar を使用する関数を削除

scmno****@osdn***** scmno****@osdn*****
2020年 1月 10日 (金) 22:13:57 JST


Revision: 8466
          https://osdn.net/projects/ttssh2/scm/svn/commits/8466
Author:   zmatsuo
Date:     2020-01-10 22:13:56 +0900 (Fri, 10 Jan 2020)
Log Message:
-----------
tmfc.cpp,h で tchar を使用する関数を削除

Modified Paths:
--------------
    trunk/teraterm/common/tmfc.cpp
    trunk/teraterm/common/tmfc.h
    trunk/teraterm/teraterm/addsetting.cpp

-------------- next part --------------
Modified: trunk/teraterm/common/tmfc.cpp
===================================================================
--- trunk/teraterm/common/tmfc.cpp	2020-01-10 13:13:45 UTC (rev 8465)
+++ trunk/teraterm/common/tmfc.cpp	2020-01-10 13:13:56 UTC (rev 8466)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2019 TeraTerm Project
+ * Copyright (C) 2018-2020 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,6 @@
 
 #include <windowsx.h>
 #include <assert.h>
-#include <tchar.h>
 #include "dlglib.h"
 #include "ttlib.h"
 #include "layer_for_unicode.h"
@@ -64,11 +63,6 @@
 	return ::GetDlgItem(m_hWnd, id);
 }
 
-LRESULT TTCWnd::SendDlgItemMessageT(int id, UINT msg, WPARAM wp, LPARAM lp)
-{
-	return ::SendDlgItemMessage(m_hWnd, id, msg, wp, lp);
-}
-
 LRESULT TTCWnd::SendDlgItemMessageW(int id, UINT msg, WPARAM wp, LPARAM lp)
 {
 	return ::_SendDlgItemMessageW(m_hWnd, id, msg, wp, lp);
@@ -79,11 +73,6 @@
 	return ::SendDlgItemMessageA(m_hWnd, id, msg, wp, lp);
 }
 
-void TTCWnd::GetDlgItemTextT(int id, TCHAR *buf, size_t size)
-{
-	::GetDlgItemText(m_hWnd, id, buf, (int)size);
-}
-
 void TTCWnd::GetDlgItemTextW(int id, wchar_t *buf, size_t size)
 {
 	_GetDlgItemTextW(m_hWnd, id, buf, (int)size);
@@ -94,11 +83,6 @@
 	::GetDlgItemTextA(m_hWnd, id, buf, (int)size);
 }
 
-void TTCWnd::SetDlgItemTextT(int id, const TCHAR *str)
-{
-	::SetDlgItemText(m_hWnd, id, str);
-}
-
 void TTCWnd::SetDlgItemTextW(int id, const wchar_t *str)
 {
 	_SetDlgItemTextW(m_hWnd, id, str);
@@ -129,12 +113,12 @@
 {
 	HWND hWnd = GetDlgItem(id);
 	assert(hWnd != 0);
-	TCHAR ClassName[32];
-	int r = GetClassName(hWnd, ClassName, _countof(ClassName));
+	char ClassName[32];
+	int r = GetClassNameA(hWnd, ClassName, _countof(ClassName));
 	assert(r != 0); (void)r;
 	UINT msg =
-		(_tcscmp(ClassName, _T("ListBox")) == 0) ? LB_SETCURSEL :
-		(_tcscmp(ClassName, _T("ComboBox")) == 0) ? CB_SETCURSEL : 0;
+		(strcmp(ClassName, "ListBox") == 0) ? LB_SETCURSEL :
+		(strcmp(ClassName, "ComboBox") == 0) ? CB_SETCURSEL : 0;
 	assert(msg != 0);
 	::SendMessage(hWnd, msg, no, 0);
 }
@@ -143,12 +127,12 @@
 {
 	HWND hWnd = GetDlgItem(id);
 	assert(hWnd != 0);
-	TCHAR ClassName[32];
-	int r = GetClassName(hWnd, ClassName, _countof(ClassName));
+	char ClassName[32];
+	int r = GetClassNameA(hWnd, ClassName, _countof(ClassName));
 	assert(r != 0); (void)r;
 	UINT msg =
-		(_tcscmp(ClassName, _T("ListBox")) == 0) ? LB_GETCURSEL :
-		(_tcscmp(ClassName, _T("ComboBox")) == 0) ? CB_GETCURSEL : 0;
+		(strcmp(ClassName, "ListBox") == 0) ? LB_GETCURSEL :
+		(strcmp(ClassName, "ComboBox") == 0) ? CB_GETCURSEL : 0;
 	assert(msg != 0);
 	LRESULT lResult = ::SendMessage(hWnd, msg, 0, 0);
 	return (int)lResult;
@@ -174,11 +158,6 @@
 	::ShowWindow(m_hWnd, nCmdShow);
 }
 
-void TTCWnd::SetWindowTextT(const TCHAR *str)
-{
-	::SetWindowText(m_hWnd, str);
-}
-
 void TTCWnd::SetWindowTextW(const wchar_t *str)
 {
 	_SetWindowTextW(m_hWnd, str);
@@ -226,11 +205,6 @@
 	ModifyStyleCom(GWL_EXSTYLE, dwRemove, dwAdd, nFlags);
 }
 
-int TTCWnd::MessageBoxT(LPCTSTR lpText, LPCTSTR lpCaption, UINT uType)
-{
-	return ::MessageBox(m_hWnd, lpText, lpCaption, uType);
-}
-
 int TTCWnd::MessageBoxA(const char *lpText, const char *lpCaption, UINT uType)
 {
 	return ::MessageBoxA(m_hWnd, lpText, lpCaption, uType);

Modified: trunk/teraterm/common/tmfc.h
===================================================================
--- trunk/teraterm/common/tmfc.h	2020-01-10 13:13:45 UTC (rev 8465)
+++ trunk/teraterm/common/tmfc.h	2020-01-10 13:13:56 UTC (rev 8466)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2019 TeraTerm Project
+ * Copyright (C) 2018-2020 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,6 @@
 	BOOL EndPaint(LPPAINTSTRUCT lpPaint);
 	LRESULT SendMessage(UINT msg, WPARAM wp, LPARAM lp);
 	void ShowWindow(int nCmdShow);
-	void SetWindowTextT(const TCHAR *str);
 	void SetWindowTextW(const wchar_t *str);
 	void SetWindowTextA(const char *str);
 	LONG_PTR SetWindowLongPtr(int nIndex, LONG_PTR dwNewLong);
@@ -55,11 +54,8 @@
 	LONG_PTR GetWindowLongPtr(int nIndex);
 	void ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0);
 	void ModifyStyleEx(DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0);
-	int MessageBoxT(LPCTSTR lpText, LPCTSTR lpCaption, UINT uType);
 	int MessageBoxA(const char * lpText, const char *lpCaption, UINT uType);
-#if defined(UNICODE)
 	int MessageBoxW(const wchar_t * lpText, const wchar_t *lpCaption, UINT uType);
-#endif
 	//virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
 	LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
 	BOOL GetWindowRect(RECT *R);
@@ -69,13 +65,10 @@
 	BOOL EndDialog(int nResult);
 	// for controls
 	HWND GetDlgItem(int id);
-	LRESULT SendDlgItemMessageT(int id, UINT msg, WPARAM wp, LPARAM lp);
 	LRESULT SendDlgItemMessageW(int id, UINT msg, WPARAM wp, LPARAM lp);
 	LRESULT SendDlgItemMessageA(int id, UINT msg, WPARAM wp, LPARAM lp);
-	void GetDlgItemTextT(int id, TCHAR *buf, size_t size);
 	void GetDlgItemTextW(int id, wchar_t *buf, size_t size);
 	void GetDlgItemTextA(int id, char *buf, size_t size);
-	void SetDlgItemTextT(int id, const TCHAR *str);
 	void SetDlgItemTextW(int id, const wchar_t *str);
 	void SetDlgItemTextA(int id, const char *str);
 	void SetDlgItemNum(int id, LONG Num);

Modified: trunk/teraterm/teraterm/addsetting.cpp
===================================================================
--- trunk/teraterm/teraterm/addsetting.cpp	2020-01-10 13:13:45 UTC (rev 8465)
+++ trunk/teraterm/teraterm/addsetting.cpp	2020-01-10 13:13:56 UTC (rev 8466)
@@ -158,7 +158,7 @@
 
 void CGeneralPropPageDlg::OnOK()
 {
-	TCHAR buf[64];
+	char buf[64];
 	int val;
 
 	// (1)
@@ -171,8 +171,8 @@
 	ts.AcceptBroadcast = GetCheck(IDC_ACCEPT_BROADCAST);
 
 	// (4)IDC_MOUSEWHEEL_SCROLL_LINE
-	GetDlgItemTextT(IDC_SCROLL_LINE, buf, _countof(buf));
-	val = _tstoi(buf);
+	GetDlgItemText(IDC_SCROLL_LINE, buf, _countof(buf));
+	val = atoi(buf);
 	if (val > 0)
 		ts.MouseWheelScrollLine = val;
 
@@ -899,7 +899,7 @@
 				// \x96\xB3\x8C\x{27B0B3}\x82ꂽ\x82\xE7\x81ABGThemeFile \x82\xF0\x8C\xB3\x82ɖ߂\xB7\x81B
 				strncpy_s(ts.EtermLookfeel.BGThemeFile, BG_THEME_IMAGEFILE_DEFAULT, sizeof(ts.EtermLookfeel.BGThemeFile));
 				// \x94w\x8Ci\x89摜\x82\xE0\x96\xB3\x8C\x{27B0B7}\x82\xE9\x81B
-				SetDlgItemTextT(IDC_BGIMG_EDIT, _T(""));
+				SetDlgItemText(IDC_BGIMG_EDIT, "");
 				SetDlgItemInt(IDC_EDIT_BGIMG_BRIGHTNESS, BG_THEME_IMAGE_BRIGHTNESS_DEFAULT);
 
 				EnableDlgItem(IDC_MIXED_THEME_FILE, FALSE);
@@ -934,7 +934,7 @@
 				// \x96\xB3\x8C\x{27B0B3}\x82ꂽ\x82\xE7\x81ABGThemeFile \x82\xF0\x8C\xB3\x82ɖ߂\xB7\x81B
 				strncpy_s(ts.EtermLookfeel.BGThemeFile, BG_THEME_IMAGEFILE_DEFAULT, sizeof(ts.EtermLookfeel.BGThemeFile));
 				// \x94w\x8Ci\x89摜\x82\xE0\x96\xB3\x8C\x{27B0B7}\x82\xE9\x81B
-				SetDlgItemTextT(IDC_BGIMG_EDIT, _T(""));
+				SetDlgItemText(IDC_BGIMG_EDIT, "");
 				SetDlgItemInt(IDC_EDIT_BGIMG_BRIGHTNESS, BG_THEME_IMAGE_BRIGHTNESS_DEFAULT);
 			}
 			return TRUE;


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