From d7e53c4d5a748d5ef8c934e90dc59ff23c667420 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 15:13:30 +0300 Subject: WCHAR -> wchar_t --- plugins/HistoryStats/src/_consts.h | 4 ++-- plugins/HistoryStats/src/_strfunc.h | 20 ++++++++++---------- plugins/HistoryStats/src/mu_common.cpp | 10 +++++----- plugins/HistoryStats/src/mu_common.h | 10 +++++----- plugins/HistoryStats/src/statistic.cpp | 4 ++-- plugins/HistoryStats/src/stdafx.h | 16 ++++++++-------- plugins/HistoryStats/src/utf8buffer.h | 8 ++++---- plugins/HistoryStats/src/utils.cpp | 22 +++++++++++----------- plugins/HistoryStats/src/utils.h | 6 +++--- 9 files changed, 50 insertions(+), 50 deletions(-) (limited to 'plugins/HistoryStats/src') diff --git a/plugins/HistoryStats/src/_consts.h b/plugins/HistoryStats/src/_consts.h index d2dbf156c2..a9d8d5a4ed 100644 --- a/plugins/HistoryStats/src/_consts.h +++ b/plugins/HistoryStats/src/_consts.h @@ -5,10 +5,10 @@ #if defined(HISTORYSTATS_CONST_DEFINE) #define CONST_A(nam, txt) extern const char* nam = txt; -#define CONST_W(nam, txt) extern const WCHAR* nam = L##txt; +#define CONST_W(nam, txt) extern const wchar_t* nam = L##txt; #else #define CONST_A(nam, txt) extern const char* nam; -#define CONST_W(nam, txt) extern const WCHAR* nam; +#define CONST_W(nam, txt) extern const wchar_t* nam; #endif /* diff --git a/plugins/HistoryStats/src/_strfunc.h b/plugins/HistoryStats/src/_strfunc.h index f00af2f367..9577bcfd72 100644 --- a/plugins/HistoryStats/src/_strfunc.h +++ b/plugins/HistoryStats/src/_strfunc.h @@ -24,18 +24,18 @@ namespace ext }; template<> - class basic_strfunc + class basic_strfunc { public: - static const WCHAR* chr(const WCHAR* string, WCHAR c) { return wcschr(string, c); } - static int cmp(const WCHAR* string1, const WCHAR* string2) { return mir_wstrcmp(string1, string2); } - static int icmp(const WCHAR* string1, const WCHAR* string2) { return _wcsicmp(string1, string2); } - static int coll(const WCHAR* string1, const WCHAR* string2) { return wcscoll(string1, string2); } - static int icoll(const WCHAR* string1, const WCHAR* string2) { return _wcsicoll(string1, string2); } - static const WCHAR* str(const WCHAR* string, const WCHAR* strSearch) { return wcsstr(string, strSearch); } - static size_t len(const WCHAR* string) { return mir_wstrlen(string); } - static size_t ftime(WCHAR* strDest, size_t maxsize, const WCHAR* format, const struct tm* timeptr) { return wcsftime(strDest, maxsize, format, timeptr); } - static int sprintf(WCHAR* buffer, const WCHAR* format, ...) { va_list args; va_start(args, format); return vswprintf(buffer, format, args); } + static const wchar_t* chr(const wchar_t* string, wchar_t c) { return wcschr(string, c); } + static int cmp(const wchar_t* string1, const wchar_t* string2) { return mir_wstrcmp(string1, string2); } + static int icmp(const wchar_t* string1, const wchar_t* string2) { return _wcsicmp(string1, string2); } + static int coll(const wchar_t* string1, const wchar_t* string2) { return wcscoll(string1, string2); } + static int icoll(const wchar_t* string1, const wchar_t* string2) { return _wcsicoll(string1, string2); } + static const wchar_t* str(const wchar_t* string, const wchar_t* strSearch) { return wcsstr(string, strSearch); } + static size_t len(const wchar_t* string) { return mir_wstrlen(string); } + static size_t ftime(wchar_t* strDest, size_t maxsize, const wchar_t* format, const struct tm* timeptr) { return wcsftime(strDest, maxsize, format, timeptr); } + static int sprintf(wchar_t* buffer, const wchar_t* format, ...) { va_list args; va_start(args, format); return vswprintf(buffer, format, args); } }; } diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp index f9283bf433..10c5eadb61 100644 --- a/plugins/HistoryStats/src/mu_common.cpp +++ b/plugins/HistoryStats/src/mu_common.cpp @@ -125,7 +125,7 @@ namespace mu * string handling */ - char* wideToAnsiDup(const WCHAR* pszWide, UINT uCP /* = CP_ACP */) + char* wideToAnsiDup(const wchar_t* pszWide, UINT uCP /* = CP_ACP */) { if (!pszWide) return nullptr; @@ -140,13 +140,13 @@ namespace mu return result; } - WCHAR* ansiToWideDup(const char* pszAnsi, UINT uCP /* = CP_ACP */) + wchar_t* ansiToWideDup(const char* pszAnsi, UINT uCP /* = CP_ACP */) { if (!pszAnsi) return nullptr; int len = MultiByteToWideChar(uCP, 0, pszAnsi, -1, nullptr, 0); - WCHAR* result = reinterpret_cast(malloc(sizeof(WCHAR)* len)); + wchar_t* result = reinterpret_cast(malloc(sizeof(wchar_t)* len)); if (!result) return nullptr; @@ -155,7 +155,7 @@ namespace mu return result; } - char* wideToAnsi(const WCHAR* pszWide, char* pszRes, int maxLen, UINT uCP /* = CP_ACP */) + char* wideToAnsi(const wchar_t* pszWide, char* pszRes, int maxLen, UINT uCP /* = CP_ACP */) { if (!pszWide) return nullptr; @@ -164,7 +164,7 @@ namespace mu return pszRes; } - WCHAR* ansiToWide(const char* pszAnsi, WCHAR* pszRes, int maxLen, UINT uCP /* = CP_ACP */) + wchar_t* ansiToWide(const char* pszAnsi, wchar_t* pszRes, int maxLen, UINT uCP /* = CP_ACP */) { if (!pszAnsi) return nullptr; diff --git a/plugins/HistoryStats/src/mu_common.h b/plugins/HistoryStats/src/mu_common.h index f8f9f7923c..635b398a86 100644 --- a/plugins/HistoryStats/src/mu_common.h +++ b/plugins/HistoryStats/src/mu_common.h @@ -72,11 +72,11 @@ namespace mu * string handling */ - char* wideToAnsiDup(const WCHAR* pszWide, UINT uCP = CP_ACP); - WCHAR* ansiToWideDup(const char* pszAnsi, UINT uCP = CP_ACP); - char* wideToAnsi(const WCHAR* pszWide, char* pszRes, int maxLen, UINT uCP = CP_ACP); - WCHAR* ansiToWide(const char* pszAnsi, WCHAR* pszRes, int maxLen, UINT uCP = CP_ACP); - inline void freeWide(WCHAR* pszWide) { free(pszWide); } + char* wideToAnsiDup(const wchar_t* pszWide, UINT uCP = CP_ACP); + wchar_t* ansiToWideDup(const char* pszAnsi, UINT uCP = CP_ACP); + char* wideToAnsi(const wchar_t* pszWide, char* pszRes, int maxLen, UINT uCP = CP_ACP); + wchar_t* ansiToWide(const char* pszAnsi, wchar_t* pszRes, int maxLen, UINT uCP = CP_ACP); + inline void freeWide(wchar_t* pszWide) { free(pszWide); } inline void freeAnsi(char* pszAnsi) { free(pszAnsi); } } diff --git a/plugins/HistoryStats/src/statistic.cpp b/plugins/HistoryStats/src/statistic.cpp index aa131b3a91..4ef53b9379 100644 --- a/plugins/HistoryStats/src/statistic.cpp +++ b/plugins/HistoryStats/src/statistic.cpp @@ -420,9 +420,9 @@ bool Statistic::stepReadDB() char* pAnsiText = reinterpret_cast(dbei.pBlob); int nAnsiLenP1 = ext::a::strfunc::len(pAnsiText) + 1; - WCHAR* pWideText = reinterpret_cast(pAnsiText + nAnsiLenP1); + wchar_t* pWideText = reinterpret_cast(pAnsiText + nAnsiLenP1); int nWideLen = 0; - int nWideMaxLen = (dbei.cbBlob - nAnsiLenP1) / sizeof(WCHAR); + int nWideMaxLen = (dbei.cbBlob - nAnsiLenP1) / sizeof(wchar_t); if (dbei.cbBlob >= nAnsiLenP1 * 3) { for (int i = 0; i < nWideMaxLen; ++i) { diff --git a/plugins/HistoryStats/src/stdafx.h b/plugins/HistoryStats/src/stdafx.h index 146727511f..0532e2c430 100644 --- a/plugins/HistoryStats/src/stdafx.h +++ b/plugins/HistoryStats/src/stdafx.h @@ -77,14 +77,14 @@ namespace ext { namespace w { - const WCHAR* const endl = L"\n"; - - typedef std::basic_string string; - typedef std::basic_ofstream ofstream; - typedef std::basic_ostream ostream; - typedef ext::basic_strfunc strfunc; - typedef ext::basic_format format; - typedef ext::basic_kformat kformat; + const wchar_t* const endl = L"\n"; + + typedef std::basic_string string; + typedef std::basic_ofstream ofstream; + typedef std::basic_ostream ostream; + typedef ext::basic_strfunc strfunc; + typedef ext::basic_format format; + typedef ext::basic_kformat kformat; } namespace a diff --git a/plugins/HistoryStats/src/utf8buffer.h b/plugins/HistoryStats/src/utf8buffer.h index 8f7d3cdddc..a661b14d39 100644 --- a/plugins/HistoryStats/src/utf8buffer.h +++ b/plugins/HistoryStats/src/utf8buffer.h @@ -16,10 +16,10 @@ private: wchar_t* m_pBuf; ext::a::ostream& m_Stream; char* m_pUTF8Buf; - WCHAR* m_pBufW; + wchar_t* m_pBufW; #if !defined(_UNICODE) - WCHAR m_CharMap[256]; + wchar_t m_CharMap[256]; #endif // _UNICODE private: @@ -28,7 +28,7 @@ private: size_t len = pEnd - pBegin; #if !defined(_UNICODE) - WCHAR* pW = m_pBufW; + wchar_t* pW = m_pBufW; char* pA = m_pBuf; while (pA < pEnd) @@ -87,7 +87,7 @@ public: #if defined(_UNICODE) m_pBufW = m_pBuf; #else // _UNICODE - m_pBufW = new WCHAR[m_BufSize]; + m_pBufW = new wchar_t[m_BufSize]; #endif // _UNICODE #if !defined(_UNICODE) diff --git a/plugins/HistoryStats/src/utils.cpp b/plugins/HistoryStats/src/utils.cpp index a199caa059..aa656e11cb 100644 --- a/plugins/HistoryStats/src/utils.cpp +++ b/plugins/HistoryStats/src/utils.cpp @@ -407,7 +407,7 @@ ext::string utils::versionToDotted(DWORD version) return temp; } -ext::a::string utils::convertWToA(const WCHAR* str, size_t len) +ext::a::string utils::convertWToA(const wchar_t* str, size_t len) { char* buf = new char[len + 1]; @@ -424,7 +424,7 @@ ext::a::string utils::convertWToA(const WCHAR* str, size_t len) ext::w::string utils::convertAToW(const char* str, size_t len) { - WCHAR* buf = new WCHAR[len + 1]; + wchar_t* buf = new wchar_t[len + 1]; len = MultiByteToWideChar(CP_ACP, 0, str, len, buf, len); @@ -440,17 +440,17 @@ ext::w::string utils::convertAToW(const char* str, size_t len) ext::a::string utils::convertTToUTF8(const wchar_t* str, size_t str_len) { #if defined(_UNICODE) - const WCHAR* conv_str = str; + const wchar_t* conv_str = str; #else // _UNICODE const ext::w::string conv_strX = convertAToW(str, str_len); - const WCHAR* conv_str = conv_strX.c_str(); + const wchar_t* conv_str = conv_strX.c_str(); #endif // _UNICODE int len = 0; upto_each_(i, str_len) { - WCHAR c = conv_str[i]; + wchar_t c = conv_str[i]; if (c <= 0x007F) { len++; @@ -469,7 +469,7 @@ ext::a::string utils::convertTToUTF8(const wchar_t* str, size_t str_len) upto_each_(i, str_len) { - WCHAR c = conv_str[i]; + wchar_t c = conv_str[i]; if (c <= 0x007F) { out_str[pos++] = (unsigned char)c; @@ -520,15 +520,15 @@ ext::string utils::convertUTF8ToT(const char* str, size_t str_len) unsigned char c = (unsigned char)str[in_pos]; if ((c & 0x80) == 0x00) { - out_str[out_pos] = (WCHAR)c; + out_str[out_pos] = (wchar_t)c; in_pos++; } else if ((c & 0xE0) == 0xC0) { - out_str[out_pos] = (WCHAR)(((c & 0x1F) << 6) | ((unsigned char)str[in_pos + 1] & 0x3F)); + out_str[out_pos] = (wchar_t)(((c & 0x1F) << 6) | ((unsigned char)str[in_pos + 1] & 0x3F)); in_pos += 2; } else if ((c & 0xF0) == 0xE0) { - out_str[out_pos] = (WCHAR)(((c & 0x0F) << 12) | (((unsigned char)str[in_pos + 1] & 0x3F) << 6) | ((unsigned char)str[in_pos + 2] & 0x3F)); + out_str[out_pos] = (wchar_t)(((c & 0x0F) << 12) | (((unsigned char)str[in_pos + 1] & 0x3F) << 6) | ((unsigned char)str[in_pos + 2] & 0x3F)); in_pos += 3; } else { @@ -545,13 +545,13 @@ ext::string utils::convertUTF8ToT(const char* str, size_t str_len) #endif // _UNICODE } -size_t utils::rawUTF8Encode(const WCHAR* pIn, size_t lenIn, char* pOut) +size_t utils::rawUTF8Encode(const wchar_t* pIn, size_t lenIn, char* pOut) { char* pOutBegin = pOut; upto_each_(i, lenIn) { - WCHAR c = pIn[i]; + wchar_t c = pIn[i]; if (c <= 0x007F) { *pOut++ = (unsigned char)c; diff --git a/plugins/HistoryStats/src/utils.h b/plugins/HistoryStats/src/utils.h index 8b5f6c3d9d..7e07ba6cbb 100644 --- a/plugins/HistoryStats/src/utils.h +++ b/plugins/HistoryStats/src/utils.h @@ -43,18 +43,18 @@ namespace utils ext::string versionToDotted(DWORD version); // character conversion (wide, ansi, utf8) - ext::a::string convertWToA(const WCHAR* str, size_t len); + ext::a::string convertWToA(const wchar_t* str, size_t len); ext::w::string convertAToW(const char* str, size_t len); ext::a::string convertTToUTF8(const wchar_t* str, size_t str_len); ext::string convertUTF8ToT(const char* str, size_t str_len); - size_t rawUTF8Encode(const WCHAR* pIn, size_t lenIn, char* pOut); + size_t rawUTF8Encode(const wchar_t* pIn, size_t lenIn, char* pOut); size_t getUTF8Len(const char* str); // character conversion (convenience functions) inline ext::a::string toA(const wchar_t* str) { return convertWToA(str, ext::strfunc::len(str)); } inline ext::w::string toW(const wchar_t* str) { return str; } inline ext::string fromA(const char* str) { return convertAToW(str, ext::a::strfunc::len(str)); } - inline ext::string fromW(const WCHAR* str) { return str; } + inline ext::string fromW(const wchar_t* str) { return str; } inline ext::a::string toA(const ext::string& str) { return convertWToA(str.c_str(), str.length()); } inline ext::w::string toW(const ext::string& str) { return str; } inline ext::string fromA(const ext::a::string& str) { return convertAToW(str.c_str(), str.length()); } -- cgit v1.2.3