summaryrefslogtreecommitdiff
path: root/plugins/SeenPlugin/src/utils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
commit6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch)
tree2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/SeenPlugin/src/utils.cpp
parenta61c8728b379057fe7f0a0d86fe0b037598229dd (diff)
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
Diffstat (limited to 'plugins/SeenPlugin/src/utils.cpp')
-rw-r--r--plugins/SeenPlugin/src/utils.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp
index 8b281dd3f9..e820fa97b6 100644
--- a/plugins/SeenPlugin/src/utils.cpp
+++ b/plugins/SeenPlugin/src/utils.cpp
@@ -141,17 +141,17 @@ DWORD isSeen(MCONTACT hcontact, SYSTEMTIME *st)
return res;
}
-TCHAR *weekdays[] = { LPGENT("Sunday"), LPGENT("Monday"), LPGENT("Tuesday"), LPGENT("Wednesday"), LPGENT("Thursday"), LPGENT("Friday"), LPGENT("Saturday") };
-TCHAR *wdays_short[] = { LPGENT("Sun."), LPGENT("Mon."), LPGENT("Tue."), LPGENT("Wed."), LPGENT("Thu."), LPGENT("Fri."), LPGENT("Sat.") };
-TCHAR *monthnames[] = { LPGENT("January"), LPGENT("February"), LPGENT("March"), LPGENT("April"), LPGENT("May"), LPGENT("June"), LPGENT("July"), LPGENT("August"), LPGENT("September"), LPGENT("October"), LPGENT("November"), LPGENT("December") };
-TCHAR *mnames_short[] = { LPGENT("Jan."), LPGENT("Feb."), LPGENT("Mar."), LPGENT("Apr."), LPGENT("May"), LPGENT("Jun."), LPGENT("Jul."), LPGENT("Aug."), LPGENT("Sep."), LPGENT("Oct."), LPGENT("Nov."), LPGENT("Dec.") };
+wchar_t *weekdays[] = { LPGENW("Sunday"), LPGENW("Monday"), LPGENW("Tuesday"), LPGENW("Wednesday"), LPGENW("Thursday"), LPGENW("Friday"), LPGENW("Saturday") };
+wchar_t *wdays_short[] = { LPGENW("Sun."), LPGENW("Mon."), LPGENW("Tue."), LPGENW("Wed."), LPGENW("Thu."), LPGENW("Fri."), LPGENW("Sat.") };
+wchar_t *monthnames[] = { LPGENW("January"), LPGENW("February"), LPGENW("March"), LPGENW("April"), LPGENW("May"), LPGENW("June"), LPGENW("July"), LPGENW("August"), LPGENW("September"), LPGENW("October"), LPGENW("November"), LPGENW("December") };
+wchar_t *mnames_short[] = { LPGENW("Jan."), LPGENW("Feb."), LPGENW("Mar."), LPGENW("Apr."), LPGENW("May"), LPGENW("Jun."), LPGENW("Jul."), LPGENW("Aug."), LPGENW("Sep."), LPGENW("Oct."), LPGENW("Nov."), LPGENW("Dec.") };
-TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
+wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact)
{
#define MAXSIZE 1024
- static TCHAR sztemp[MAXSIZE + 1];
- TCHAR szdbsetting[128];
- TCHAR *charPtr;
+ static wchar_t sztemp[MAXSIZE + 1];
+ wchar_t szdbsetting[128];
+ wchar_t *charPtr;
int isetting = 0;
DWORD dwsetting = 0;
struct in_addr ia;
@@ -168,8 +168,8 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
char *szProto = hcontact ? GetContactProto(hcontact) : courProtoName;
ptrT info;
- TCHAR *d = sztemp;
- for (TCHAR *p = szstring; *p; p++) {
+ wchar_t *d = sztemp;
+ for (wchar_t *p = szstring; *p; p++) {
if (d >= sztemp + MAXSIZE)
break;
@@ -182,18 +182,18 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
switch (*++p) {
case 'Y':
if (!st.wYear) goto LBL_noData;
- d += _stprintf(d, L"%04i", st.wYear); //!!!!!!!!!!!!
+ d += swprintf(d, L"%04i", st.wYear); //!!!!!!!!!!!!
break;
case 'y':
if (!st.wYear) goto LBL_noData;
- d += _stprintf(d, L"%02i", st.wYear % 100); //!!!!!!!!!!!!
+ d += swprintf(d, L"%02i", st.wYear % 100); //!!!!!!!!!!!!
break;
case 'm':
if (!(isetting = st.wMonth)) goto LBL_noData;
LBL_2DigNum:
- d += _stprintf(d, L"%02i", isetting); //!!!!!!!!!!!!
+ d += swprintf(d, L"%02i", isetting); //!!!!!!!!!!!!
break;
case 'd':
@@ -252,7 +252,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
goto LBL_2DigNum;
case 'n':
- charPtr = hcontact ? (TCHAR*)pcli->pfnGetContactDisplayName(hcontact, 0) : (wantempty ? L"" : L"---");
+ charPtr = hcontact ? (wchar_t*)pcli->pfnGetContactDisplayName(hcontact, 0) : (wantempty ? L"" : L"---");
goto LBL_charPtr;
case 'N':
@@ -264,7 +264,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
case 'G':
if (!db_get_ts(hcontact, "CList", "Group", &dbv)) {
- _tcsncpy(szdbsetting, dbv.ptszVal, _countof(szdbsetting));
+ wcsncpy(szdbsetting, dbv.ptszVal, _countof(szdbsetting));
db_free(&dbv);
charPtr = szdbsetting;
goto LBL_charPtr;
@@ -280,7 +280,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
case 's':
if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "StatusTriger" : courProtoName, 0)) {
- _tcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting | 0x8000, 0), _countof(szdbsetting));
+ wcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting | 0x8000, 0), _countof(szdbsetting));
if (!(isetting & 0x8000)) {
mir_tstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_tstrlen(szdbsetting));
mir_tstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_tstrlen(szdbsetting));
@@ -300,7 +300,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
case 'o':
if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "OldStatus" : courProtoName, 0)) {
- _tcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting, 0), _countof(szdbsetting));
+ wcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting, 0), _countof(szdbsetting));
if (includeIdle && hcontact && db_get_b(hcontact, S_MOD, "OldIdle", 0)) {
mir_tstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_tstrlen(szdbsetting));
mir_tstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_tstrlen(szdbsetting));
@@ -325,13 +325,13 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
goto LBL_noData;
ia.S_un.S_addr = htonl(dwsetting);
- _tcsncpy(szdbsetting, _A2T(inet_ntoa(ia)), _countof(szdbsetting));
+ wcsncpy(szdbsetting, _A2T(inet_ntoa(ia)), _countof(szdbsetting));
charPtr = szdbsetting;
}
goto LBL_charPtr;
case 'P':
- _tcsncpy(szdbsetting, szProto ? _A2T(szProto) : (wantempty ? L"" : L"ProtoUnknown"), _countof(szdbsetting));
+ wcsncpy(szdbsetting, szProto ? _A2T(szProto) : (wantempty ? L"" : L"ProtoUnknown"), _countof(szdbsetting));
charPtr = szdbsetting;
goto LBL_charPtr;
@@ -356,7 +356,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
if (!pa)
goto LBL_noData;
- _tcsncpy(szdbsetting, pa->tszAccountName, _countof(szdbsetting));
+ wcsncpy(szdbsetting, pa->tszAccountName, _countof(szdbsetting));
charPtr = szdbsetting;
}
goto LBL_charPtr;
@@ -477,16 +477,16 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus)
ppd.lchIcon = Skin_LoadProtoIcon(lpzProto, newStatus);
if (!db_get_ts(NULL, S_MOD, "PopupStamp", &dbv)) {
- _tcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact), MAX_CONTACTNAME);
db_free(&dbv);
}
- else _tcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact), MAX_CONTACTNAME);
+ else wcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact), MAX_CONTACTNAME);
if (!db_get_ts(NULL, S_MOD, "PopupStampText", &dbv)) {
- _tcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact), MAX_SECONDLINE);
db_free(&dbv);
}
- else _tcsncpy(ppd.lptzText, ParseString(DEFAULT_POPUPSTAMPTEXT, hcontact), MAX_SECONDLINE);
+ else wcsncpy(ppd.lptzText, ParseString(DEFAULT_POPUPSTAMPTEXT, hcontact), MAX_SECONDLINE);
ppd.PluginWindowProc = PopupDlgProc;
PUAddPopupT(&ppd);
}
@@ -731,24 +731,24 @@ short int isDbZero(MCONTACT hContact, const char *module_name, const char *setti
return -1;
}
-TCHAR* any_to_IdleNotidleUnknown(MCONTACT hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen)
+wchar_t* any_to_IdleNotidleUnknown(MCONTACT hContact, const char *module_name, const char *setting_name, wchar_t *buff, int bufflen)
{
short int r = isDbZero(hContact, module_name, setting_name);
if (r == -1) {
- _tcsncpy(buff, TranslateT("Unknown"), bufflen);
+ wcsncpy(buff, TranslateT("Unknown"), bufflen);
}
else {
- _tcsncpy(buff, r ? TranslateT("Not Idle") : TranslateT("Idle"), bufflen);
+ wcsncpy(buff, r ? TranslateT("Not Idle") : TranslateT("Idle"), bufflen);
};
buff[bufflen - 1] = 0;
return buff;
}
-TCHAR* any_to_Idle(MCONTACT hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen)
+wchar_t* any_to_Idle(MCONTACT hContact, const char *module_name, const char *setting_name, wchar_t *buff, int bufflen)
{
if (isDbZero(hContact, module_name, setting_name) == 0) { //DB setting is NOT zero and exists
buff[0] = L'/';
- _tcsncpy(&buff[1], TranslateT("Idle"), bufflen - 1);
+ wcsncpy(&buff[1], TranslateT("Idle"), bufflen - 1);
}
else buff[0] = 0;
buff[bufflen - 1] = 0;