From 428bf0cbd77813a43094cb5c984436deff251936 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 29 Jul 2016 12:36:34 +0000 Subject: no more TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/src/bitmaps.cpp | 4 ++-- src/mir_core/src/db.cpp | 2 +- src/mir_core/src/icons.cpp | 4 ++-- src/mir_core/src/langpack.cpp | 20 ++++++++++---------- src/mir_core/src/logger.cpp | 2 +- src/mir_core/src/miranda.cpp | 2 +- src/mir_core/src/mstring.cpp | 2 +- src/mir_core/src/openurl.cpp | 4 ++-- src/mir_core/src/timezones.cpp | 10 +++++----- src/mir_core/src/ui_utils.cpp | 20 ++++++++++---------- src/mir_core/src/winver.cpp | 2 +- 11 files changed, 36 insertions(+), 36 deletions(-) (limited to 'src/mir_core') diff --git a/src/mir_core/src/bitmaps.cpp b/src/mir_core/src/bitmaps.cpp index 5a06bb50ff..42db450952 100644 --- a/src/mir_core/src/bitmaps.cpp +++ b/src/mir_core/src/bitmaps.cpp @@ -28,13 +28,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. MIR_CORE_DLL(HBITMAP) Bitmap_Load(const wchar_t *ptszFileName) { wchar_t szFilename[MAX_PATH]; - if (!PathToAbsoluteT(ptszFileName, szFilename)) + if (!PathToAbsoluteW(ptszFileName, szFilename)) wcsncpy_s(szFilename, ptszFileName, _TRUNCATE); if (!ServiceExists(MS_IMG_LOAD)) return NULL; - return (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_TCHAR); + return (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_WCHAR); } MIR_CORE_DLL(void) Bitmap_GetFilter(wchar_t *dest, size_t destLen) diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index 0e028bb398..8bac3b89bb 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -351,7 +351,7 @@ extern "C" MIR_CORE_DLL(void) db_setCurrent(MIDatabase *_db) currDb = _db; // try to get the langpack's name from a profile - ptrW langpack(db_get_tsa(NULL, "Langpack", "Current")); + ptrW langpack(db_get_wsa(NULL, "Langpack", "Current")); if (langpack && langpack[0] != '\0') LoadLangPack(langpack); else diff --git a/src/mir_core/src/icons.cpp b/src/mir_core/src/icons.cpp index 9b2ee4a65c..a5c310d6b8 100644 --- a/src/mir_core/src/icons.cpp +++ b/src/mir_core/src/icons.cpp @@ -31,7 +31,7 @@ MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconIte SKINICONDESC sid = { 0 }; sid.defaultFile.w = szFile; sid.section.a = (char*)szSection; - sid.flags = SIDF_PATH_TCHAR; + sid.flags = SIDF_PATH_UNICODE; for (unsigned i = 0; i < iCount; i++) { char szSetting[100]; @@ -56,7 +56,7 @@ MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t *szSection, Ico SKINICONDESC sid = { 0 }; sid.defaultFile.w = szFile; sid.section.w = (wchar_t*)szSection; - sid.flags = SIDF_ALL_TCHAR; + sid.flags = SIDF_ALL_UNICODE; for (unsigned i = 0; i < iCount; i++) { char szSetting[100]; diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index 9c29fc24da..a59aa89b0d 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -379,7 +379,7 @@ MIR_CORE_DLL(int) LoadLangPack(const wchar_t *ptszLangPack) // ensure that a lang's name is a full file name wchar_t tszFullPath[MAX_PATH]; - if (!PathIsAbsoluteT(ptszLangPack)) + if (!PathIsAbsoluteW(ptszLangPack)) mir_snwprintf(tszFullPath, L"%s\\%s", g_tszRoot, ptszLangPack); else wcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE); @@ -503,7 +503,7 @@ MIR_CORE_DLL(wchar_t*) Langpack_PcharToTchar(const char *pszStr) wchar_t *result = (wchar_t*)alloca((len + 1)*sizeof(wchar_t)); MultiByteToWideChar(Langpack_GetDefaultCodePage(), 0, pszStr, -1, result, len); result[len] = 0; - return mir_wstrdup(TranslateTS(result)); + return mir_wstrdup(TranslateW(result)); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -632,21 +632,21 @@ MIR_CORE_DLL(void) Langpack_SortDuplicates(void) void GetDefaultLang() { // calculate the langpacks' root - PathToAbsoluteT(L"\\Languages", g_tszRoot); + PathToAbsoluteW(L"\\Languages", g_tszRoot); if (_waccess(g_tszRoot, 0) != 0) // directory Languages exists - PathToAbsoluteT(L".", g_tszRoot); + PathToAbsoluteW(L".", g_tszRoot); // look into mirandaboot.ini wchar_t tszPath[MAX_PATH], tszLangName[256]; - PathToAbsoluteT(L"\\mirandaboot.ini", tszPath); + PathToAbsoluteW(L"\\mirandaboot.ini", tszPath); GetPrivateProfileString(L"Language", L"DefaultLanguage", L"", tszLangName, _countof(tszLangName), tszPath); if (tszLangName[0]) { if (!mir_wstrcmpi(tszLangName, L"default")) { - db_set_ts(NULL, "Langpack", "Current", L"default"); + db_set_ws(NULL, "Langpack", "Current", L"default"); return; } if (!LoadLangPack(tszLangName)) { - db_set_ts(NULL, "Langpack", "Current", tszLangName); + db_set_ws(NULL, "Langpack", "Current", tszLangName); return; } } @@ -655,7 +655,7 @@ void GetDefaultLang() if (GetLocaleInfo(MAKELCID(GetUserDefaultUILanguage(), SORT_DEFAULT), LOCALE_SENGLANGUAGE, tszLangName, _countof(tszLangName))) { mir_snwprintf(tszPath, L"langpack_%s.txt", wcslwr(tszLangName)); if (!LoadLangPack(tszPath)) { - db_set_ts(NULL, "Langpack", "Current", tszPath); + db_set_ws(NULL, "Langpack", "Current", tszPath); return; } } @@ -672,13 +672,13 @@ void GetDefaultLang() continue; if (!LoadLangPack(fd.cFileName)) { - db_set_ts(NULL, "Langpack", "Current", fd.cFileName); + db_set_ws(NULL, "Langpack", "Current", fd.cFileName); break; } } while (FindNextFile(hFind, &fd)); FindClose(hFind); } - else db_set_ts(NULL, "Langpack", "Current", L"default"); + else db_set_ws(NULL, "Langpack", "Current", L"default"); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/mir_core/src/logger.cpp b/src/mir_core/src/logger.cpp index a2e526a6a2..5dbc758b2e 100644 --- a/src/mir_core/src/logger.cpp +++ b/src/mir_core/src/logger.cpp @@ -112,7 +112,7 @@ MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const wchar_t *ptszDescr if (fp == NULL) { wchar_t tszPath[MAX_PATH]; wcsncpy_s(tszPath, ptszFile, _TRUNCATE); - CreatePathToFileT(tszPath); + CreatePathToFileW(tszPath); } else fclose(fp); diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp index c2b4208b54..596d8c7b25 100644 --- a/src/mir_core/src/miranda.cpp +++ b/src/mir_core/src/miranda.cpp @@ -57,7 +57,7 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM lParam) GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath)); if (wParam) { - VARST profilename(L"%miranda_profilename%"); + VARSW profilename(L"%miranda_profilename%"); mir_snwprintf(cmdLine, L"\"%s\" /restart:%d /profile=%s", mirandaPath, GetCurrentProcessId(), (wchar_t*)profilename); } else mir_snwprintf(cmdLine, L"\"%s\" /restart:%d", mirandaPath, GetCurrentProcessId()); diff --git a/src/mir_core/src/mstring.cpp b/src/mir_core/src/mstring.cpp index eaef7b0d8a..47875a439e 100644 --- a/src/mir_core/src/mstring.cpp +++ b/src/mir_core/src/mstring.cpp @@ -121,7 +121,7 @@ MIR_CORE_DLL(void) mirstr_unlock(CMStringData* pThis) ///////////////////////////////////////////////////////////////////////////////////////// // don't remove it -// this code just instantiates templates for CMString[A/W] +// this code just instantiates templates for CMStringW[A/W] template CMStringW; template MIR_CORE_EXPORT CMStringW CALLBACK operator + (const CMStringW& str1, const CMStringW& str2); diff --git a/src/mir_core/src/openurl.cpp b/src/mir_core/src/openurl.cpp index 93aab27ec2..49b2f57309 100644 --- a/src/mir_core/src/openurl.cpp +++ b/src/mir_core/src/openurl.cpp @@ -41,7 +41,7 @@ static void OpenURLThread(void *arg) TOpenUrlInfo *hUrlInfo = (TOpenUrlInfo*)arg; // wack a protocol on it - CMString tszUrl; + CMStringW tszUrl; if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\') tszUrl.Format(L"file:///%s", hUrlInfo->szUrl); else { @@ -56,7 +56,7 @@ static void OpenURLThread(void *arg) } // check user defined browser for opening urls - ptrW tszBrowser(db_get_tsa(NULL, "Miranda", "OpenUrlBrowser")); + ptrW tszBrowser(db_get_wsa(NULL, "Miranda", "OpenUrlBrowser")); if (tszBrowser) ShellExecute(NULL, L"open", tszBrowser, tszUrl, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT); else diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp index e8f0e05356..bb12b1e673 100644 --- a/src/mir_core/src/timezones.cpp +++ b/src/mir_core/src/timezones.cpp @@ -86,7 +86,7 @@ void FormatTime(const SYSTEMTIME *st, const wchar_t *szFormat, wchar_t *szDest, { if (szDest == NULL || cbDest == 0) return; - CMString tszTemp; + CMStringW tszTemp; for (const wchar_t* pFormat = szFormat; *pFormat; ++pFormat) { DWORD fmt = 0; @@ -242,7 +242,7 @@ MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule if (szModule == NULL) szModule = "UserInfo"; DBVARIANT dbv; - if (!db_get_ts(hContact, szModule, "TzName", &dbv)) { + if (!db_get_ws(hContact, szModule, "TzName", &dbv)) { HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags); db_free(&dbv); if (res) return res; @@ -251,7 +251,7 @@ MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule signed char timezone = (signed char)db_get_b(hContact, szModule, "Timezone", -1); if (timezone == -1) { char *szProto = GetContactProto(hContact); - if (!db_get_ts(hContact, szProto, "TzName", &dbv)) { + if (!db_get_ws(hContact, szProto, "TzName", &dbv)) { HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags); db_free(&dbv); if (res) return res; @@ -293,7 +293,7 @@ MIR_CORE_DLL(void) TimeZone_StoreByContact(MCONTACT hContact, LPCSTR szModule, H MIM_TIMEZONE *tz = (MIM_TIMEZONE*)hTZ; if (tz) { - db_set_ts(hContact, szModule, "TzName", tz->tszName); + db_set_ws(hContact, szModule, "TzName", tz->tszName); db_set_b(hContact, szModule, "Timezone", (char)((tz->tzi.Bias + tz->tzi.StandardBias) / 30)); } else { @@ -405,7 +405,7 @@ MIR_CORE_DLL(int) TimeZone_SelectListItem(MCONTACT hContact, LPCSTR szModule, HW if (szModule == NULL) szModule = "UserInfo"; int iSelection = 0; - ptrW tszName(db_get_tsa(hContact, szModule, "TzName")); + ptrW tszName(db_get_wsa(hContact, szModule, "TzName")); if (tszName != NULL) { unsigned hash = mir_hashstrT(tszName); for (int i = 0; i < g_timezonesBias.getCount(); i++) { diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index 8de4a148e7..307298a86d 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -308,7 +308,7 @@ void CCtrlCombo::OnApply() { CSuper::OnApply(); - if (GetDataType() == DBVT_TCHAR) { + if (GetDataType() == DBVT_WCHAR) { int len = GetWindowTextLength(m_hwnd) + 1; wchar_t *buf = (wchar_t *)_alloca(sizeof(wchar_t) * len); GetWindowText(m_hwnd, buf, len); @@ -321,7 +321,7 @@ void CCtrlCombo::OnApply() void CCtrlCombo::OnReset() { - if (GetDataType() == DBVT_TCHAR) + if (GetDataType() == DBVT_WCHAR) SetText(LoadText()); else if (GetDataType() != DBVT_DELETED) SetInt(LoadInt()); @@ -573,7 +573,7 @@ void CCtrlEdit::OnApply() { CSuper::OnApply(); - if (GetDataType() == DBVT_TCHAR) { + if (GetDataType() == DBVT_WCHAR) { int len = GetWindowTextLength(m_hwnd) + 1; wchar_t *buf = (wchar_t *)_alloca(sizeof(wchar_t) * len); GetWindowText(m_hwnd, buf, len); @@ -586,7 +586,7 @@ void CCtrlEdit::OnApply() void CCtrlEdit::OnReset() { - if (GetDataType() == DBVT_TCHAR) + if (GetDataType() == DBVT_WCHAR) SetText(LoadText()); else if (GetDataType() != DBVT_DELETED) SetInt(LoadInt()); @@ -619,7 +619,7 @@ void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, BY void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, wchar_t* szValue) { - m_dbLink = new CDbLink(szModuleName, szSetting, DBVT_TCHAR, szValue); + m_dbLink = new CDbLink(szModuleName, szSetting, DBVT_WCHAR, szValue); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -1632,7 +1632,7 @@ void CCtrlTreeView::TranslateItem(HTREEITEM hItem) TVITEMEX tvi; wchar_t buf[128]; GetItem(hItem, &tvi, buf, _countof(buf)); - tvi.pszText = TranslateTS(tvi.pszText); + tvi.pszText = TranslateW(tvi.pszText); SetItem(&tvi); } @@ -2067,7 +2067,7 @@ void CCtrlPages::OnInit() TCITEM tci = { 0 }; tci.mask = TCIF_PARAM | TCIF_TEXT; tci.lParam = (LPARAM)p; - tci.pszText = TranslateTS(p->m_ptszHeader); + tci.pszText = TranslateW(p->m_ptszHeader); if (p->m_hIcon) { if (!m_hIml) { m_hIml = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 1); @@ -2504,8 +2504,8 @@ void CDbLink::SaveInt(DWORD value) wchar_t* CDbLink::LoadText() { if (dbv.type != DBVT_DELETED) db_free(&dbv); - if (!db_get_ts(NULL, m_szModule, m_szSetting, &dbv)) { - if (dbv.type == DBVT_TCHAR) + if (!db_get_ws(NULL, m_szModule, m_szSetting, &dbv)) { + if (dbv.type == DBVT_WCHAR) return dbv.ptszVal; return m_szDefault; } @@ -2516,5 +2516,5 @@ wchar_t* CDbLink::LoadText() void CDbLink::SaveText(wchar_t *value) { - db_set_ts(NULL, m_szModule, m_szSetting, value); + db_set_ws(NULL, m_szModule, m_szSetting, value); } diff --git a/src/mir_core/src/winver.cpp b/src/mir_core/src/winver.cpp index 8c7d73e98a..6e86300372 100644 --- a/src/mir_core/src/winver.cpp +++ b/src/mir_core/src/winver.cpp @@ -220,7 +220,7 @@ MIR_CORE_DLL(BOOL) GetOSDisplayString(wchar_t *buf, size_t bufSize) SYSTEM_INFO sysInfo = { 0 }; GetNativeSystemInfo(&sysInfo); - CMString ret(L"Microsoft "); + CMStringW ret(L"Microsoft "); // Test for the specific product. if (osvi.dwMajorVersion >= 6) { -- cgit v1.2.3