From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/FavContacts/src/contact_cache.cpp | 18 +++++++-------- plugins/FavContacts/src/contact_cache.h | 4 ++-- plugins/FavContacts/src/favlist.h | 10 ++++---- plugins/FavContacts/src/http_api.cpp | 2 +- plugins/FavContacts/src/menu.cpp | 22 +++++++++--------- plugins/FavContacts/src/services.cpp | 38 +++++++++++++++---------------- 6 files changed, 47 insertions(+), 47 deletions(-) (limited to 'plugins/FavContacts') diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index 38cd4abb62..fb837cdd09 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -114,7 +114,7 @@ float CContactCache::getWeight(int rate) return -1; } -static bool AppendInfo(TCHAR *buf, int size, MCONTACT hContact, int info) +static bool AppendInfo(wchar_t *buf, int size, MCONTACT hContact, int info) { ptrT str(Contact_GetInfo(info, hContact)); if (str != NULL) { @@ -128,7 +128,7 @@ static bool AppendInfo(TCHAR *buf, int size, MCONTACT hContact, int info) void CContactCache::TContactInfo::LoadInfo() { if (infoLoaded) return; - TCHAR *p = info; + wchar_t *p = info; p[0] = p[1] = 0; @@ -147,22 +147,22 @@ void CContactCache::TContactInfo::LoadInfo() infoLoaded = true; } -TCHAR *nb_stristr(TCHAR *str, TCHAR *substr) +wchar_t *nb_stristr(wchar_t *str, wchar_t *substr) { if (!substr || !*substr) return str; if (!str || !*str) return NULL; - TCHAR *str_up = NEWTSTR_ALLOCA(str); - TCHAR *substr_up = NEWTSTR_ALLOCA(substr); + wchar_t *str_up = NEWWSTR_ALLOCA(str); + wchar_t *substr_up = NEWWSTR_ALLOCA(substr); CharUpperBuff(str_up, (DWORD)mir_tstrlen(str_up)); CharUpperBuff(substr_up, (DWORD)mir_tstrlen(substr_up)); - TCHAR *p = _tcsstr(str_up, substr_up); + wchar_t *p = wcsstr(str_up, substr_up); return p ? (str + (p - str_up)) : NULL; } -bool CContactCache::filter(int rate, TCHAR *str) +bool CContactCache::filter(int rate, wchar_t *str) { if (!str || !*str) return true; @@ -172,7 +172,7 @@ bool CContactCache::filter(int rate, TCHAR *str) HKL kbdLayouts[10]; int nKbdLayouts = GetKeyboardLayoutList(_countof(kbdLayouts), kbdLayouts); - TCHAR buf[256]; + wchar_t buf[256]; BYTE keyState[256] = { 0 }; for (int iLayout = 0; iLayout < nKbdLayouts; ++iLayout) { @@ -188,7 +188,7 @@ bool CContactCache::filter(int rate, TCHAR *str) buf[i] = 0; } - for (TCHAR *p = m_cache[rate]->info; p && *p; p = p + mir_tstrlen(p) + 1) + for (wchar_t *p = m_cache[rate]->info; p && *p; p = p + mir_tstrlen(p) + 1) if (nb_stristr(p, buf)) return true; } diff --git a/plugins/FavContacts/src/contact_cache.h b/plugins/FavContacts/src/contact_cache.h index 6bbd52a74b..2987290735 100644 --- a/plugins/FavContacts/src/contact_cache.h +++ b/plugins/FavContacts/src/contact_cache.h @@ -11,7 +11,7 @@ public: MCONTACT hContact; float rate; bool infoLoaded; - TCHAR info[INFOSIZE]; + wchar_t info[INFOSIZE]; TContactInfo() { @@ -39,7 +39,7 @@ public: MCONTACT get(int rate); float getWeight(int rate); - bool filter(int rate, TCHAR *str); + bool filter(int rate, wchar_t *str); }; #endif // __contact_cache__ diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h index c8adf21ca1..91245327d7 100644 --- a/plugins/FavContacts/src/favlist.h +++ b/plugins/FavContacts/src/favlist.h @@ -6,8 +6,8 @@ struct TContactInfo private: MCONTACT hContact; DWORD status; - TCHAR *name; - TCHAR *group; + wchar_t *name; + wchar_t *group; bool bManual; float fRate; @@ -39,7 +39,7 @@ public: return hContact; } - TCHAR *getGroup() const + wchar_t *getGroup() const { return group; } @@ -66,7 +66,7 @@ class TFavContacts : public LIST < TContactInfo > { private: int nGroups; - TCHAR *prevGroup; + wchar_t *prevGroup; MIDatabase *db; int addContact(MCONTACT hContact, bool bManual) @@ -84,7 +84,7 @@ private: TContactInfo *info = new TContactInfo(hContact, bManual); insert(info); - TCHAR *group = info->getGroup(); + wchar_t *group = info->getGroup(); if (prevGroup && mir_tstrcmp(prevGroup, group)) ++nGroups; prevGroup = group; diff --git a/plugins/FavContacts/src/http_api.cpp b/plugins/FavContacts/src/http_api.cpp index ab04a6ac71..cc84b08adc 100644 --- a/plugins/FavContacts/src/http_api.cpp +++ b/plugins/FavContacts/src/http_api.cpp @@ -74,7 +74,7 @@ public: for (int i = 0; i < favList.getCount(); ++i) { MCONTACT hContact = favList[i]->getHandle(); - TCHAR *name = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0); + wchar_t *name = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0); AVATARCACHEENTRY *avatar = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0); int status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE); diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp index 6110ad45ba..15c2f3189e 100644 --- a/plugins/FavContacts/src/menu.cpp +++ b/plugins/FavContacts/src/menu.cpp @@ -23,11 +23,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. UINT g_maxItemWidth = 0; float g_widthMultiplier = 0; -TCHAR g_filter[1024] = { 0 }; +wchar_t g_filter[1024] = { 0 }; HWND g_hwndMenuHost = NULL; -static TCHAR* sttGetGroupName(int id) +static wchar_t* sttGetGroupName(int id) { if (id == 1) { if (g_Options.bUseGroups) @@ -42,7 +42,7 @@ static BOOL sttMeasureItem_Group(LPMEASUREITEMSTRUCT lpmis, Options *options) { HDC hdc = GetDC(g_hwndMenuHost); HFONT hfntSave = (HFONT)SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT)); - TCHAR *name = sttGetGroupName(-INT_PTR(lpmis->itemData)); + wchar_t *name = sttGetGroupName(-INT_PTR(lpmis->itemData)); if (!options->bSysColors) SelectObject(hdc, g_Options.hfntName); @@ -71,7 +71,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) if (options->bSecondLine) { bool bFree = false; - TCHAR *title = db_get_tsa(hContact, "CList", "StatusMsg"); + wchar_t *title = db_get_tsa(hContact, "CList", "StatusMsg"); if (title == NULL) { char *proto = GetContactProto(hContact); int status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE); @@ -89,7 +89,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) mir_free(title); } - TCHAR *name = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0); + wchar_t *name = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0); if (!options->bSysColors) SelectObject(hdc, g_Options.hfntName); GetTextExtentPoint32(hdc, name, (int)mir_tstrlen(name), &sz); @@ -155,7 +155,7 @@ static BOOL sttDrawItem_Group(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) SetTextColor(lpdis->hDC, g_Options.clLine1Sel); } - TCHAR *name = sttGetGroupName(-INT_PTR(lpdis->itemData)); + wchar_t *name = sttGetGroupName(-INT_PTR(lpdis->itemData)); if (!options->bSysColors) SelectObject(lpdis->hDC, g_Options.hfntName); DrawText(lpdis->hDC, name, -1, &lpdis->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_CENTER); @@ -301,7 +301,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) } if (true) { - TCHAR *name = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0); + wchar_t *name = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0); if (!options->bSysColors) SelectObject(hdcTemp, g_Options.hfntName); @@ -315,7 +315,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) if (options->bSecondLine) { bool bFree = false; - TCHAR *title = db_get_tsa(hContact, "CList", "StatusMsg"); + wchar_t *title = db_get_tsa(hContact, "CList", "StatusMsg"); if (title == NULL) { int status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE); title = pcli->pfnGetStatusModeDescription(status, 0); @@ -393,9 +393,9 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, if (size_t l = mir_tstrlen(g_filter)) g_filter[l - 1] = 0; } - else if (_istalnum(LOWORD(wParam))) { + else if (iswalnum(LOWORD(wParam))) { if (mir_tstrlen(g_filter) < _countof(g_filter) - 1) { - TCHAR s[] = { LOWORD(wParam), 0 }; + wchar_t s[] = { LOWORD(wParam), 0 }; mir_tstrcat(g_filter, s); } } @@ -444,7 +444,7 @@ int ShowMenu(bool centered) HMENU hMenu = CreatePopupMenu(); SIZE szMenu = { 0 }; SIZE szColumn = { 0 }; - TCHAR *prevGroup = NULL; + wchar_t *prevGroup = NULL; int idItem = 100; MCONTACT hContact; diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp index 7a2658b6bc..556e0ebbaa 100644 --- a/plugins/FavContacts/src/services.cpp +++ b/plugins/FavContacts/src/services.cpp @@ -128,27 +128,27 @@ int ProcessReloadFonts(WPARAM, LPARAM) LOGFONT lf = { 0 }; FontIDT fontid = { sizeof(fontid) }; - mir_tstrcpy(fontid.group, LPGENT("Favorite Contacts")); - mir_tstrcpy(fontid.name, LPGENT("Contact name")); + mir_tstrcpy(fontid.group, LPGENW("Favorite Contacts")); + mir_tstrcpy(fontid.name, LPGENW("Contact name")); g_Options.clLine1 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf); g_Options.hfntName = CreateFontIndirect(&lf); - mir_tstrcpy(fontid.name, LPGENT("Second line")); + mir_tstrcpy(fontid.name, LPGENW("Second line")); g_Options.clLine2 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf); g_Options.hfntSecond = CreateFontIndirect(&lf); - mir_tstrcpy(fontid.name, LPGENT("Selected contact name (color)")); + mir_tstrcpy(fontid.name, LPGENW("Selected contact name (color)")); g_Options.clLine1Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf); - mir_tstrcpy(fontid.name, LPGENT("Selected second line (color)")); + mir_tstrcpy(fontid.name, LPGENW("Selected second line (color)")); g_Options.clLine2Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf); ColourIDT colourid = { sizeof(colourid) }; - mir_tstrcpy(colourid.group, LPGENT("Favorite Contacts")); - mir_tstrcpy(colourid.name, LPGENT("Background")); + mir_tstrcpy(colourid.group, LPGENW("Favorite Contacts")); + mir_tstrcpy(colourid.name, LPGENW("Background")); g_Options.clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf); - mir_tstrcpy(colourid.name, LPGENT("Selected background")); + mir_tstrcpy(colourid.name, LPGENW("Selected background")); g_Options.clBackSel = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf); return 0; @@ -171,38 +171,38 @@ int ProcessModulesLoaded(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////// FontIDT fontid = { sizeof(fontid) }; - mir_tstrcpy(fontid.group, LPGENT("Favorite Contacts")); + mir_tstrcpy(fontid.group, LPGENW("Favorite Contacts")); mir_strcpy(fontid.dbSettingsGroup, "FavContacts"); - mir_tstrcpy(fontid.backgroundGroup, LPGENT("Favorite Contacts")); + mir_tstrcpy(fontid.backgroundGroup, LPGENW("Favorite Contacts")); fontid.flags = FIDF_DEFAULTVALID; fontid.deffontsettings.charset = DEFAULT_CHARSET; fontid.deffontsettings.size = -11; mir_tstrcpy(fontid.deffontsettings.szFace, L"MS Shell Dlg"); fontid.deffontsettings.style = 0; - mir_tstrcpy(fontid.backgroundName, LPGENT("Background")); + mir_tstrcpy(fontid.backgroundName, LPGENW("Background")); - mir_tstrcpy(fontid.name, LPGENT("Contact name")); + mir_tstrcpy(fontid.name, LPGENW("Contact name")); mir_strcpy(fontid.prefix, "fntName"); fontid.deffontsettings.colour = GetSysColor(COLOR_MENUTEXT); fontid.deffontsettings.style = DBFONTF_BOLD; FontRegisterT(&fontid); - mir_tstrcpy(fontid.name, LPGENT("Second line")); + mir_tstrcpy(fontid.name, LPGENW("Second line")); mir_strcpy(fontid.prefix, "fntSecond"); fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_MENUTEXT), GetSysColor(COLOR_MENU)); fontid.deffontsettings.style = 0; FontRegisterT(&fontid); - mir_tstrcpy(fontid.backgroundName, LPGENT("Selected background")); + mir_tstrcpy(fontid.backgroundName, LPGENW("Selected background")); - mir_tstrcpy(fontid.name, LPGENT("Selected contact name (color)")); + mir_tstrcpy(fontid.name, LPGENW("Selected contact name (color)")); mir_strcpy(fontid.prefix, "fntNameSel"); fontid.deffontsettings.colour = GetSysColor(COLOR_HIGHLIGHTTEXT); fontid.deffontsettings.style = DBFONTF_BOLD; FontRegisterT(&fontid); - mir_tstrcpy(fontid.name, LPGENT("Selected second line (color)")); + mir_tstrcpy(fontid.name, LPGENW("Selected second line (color)")); mir_strcpy(fontid.prefix, "fntSecondSel"); fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_HIGHLIGHT)); fontid.deffontsettings.style = 0; @@ -211,15 +211,15 @@ int ProcessModulesLoaded(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////// ColourIDT colourid = { sizeof(colourid) }; - mir_tstrcpy(colourid.group, LPGENT("Favorite Contacts")); + mir_tstrcpy(colourid.group, LPGENW("Favorite Contacts")); mir_strcpy(colourid.dbSettingsGroup, "FavContacts"); - mir_tstrcpy(colourid.name, LPGENT("Background")); + mir_tstrcpy(colourid.name, LPGENW("Background")); mir_strcpy(colourid.setting, "BackColour"); colourid.defcolour = GetSysColor(COLOR_MENU); ColourRegisterT(&colourid); - mir_tstrcpy(colourid.name, LPGENT("Selected background")); + mir_tstrcpy(colourid.name, LPGENW("Selected background")); mir_strcpy(colourid.setting, "SelectedColour"); colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT); ColourRegisterT(&colourid); -- cgit v1.2.3