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/SimpleAR/src/Main.cpp | 50 ++++++++++++++++++++-------------------- plugins/SimpleAR/src/Options.cpp | 14 +++++------ plugins/SimpleAR/src/stdafx.h | 2 +- 3 files changed, 33 insertions(+), 33 deletions(-) (limited to 'plugins/SimpleAR/src') diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 917ab2ae7d..451539ba83 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -24,13 +24,13 @@ BOOL gbVarsServiceExist = FALSE; INT interval; int hLangpack; -TCHAR* ptszDefaultMsg[] = { - LPGENT("I am currently away. I will reply to you when I am back."), - LPGENT("I am currently very busy and can't spare any time to talk with you. Sorry..."), - LPGENT("I am not available right now."), - LPGENT("I am now doing something, I will talk to you later."), - LPGENT("I am on the phone right now. I will get back to you very soon."), - LPGENT("I am having meal right now. I will get back to you very soon.") +wchar_t* ptszDefaultMsg[] = { + LPGENW("I am currently away. I will reply to you when I am back."), + LPGENW("I am currently very busy and can't spare any time to talk with you. Sorry..."), + LPGENW("I am not available right now."), + LPGENW("I am now doing something, I will talk to you later."), + LPGENW("I am on the phone right now. I will get back to you very soon."), + LPGENW("I am having meal right now. I will get back to you very soon.") }; PLUGININFOEX pluginInfoEx = { @@ -64,9 +64,9 @@ INT_PTR ToggleEnable(WPARAM, LPARAM) db_set_b(NULL, protocolname, KEY_ENABLED, fEnabled); if (fEnabled) - Menu_ModifyItem(hEnableMenu, LPGENT("Disable Auto&reply"), iconList[0].hIcolib); + Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib); else - Menu_ModifyItem(hEnableMenu, LPGENT("Enable Auto&reply"), iconList[1].hIcolib); + Menu_ModifyItem(hEnableMenu, LPGENW("Enable Auto&reply"), iconList[1].hIcolib); return 0; } @@ -77,9 +77,9 @@ INT_PTR Toggle(WPARAM hContact, LPARAM) on = !on; if (on) - Menu_ModifyItem(hToggle, LPGENT("Turn off Autoanswer"), iconList[0].hIcolib); + Menu_ModifyItem(hToggle, LPGENW("Turn off Autoanswer"), iconList[0].hIcolib); else - Menu_ModifyItem(hToggle, LPGENT("Turn on Autoanswer"), iconList[1].hIcolib); + Menu_ModifyItem(hToggle, LPGENW("Turn on Autoanswer"), iconList[1].hIcolib); return 0; } @@ -87,9 +87,9 @@ INT OnPreBuildContactMenu(WPARAM hContact, LPARAM) { BOOL on = !db_get_b(hContact, protocolname, "TurnedOn", 0); if (on) - Menu_ModifyItem(hToggle, LPGENT("Turn off Autoanswer"), iconList[0].hIcolib); + Menu_ModifyItem(hToggle, LPGENW("Turn off Autoanswer"), iconList[0].hIcolib); else - Menu_ModifyItem(hToggle, LPGENT("Turn on Autoanswer"), iconList[1].hIcolib); + Menu_ModifyItem(hToggle, LPGENW("Turn on Autoanswer"), iconList[1].hIcolib); return 0; } @@ -97,7 +97,7 @@ INT CheckDefaults(WPARAM, LPARAM) { interval = db_get_w(NULL, protocolname, KEY_REPEATINTERVAL, 300); - TCHAR *ptszVal = db_get_tsa(NULL, protocolname, KEY_HEADING); + wchar_t *ptszVal = db_get_tsa(NULL, protocolname, KEY_HEADING); if (ptszVal == 0) // Heading not set db_set_ts(NULL, protocolname, KEY_HEADING, TranslateT("Dear %user%, the owner left the following message:")); @@ -112,7 +112,7 @@ INT CheckDefaults(WPARAM, LPARAM) mir_snprintf(szStatus, "%d", c); ptszVal = db_get_tsa(NULL, protocolname, szStatus); if (ptszVal == 0) { - TCHAR *ptszDefault; + wchar_t *ptszDefault; if (c < ID_STATUS_FREECHAT) // This mode does not have a preset message ptszDefault = ptszDefaultMsg[c - ID_STATUS_ONLINE - 1]; @@ -133,9 +133,9 @@ INT CheckDefaults(WPARAM, LPARAM) BOOL fEnabled = db_get_b(NULL, protocolname, KEY_ENABLED, 1); if (fEnabled) - Menu_ModifyItem(hEnableMenu, LPGENT("Disable Auto&reply"), iconList[0].hIcolib); + Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib); else - Menu_ModifyItem(hEnableMenu, LPGENT("Enable Auto&reply"), iconList[1].hIcolib); + Menu_ModifyItem(hEnableMenu, LPGENW("Enable Auto&reply"), iconList[1].hIcolib); return 0; } @@ -164,7 +164,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) if (!dbei.cbBlob) /// invalid size return FALSE; - TCHAR *ptszVal = db_get_tsa(hContact, "Protocol", "p"); + wchar_t *ptszVal = db_get_tsa(hContact, "Protocol", "p"); if (ptszVal == NULL) // Contact with no protocol ?!! return FALSE; mir_free(ptszVal); @@ -190,7 +190,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) if (*ptszVal) { CMString ptszTemp; - TCHAR *ptszNick = db_get_tsa(hContact, pszProto, "Nick"); + wchar_t *ptszNick = db_get_tsa(hContact, pszProto, "Nick"); if (ptszNick == 0) { mir_free(ptszVal); return FALSE; @@ -198,7 +198,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) msgLen += mir_tstrlen(ptszVal); - TCHAR *ptszHead = db_get_tsa(NULL, protocolname, KEY_HEADING); + wchar_t *ptszHead = db_get_tsa(NULL, protocolname, KEY_HEADING); if (ptszHead != NULL) { ptszTemp = ptszHead; ptszTemp.Replace(L"%user%", ptszNick); @@ -206,7 +206,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) mir_free(ptszHead); } - TCHAR *ptszTemp2 = (TCHAR*)mir_alloc(sizeof(TCHAR) * (msgLen + 5)); + wchar_t *ptszTemp2 = (wchar_t*)mir_alloc(sizeof(wchar_t) * (msgLen + 5)); mir_sntprintf(ptszTemp2, msgLen + 5, L"%s\r\n\r\n%s", ptszTemp.c_str(), ptszVal); if (ServiceExists(MS_VARS_FORMATSTRING)) { ptszTemp = variables_parse(ptszTemp2, 0, hContact); @@ -241,8 +241,8 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) IconItemT iconList[] = { - { LPGENT("Disable Auto&reply"), "Disable Auto&reply", IDI_OFF }, - { LPGENT("Enable Auto&reply"), "Enable Auto&reply", IDI_ON } + { LPGENW("Disable Auto&reply"), "Disable Auto&reply", IDI_OFF }, + { LPGENW("Enable Auto&reply"), "Enable Auto&reply", IDI_ON } }; extern "C" int __declspec(dllexport)Load(void) @@ -257,13 +257,13 @@ extern "C" int __declspec(dllexport)Load(void) SET_UID(mi, 0xac1c64a, 0x82ca, 0x4845, 0x86, 0x89, 0x59, 0x76, 0x12, 0x74, 0x72, 0x7b); mi.position = 500090000; - mi.name.t = L""; + mi.name.w = L""; mi.pszService = protocolname"/ToggleEnable"; hEnableMenu = Menu_AddMainMenuItem(&mi); SET_UID(mi, 0xb290cccd, 0x4ecc, 0x475e, 0x87, 0xcb, 0x51, 0xf4, 0x3b, 0xc3, 0x44, 0x9c); mi.position = -0x7FFFFFFF; - mi.name.t = L""; + mi.name.w = L""; mi.pszService = protocolname"/ToggleAutoanswer"; hToggle = Menu_AddContactMenuItem(&mi); diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index 038988fe43..59dbbe5ad6 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -TCHAR* ptszMessage[6]={0}; +wchar_t* ptszMessage[6]={0}; INT lastIndex=-1; INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -22,7 +22,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara for (INT c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) { mir_snprintf(tszStatus, "%d", c); - TCHAR *pszStatus = pcli->pfnGetStatusModeDescription(c, 0); + wchar_t *pszStatus = pcli->pfnGetStatusModeDescription(c, 0); if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE) continue; else { @@ -30,9 +30,9 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara if (!db_get_ts(NULL, protocolname, tszStatus, &dbv)) { if (c < ID_STATUS_FREECHAT) - ptszMessage[c - ID_STATUS_ONLINE - 1] = _tcsdup(dbv.ptszVal); + ptszMessage[c - ID_STATUS_ONLINE - 1] = wcsdup(dbv.ptszVal); else if (c > ID_STATUS_INVISIBLE) - ptszMessage[c - ID_STATUS_ONLINE - 3] = _tcsdup(dbv.ptszVal); + ptszMessage[c - ID_STATUS_ONLINE - 3] = wcsdup(dbv.ptszVal); db_free(&dbv); } } @@ -76,16 +76,16 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - TCHAR ptszText[1024]; + wchar_t ptszText[1024]; BOOL translated; BOOL fEnabled = IsDlgButtonChecked(hwndDlg, IDC_ENABLEREPLIER) == 1; db_set_b(NULL, protocolname, KEY_ENABLED, (BYTE)fEnabled); if (fEnabled) - Menu_ModifyItem(hEnableMenu, LPGENT("Disable Auto&reply"), iconList[0].hIcolib); + Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib); else - Menu_ModifyItem(hEnableMenu, LPGENT("Enable Auto&reply"), iconList[1].hIcolib); + Menu_ModifyItem(hEnableMenu, LPGENW("Enable Auto&reply"), iconList[1].hIcolib); GetDlgItemText(hwndDlg, IDC_HEADING, ptszText, _countof(ptszText)); db_set_ts(NULL, protocolname, KEY_HEADING, ptszText); diff --git a/plugins/SimpleAR/src/stdafx.h b/plugins/SimpleAR/src/stdafx.h index 1994df2a7c..ff19f084ef 100644 --- a/plugins/SimpleAR/src/stdafx.h +++ b/plugins/SimpleAR/src/stdafx.h @@ -23,7 +23,7 @@ //General extern HINSTANCE hinstance; extern INT interval; -extern TCHAR *ptszDefaultMsg[6]; +extern wchar_t *ptszDefaultMsg[6]; extern HGENMENU hEnableMenu; extern IconItemT iconList[]; -- cgit v1.2.3