From 509fbd91ed545d05cc266a80ec19fe7b9c9d28db Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 20 Jul 2018 13:25:21 +0300 Subject: we don't need two name sets for the same array of functions --- src/mir_app/src/auth.cpp | 18 +++++++++--------- src/mir_app/src/db_events.cpp | 8 ++++---- src/mir_app/src/help.cpp | 2 +- src/mir_app/src/miranda.h | 2 +- src/mir_app/src/netliblog.cpp | 6 +++--- src/mir_app/src/pluginopts.cpp | 2 +- src/mir_app/src/xmlParser.cpp | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/auth.cpp b/src/mir_app/src/auth.cpp index 6633802df0..0e94be47c5 100644 --- a/src/mir_app/src/auth.cpp +++ b/src/mir_app/src/auth.cpp @@ -81,11 +81,11 @@ public: SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, CallProtoService(dbei.szModule, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0)); SendMessage(m_hwnd, WM_SETICON, ICON_BIG, CallProtoService(dbei.szModule, PS_LOADICON, PLI_PROTOCOL | PLIF_LARGE, 0)); - ptrW lastT(dbei.flags & DBEF_UTF ? Utf8DecodeW(last) : mir_a2u(last)); - ptrW firstT(dbei.flags & DBEF_UTF ? Utf8DecodeW(first) : mir_a2u(first)); - ptrW nickT(dbei.flags & DBEF_UTF ? Utf8DecodeW(nick) : mir_a2u(nick)); - ptrW emailT(dbei.flags & DBEF_UTF ? Utf8DecodeW(email) : mir_a2u(email)); - ptrW reasonT(dbei.flags & DBEF_UTF ? Utf8DecodeW(reason) : mir_a2u(reason)); + ptrW lastT(dbei.flags & DBEF_UTF ? mir_utf8decodeW(last) : mir_a2u(last)); + ptrW firstT(dbei.flags & DBEF_UTF ? mir_utf8decodeW(first) : mir_a2u(first)); + ptrW nickT(dbei.flags & DBEF_UTF ? mir_utf8decodeW(nick) : mir_a2u(nick)); + ptrW emailT(dbei.flags & DBEF_UTF ? mir_utf8decodeW(email) : mir_a2u(email)); + ptrW reasonT(dbei.flags & DBEF_UTF ? mir_utf8decodeW(reason) : mir_a2u(reason)); wchar_t name[128] = L""; int off = 0; @@ -223,10 +223,10 @@ public: PROTOACCOUNT* acc = Proto_GetAccount(dbei.szModule); - ptrW lastT(dbei.flags & DBEF_UTF ? Utf8DecodeW(last) : mir_a2u(last)); - ptrW firstT(dbei.flags & DBEF_UTF ? Utf8DecodeW(first) : mir_a2u(first)); - ptrW nickT(dbei.flags & DBEF_UTF ? Utf8DecodeW(nick) : mir_a2u(nick)); - ptrW emailT(dbei.flags & DBEF_UTF ? Utf8DecodeW(email) : mir_a2u(email)); + ptrW lastT(dbei.flags & DBEF_UTF ? mir_utf8decodeW(last) : mir_a2u(last)); + ptrW firstT(dbei.flags & DBEF_UTF ? mir_utf8decodeW(first) : mir_a2u(first)); + ptrW nickT(dbei.flags & DBEF_UTF ? mir_utf8decodeW(nick) : mir_a2u(nick)); + ptrW emailT(dbei.flags & DBEF_UTF ? mir_utf8decodeW(email) : mir_a2u(email)); wchar_t name[128] = L""; int off = 0; diff --git a/src/mir_app/src/db_events.cpp b/src/mir_app/src/db_events.cpp index 4b000a1f75..fb1dd02cb6 100644 --- a/src/mir_app/src/db_events.cpp +++ b/src/mir_app/src/db_events.cpp @@ -96,7 +96,7 @@ static wchar_t* getEventString(DBEVENTINFO *dbei, LPSTR &buf) { LPSTR in = buf; buf += mir_strlen(buf) + 1; - return (dbei->flags & DBEF_UTF) ? Utf8DecodeW(in) : mir_a2u(in); + return (dbei->flags & DBEF_UTF) ? mir_utf8decodeW(in) : mir_a2u(in); } static INT_PTR DbEventGetTextWorker(DBEVENTINFO *dbei, int codepage, int datatype) @@ -184,7 +184,7 @@ static INT_PTR DbEventGetTextWorker(DBEVENTINFO *dbei, int codepage, int datatyp if (dbei->flags & DBEF_UTF) { WCHAR *msg = nullptr; - Utf8DecodeCP(str, codepage, &msg); + mir_utf8decodecp(str, codepage, &msg); if (msg) return (INT_PTR)msg; } @@ -195,7 +195,7 @@ static INT_PTR DbEventGetTextWorker(DBEVENTINFO *dbei, int codepage, int datatyp if (datatype == DBVT_ASCIIZ) { char *msg = mir_strdup((char*)dbei->pBlob); if (dbei->flags & DBEF_UTF) - Utf8DecodeCP(msg, codepage, nullptr); + mir_utf8decodecp(msg, codepage, nullptr); return (INT_PTR)msg; } @@ -256,7 +256,7 @@ MIR_APP_DLL(HICON) DbEvent_GetIcon(DBEVENTINFO *dbei, int flags) MIR_APP_DLL(wchar_t*) DbEvent_GetString(DBEVENTINFO *dbei, const char *str) { if (dbei->flags & DBEF_UTF) - return Utf8DecodeW(str); + return mir_utf8decodeW(str); return mir_a2u(str); } diff --git a/src/mir_app/src/help.cpp b/src/mir_app/src/help.cpp index 89faf55ce6..31674a121e 100644 --- a/src/mir_app/src/help.cpp +++ b/src/mir_app/src/help.cpp @@ -71,7 +71,7 @@ public: ptrW ptszMsg; if (ResSize >= 3 && pszMsgt[0] == '\xef' && pszMsgt[1] == '\xbb' && pszMsgt[2] == '\xbf') - ptszMsg = Utf8DecodeW(pszMsgt + 3); + ptszMsg = mir_utf8decodeW(pszMsgt + 3); else ptszMsg = mir_a2u_cp(pszMsgt, 1252); ctrlCredits.SetText(ptszMsg); diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index b37abcea3b..23eac6d4ea 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -91,7 +91,7 @@ void KillModuleToolbarIcons(HPLUGIN); __forceinline char* Utf8DecodeA(const char* src) { char* tmp = mir_strdup(src); - Utf8Decode(tmp, nullptr); + mir_utf8decode(tmp, nullptr); return tmp; } diff --git a/src/mir_app/src/netliblog.cpp b/src/mir_app/src/netliblog.cpp index 1321955801..50f3ee946a 100644 --- a/src/mir_app/src/netliblog.cpp +++ b/src/mir_app/src/netliblog.cpp @@ -369,7 +369,7 @@ void PROTO_INTERFACE::debugLogW(const wchar_t *wszFormat, ...) va_list args; va_start(args, wszFormat); int res = _vsnwprintf(buf, _countof(buf), wszFormat, args); - NetlibLog_Worker(m_hNetlibUser, ptrA(Utf8EncodeW((res != -1) ? buf : CMStringW().FormatV(wszFormat, args))), 0); + NetlibLog_Worker(m_hNetlibUser, ptrA(mir_utf8encodeW((res != -1) ? buf : CMStringW().FormatV(wszFormat, args))), 0); va_end(args); } @@ -392,7 +392,7 @@ MIR_APP_DLL(int) Netlib_LogfW(HNETLIBUSER hUser, const wchar_t *fmt, ...) wchar_t szText[8000]; mir_vsnwprintf(szText, _countof(szText), fmt, va); va_end(va); - return NetlibLog_Worker(hUser, ptrA(Utf8EncodeW(szText)), 0); + return NetlibLog_Worker(hUser, ptrA(mir_utf8encodeW(szText)), 0); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -404,7 +404,7 @@ MIR_APP_DLL(int) Netlib_Log(HNETLIBUSER hUser, const char *pszStr) MIR_APP_DLL(int) Netlib_LogW(HNETLIBUSER hUser, const wchar_t *pwszStr) { - return NetlibLog_Worker(hUser, ptrA(Utf8EncodeW(pwszStr)), 0); + return NetlibLog_Worker(hUser, ptrA(mir_utf8encodeW(pwszStr)), 0); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index 96b1f8e01d..c196e30494 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -48,7 +48,7 @@ static wchar_t* sttUtf8auto(const char *src) char *p = NEWSTR_ALLOCA(src); wchar_t *pwszRes; - return (Utf8Decode(p, &pwszRes) != nullptr) ? pwszRes : mir_a2u_cp(src, 1250); + return (mir_utf8decode(p, &pwszRes) != nullptr) ? pwszRes : mir_a2u_cp(src, 1250); } static int sttSortPlugins(const PluginListItemData *p1, const PluginListItemData *p2) diff --git a/src/mir_app/src/xmlParser.cpp b/src/mir_app/src/xmlParser.cpp index fbacef5451..53c57fea06 100644 --- a/src/mir_app/src/xmlParser.cpp +++ b/src/mir_app/src/xmlParser.cpp @@ -857,7 +857,7 @@ XMLSTR fromXMLString(XMLCSTR s, int lo, XML *pXML) #ifndef _XMLWIDECHAR if (characterEncoding != XMLNode::char_encoding_legacy) - Utf8Decode((XMLSTR)s, nullptr); + mir_utf8decode((XMLSTR)s, nullptr); #endif return (XMLSTR)s; -- cgit v1.2.3