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/StatusPlugins/commonstatus.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'plugins/StatusPlugins/commonstatus.cpp') diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index 4f78f829d1..19411d9938 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -95,7 +95,7 @@ int GetActualStatus(PROTOCOLSETTINGEX *protoSetting) } // helper, from core -static TCHAR* GetDefaultMessage(int status) +static wchar_t* GetDefaultMessage(int status) { switch (status) { case ID_STATUS_AWAY: return TranslateT("I've been away since %time%."); @@ -113,14 +113,14 @@ static TCHAR* GetDefaultMessage(int status) return NULL; } -TCHAR* GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int newstatus) +wchar_t* GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int newstatus) { if (ps->szMsg != NULL) {// custom message set log_infoA("CommonStatus: Status message set by calling plugin"); return mir_tstrdup(ps->szMsg); } - TCHAR *tMsg = (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, newstatus, (LPARAM)ps->szName); + wchar_t *tMsg = (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, newstatus, (LPARAM)ps->szName); log_debugA("CommonStatus: Status message retrieved from general awaysys: %S", tMsg); return tMsg; } @@ -169,28 +169,28 @@ static int equalsGlobalStatus(PROTOCOLSETTINGEX **ps) static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus) { - TCHAR* tszMsg = GetDefaultStatusMessage(ps, newstatus); + wchar_t* tszMsg = GetDefaultStatusMessage(ps, newstatus); if (tszMsg) { /* replace the default vars in msg (I believe this is from core) */ for (int j = 0; tszMsg[j]; j++) { if (tszMsg[j] != '%') continue; - TCHAR substituteStr[128]; - if (!_tcsnicmp(tszMsg + j, L"%time%", 6)) + wchar_t substituteStr[128]; + if (!wcsnicmp(tszMsg + j, L"%time%", 6)) GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, 0, 0, substituteStr, _countof(substituteStr)); - else if (!_tcsnicmp(tszMsg + j, L"%date%", 6)) + else if (!wcsnicmp(tszMsg + j, L"%date%", 6)) GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, 0, 0, substituteStr, _countof(substituteStr)); else continue; if (mir_tstrlen(substituteStr) > 6) - tszMsg = (TCHAR*)mir_realloc(tszMsg, sizeof(TCHAR)*(mir_tstrlen(tszMsg) + 1 + mir_tstrlen(substituteStr) - 6)); - memmove(tszMsg + j + mir_tstrlen(substituteStr), tszMsg + j + 6, sizeof(TCHAR)*(mir_tstrlen(tszMsg) - j - 5)); - memcpy(tszMsg + j, substituteStr, sizeof(TCHAR)*mir_tstrlen(substituteStr)); + tszMsg = (wchar_t*)mir_realloc(tszMsg, sizeof(wchar_t)*(mir_tstrlen(tszMsg) + 1 + mir_tstrlen(substituteStr) - 6)); + memmove(tszMsg + j + mir_tstrlen(substituteStr), tszMsg + j + 6, sizeof(wchar_t)*(mir_tstrlen(tszMsg) - j - 5)); + memcpy(tszMsg + j, substituteStr, sizeof(wchar_t)*mir_tstrlen(substituteStr)); } - TCHAR *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL); + wchar_t *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL); if (szFormattedMsg != NULL) { mir_free(tszMsg); tszMsg = szFormattedMsg; -- cgit v1.2.3