• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Révision29193 (tree)
l'heure2021-05-04 03:37:02
Auteurstefankueng

Message de Log

remove tstring and includes to tchar.h

Change Summary

Modification

--- trunk/src/LogCache/Access/stdafx.h (revision 29192)
+++ trunk/src/LogCache/Access/stdafx.h (revision 29193)
@@ -1,4 +1,4 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
33 // Copyright (C) 2007-2008, 2010, 2014 - TortoiseSVN
44
@@ -68,8 +68,6 @@
6868 #include <fstream>
6969 #include <memory>
7070
71-#include "tstring.h"
72-
7371 // Commonly used log cache streams
7472 // (others may be included locally)
7573
--- trunk/src/LogCache/stdafx.h (revision 29192)
+++ trunk/src/LogCache/stdafx.h (revision 29193)
@@ -1,4 +1,4 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
33 // Copyright (C) 2007-2008, 2012, 2014 - TortoiseSVN
44
@@ -70,8 +70,6 @@
7070 #include <memory>
7171 #include <algorithm>
7272
73-#include "tstring.h"
74-
7573 // Commonly used log cache streams
7674 // (others may be included locally)
7775
--- trunk/src/ResText/POFile.cpp (revision 29192)
+++ trunk/src/ResText/POFile.cpp (revision 29193)
@@ -56,7 +56,7 @@
5656 m_bAdjustEOLs = bAdjustEOLs;
5757
5858 if (!m_bQuiet)
59- _ftprintf(stdout, L"parsing file %s...\n", szPath);
59+ fwprintf(stdout, L"parsing file %s...\n", szPath);
6060
6161 int nEntries = 0;
6262 int nDeleted = 0;
@@ -71,7 +71,7 @@
7171 file.open(filepath);
7272 if (!file.good())
7373 {
74- _ftprintf(stderr, L"can't open input file %s\n", szPath);
74+ fwprintf(stderr, L"can't open input file %s\n", szPath);
7575 return FALSE;
7676 }
7777 auto line = std::make_unique<TCHAR[]>(2 * MAX_STRING_LENGTH);
@@ -185,7 +185,7 @@
185185 RESOURCEENTRY emptyentry = {0};
186186 (*this)[std::wstring(L"")] = emptyentry;
187187 if (!m_bQuiet)
188- _ftprintf(stdout, L"%d Entries found, %d were already translated and %d got deleted\n", nEntries, nTranslated, nDeleted);
188+ fwprintf(stdout, L"%d Entries found, %d were already translated and %d got deleted\n", nEntries, nTranslated, nDeleted);
189189 return TRUE;
190190 }
191191
@@ -290,7 +290,7 @@
290290 }
291291 file.close();
292292 if (!m_bQuiet)
293- _ftprintf(stdout, L"File %s saved, containing %d entries\n", szPath, nEntries);
293+ fwprintf(stdout, L"File %s saved, containing %d entries\n", szPath, nEntries);
294294 return TRUE;
295295 }
296296
--- trunk/src/ResText/ResModule.cpp (revision 29192)
+++ trunk/src/ResText/ResModule.cpp (revision 29193)
@@ -110,36 +110,36 @@
110110 // fill in the std::map with all translatable entries
111111
112112 if (!m_bQuiet)
113- _ftprintf(stdout, L"Extracting StringTable....");
113+ fwprintf(stdout, L"Extracting StringTable....");
114114 EnumResourceNames(m_hResDll, RT_STRING, EnumResNameCallback, reinterpret_cast<LONG_PTR>(this));
115115 if (!m_bQuiet)
116- _ftprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
116+ fwprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
117117 nEntries = m_stringEntries.size();
118118
119119 if (!m_bQuiet)
120- _ftprintf(stdout, L"Extracting Dialogs........");
120+ fwprintf(stdout, L"Extracting Dialogs........");
121121 EnumResourceNames(m_hResDll, RT_DIALOG, EnumResNameCallback, reinterpret_cast<LONG_PTR>(this));
122122 if (!m_bQuiet)
123- _ftprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
123+ fwprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
124124 nEntries = m_stringEntries.size();
125125
126126 if (!m_bQuiet)
127- _ftprintf(stdout, L"Extracting Menus..........");
127+ fwprintf(stdout, L"Extracting Menus..........");
128128 EnumResourceNames(m_hResDll, RT_MENU, EnumResNameCallback, reinterpret_cast<LONG_PTR>(this));
129129 if (!m_bQuiet)
130- _ftprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
130+ fwprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
131131 nEntries = m_stringEntries.size();
132132 if (!m_bQuiet)
133- _ftprintf(stdout, L"Extracting Accelerators...");
133+ fwprintf(stdout, L"Extracting Accelerators...");
134134 EnumResourceNames(m_hResDll, RT_ACCELERATOR, EnumResNameCallback, reinterpret_cast<LONG_PTR>(this));
135135 if (!m_bQuiet)
136- _ftprintf(stdout, L"%4Iu Accelerators\n", m_stringEntries.size() - nEntries);
136+ fwprintf(stdout, L"%4Iu Accelerators\n", m_stringEntries.size() - nEntries);
137137 nEntries = m_stringEntries.size();
138138 if (!m_bQuiet)
139- _ftprintf(stdout, L"Extracting Ribbons........");
139+ fwprintf(stdout, L"Extracting Ribbons........");
140140 EnumResourceNames(m_hResDll, RT_RIBBON, EnumResNameCallback, reinterpret_cast<LONG_PTR>(this));
141141 if (!m_bQuiet)
142- _ftprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
142+ fwprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
143143 nEntries = m_stringEntries.size();
144144
145145 // parse a probably existing file and update the translations which are
@@ -163,31 +163,31 @@
163163 // fill in the std::map with all translatable entries
164164
165165 if (!m_bQuiet)
166- _ftprintf(stdout, L"Extracting StringTable....");
166+ fwprintf(stdout, L"Extracting StringTable....");
167167 EnumResourceNames(m_hResDll, RT_STRING, EnumResNameCallback, reinterpret_cast<LONG_PTR>(this));
168168 if (!m_bQuiet)
169- _ftprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size());
169+ fwprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size());
170170 nEntries = m_stringEntries.size();
171171
172172 if (!m_bQuiet)
173- _ftprintf(stdout, L"Extracting Dialogs........");
173+ fwprintf(stdout, L"Extracting Dialogs........");
174174 EnumResourceNames(m_hResDll, RT_DIALOG, EnumResNameCallback, reinterpret_cast<LONG_PTR>(this));
175175 if (!m_bQuiet)
176- _ftprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
176+ fwprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
177177 nEntries = m_stringEntries.size();
178178
179179 if (!m_bQuiet)
180- _ftprintf(stdout, L"Extracting Menus..........");
180+ fwprintf(stdout, L"Extracting Menus..........");
181181 EnumResourceNames(m_hResDll, RT_MENU, EnumResNameCallback, reinterpret_cast<LONG_PTR>(this));
182182 if (!m_bQuiet)
183- _ftprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
183+ fwprintf(stdout, L"%4Iu Strings\n", m_stringEntries.size() - nEntries);
184184 nEntries = m_stringEntries.size();
185185
186186 if (!m_bQuiet)
187- _ftprintf(stdout, L"Extracting Accelerators...");
187+ fwprintf(stdout, L"Extracting Accelerators...");
188188 EnumResourceNames(m_hResDll, RT_ACCELERATOR, EnumResNameCallback, reinterpret_cast<LONG_PTR>(this));
189189 if (!m_bQuiet)
190- _ftprintf(stdout, L"%4Iu Accelerators\n", m_stringEntries.size() - nEntries);
190+ fwprintf(stdout, L"%4Iu Accelerators\n", m_stringEntries.size() - nEntries);
191191 nEntries = m_stringEntries.size();
192192
193193 // parse a probably existing file and update the translations which are
@@ -254,34 +254,34 @@
254254 MYERROR;
255255
256256 if (!m_bQuiet)
257- _ftprintf(stdout, L"Translating StringTable...");
257+ fwprintf(stdout, L"Translating StringTable...");
258258 bRes = EnumResourceNames(m_hResDll, RT_STRING, EnumResNameWriteCallback, reinterpret_cast<LONG_PTR>(this));
259259 if (!m_bQuiet)
260- _ftprintf(stdout, L"%4d translated, %4d not translated\n", m_bTranslatedStrings, m_bDefaultStrings);
260+ fwprintf(stdout, L"%4d translated, %4d not translated\n", m_bTranslatedStrings, m_bDefaultStrings);
261261
262262 if (!m_bQuiet)
263- _ftprintf(stdout, L"Translating Dialogs.......");
263+ fwprintf(stdout, L"Translating Dialogs.......");
264264 bRes = EnumResourceNames(m_hResDll, RT_DIALOG, EnumResNameWriteCallback, reinterpret_cast<LONG_PTR>(this));
265265 if (!m_bQuiet)
266- _ftprintf(stdout, L"%4d translated, %4d not translated\n", m_bTranslatedDialogStrings, m_bDefaultDialogStrings);
266+ fwprintf(stdout, L"%4d translated, %4d not translated\n", m_bTranslatedDialogStrings, m_bDefaultDialogStrings);
267267
268268 if (!m_bQuiet)
269- _ftprintf(stdout, L"Translating Menus.........");
269+ fwprintf(stdout, L"Translating Menus.........");
270270 bRes = EnumResourceNames(m_hResDll, RT_MENU, EnumResNameWriteCallback, reinterpret_cast<LONG_PTR>(this));
271271 if (!m_bQuiet)
272- _ftprintf(stdout, L"%4d translated, %4d not translated\n", m_bTranslatedMenuStrings, m_bDefaultMenuStrings);
272+ fwprintf(stdout, L"%4d translated, %4d not translated\n", m_bTranslatedMenuStrings, m_bDefaultMenuStrings);
273273
274274 if (!m_bQuiet)
275- _ftprintf(stdout, L"Translating Accelerators..");
275+ fwprintf(stdout, L"Translating Accelerators..");
276276 bRes = EnumResourceNames(m_hResDll, RT_ACCELERATOR, EnumResNameWriteCallback, reinterpret_cast<LONG_PTR>(this));
277277 if (!m_bQuiet)
278- _ftprintf(stdout, L"%4d translated, %4d not translated\n", m_bTranslatedAcceleratorStrings, m_bDefaultAcceleratorStrings);
278+ fwprintf(stdout, L"%4d translated, %4d not translated\n", m_bTranslatedAcceleratorStrings, m_bDefaultAcceleratorStrings);
279279
280280 if (!m_bQuiet)
281- _ftprintf(stdout, L"Translating Ribbons.......");
281+ fwprintf(stdout, L"Translating Ribbons.......");
282282 bRes = EnumResourceNames(m_hResDll, RT_RIBBON, EnumResNameWriteCallback, reinterpret_cast<LONG_PTR>(this));
283283 if (!m_bQuiet)
284- _ftprintf(stdout, L"%4d translated, %4d not translated\n", m_bTranslatedRibbonTexts, m_bDefaultRibbonTexts);
284+ fwprintf(stdout, L"%4d translated, %4d not translated\n", m_bTranslatedRibbonTexts, m_bDefaultRibbonTexts);
285285 bRes = TRUE;
286286 if (!EndUpdateResource(m_hUpdateRes, !bRes))
287287 MYERROR;
--- trunk/src/ResText/Utils.cpp (revision 29192)
+++ trunk/src/ResText/Utils.cpp (revision 29193)
@@ -133,7 +133,7 @@
133133 {
134134 CFormatMessageWrapper errorDetails;
135135 if (errorDetails)
136- _ftprintf(stderr, L"%s\n", static_cast<LPCWSTR>(errorDetails));
136+ fwprintf(stderr, L"%s\n", static_cast<LPCWSTR>(errorDetails));
137137 }
138138
139139 void CUtils::SearchReplace(std::wstring& str, const std::wstring& toReplace, const std::wstring& replaceWith)
--- trunk/src/ResText/stdafx.h (revision 29192)
+++ trunk/src/ResText/stdafx.h (revision 29193)
@@ -1,4 +1,4 @@
1-// stdafx.h : include file for standard system include files,
1+// stdafx.h : include file for standard system include files,
22 // or project specific include files that are used frequently, but
33 // are changed infrequently
44 //
@@ -7,6 +7,5 @@
77
88 #pragma warning(push)
99 #include <iostream>
10-#include <tchar.h>
1110 #include <windows.h>
1211 #pragma warning(pop)
--- trunk/src/SubWCRev/SubWCRevCOM.cpp (revision 29192)
+++ trunk/src/SubWCRev/SubWCRevCOM.cpp (revision 29193)
@@ -35,7 +35,6 @@
3535 #include "UnicodeUtils.h"
3636 #include <atlbase.h>
3737
38-#include <tchar.h>
3938 #include <windows.h>
4039 #include <shlwapi.h>
4140 #include <Shellapi.h>
--- trunk/src/TSVNCache/stdafx.h (revision 29192)
+++ trunk/src/TSVNCache/stdafx.h (revision 29193)
@@ -17,7 +17,6 @@
1717
1818 #include <SDKDDKVer.h>
1919
20-#include <tchar.h>
2120 #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
2221
2322 #include <WinSock2.h>
--- trunk/src/TortoiseBlame/TortoiseBlame.cpp (revision 29192)
+++ trunk/src/TortoiseBlame/TortoiseBlame.cpp (revision 29193)
@@ -263,7 +263,7 @@
263263 int retrycount = 10;
264264 while (retrycount)
265265 {
266- _tfopen_s(&file, fileName, L"rbS");
266+ _wfopen_s(&file, fileName, L"rbS");
267267 if (file == nullptr)
268268 {
269269 Sleep(500);
@@ -1895,7 +1895,7 @@
18951895 app.hInstance = hInstance;
18961896
18971897 SetDllDirectory(L"");
1898- CCrashReportTSVN crasher(L"TortoiseBlame " _T(APP_X64_STRING));
1898+ CCrashReportTSVN crasher(L"TortoiseBlame " TEXT(APP_X64_STRING));
18991899 CCrashReport::Instance().AddUserInfoToReport(L"CommandLine", GetCommandLine());
19001900
19011901 Gdiplus::GdiplusStartupInput gdiplusStartupInput;
--- trunk/src/TortoiseBlame/stdafx.h (revision 29192)
+++ trunk/src/TortoiseBlame/stdafx.h (revision 29193)
@@ -24,7 +24,6 @@
2424 #include <stdlib.h>
2525 #include <malloc.h>
2626 #include <memory.h>
27-#include <tchar.h>
2827 #include <shlwapi.h>
2928 #include <richedit.h>
3029 #include <commctrl.h>
--- trunk/src/TortoiseIDiff/stdafx.h (revision 29192)
+++ trunk/src/TortoiseIDiff/stdafx.h (revision 29193)
@@ -19,7 +19,6 @@
1919 #include <stdlib.h>
2020 #include <malloc.h>
2121 #include <memory.h>
22-#include <tchar.h>
2322 #include <comdef.h>
2423
2524 #include "MyMemDC.h"
--- trunk/src/TortoiseOverlays/stdafx.h (revision 29192)
+++ trunk/src/TortoiseOverlays/stdafx.h (revision 29193)
@@ -1,4 +1,4 @@
1-// TortoiseOverlays - an overlay handler for Tortoise clients
1+// TortoiseOverlays - an overlay handler for Tortoise clients
22 // Copyright (C) 2007-2008, 2012-2013, 2015 - TortoiseSVN
33
44 #pragma once
@@ -29,7 +29,6 @@
2929 #include <shlobj.h>
3030 #pragma warning(pop)
3131 #include <Shlwapi.h>
32-#include <tchar.h>
3332
3433 #include <string>
3534 #include <vector>
--- trunk/src/TortoiseShell/TortoiseStub.cpp (revision 29192)
+++ trunk/src/TortoiseShell/TortoiseStub.cpp (revision 29193)
@@ -17,7 +17,6 @@
1717 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818 //
1919 #include <Windows.h>
20-#include <tchar.h>
2120 #include "Debug.h"
2221
2322 const HINSTANCE NIL = reinterpret_cast<HINSTANCE>(static_cast<char *>(nullptr) - 1);
--- trunk/src/TortoiseShell/stdafx.h (revision 29192)
+++ trunk/src/TortoiseShell/stdafx.h (revision 29193)
@@ -23,7 +23,6 @@
2323 #include <shlobj.h>
2424 #pragma warning(pop)
2525 #include <Shlwapi.h>
26-#include <tchar.h>
2726 #include <wininet.h>
2827 #include <Aclapi.h>
2928
--- trunk/src/TortoiseUDiff/TortoiseUDiff.cpp (revision 29192)
+++ trunk/src/TortoiseUDiff/TortoiseUDiff.cpp (revision 29193)
@@ -45,7 +45,7 @@
4545 MSG msg;
4646 HACCEL hAccelTable;
4747
48- CCrashReportTSVN crasher(L"TortoiseUDiff " _T(APP_X64_STRING));
48+ CCrashReportTSVN crasher(L"TortoiseUDiff " TEXT(APP_X64_STRING));
4949 CCrashReport::Instance().AddUserInfoToReport(L"CommandLine", GetCommandLine());
5050 CRegStdDWORD loc = CRegStdDWORD(L"Software\\TortoiseSVN\\LanguageID", 1033);
5151 long langId = loc;
--- trunk/src/TortoiseUDiff/stdafx.h (revision 29192)
+++ trunk/src/TortoiseUDiff/stdafx.h (revision 29193)
@@ -21,7 +21,6 @@
2121 #include <stdlib.h>
2222 #include <malloc.h>
2323 #include <memory.h>
24-#include <tchar.h>
2524
2625 #include <windows.h>
2726 #include <Commdlg.h>
--- trunk/src/Utils/tstring.h (revision 29192)
+++ trunk/src/Utils/tstring.h (nonexistent)
@@ -1,25 +0,0 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
2-
3-// Copyright (C) 2009 - TortoiseSVN
4-
5-// This program is free software; you can redistribute it and/or
6-// modify it under the terms of the GNU General Public License
7-// as published by the Free Software Foundation; either version 2
8-// of the License, or (at your option) any later version.
9-
10-// This program is distributed in the hope that it will be useful,
11-// but WITHOUT ANY WARRANTY; without even the implied warranty of
12-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-// GNU General Public License for more details.
14-
15-// You should have received a copy of the GNU General Public License
16-// along with this program; if not, write to the Free Software Foundation,
17-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18-//
19-#pragma once
20-
21-#include <string>
22-#include <tchar.h>
23-
24-typedef std::basic_string<TCHAR> tstring;
25-
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
--- trunk/src/Utils/CmdLineParser.cpp (revision 29192)
+++ trunk/src/Utils/CmdLineParser.cpp (revision 29193)
@@ -61,7 +61,7 @@
6161 LPCWSTR sArg = wcspbrk(sCurrent, m_sDelims);
6262 if (!sArg)
6363 break; // no (more) delimiters found
64- sArg = _wcsinc(sArg);
64+ ++sArg;
6565
6666 if (sArg[0] == 0)
6767 break; // ends with delim
@@ -83,11 +83,11 @@
8383 if (sVal[0] != 0)
8484 {
8585 if (sVal[0] != ' ')
86- sVal = _wcsinc(sVal);
86+ ++sVal;
8787 else
8888 {
8989 while (sVal[0] == ' ')
90- sVal = _wcsinc(sVal);
90+ ++sVal;
9191 }
9292
9393 LPCWSTR nextArg = wcspbrk(sVal, m_sDelims);
@@ -112,7 +112,7 @@
112112 if (sQuote == sVal)
113113 {
114114 // string with quotes (defined in m_sQuotes, e.g. '")
115- sQuote = _wcsinc(sVal);
115+ sQuote = sVal + 1;
116116 sEndQuote = wcspbrk(sQuote, m_sQuotes);
117117 }
118118 else
@@ -141,7 +141,7 @@
141141 std::wstring csVal(sQuote, static_cast<int>(sEndQuote - sQuote));
142142 m_valueMap.insert(CValsMap::value_type(sKey, csVal));
143143 }
144- sCurrent = _wcsinc(sEndQuote);
144+ sCurrent = sEndQuote + 1;
145145 continue;
146146 }
147147 }
@@ -188,7 +188,7 @@
188188 CValsMap::const_iterator it = findKey(sKey);
189189 if (it == m_valueMap.end())
190190 return 0;
191- return _tstol(it->second.c_str());
191+ return _wtol(it->second.c_str());
192192 }
193193
194194 __int64 CCmdLineParser::GetLongLongVal(LPCWSTR sKey) const
--- trunk/src/Utils/CreateProcessHelper.h (revision 29192)
+++ trunk/src/Utils/CreateProcessHelper.h (revision 29193)
@@ -62,7 +62,7 @@
6262 LPWSTR commandLineBuf;
6363 if (commandLine)
6464 {
65- commandLineBuf = _tcsdup(commandLine);
65+ commandLineBuf = _wcsdup(commandLine);
6666 }
6767 else
6868 {
--- trunk/src/Utils/Debug.cpp (revision 29192)
+++ trunk/src/Utils/Debug.cpp (revision 29193)
@@ -1,4 +1,4 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
33 // Copyright (C) 2007, 2012 - TortoiseSVN
44
@@ -17,23 +17,24 @@
1717 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818 //
1919 #include "Debug.h"
20-#include <tchar.h>
20+#include <stdio.h>
2121
2222 #if defined(_DEBUG) || defined(DEBUG)
23-#include <stdlib.h>
2423 #include <stdarg.h>
25-void TRACE(LPCTSTR str, ...)
24+
25+// ReSharper disable once CppInconsistentNaming
26+void TRACE(LPCWSTR str, ...)
2627 {
27- static TCHAR buf[20*1024];
28+ static wchar_t buf[20 * 1024];
2829
2930 va_list ap;
3031 va_start(ap, str);
3132
32- _vstprintf_s(buf, 20*1024, str, ap);
33+ vswprintf_s(buf, 20*1024, str, ap);
3334 OutputDebugString(buf);
3435 va_end(ap);
3536
3637 };
3738 #else
38-void TRACE(LPCTSTR str, ...) {UNREFERENCED_PARAMETER(str);}
39+void TRACE(LPCWSTR str, ...) {UNREFERENCED_PARAMETER(str);}
3940 #endif
Afficher sur ancien navigateur de dépôt.