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 --- src/core/stdclist/src/clcfonts.cpp | 34 ++++++++++++------------- src/core/stdclist/src/clcopts.cpp | 48 +++++++++++++++++------------------ src/core/stdclist/src/clcpaint.cpp | 2 +- src/core/stdclist/src/cluiopts.cpp | 2 +- src/core/stdclist/src/contact.cpp | 52 +++++++++++++++++++------------------- 5 files changed, 69 insertions(+), 69 deletions(-) (limited to 'src/core/stdclist') diff --git a/src/core/stdclist/src/clcfonts.cpp b/src/core/stdclist/src/clcfonts.cpp index 79150a51f4..74c09a7278 100644 --- a/src/core/stdclist/src/clcfonts.cpp +++ b/src/core/stdclist/src/clcfonts.cpp @@ -28,19 +28,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct { - const TCHAR *tszName; + const wchar_t *tszName; int iMask; } static clistFontDescr[] = { - { LPGENT("Standard contacts"), FIDF_CLASSGENERAL }, - { LPGENT("Online contacts to whom you have a different visibility"), FIDF_CLASSGENERAL }, - { LPGENT("Offline contacts"), FIDF_CLASSGENERAL }, - { LPGENT("Contacts which are 'not on list'"), FIDF_CLASSGENERAL }, - { LPGENT("Groups"), FIDF_CLASSHEADER }, - { LPGENT("Group member counts"), FIDF_CLASSHEADER }, - { LPGENT("Dividers"), FIDF_CLASSSMALL }, - { LPGENT("Offline contacts to whom you have a different visibility"), FIDF_CLASSGENERAL } + { LPGENW("Standard contacts"), FIDF_CLASSGENERAL }, + { LPGENW("Online contacts to whom you have a different visibility"), FIDF_CLASSGENERAL }, + { LPGENW("Offline contacts"), FIDF_CLASSGENERAL }, + { LPGENW("Contacts which are 'not on list'"), FIDF_CLASSGENERAL }, + { LPGENW("Groups"), FIDF_CLASSHEADER }, + { LPGENW("Group member counts"), FIDF_CLASSHEADER }, + { LPGENW("Dividers"), FIDF_CLASSSMALL }, + { LPGENW("Offline contacts to whom you have a different visibility"), FIDF_CLASSGENERAL } }; static int FS_FontsChanged(WPARAM, LPARAM) @@ -54,7 +54,7 @@ void RegisterCListFonts() FontIDT fontid = { sizeof(fontid) }; fontid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWREREGISTER | FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS; strncpy(fontid.dbSettingsGroup, "CLC", sizeof(fontid.dbSettingsGroup)); - _tcsncpy(fontid.group, LPGENT("Contact list"), _countof(fontid.group)); + wcsncpy(fontid.group, LPGENW("Contact list"), _countof(fontid.group)); HDC hdc = GetDC(NULL); for (int i = 0; i < _countof(clistFontDescr); i++) { @@ -62,7 +62,7 @@ void RegisterCListFonts() pcli->pfnGetFontSetting(i, &lf, &fontid.deffontsettings.colour); lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72); - _tcsncpy_s(fontid.deffontsettings.szFace, lf.lfFaceName, _TRUNCATE); + wcsncpy_s(fontid.deffontsettings.szFace, lf.lfFaceName, _TRUNCATE); fontid.deffontsettings.charset = lf.lfCharSet; fontid.deffontsettings.size = (char)lf.lfHeight; fontid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? DBFONTF_BOLD : 0) | (lf.lfItalic ? DBFONTF_ITALIC : 0); @@ -70,7 +70,7 @@ void RegisterCListFonts() fontid.flags &= ~FIDF_CLASSMASK; fontid.flags |= clistFontDescr[i].iMask; - _tcsncpy(fontid.name, clistFontDescr[i].tszName, _countof(fontid.name)); + wcsncpy(fontid.name, clistFontDescr[i].tszName, _countof(fontid.name)); char idstr[10]; mir_snprintf(idstr, "Font%d", i); @@ -87,25 +87,25 @@ void RegisterCListFonts() strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup)); strncpy(colourid.setting, "BkColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Background"), _countof(colourid.name)); - _tcsncpy(colourid.group, LPGENT("Contact list"), _countof(colourid.group)); + wcsncpy(colourid.name, LPGENW("Background"), _countof(colourid.name)); + wcsncpy(colourid.group, LPGENW("Contact list"), _countof(colourid.group)); colourid.defcolour = CLCDEFAULT_BKCOLOUR; ColourRegisterT(&colourid); strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Selected text"), _countof(colourid.name)); + wcsncpy(colourid.name, LPGENW("Selected text"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR; ColourRegisterT(&colourid); strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Hottrack text"), _countof(colourid.name)); + wcsncpy(colourid.name, LPGENW("Hottrack text"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR; ColourRegisterT(&colourid); strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Quicksearch text"), _countof(colourid.name)); + wcsncpy(colourid.name, LPGENW("Quicksearch text"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR; ColourRegisterT(&colourid); diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index ef529785e9..53d42c65c3 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -54,36 +54,36 @@ static const checkBoxToStyleEx[] = struct CheckBoxValues_t { DWORD style; - TCHAR* szDescr; + wchar_t* szDescr; }; static const struct CheckBoxValues_t greyoutValues[] = { - { GREYF_UNFOCUS, LPGENT("Not focused") }, - { MODEF_OFFLINE, LPGENT("Offline") }, - { PF2_ONLINE, LPGENT("Online") }, - { PF2_SHORTAWAY, LPGENT("Away") }, - { PF2_LONGAWAY, LPGENT("Not available") }, - { PF2_LIGHTDND, LPGENT("Occupied") }, - { PF2_HEAVYDND, LPGENT("Do not disturb")}, - { PF2_FREECHAT, LPGENT("Free for chat") }, - { PF2_INVISIBLE, LPGENT("Invisible") }, - { PF2_OUTTOLUNCH, LPGENT("Out to lunch") }, - { PF2_ONTHEPHONE, LPGENT("On the phone") } + { GREYF_UNFOCUS, LPGENW("Not focused") }, + { MODEF_OFFLINE, LPGENW("Offline") }, + { PF2_ONLINE, LPGENW("Online") }, + { PF2_SHORTAWAY, LPGENW("Away") }, + { PF2_LONGAWAY, LPGENW("Not available") }, + { PF2_LIGHTDND, LPGENW("Occupied") }, + { PF2_HEAVYDND, LPGENW("Do not disturb")}, + { PF2_FREECHAT, LPGENW("Free for chat") }, + { PF2_INVISIBLE, LPGENW("Invisible") }, + { PF2_OUTTOLUNCH, LPGENW("Out to lunch") }, + { PF2_ONTHEPHONE, LPGENW("On the phone") } }; static const struct CheckBoxValues_t offlineValues[] = { - { MODEF_OFFLINE, LPGENT("Offline") }, - { PF2_ONLINE, LPGENT("Online") }, - { PF2_SHORTAWAY, LPGENT("Away") }, - { PF2_LONGAWAY, LPGENT("Not available") }, - { PF2_LIGHTDND, LPGENT("Occupied") }, - { PF2_HEAVYDND, LPGENT("Do not disturb")}, - { PF2_FREECHAT, LPGENT("Free for chat") }, - { PF2_INVISIBLE, LPGENT("Invisible") }, - { PF2_OUTTOLUNCH, LPGENT("Out to lunch") }, - { PF2_ONTHEPHONE, LPGENT("On the phone") } + { MODEF_OFFLINE, LPGENW("Offline") }, + { PF2_ONLINE, LPGENW("Online") }, + { PF2_SHORTAWAY, LPGENW("Away") }, + { PF2_LONGAWAY, LPGENW("Not available") }, + { PF2_LIGHTDND, LPGENW("Occupied") }, + { PF2_HEAVYDND, LPGENW("Do not disturb")}, + { PF2_FREECHAT, LPGENW("Free for chat") }, + { PF2_INVISIBLE, LPGENW("Invisible") }, + { PF2_OUTTOLUNCH, LPGENW("Out to lunch") }, + { PF2_ONTHEPHONE, LPGENW("On the phone") } }; static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style) @@ -340,7 +340,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_COMMAND: if (LOWORD(wParam) == IDC_BROWSE) { - TCHAR str[MAX_PATH], filter[512]; + wchar_t str[MAX_PATH], filter[512]; GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str)); OPENFILENAME ofn = { 0 }; @@ -459,7 +459,7 @@ int ClcModernOptInit(WPARAM wParam, LPARAM) obj.hInstance = g_hInst; obj.iSection = MODERNOPT_PAGE_SKINS; obj.iType = MODERNOPT_TYPE_SUBSECTIONPAGE; - obj.lptzSubsection = LPGENT("Contact list"); + obj.lptzSubsection = LPGENW("Contact list"); obj.iBoldControls = iBoldControls; obj.lpzHelpUrl = "http://wiki.miranda-ng.org/"; diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp index 3360176522..cb679abd0e 100644 --- a/src/core/stdclist/src/clcpaint.cpp +++ b/src/core/stdclist/src/clcpaint.cpp @@ -316,7 +316,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) GetTextExtentPoint32(hdcMem, cc->szText, (int)mir_tstrlen(cc->szText), &textSize); width = textSize.cx; - TCHAR *ptszGroupCount = NULL; + wchar_t *ptszGroupCount = NULL; if (cc->type == CLCIT_GROUP) { ptszGroupCount = pcli->pfnGetGroupCountsText(dat, cc); if (*ptszGroupCount) { diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp index 00f163105c..fdd473a268 100644 --- a/src/core/stdclist/src/cluiopts.cpp +++ b/src/core/stdclist/src/cluiopts.cpp @@ -170,7 +170,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L db_set_b(NULL, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG)); db_set_b(NULL, "CList", "Min2Tray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY)); { - TCHAR title[256]; + wchar_t title[256]; GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title)); db_set_ts(NULL, "CList", "TitleText", title); SetWindowText(pcli->hwndContactList, title); diff --git a/src/core/stdclist/src/contact.cpp b/src/core/stdclist/src/contact.cpp index 5e4e5634e2..359419faa3 100644 --- a/src/core/stdclist/src/contact.cpp +++ b/src/core/stdclist/src/contact.cpp @@ -24,37 +24,37 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -int g_bSortByStatus, g_bSortByProto; +int g_bSortByStatus, g_bSortByProto; -const struct -{ - int status, order; -} -static statusModeOrder[] = { - { ID_STATUS_OFFLINE, 500 }, - { ID_STATUS_ONLINE, 10 }, - { ID_STATUS_AWAY, 200 }, - { ID_STATUS_DND, 110 }, - { ID_STATUS_NA, 450 }, - { ID_STATUS_OCCUPIED, 100 }, - { ID_STATUS_FREECHAT, 0 }, - { ID_STATUS_INVISIBLE, 20 }, - { ID_STATUS_ONTHEPHONE, 150 }, - { ID_STATUS_OUTTOLUNCH, 425 } }; +const struct +{ + int status, order; +} +static statusModeOrder[] = { + { ID_STATUS_OFFLINE, 500 }, + { ID_STATUS_ONLINE, 10 }, + { ID_STATUS_AWAY, 200 }, + { ID_STATUS_DND, 110 }, + { ID_STATUS_NA, 450 }, + { ID_STATUS_OCCUPIED, 100 }, + { ID_STATUS_FREECHAT, 0 }, + { ID_STATUS_INVISIBLE, 20 }, + { ID_STATUS_ONTHEPHONE, 150 }, + { ID_STATUS_OUTTOLUNCH, 425 } }; -int GetStatusModeOrdering(int statusMode) -{ - int i; - for (i = 0; i < _countof(statusModeOrder); i++) - if (statusModeOrder[i].status == statusMode) - return statusModeOrder[i].order; - return 1000; -} +int GetStatusModeOrdering(int statusMode) +{ + int i; + for (i = 0; i < _countof(statusModeOrder); i++) + if (statusModeOrder[i].status == statusMode) + return statusModeOrder[i].order; + return 1000; +} int CompareContacts(const ClcContact* c1, const ClcContact* c2) { MCONTACT a = c1->hContact, b = c2->hContact; - TCHAR namea[128], *nameb; + wchar_t namea[128], *nameb; int statusa, statusb; int rc; @@ -88,7 +88,7 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2) } nameb = pcli->pfnGetContactDisplayName(a, 0); - _tcsncpy_s(namea, nameb, _TRUNCATE); + wcsncpy_s(namea, nameb, _TRUNCATE); namea[ _countof(namea)-1 ] = 0; nameb = pcli->pfnGetContactDisplayName(b, 0); -- cgit v1.2.3