diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
commit | 2f261839b60692e33d0e160344d0d636d49c90ba (patch) | |
tree | 187921722698b681d29df3f6e60fb18394a5e9d5 /plugins | |
parent | 2e931a0b2780587d85f3902468c935f5adba70c8 (diff) |
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
573 files changed, 4954 insertions, 4957 deletions
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp index 96935ace4f..38e62a954f 100644 --- a/plugins/AVS/src/acc.cpp +++ b/plugins/AVS/src/acc.cpp @@ -469,7 +469,7 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP return TRUE;
case AVATAR_SETNOAVATARTEXT:
- mir_tstrncpy(data->noAvatarText, TranslateTS((wchar_t*)lParam), _countof(data->noAvatarText));
+ mir_wstrncpy(data->noAvatarText, TranslateTS((wchar_t*)lParam), _countof(data->noAvatarText));
Invalidate(hwnd);
return TRUE;
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index c4702ae89c..2f521cc01d 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -150,7 +150,7 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace) // Default value
if (cacn.hash[0] == '\0')
- mir_sntprintf(cacn.hash, L"AVS-HASH-%x", GetFileHash(cacn.filename));
+ mir_snwprintf(cacn.hash, L"AVS-HASH-%x", GetFileHash(cacn.filename));
NotifyEventHooks(hEventContactAvatarChanged, hContact, (LPARAM)&cacn);
}
diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp index 61c548c96b..70fe12713e 100644 --- a/plugins/AVS/src/image_utils.cpp +++ b/plugins/AVS/src/image_utils.cpp @@ -212,7 +212,7 @@ int BmpFilterSaveBitmap(HBITMAP hBmp, const wchar_t *ptszFile, int flags) if (!PathToAbsoluteT(ptszFile, tszFilename))
wcsncpy_s(tszFilename, ptszFile, _TRUNCATE);
- if (mir_tstrlen(tszFilename) <= 4)
+ if (mir_wstrlen(tszFilename) <= 4)
return -1;
IMGSRVC_INFO i = { 0 };
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 516d6a204b..a52cd78b6a 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -132,7 +132,7 @@ static void LoadDefaultInfo() db_unset(0, PPICT_MODULE, AVS_DEFAULT);
pce->szProtoname = mir_strdup(AVS_DEFAULT);
- pce->tszAccName = mir_tstrdup(TranslateT("Global avatar"));
+ pce->tszAccName = mir_wstrdup(TranslateT("Global avatar"));
g_ProtoPictures.insert(pce);
}
@@ -145,13 +145,13 @@ static void LoadProtoInfo(PROTOCOLDESCRIPTOR *proto) mir_snprintf(protoName, "Global avatar for %s accounts", proto->szName);
wchar_t protoNameTmp[MAX_PATH];
- mir_sntprintf(protoNameTmp, TranslateT("Global avatar for %s accounts"), _A2T(proto->szName));
+ mir_snwprintf(protoNameTmp, TranslateT("Global avatar for %s accounts"), _A2T(proto->szName));
protoPicCacheEntry *pce = new protoPicCacheEntry;
if (CreateAvatarInCache(0, pce, protoName) != 1)
db_unset(0, PPICT_MODULE, protoName);
pce->szProtoname = mir_strdup(protoName);
- pce->tszAccName = mir_tstrdup(protoNameTmp);
+ pce->tszAccName = mir_wstrdup(protoNameTmp);
g_ProtoPictures.insert(pce);
}
@@ -162,13 +162,13 @@ static void LoadAccountInfo(PROTOACCOUNT *acc) db_unset(0, PPICT_MODULE, acc->szModuleName);
pce->szProtoname = mir_strdup(acc->szModuleName);
- pce->tszAccName = mir_tstrdup(acc->tszAccountName);
+ pce->tszAccName = mir_wstrdup(acc->tszAccountName);
g_ProtoPictures.insert(pce);
pce = new protoPicCacheEntry;
CreateAvatarInCache(INVALID_CONTACT_ID, pce, acc->szModuleName);
pce->szProtoname = mir_strdup(acc->szModuleName);
- pce->tszAccName = mir_tstrdup(acc->tszAccountName);
+ pce->tszAccName = mir_wstrdup(acc->tszAccountName);
g_MyAvatars.insert(pce);
}
@@ -323,7 +323,7 @@ void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bm static int ModulesLoaded(WPARAM, LPARAM)
{
wchar_t szEventName[100];
- mir_sntprintf(szEventName, L"avs_loaderthread_%d", GetCurrentThreadId());
+ mir_snwprintf(szEventName, L"avs_loaderthread_%d", GetCurrentThreadId());
hLoaderEvent = CreateEvent(NULL, TRUE, FALSE, szEventName);
SetThreadPriority(mir_forkthread(PicLoader, 0), THREAD_PRIORITY_IDLE);
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 7254543bb3..cead97c735 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -388,7 +388,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar if (!db_get_ts(NULL, PPICT_MODULE, g_selectedProto, &dbv)) { if (!PathIsAbsoluteT(VARST(dbv.ptszVal))) { wchar_t szFinalPath[MAX_PATH]; - mir_sntprintf(szFinalPath, L"%%miranda_path%%\\%s", dbv.ptszVal); + mir_snwprintf(szFinalPath, L"%%miranda_path%%\\%s", dbv.ptszVal); SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, szFinalPath); } else SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, dbv.ptszVal); @@ -489,7 +489,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA TranslateDialogDefault(hwndDlg); if (hContact) { wchar_t szTitle[512]; - mir_sntprintf(szTitle, TranslateT("Set avatar options for %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_snwprintf(szTitle, TranslateT("Set avatar options for %s"), pcli->pfnGetContactDisplayName(hContact, 0)); SetWindowText(hwndDlg, szTitle); } SendMessage(hwndDlg, DM_SETAVATARNAME, 0, 0); @@ -1082,7 +1082,7 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP char description[256]; CallProtoService(proto, PS_GETNAME, _countof(description), (LPARAM)description); - wchar_t *descr = mir_a2t(description); + wchar_t *descr = mir_a2u(description); if (MessageBox(hwndDlg, TranslateT("Are you sure you want to remove your avatar?"), descr, MB_YESNO) == IDYES) avSetMyAvatar(proto, L""); mir_free(descr); diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 79a21f3b8a..817c15630e 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -347,7 +347,7 @@ void SaveImage(SaveProtocolData &d, char *protocol, int format) if (!Proto_IsAvatarFormatSupported(protocol, format))
return;
- mir_sntprintf(d.image_file_name, L"%s%s", d.temp_file, ProtoGetAvatarExtension(format));
+ mir_snwprintf(d.image_file_name, L"%s%s", d.temp_file, ProtoGetAvatarExtension(format));
if (BmpFilterSaveBitmap(d.hBmpProto, d.image_file_name, format == PA_FORMAT_JPEG ? JPEG_QUALITYSUPERB : 0))
return;
@@ -550,13 +550,13 @@ static int InternalSetMyAvatar(char *protocol, wchar_t *szFinalName, SetMyAvatar wchar_t globalFile[1024];
BOOL saved = TRUE;
if (FoldersGetCustomPathT(hGlobalAvatarFolder, globalFile, _countof(globalFile), L"")) {
- mir_sntprintf(globalFile, L"%s%s", g_szDataPath, L"GlobalAvatar");
+ mir_snwprintf(globalFile, L"%s%s", g_szDataPath, L"GlobalAvatar");
CreateDirectory(globalFile, NULL);
}
wchar_t *ext = wcsrchr(szFinalName, '.'); // Can't be NULL here
if (format == PA_FORMAT_XML || format == PA_FORMAT_SWF) {
- mir_sntprintf(globalFile, L"%s\\my_global_avatar%s", globalFile, ext);
+ mir_snwprintf(globalFile, L"%s\\my_global_avatar%s", globalFile, ext);
CopyFile(szFinalName, globalFile, FALSE);
}
else {
@@ -574,12 +574,12 @@ static int InternalSetMyAvatar(char *protocol, wchar_t *szFinalName, SetMyAvatar // Check if need to resize
if (hBmpTmp == hBmp || hBmpTmp == NULL) {
// Use original image
- mir_sntprintf(globalFile, L"%s\\my_global_avatar%s", globalFile, ext);
+ mir_snwprintf(globalFile, L"%s\\my_global_avatar%s", globalFile, ext);
CopyFile(szFinalName, globalFile, FALSE);
}
else {
// Save as PNG
- mir_sntprintf(globalFile, L"%s\\my_global_avatar.png", globalFile);
+ mir_snwprintf(globalFile, L"%s\\my_global_avatar.png", globalFile);
if (BmpFilterSaveBitmap(hBmpTmp, globalFile, 0))
saved = FALSE;
@@ -685,10 +685,10 @@ INT_PTR avSetMyAvatar(char* protocol, wchar_t* tszPath) wchar_t title[256];
if (protocol == NULL)
- mir_sntprintf(title, TranslateT("Set my avatar"));
+ mir_snwprintf(title, TranslateT("Set my avatar"));
else {
- wchar_t* prototmp = mir_a2t(protocol);
- mir_sntprintf(title, TranslateT("Set my avatar for %s"), prototmp);
+ wchar_t* prototmp = mir_a2u(protocol);
+ mir_snwprintf(title, TranslateT("Set my avatar for %s"), prototmp);
mir_free(prototmp);
}
ofn.lpstrTitle = title;
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index c46fff6a58..4cfc38d67f 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -56,7 +56,7 @@ void MakePathRelative(MCONTACT hContact, wchar_t *path) void MakePathRelative(MCONTACT hContact)
{
- ptrT tszPath(db_get_tsa(hContact, "ContactPhoto", "File"));
+ ptrW tszPath(db_get_tsa(hContact, "ContactPhoto", "File"));
if (tszPath)
MakePathRelative(hContact, tszPath);
}
@@ -67,7 +67,7 @@ void MakePathRelative(MCONTACT hContact) int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
{
- ptrT tszValue;
+ ptrW tszValue;
wchar_t tszFilename[MAX_PATH]; tszFilename[0] = 0;
ace->hbmPic = 0;
@@ -136,7 +136,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) }
}
- if (mir_tstrlen(tszFilename) < 4)
+ if (mir_wstrlen(tszFilename) < 4)
return -1;
wcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE);
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index 424976f0b0..84b1ae5768 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -62,7 +62,7 @@ void AddContactDlgOpts(HWND hdlg, const char* szProto, BOOL bAuthOptsOnly = FALS if (szUniqueId) {
size_t cbLen = mir_strlen(szUniqueId) + 2;
wchar_t* pszUniqueId = (wchar_t*)mir_alloc(cbLen * sizeof(wchar_t));
- mir_sntprintf(pszUniqueId, cbLen, L"%S:", szUniqueId);
+ mir_snwprintf(pszUniqueId, cbLen, L"%S:", szUniqueId);
SetDlgItemText(hdlg, IDC_IDLABEL, pszUniqueId);
mir_free(pszUniqueId);
}
@@ -126,7 +126,7 @@ bool AddContactDlgAccounts(HWND hdlg, AddDialogParam *acs) continue;
cbei.pszText = pAccounts[i]->tszAccountName;
- GetTextExtentPoint32(hdc, cbei.pszText, (int)mir_tstrlen(cbei.pszText), &textSize);
+ GetTextExtentPoint32(hdc, cbei.pszText, (int)mir_wstrlen(cbei.pszText), &textSize);
if (textSize.cx > cbWidth) cbWidth = textSize.cx;
HICON hIcon = (HICON)CallProtoService(pAccounts[i]->szModuleName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
cbei.iImage = cbei.iSelectedImage = ImageList_AddIcon(hIml, hIcon);
@@ -236,7 +236,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) wchar_t szUserId[256];
GetDlgItemText(hdlg, IDC_USERID, szUserId, _countof(szUserId));
- if (*rtrimt(szUserId) == 0 ||
+ if (*rtrimw(szUserId) == 0 ||
(strstr(acs->proto, "GG") && wcstoul(szUserId, NULL, 10) > INT_MAX) || // Gadu-Gadu protocol
((CallProtoService(acs->proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_NUMERICUSERID) && !wcstoul(szUserId, NULL, 10)))
{
@@ -264,7 +264,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) }
psr->flags = PSR_TCHAR;
- psr->id.w = mir_tstrdup(szUserId);
+ psr->id.w = mir_wstrdup(szUserId);
acs->psr = psr;
MCONTACT hContact = (MCONTACT)CallProtoService(acs->proto, PS_ADDTOLIST, IsDlgButtonChecked(hdlg, IDC_ADDTEMP) ? PALF_TEMPORARY : 0, (LPARAM)acs->psr);
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp index f39333767d..4052bc7f79 100644 --- a/plugins/Alarms/src/alarm_win.cpp +++ b/plugins/Alarms/src/alarm_win.cpp @@ -267,7 +267,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar #define AddItem(x) \
mii.wID++; \
mii.dwTypeData = TranslateW(x); \
- mii.cch = ( UINT )mir_tstrlen(mii.dwTypeData); \
+ mii.cch = ( UINT )mir_wstrlen(mii.dwTypeData); \
InsertMenuItem(hMenu, mii.wID, FALSE, &mii);
AddItem(LPGENW("5 mins"));
@@ -350,31 +350,31 @@ int ReloadFonts(WPARAM, LPARAM) int AlarmWinModulesLoaded(WPARAM, LPARAM)
{
title_font_id.cbSize = sizeof(FontIDT);
- mir_tstrcpy(title_font_id.group, LPGENW("Alarms"));
- mir_tstrcpy(title_font_id.name, LPGENW("Title"));
+ mir_wstrcpy(title_font_id.group, LPGENW("Alarms"));
+ mir_wstrcpy(title_font_id.name, LPGENW("Title"));
mir_strcpy(title_font_id.dbSettingsGroup, MODULE);
mir_strcpy(title_font_id.prefix, "FontTitle");
- mir_tstrcpy(title_font_id.backgroundGroup, LPGENW("Alarms"));
- mir_tstrcpy(title_font_id.backgroundName, LPGENW("Background"));
+ mir_wstrcpy(title_font_id.backgroundGroup, LPGENW("Alarms"));
+ mir_wstrcpy(title_font_id.backgroundName, LPGENW("Background"));
title_font_id.flags = 0;
title_font_id.order = 0;
FontRegisterT(&title_font_id);
window_font_id.cbSize = sizeof(FontIDT);
- mir_tstrcpy(window_font_id.group, LPGENW("Alarms"));
- mir_tstrcpy(window_font_id.name, LPGENW("Window"));
+ mir_wstrcpy(window_font_id.group, LPGENW("Alarms"));
+ mir_wstrcpy(window_font_id.name, LPGENW("Window"));
mir_strcpy(window_font_id.dbSettingsGroup, MODULE);
mir_strcpy(window_font_id.prefix, "FontWindow");
- mir_tstrcpy(window_font_id.backgroundGroup, LPGENW("Alarms"));
- mir_tstrcpy(window_font_id.backgroundName, LPGENW("Background"));
+ mir_wstrcpy(window_font_id.backgroundGroup, LPGENW("Alarms"));
+ mir_wstrcpy(window_font_id.backgroundName, LPGENW("Background"));
window_font_id.flags = 0;
window_font_id.order = 1;
FontRegisterT(&window_font_id);
bk_colour_id.cbSize = sizeof(ColourIDT);
mir_strcpy(bk_colour_id.dbSettingsGroup, MODULE);
- mir_tstrcpy(bk_colour_id.group, LPGENW("Alarms"));
- mir_tstrcpy(bk_colour_id.name, LPGENW("Background"));
+ mir_wstrcpy(bk_colour_id.group, LPGENW("Alarms"));
+ mir_wstrcpy(bk_colour_id.name, LPGENW("Background"));
mir_strcpy(bk_colour_id.setting, "BkColour");
bk_colour_id.defcolour = GetSysColor(COLOR_3DFACE);
bk_colour_id.flags = 0;
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index c11ecba568..e108e04132 100644 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -34,10 +34,10 @@ void copy_alarm_data(ALARM *dest, ALARM *src) { dest->time = src->time;
free_alarm_data(dest);
- dest->szTitle = mir_tstrdup(src->szTitle);
- dest->szDesc = mir_tstrdup(src->szDesc);
- dest->szCommand = mir_tstrdup(src->szCommand);
- dest->szCommandParams = mir_tstrdup(src->szCommandParams);
+ dest->szTitle = mir_wstrdup(src->szTitle);
+ dest->szDesc = mir_wstrdup(src->szDesc);
+ dest->szCommand = mir_wstrdup(src->szCommand);
+ dest->szCommandParams = mir_wstrdup(src->szCommandParams);
}
void GetPluginTime(SYSTEMTIME *t) {
@@ -191,12 +191,12 @@ void LoadAlarms() { mir_snprintf(buff, "Title%d", i);
if (!db_get_ts(0, MODULE, buff, &dbv)) {
- alarm.szTitle = mir_tstrdup(dbv.ptszVal);
+ alarm.szTitle = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(buff, "Desc%d", i);
if (!db_get_ts(0, MODULE, buff, &dbv)) {
- alarm.szDesc = mir_tstrdup(dbv.ptszVal);
+ alarm.szDesc = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(buff, "Occ%d", i);
@@ -245,11 +245,11 @@ void LoadAlarms() { if (alarm.action & AAF_COMMAND) {
mir_snprintf(buff, "ActionCommand%d", i);
if (!db_get_ts(0, MODULE, buff, &dbv)) {
- alarm.szCommand = mir_tstrdup(dbv.ptszVal);
+ alarm.szCommand = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
mir_snprintf(buff, "ActionParams%d", i);
if (!db_get_ts(0, MODULE, buff, &dbv)) {
- alarm.szCommandParams = mir_tstrdup(dbv.ptszVal);
+ alarm.szCommandParams = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
}
@@ -326,10 +326,10 @@ void SaveAlarms() { mir_snprintf(buff, "ActionFlags%d", index);
db_set_dw(0, MODULE, buff, i->action);
if (i->action & AAF_COMMAND) {
- if (mir_tstrlen(i->szCommand)) {
+ if (mir_wstrlen(i->szCommand)) {
mir_snprintf(buff, "ActionCommand%d", index);
db_set_ts(0, MODULE, buff, i->szCommand);
- if (mir_tstrlen(i->szCommandParams)) {
+ if (mir_wstrlen(i->szCommandParams)) {
mir_snprintf(buff, "ActionParams%d", index);
db_set_ts(0, MODULE, buff, i->szCommandParams);
}
@@ -493,8 +493,8 @@ void ShowPopup(ALARM *alarm) POPUPDATAT ppd = { 0 };
ppd.lchIcon = hIconMenuSet;
- mir_tstrncpy(ppd.lptzContactName, data->szTitle, MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lptzText, data->szDesc, MAX_SECONDLINE);
+ mir_wstrncpy(ppd.lptzContactName, data->szTitle, MAX_CONTACTNAME);
+ mir_wstrncpy(ppd.lptzText, data->szDesc, MAX_SECONDLINE);
ppd.PluginWindowProc = PopupAlarmDlgProc;
ppd.PluginData = data;
ppd.iSeconds = -1;
@@ -633,10 +633,10 @@ INT_PTR AddAlarmService(WPARAM, LPARAM lParam) alarm.occurrence = alarm_info->occurrence;
alarm.snoozer = alarm_info->snoozer;
alarm.sound_num = alarm_info->sound_num;
- alarm.szCommand = mir_tstrdup(alarm_info->szCommand);
- alarm.szCommandParams = mir_tstrdup(alarm_info->szCommandParams);
- alarm.szDesc = mir_tstrdup(alarm_info->szDesc);
- alarm.szTitle = mir_tstrdup(alarm_info->szTitle);
+ alarm.szCommand = mir_wstrdup(alarm_info->szCommand);
+ alarm.szCommandParams = mir_wstrdup(alarm_info->szCommandParams);
+ alarm.szDesc = mir_wstrdup(alarm_info->szDesc);
+ alarm.szTitle = mir_wstrdup(alarm_info->szTitle);
alarm.time = alarm_info->time;
append_to_list(&alarm);
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp index e5b80405c2..71c2606ec0 100644 --- a/plugins/Alarms/src/alarms.cpp +++ b/plugins/Alarms/src/alarms.cpp @@ -73,8 +73,8 @@ void ShowPopup(MCONTACT hContact, const wchar_t *msg) POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact; //Be sure to use a GOOD handle, since this will not be checked.
ppd.lchIcon = hIconList1;
- mir_tstrncpy(ppd.lptzContactName, lpzContactName,MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lptzText, msg, MAX_SECONDLINE);
+ mir_wstrncpy(ppd.lptzContactName, lpzContactName,MAX_CONTACTNAME);
+ mir_wstrncpy(ppd.lptzText, msg, MAX_SECONDLINE);
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
ppd.colorText = RGB(0,0,0);
ppd.PluginWindowProc = PopupDlgProc;
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index 15f0fd185f..7ad231858c 100644 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -136,34 +136,34 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar HICON hIcon = (min <= 5 ? hIconList2 : hIconList1);
DrawIconEx(dis->hDC,dis->rcItem.left,(dis->rcItem.top + dis->rcItem.bottom - 16)>>1,hIcon,0, 0, 0, NULL, DI_NORMAL);
- GetTextExtentPoint32(dis->hDC,alarm.szTitle,(int)mir_tstrlen(alarm.szTitle),&textSize);
+ GetTextExtentPoint32(dis->hDC,alarm.szTitle,(int)mir_wstrlen(alarm.szTitle),&textSize);
wchar_t buff[100];
if (min >= 60)
- mir_sntprintf(buff, TranslateT("%dh %dm"), min / 60, min % 60);
+ mir_snwprintf(buff, TranslateT("%dh %dm"), min / 60, min % 60);
else
- mir_sntprintf(buff, TranslateT("%dm"), min);
+ mir_snwprintf(buff, TranslateT("%dm"), min);
- GetTextExtentPoint32(dis->hDC,buff,(int)mir_tstrlen(buff),&timeSize);
+ GetTextExtentPoint32(dis->hDC,buff,(int)mir_wstrlen(buff),&timeSize);
if (textSize.cx > (dis->rcItem.right - dis->rcItem.left) - (GetSystemMetrics(SM_CXSMICON) + 4) - timeSize.cx - 2 - 4) {
// need elipsis
wchar_t titlebuff[512];
- size_t len = mir_tstrlen(alarm.szTitle);
+ size_t len = mir_wstrlen(alarm.szTitle);
if (len > 511) len = 511;
while(len > 0 && textSize.cx > (dis->rcItem.right - dis->rcItem.left) - (GetSystemMetrics(SM_CXSMICON) + 4) - timeSize.cx - 2 - 4) {
len--;
wcsncpy(titlebuff, alarm.szTitle, len);
titlebuff[len] = 0;
- mir_tstrcat(titlebuff, L"...");
- GetTextExtentPoint32(dis->hDC,titlebuff,(int)mir_tstrlen(titlebuff),&textSize);
+ mir_wstrcat(titlebuff, L"...");
+ GetTextExtentPoint32(dis->hDC,titlebuff,(int)mir_wstrlen(titlebuff),&textSize);
}
- TextOut(dis->hDC,dis->rcItem.left + 16 + 4,(dis->rcItem.top + dis->rcItem.bottom - textSize.cy)>>1,titlebuff,(int)mir_tstrlen(titlebuff));
- TextOut(dis->hDC,dis->rcItem.right - timeSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom - timeSize.cy)>>1, buff,(int)mir_tstrlen(buff));
+ TextOut(dis->hDC,dis->rcItem.left + 16 + 4,(dis->rcItem.top + dis->rcItem.bottom - textSize.cy)>>1,titlebuff,(int)mir_wstrlen(titlebuff));
+ TextOut(dis->hDC,dis->rcItem.right - timeSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom - timeSize.cy)>>1, buff,(int)mir_wstrlen(buff));
}
else {
- TextOut(dis->hDC,dis->rcItem.left + 16 + 4,(dis->rcItem.top + dis->rcItem.bottom - textSize.cy)>>1,alarm.szTitle,(int)mir_tstrlen(alarm.szTitle));
- TextOut(dis->hDC,dis->rcItem.right - timeSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom - timeSize.cy)>>1, buff,(int)mir_tstrlen(buff));
+ TextOut(dis->hDC,dis->rcItem.left + 16 + 4,(dis->rcItem.top + dis->rcItem.bottom - textSize.cy)>>1,alarm.szTitle,(int)mir_wstrlen(alarm.szTitle));
+ TextOut(dis->hDC,dis->rcItem.right - timeSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom - timeSize.cy)>>1, buff,(int)mir_wstrlen(buff));
}
SetBkMode(dis->hDC, OPAQUE);
diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp index d92f7a6685..1920adb518 100644 --- a/plugins/Alarms/src/options.cpp +++ b/plugins/Alarms/src/options.cpp @@ -417,10 +417,10 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDOK:
{
GetDlgItemText(hwndDlg, IDC_TITLE, buff, _countof(buff));
- replaceStrT(add_edit_alarm->szTitle, buff);
+ replaceStrW(add_edit_alarm->szTitle, buff);
GetDlgItemText(hwndDlg, IDC_DESC, buff, _countof(buff));
- replaceStrT(add_edit_alarm->szDesc, buff);
+ replaceStrW(add_edit_alarm->szDesc, buff);
if (add_edit_alarm->szTitle == 0 || add_edit_alarm->szTitle[0] == '\0') {
MessageBox(hwndDlg, TranslateT("Please enter a title for this alarm."), TranslateT("Error"), MB_OK | MB_ICONERROR);
@@ -447,9 +447,9 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (add_edit_alarm->action & AAF_COMMAND) {
GetDlgItemText(hwndDlg, IDC_ED_COMMAND, buff, _countof(buff));
- replaceStrT(add_edit_alarm->szCommand, buff);
+ replaceStrW(add_edit_alarm->szCommand, buff);
GetDlgItemText(hwndDlg, IDC_ED_PARAMS, buff, _countof(buff));
- replaceStrT(add_edit_alarm->szCommandParams, buff);
+ replaceStrW(add_edit_alarm->szCommandParams, buff);
}
if (add_edit_alarm->action & AAF_SOUND) {
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 495cb4f125..7305022b0b 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -218,14 +218,14 @@ static ASSOCDATA* CopyAssocItem(const ASSOCDATA *assoc) assoc2 = (ASSOCDATA*)mir_alloc(sizeof(ASSOCDATA));
if (assoc2 == NULL) return NULL;
assoc2->pszClassName = mir_strdup(assoc->pszClassName);
- assoc2->pszDescription = mir_tstrdup(assoc->pszDescription);
+ assoc2->pszDescription = mir_wstrdup(assoc->pszDescription);
assoc2->hInstance = assoc->hInstance;
assoc2->nIconResID = assoc->nIconResID;
assoc2->pszService = mir_strdup(assoc->pszService);
assoc2->flags = assoc->flags;
assoc2->pszFileExt = mir_strdup(assoc->pszFileExt);
assoc2->pszMimeType = mir_strdup(assoc->pszMimeType);
- assoc2->pszVerbDesc = mir_tstrdup(assoc->pszVerbDesc);
+ assoc2->pszVerbDesc = mir_wstrdup(assoc->pszVerbDesc);
if (assoc2->pszClassName == NULL || assoc2->pszDescription == NULL ||
(assoc2->pszFileExt == NULL && assoc->pszFileExt != NULL)) {
mir_free(assoc2->pszClassName); // does NULL check
@@ -268,9 +268,9 @@ static wchar_t* GetAssocTypeDesc(const ASSOCDATA *assoc) {
static wchar_t szDesc[32];
if (assoc->pszFileExt == NULL)
- mir_sntprintf(szDesc, L"%hs:", assoc->pszClassName);
+ mir_snwprintf(szDesc, L"%hs:", assoc->pszClassName);
else
- mir_sntprintf(szDesc, TranslateT("%hs files"), assoc->pszFileExt);
+ mir_snwprintf(szDesc, TranslateT("%hs files"), assoc->pszFileExt);
return szDesc;
}
diff --git a/plugins/AssocMgr/src/dde.cpp b/plugins/AssocMgr/src/dde.cpp index aca64350e7..f6c52a67df 100644 --- a/plugins/AssocMgr/src/dde.cpp +++ b/plugins/AssocMgr/src/dde.cpp @@ -79,7 +79,7 @@ static wchar_t* GetExecuteParam(wchar_t **ppszString) *(p++) = 0;
if (fQuoted && *p == ',') p++;
}
- else p = &pszParam[mir_tstrlen(pszParam)];
+ else p = &pszParam[mir_wstrlen(pszParam)];
*ppszString = p;
return pszParam;
}
@@ -115,10 +115,10 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd, UINT msg, WPARAM wParam, LPA if (pszArg != NULL) {
/* we are inside miranda here, we make it async so the shell does
* not timeout regardless what the plugins try to do. */
- if (!mir_tstrcmpi(pszAction, L"file"))
- CallFunctionAsync(FileActionAsync, mir_tstrdup(pszArg));
- else if (!mir_tstrcmpi(pszAction, L"url"))
- CallFunctionAsync(UrlActionAsync, mir_tstrdup(pszArg));
+ if (!mir_wstrcmpi(pszAction, L"file"))
+ CallFunctionAsync(FileActionAsync, mir_wstrdup(pszArg));
+ else if (!mir_wstrcmpi(pszAction, L"url"))
+ CallFunctionAsync(UrlActionAsync, mir_wstrdup(pszArg));
}
GlobalUnlock(hCommand);
}
@@ -170,7 +170,7 @@ static HANDLE StartupMainProcess(wchar_t *pszDatabasePath) p = wcsrchr(szPath, '\\');
if (p != NULL) { *p = 0; p = wcsrchr(szPath, '\\'); }
if (p == NULL) return NULL;
- mir_tstrcpy(++p, L"miranda32.exe");
+ mir_wstrcpy(++p, L"miranda32.exe");
/* inherit startup data from RunDll32 process */
STARTUPINFO si;
diff --git a/plugins/AssocMgr/src/main.cpp b/plugins/AssocMgr/src/main.cpp index 4f0c116c36..ddc2075d52 100644 --- a/plugins/AssocMgr/src/main.cpp +++ b/plugins/AssocMgr/src/main.cpp @@ -48,27 +48,27 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) static void InstallFile(const wchar_t *pszFileName,const wchar_t *pszDestSubDir)
{
wchar_t szFileFrom[MAX_PATH+1],szFileTo[MAX_PATH+1];
- if (!GetModuleFileName(hInst, szFileFrom, _countof(szFileFrom) - (int)mir_tstrlen(pszFileName)))
+ if (!GetModuleFileName(hInst, szFileFrom, _countof(szFileFrom) - (int)mir_wstrlen(pszFileName)))
return;
wchar_t *p = wcsrchr(szFileFrom,'\\');
if (p != NULL)
*(++p) = 0;
- mir_tstrcat(szFileFrom,pszFileName); /* buffer safe */
+ mir_wstrcat(szFileFrom,pszFileName); /* buffer safe */
HANDLE hFile = CreateFile(szFileFrom,0,FILE_SHARE_READ,0,OPEN_EXISTING,0,0);
if (hFile == INVALID_HANDLE_VALUE)
return;
CloseHandle(hFile);
- if (!GetModuleFileName(NULL, szFileTo, _countof(szFileTo)-(int)mir_tstrlen(pszDestSubDir)-(int)mir_tstrlen(pszFileName)))
+ if (!GetModuleFileName(NULL, szFileTo, _countof(szFileTo)-(int)mir_wstrlen(pszDestSubDir)-(int)mir_wstrlen(pszFileName)))
return;
p = wcsrchr(szFileTo,'\\');
if (p)
*(++p)=0;
- mir_tstrcat(szFileTo,pszDestSubDir); /* buffer safe */
+ mir_wstrcat(szFileTo,pszDestSubDir); /* buffer safe */
CreateDirectory(szFileTo,NULL);
- mir_tstrcat(szFileTo,pszFileName); /* buffer safe */
+ mir_wstrcat(szFileTo,pszFileName); /* buffer safe */
if ( !MoveFile(szFileFrom,szFileTo) && GetLastError() == ERROR_ALREADY_EXISTS) {
DeleteFile(szFileTo);
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 3f079b7810..842ce654a3 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -33,7 +33,7 @@ static __inline LONG regchk(LONG res, const char *pszFunc, const void *pszInfo, char *pszErr;
pszErr = GetWinErrorDescription(res);
pszInfo2 = s2t(pszInfo, fInfoUnicode, FALSE); /* does NULL check */
- mir_sntprintf(szMsg, TranslateT("Access failed:\n%.64hs(%.128s)\n%.250hs(%u)\n%.256hs (%u)"), pszFunc, pszInfo2, pszFile, nLine, pszErr, res);
+ mir_snwprintf(szMsg, TranslateT("Access failed:\n%.64hs(%.128s)\n%.250hs(%u)\n%.256hs (%u)"), pszFunc, pszInfo2, pszFile, nLine, pszErr, res);
MessageBox(NULL, szMsg, TranslateT("Registry warning"), MB_OK | MB_ICONINFORMATION | MB_SETFOREGROUND | MB_TOPMOST | MB_TASKMODAL);
if (pszErr != NULL) LocalFree(pszErr);
mir_free(pszInfo2); /* does NULL check */
@@ -133,7 +133,7 @@ wchar_t *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) if (p)
*p = 0;
}
- else mir_tstrcpy(szDbFile, L"%1"); /* buffer safe */
+ else mir_wstrcpy(szDbFile, L"%1"); /* buffer safe */
if ( !GetModuleFileName(fMirExe ? NULL : hInst, szExe, _countof(szExe)))
return NULL;
@@ -147,7 +147,7 @@ wchar_t *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) /* ensure the command line is not too long */
GetShortPathName(szExe, szExe, _countof(szExe));
/* surround by quotes if failed */
- size_t len = mir_tstrlen(szExe);
+ size_t len = mir_wstrlen(szExe);
if ( wcschr(szExe,' ') != NULL && (len+2) < _countof(szExe)) {
memmove(szExe, szExe+1, (len+1)*sizeof(wchar_t));
szExe[len+2] = szExe[0] = '\"';
@@ -156,15 +156,15 @@ wchar_t *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) }
wchar_t tszBuffer[1024];
- mir_sntprintf(tszBuffer, pszFmt, szExe, szDbFile);
- return mir_tstrdup(tszBuffer);
+ mir_snwprintf(tszBuffer, pszFmt, szExe, szDbFile);
+ return mir_wstrdup(tszBuffer);
}
static BOOL IsValidRunCommand(const wchar_t *pszRunCmd)
{
wchar_t *buf,*pexe,*pargs;
wchar_t szFullExe[MAX_PATH],*pszFilePart;
- buf=mir_tstrcpy((wchar_t*)_alloca((mir_tstrlen(pszRunCmd)+1)*sizeof(wchar_t)),pszRunCmd);
+ buf=mir_wstrcpy((wchar_t*)_alloca((mir_wstrlen(pszRunCmd)+1)*sizeof(wchar_t)),pszRunCmd);
/* split into executable path and arguments */
if (buf[0]=='\"') {
pargs=wcschr(&buf[1],'\"');
@@ -178,7 +178,7 @@ static BOOL IsValidRunCommand(const wchar_t *pszRunCmd) }
if (SearchPath(NULL,pexe,L".exe",_countof(szFullExe),szFullExe,&pszFilePart)) {
if (pszFilePart!=NULL)
- if (!mir_tstrcmpi(pszFilePart,L"rundll32.exe") || !mir_tstrcmpi(pszFilePart,L"rundll.exe")) {
+ if (!mir_wstrcmpi(pszFilePart,L"rundll32.exe") || !mir_wstrcmpi(pszFilePart,L"rundll.exe")) {
/* split into dll path and arguments */
if (pargs[0]=='\"') {
++pargs;
@@ -203,7 +203,7 @@ wchar_t *MakeIconLocation(HMODULE hModule,WORD nIconResID) if ((cch=GetModuleFileName(hModule,szModule,_countof(szModule))) != 0) {
pszIconLoc=(wchar_t*)mir_alloc((cch+=8)*sizeof(wchar_t));
if (pszIconLoc!=NULL)
- mir_sntprintf(pszIconLoc, cch, L"%s,%i", szModule, -(int)nIconResID); /* id may be 0, buffer safe */
+ mir_snwprintf(pszIconLoc, cch, L"%s,%i", szModule, -(int)nIconResID); /* id may be 0, buffer safe */
}
return pszIconLoc;
}
@@ -216,7 +216,7 @@ wchar_t *MakeAppFileName(BOOL fMirExe) psz=wcsrchr(szExe,'\\');
if (psz!=NULL) ++psz;
else psz=szExe;
- return mir_tstrdup(psz);
+ return mir_wstrdup(psz);
}
return NULL;
}
@@ -253,7 +253,7 @@ static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const wchar_t *pszSubKey,const HKEY hSubKey;
LONG res=RegCreateKeyEx(hMainKey,pszSubKey,0,NULL,0,KEY_SET_VALUE|KEY_QUERY_VALUE,NULL,&hSubKey,NULL);
if (!res) {
- res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(int)(mir_tstrlen(pszVal)+1)*sizeof(wchar_t));
+ res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(int)(mir_wstrlen(pszVal)+1)*sizeof(wchar_t));
RegCloseKey(hSubKey);
}
return res;
@@ -262,9 +262,9 @@ static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const wchar_t *pszSubKey,const // hKey must have been opened with KEY_SET_VALUE access right
static void SetRegStrPrefixValue(HKEY hKey,const wchar_t *pszValPrefix,const wchar_t *pszVal)
{
- size_t dwSize = (mir_tstrlen(pszVal)+mir_tstrlen(pszValPrefix)+1)*sizeof(wchar_t);
+ size_t dwSize = (mir_wstrlen(pszVal)+mir_wstrlen(pszValPrefix)+1)*sizeof(wchar_t);
wchar_t *pszStr = (wchar_t*)_alloca(dwSize);
- mir_tstrcat(mir_tstrcpy(pszStr, pszValPrefix), pszVal); /* buffer safe */
+ mir_wstrcat(mir_wstrcpy(pszStr, pszValPrefix), pszVal); /* buffer safe */
RegSetValueEx(hKey, NULL, 0, REG_SZ, (BYTE*)pszStr, (int)dwSize);
}
@@ -304,7 +304,7 @@ static BOOL IsRegStrValue(HKEY hKey,const wchar_t *pszValName,const wchar_t *psz BOOL fSame=FALSE;
wchar_t *pszVal=GetRegStrValue(hKey,pszValName);
if (pszVal!=NULL) {
- fSame=!mir_tstrcmp(pszVal,pszCmpVal);
+ fSame=!mir_wstrcmp(pszVal,pszCmpVal);
mir_free(pszVal);
}
return fSame;
@@ -601,7 +601,7 @@ BOOL AddRegClass(const char *pszClassName,const wchar_t *pszTypeDescription,cons if (fUrlProto) BackupRegTree(hRootKey,pszClassName,"bak_");
/* type description */
if (fUrlProto) SetRegStrPrefixValue(hClassKey,L"URL:",pszTypeDescription);
- else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(int)(mir_tstrlen(pszTypeDescription)+1)*sizeof(wchar_t));
+ else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(int)(mir_wstrlen(pszTypeDescription)+1)*sizeof(wchar_t));
/* default icon */
if (pszIconLoc!=NULL) SetRegSubKeyStrDefValue(hClassKey,L"DefaultIcon",pszIconLoc);
/* url protocol */
@@ -629,16 +629,16 @@ BOOL AddRegClass(const char *pszClassName,const wchar_t *pszTypeDescription,cons if ((res=RegCreateKeyEx(hShellKey,L"open",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hVerbKey,NULL))==ERROR_SUCCESS) {
/* verb description */
if (pszVerbDesc==NULL) RegDeleteValue(hVerbKey,NULL);
- else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(int)(mir_tstrlen(pszVerbDesc)+1)*sizeof(wchar_t));
+ else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(int)(mir_wstrlen(pszVerbDesc)+1)*sizeof(wchar_t));
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
+ RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_wstrlen(pszAppName)+1)*sizeof(wchar_t));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,L"command",pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL) {
if (!RegCreateKeyEx(hVerbKey,L"ddeexec",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_wstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,L"application",pszDdeApp);
/* topic */
@@ -993,7 +993,7 @@ void AddRegOpenWith(const wchar_t *pszAppFileName,BOOL fAllowOpenWith,const wcha /* filename */
if (!RegCreateKeyEx(hAppsKey,pszAppFileName,0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hExeKey,NULL)) {
/* appname */
- RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
+ RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(int)(mir_wstrlen(pszAppName)+1)*sizeof(wchar_t));
/* no open-with flag */
if (fAllowOpenWith) RegDeleteValue(hExeKey,L"NoOpenWith");
else RegSetValueEx(hExeKey,L"NoOpenWith",0,REG_SZ,NULL,0);
@@ -1006,14 +1006,14 @@ void AddRegOpenWith(const wchar_t *pszAppFileName,BOOL fAllowOpenWith,const wcha /* verb */
if (!RegCreateKeyEx(hShellKey,L"open",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hVerbKey,NULL)) {
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
+ RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_wstrlen(pszAppName)+1)*sizeof(wchar_t));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,L"command",pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL)
if (!RegCreateKeyEx(hVerbKey,L"ddeexec",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_wstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,L"application",pszDdeApp);
/* topic */
@@ -1101,7 +1101,7 @@ void AddRegOpenWithExtEntry(const wchar_t *pszAppFileName,const char *pszFileExt wchar_t *ptszFileExt;
ptszFileExt=a2t(pszFileExt);
if (ptszFileExt!=NULL)
- RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(int)(mir_tstrlen(pszFileDesc)+1)*sizeof(wchar_t));
+ RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(int)(mir_wstrlen(pszFileDesc)+1)*sizeof(wchar_t));
mir_free(ptszFileExt); /* does NULL check */
RegCloseKey(hTypesKey);
}
@@ -1154,7 +1154,7 @@ BOOL AddRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd) /* run */
if (!RegCreateKeyEx(HKEY_CURRENT_USER,L"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,NULL,0,KEY_SET_VALUE,NULL,&hRunKey,NULL)) {
/* appname */
- fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(int)(mir_tstrlen(pszRunCmd)+1)*sizeof(wchar_t));
+ fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(int)(mir_wstrlen(pszRunCmd)+1)*sizeof(wchar_t));
RegCloseKey(hRunKey);
}
return fSuccess;
diff --git a/plugins/AutoRun/src/main.cpp b/plugins/AutoRun/src/main.cpp index 7781742096..eddc483179 100644 --- a/plugins/AutoRun/src/main.cpp +++ b/plugins/AutoRun/src/main.cpp @@ -33,7 +33,7 @@ void GetProfilePath(wchar_t *res, size_t resLen) wchar_t *p = wcsrchr(dbname, '.');
if (p) *p = 0;
- mir_sntprintf(res, resLen, L"\"%s\" \"/profile:%s\"", exename, dbname);
+ mir_snwprintf(res, resLen, L"\"%s\" \"/profile:%s\"", exename, dbname);
}
static void SetAutorun(BOOL autorun)
@@ -45,7 +45,7 @@ static void SetAutorun(BOOL autorun) if ( RegCreateKeyEx(ROOT_KEY, SUB_KEY, 0, NULL, 0, KEY_CREATE_SUB_KEY|KEY_SET_VALUE,NULL,&hKey,&dw) == ERROR_SUCCESS) {
wchar_t result[MAX_PATH];
GetProfilePath(result, _countof(result));
- RegSetValueEx(hKey, L"MirandaNG", 0, REG_SZ, (BYTE*)result, sizeof(wchar_t)*(DWORD)mir_tstrlen(result));
+ RegSetValueEx(hKey, L"MirandaNG", 0, REG_SZ, (BYTE*)result, sizeof(wchar_t)*(DWORD)mir_wstrlen(result));
RegCloseKey(hKey);
}
break;
@@ -70,7 +70,7 @@ static BOOL CmpCurrentAndRegistry() return FALSE;
GetProfilePath(result, _countof(result));
- return mir_tstrcmpi(result, dbpath) == 0;
+ return mir_wstrcmpi(result, dbpath) == 0;
}
static INT_PTR CALLBACK DlgProcAutorunOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index 972102796f..f89a183373 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -422,7 +422,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP if (hdc != NULL) {
if (dat->hFont != NULL)
hFontPrev = (HFONT)SelectObject(hdc, dat->hFont);
- if (GetTextExtentPoint32(hdc, szOutput, (int)mir_tstrlen(szOutput), &size))
+ if (GetTextExtentPoint32(hdc, szOutput, (int)mir_wstrlen(szOutput), &size))
if (size.cx >= (rc.right - rc.left))
dat->flags &= FWPDF_TIMEISCLIPPED;
if (dat->hFont != NULL)
@@ -468,7 +468,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP if (dat->fTimeFlags&SDWTF_ST_TIME)
GetFormatedDateTime(szTime, _countof(szTime), dat->settingLastTime, FALSE);
else GetFormatedCountdown(szTime, _countof(szTime), dat->countdown);
- mir_sntprintf(ttdi->szText, L"%s %s", (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"), szTime);
+ mir_snwprintf(ttdi->szText, L"%s %s", (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"), szTime);
ttdi->lpszText = ttdi->szText;
}
return 0;
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 33a4e647c4..0488ef6a65 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -48,7 +48,7 @@ static BOOL CALLBACK DisplayCpuUsageProc(BYTE nCpuUsage, LPARAM lParam) return FALSE; /* stop poll thread */
wchar_t str[64];
- mir_sntprintf(str, TranslateT("(current: %u%%)"), nCpuUsage);
+ mir_snwprintf(str, TranslateT("(current: %u%%)"), nCpuUsage);
SetWindowText((HWND)lParam, str);
return TRUE;
}
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index b77aab3558..e8ba15d8a0 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -384,7 +384,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case M_UPDATE_COUNTDOWN: /* lParam=(WORD)countdown */
{
wchar_t szText[256];
- mir_sntprintf(szText, TranslateTS(desc[shutdownType - 1]), lParam);
+ mir_snwprintf(szText, TranslateTS(desc[shutdownType - 1]), lParam);
SetDlgItemText(hwndDlg, IDC_TEXT_HEADER, szText);
/* countdown finished */
if (!lParam)
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp index ffe41e4a0a..c6724ab982 100644 --- a/plugins/AutoShutdown/src/utils.cpp +++ b/plugins/AutoShutdown/src/utils.cpp @@ -52,7 +52,7 @@ void TrimString(wchar_t *pszStr) wchar_t *psz, szChars[] = L" \r\n\t";
for (int i = 0; i < _countof(szChars); ++i) {
/* trim end */
- psz = &pszStr[mir_tstrlen(pszStr) - 1];
+ psz = &pszStr[mir_wstrlen(pszStr) - 1];
while (pszStr[0] && *psz == szChars[i]) {
*psz = 0;
psz = CharPrev(pszStr, psz);
@@ -60,7 +60,7 @@ void TrimString(wchar_t *pszStr) /* trim beginning */
for (psz = pszStr; (*psz && *psz == szChars[i]); psz = CharNext(psz))
;
- memmove(pszStr, psz, (mir_tstrlen(psz) + 1)*sizeof(wchar_t));
+ memmove(pszStr, psz, (mir_wstrlen(psz) + 1)*sizeof(wchar_t));
}
}
@@ -199,7 +199,7 @@ BOOL GetFormatedDateTime(wchar_t *pszOut, int nSize, time_t timestamp, BOOL fSho return FALSE;
if (!GetDateFormat(locale, DATE_SHORTDATE, &st, NULL, szDate, _countof(szDate)))
return FALSE;
- mir_sntprintf(pszOut, nSize, L"%s %s", szTime, szDate);
+ mir_snwprintf(pszOut, nSize, L"%s %s", szTime, szDate);
return TRUE;
}
}
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 623d4a8c0e..ebd5c219a7 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -136,7 +136,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l wchar_t *displayName = pcli->pfnGetContactDisplayName(data->hContact, 0);
if (displayName) {
wchar_t title[MAX_PATH];
- mir_sntprintf(title, TranslateT("Avatar History for %s"), displayName);
+ mir_snwprintf(title, TranslateT("Avatar History for %s"), displayName);
SetWindowText(hwnd, title);
}
@@ -356,8 +356,8 @@ int AddFileToList(wchar_t *path,wchar_t *lnk,wchar_t *filename, HWND list) {
// Add to list
ListEntry *le = new ListEntry();
- le->filename = mir_tstrdup(path);
- le->filelink = mir_tstrdup(lnk);
+ le->filename = mir_wstrdup(path);
+ le->filelink = mir_wstrdup(lnk);
wchar_t *p = wcschr(filename, '.');
if (p != NULL)
@@ -374,7 +374,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) WIN32_FIND_DATA finddata;
GetContactFolder(dir, hContact);
- mir_sntprintf(path, L"%s\\*.*", dir);
+ mir_snwprintf(path, L"%s\\*.*", dir);
HANDLE hFind = FindFirstFile(path, &finddata);
if (hFind == INVALID_HANDLE_VALUE)
@@ -384,7 +384,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) {
if (finddata.cFileName[0] != '.')
{
- mir_sntprintf(path, L"%s\\%s", dir, finddata.cFileName);
+ mir_snwprintf(path, L"%s\\%s", dir, finddata.cFileName);
max_pos = AddFileToList(path,finddata.cFileName,finddata.cFileName,list);
}
}
@@ -401,7 +401,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) WIN32_FIND_DATA finddata;
GetContactFolder(dir, hContact);
- mir_sntprintf(path, L"%s\\*.lnk", dir);
+ mir_snwprintf(path, L"%s\\*.lnk", dir);
HANDLE hFind = FindFirstFile(path, &finddata);
if (hFind == INVALID_HANDLE_VALUE)
@@ -412,7 +412,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) if (finddata.cFileName[0] != '.')
{
wchar_t lnk[MAX_PATH];
- mir_sntprintf(lnk, L"%s\\%s", dir, finddata.cFileName);
+ mir_snwprintf(lnk, L"%s\\%s", dir, finddata.cFileName);
if (ResolveShortcut(lnk, path))
max_pos = AddFileToList(path,lnk,finddata.cFileName,list);
}
@@ -440,13 +440,13 @@ int FillAvatarListFromDB(HWND list, MCONTACT hContact) // Get file in disk
wchar_t path[MAX_PATH];
- ptrT tszStoredPath(mir_utf8decodeT((char*)dbei.pBlob));
+ ptrW tszStoredPath(mir_utf8decodeW((char*)dbei.pBlob));
PathToAbsoluteT(tszStoredPath, path);
// Add to list
ListEntry *le = new ListEntry();
le->hDbEvent = hDbEvent;
- le->filename = mir_tstrdup(path);
+ le->filename = mir_wstrdup(path);
max_pos = SendMessage(list,LB_ADDSTRING, 0, (LPARAM)date);
SendMessage(list, LB_SETITEMDATA, max_pos, (LPARAM)le);
}
@@ -550,7 +550,7 @@ int ShowSaveDialog(HWND hwnd, wchar_t* fn, MCONTACT hContact) wchar_t title[MAX_PATH];
if (displayName)
{
- mir_sntprintf(title, TranslateT("Save Avatar for %s"), displayName);
+ mir_snwprintf(title, TranslateT("Save Avatar for %s"), displayName);
ofn.lpstrTitle = title;
}
else
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index 46547ae455..a678580bcc 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -120,7 +120,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) CONTACTAVATARCHANGEDNOTIFICATION* avatar = (CONTACTAVATARCHANGEDNOTIFICATION*)lParam;
if (avatar == NULL) {
- if (!ret || !mir_tstrcmp(dbvOldHash.ptszVal, L"-")) {
+ if (!ret || !mir_wstrcmp(dbvOldHash.ptszVal, L"-")) {
//avoid duplicate "removed avatar" notifications
//do not notify on an empty profile
ShowDebugPopup(hContact, TranslateT("AVH Debug"), TranslateT("Removed avatar, no avatar before... skipping"));
@@ -136,7 +136,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) ShowPopup(hContact, NULL, opts.popup_removed);
}
else {
- if (ret && !mir_tstrcmp(dbvOldHash.ptszVal, avatar->hash)) {
+ if (ret && !mir_wstrcmp(dbvOldHash.ptszVal, avatar->hash)) {
// same avatar hash, skipping
ShowDebugPopup(hContact, TranslateT("AVH Debug"), TranslateT("Hashes are the same... skipping"));
db_free(&dbvOldHash);
@@ -178,7 +178,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) wchar_t *file = GetCachedAvatar(proto, hash);
if (file != NULL) {
- mir_tstrncpy(history_filename, file, _countof(history_filename));
+ mir_wstrncpy(history_filename, file, _countof(history_filename));
mir_free(file);
}
else {
@@ -187,7 +187,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) else
GetProtocolFolder(history_filename, proto);
- mir_sntprintf(history_filename,
+ mir_snwprintf(history_filename,
L"%s\\%s", history_filename, hash);
if (CopyImageFile(avatar->filename, history_filename))
@@ -236,7 +236,7 @@ static int PreShutdown(WPARAM, LPARAM) static int ModulesLoaded(WPARAM, LPARAM)
{
- mir_sntprintf(basedir, L"%s\\Avatars History", profilePath);
+ mir_snwprintf(basedir, L"%s\\Avatars History", profilePath);
hFolder = FoldersRegisterCustomPathT( LPGEN("Avatars"), LPGEN("Avatar History"),
PROFILE_PATHT L"\\" CURRENT_PROFILET L"\\Avatars History");
@@ -344,7 +344,7 @@ extern "C" __declspec(dllexport) int Load(void) CreateServiceFunction(MS_AVATARHISTORY_GET_CACHED_AVATAR, GetCachedAvatar);
if (CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath) != 0)
- mir_tstrcpy(profilePath, L"."); // Failed, use current dir
+ mir_wstrcpy(profilePath, L"."); // Failed, use current dir
SkinAddNewSoundExT("avatar_changed",LPGENW("Avatar History"),LPGENW("Contact changed avatar"));
SkinAddNewSoundExT("avatar_removed",LPGENW("Avatar History"),LPGENW("Contact removed avatar"));
diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp index f936953b4b..165741a06e 100644 --- a/plugins/AvatarHistory/src/popup.cpp +++ b/plugins/AvatarHistory/src/popup.cpp @@ -105,13 +105,13 @@ void ShowPopupEx(MCONTACT hContact, const wchar_t *title, const wchar_t *descrip ((PopupDataType*)ppd.PluginData)->hIcon = ppd.lchIcon;
if (title != NULL)
- mir_tstrncpy(ppd.lptzContactName, title, _countof(ppd.lptzContactName));
+ mir_wstrncpy(ppd.lptzContactName, title, _countof(ppd.lptzContactName));
else if (hContact != NULL)
- mir_tstrncpy(ppd.lptzContactName, (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0),
+ mir_wstrncpy(ppd.lptzContactName, (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0),
_countof(ppd.lptzContactName));
if (description != NULL)
- mir_tstrncpy(ppd.lptzText, description, _countof(ppd.lptzText));
+ mir_wstrncpy(ppd.lptzText, description, _countof(ppd.lptzText));
if (type == POPUP_TYPE_NORMAL || type == POPUP_TYPE_TEST)
{
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index 07ef4f9e97..e3c7bbe109 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -104,7 +104,7 @@ wchar_t* GetProtocolFolder(wchar_t *fn, char *proto) if (proto == NULL)
proto = Translate("Unknown Protocol");
- mir_sntprintf(fn, MAX_PATH, L"%s\\%S", fn, proto);
+ mir_snwprintf(fn, MAX_PATH, L"%s\\%S", fn, proto);
CreateDirectoryTreeT(fn);
return fn;
}
@@ -115,15 +115,15 @@ wchar_t* GetContactFolder(wchar_t *fn, MCONTACT hContact) GetProtocolFolder(fn, proto);
wchar_t uin[MAX_PATH];
- ptrT id(Contact_GetInfo(CNF_UNIQUEID, hContact, proto));
+ ptrW id(Contact_GetInfo(CNF_UNIQUEID, hContact, proto));
wcsncpy_s(uin, (id == NULL) ? TranslateT("Unknown UIN") : id, _TRUNCATE);
ConvertToFilename(uin, MAX_PATH); //added so that weather id's like "yw/CI0000" work
- mir_sntprintf(fn, MAX_PATH, L"%s\\%s", fn, uin);
+ mir_snwprintf(fn, MAX_PATH, L"%s\\%s", fn, uin);
CreateDirectoryTreeT(fn);
#ifdef DBGPOPUPS
wchar_t log[1024];
- mir_sntprintf(log, L"Path: %s\nProto: %S\nUIN: %s", fn, proto, uin);
+ mir_snwprintf(log, L"Path: %s\nProto: %S\nUIN: %s", fn, proto, uin);
ShowPopup(hContact, L"AVH Debug: GetContactFolder", log);
#endif
@@ -136,7 +136,7 @@ wchar_t* GetOldStyleAvatarName(wchar_t *fn, MCONTACT hContact) SYSTEMTIME curtime;
GetLocalTime(&curtime);
- mir_sntprintf(fn, MAX_PATH,
+ mir_snwprintf(fn, MAX_PATH,
L"%s\\%04d-%02d-%02d %02dh%02dm%02ds", fn,
curtime.wYear, curtime.wMonth, curtime.wDay,
curtime.wHour, curtime.wMinute, curtime.wSecond);
@@ -150,7 +150,7 @@ void CreateOldStyleShortcut(MCONTACT hContact, wchar_t *history_filename) GetOldStyleAvatarName(shortcut, hContact);
- mir_sntprintf(shortcut, L"%s.%s.lnk", shortcut,
+ mir_snwprintf(shortcut, L"%s.%s.lnk", shortcut,
GetExtension(history_filename));
if (!CreateShortcut(history_filename, shortcut))
@@ -166,7 +166,7 @@ void CreateOldStyleShortcut(MCONTACT hContact, wchar_t *history_filename) BOOL CopyImageFile(wchar_t *old_file, wchar_t *new_file)
{
wchar_t *ext = GetExtension(old_file);
- mir_sntprintf(new_file, MAX_PATH, L"%s.%s", new_file, ext);
+ mir_snwprintf(new_file, MAX_PATH, L"%s.%s", new_file, ext);
return !CopyFile(old_file, new_file, TRUE);
}
@@ -180,7 +180,7 @@ wchar_t * GetCachedAvatar(char *proto, wchar_t *hash) else
GetProtocolFolder(file, proto);
- mir_sntprintf(search, L"%s\\%s.*", file, hash);
+ mir_snwprintf(search, L"%s\\%s.*", file, hash);
WIN32_FIND_DATA finddata;
HANDLE hFind = FindFirstFile(search, &finddata);
@@ -189,16 +189,16 @@ wchar_t * GetCachedAvatar(char *proto, wchar_t *hash) do
{
- size_t len = mir_tstrlen(finddata.cFileName);
+ size_t len = mir_wstrlen(finddata.cFileName);
if (len > 4
- && (!mir_tstrcmpi(&finddata.cFileName[len-4], L".png")
- || !mir_tstrcmpi(&finddata.cFileName[len-4], L".bmp")
- || !mir_tstrcmpi(&finddata.cFileName[len-4], L".gif")
- || !mir_tstrcmpi(&finddata.cFileName[len-4], L".jpg")
- || !mir_tstrcmpi(&finddata.cFileName[len-5], L".jpeg")))
+ && (!mir_wstrcmpi(&finddata.cFileName[len-4], L".png")
+ || !mir_wstrcmpi(&finddata.cFileName[len-4], L".bmp")
+ || !mir_wstrcmpi(&finddata.cFileName[len-4], L".gif")
+ || !mir_wstrcmpi(&finddata.cFileName[len-4], L".jpg")
+ || !mir_wstrcmpi(&finddata.cFileName[len-5], L".jpeg")))
{
- mir_sntprintf(file, L"%s\\%s", file, finddata.cFileName);
- ret = mir_tstrdup(file);
+ mir_snwprintf(file, L"%s\\%s", file, finddata.cFileName);
+ ret = mir_wstrdup(file);
break;
}
} while(FindNextFile(hFind, &finddata));
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index ea4c0c93fc..8e3ab62e57 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -188,7 +188,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara }
else {
DWORD bassver = BASS_GetVersion();
- mir_sntprintf(tmp, TranslateT("un4seen's bass version: %d.%d.%d.%d"), bassver >> 24, (bassver >> 16) & 0xff, (bassver >> 8) & 0xff, bassver & 0xff);
+ mir_snwprintf(tmp, TranslateT("un4seen's bass version: %d.%d.%d.%d"), bassver >> 24, (bassver >> 16) & 0xff, (bassver >> 8) & 0xff, bassver & 0xff);
SetDlgItemText(hwndDlg, IDC_BASSVERSION, tmp);
SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_RESETCONTENT, 0, 0);
@@ -196,10 +196,10 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_SETCURSEL, 0, 0);
BASS_DEVICEINFO info;
- ptrT tszDeviceName(db_get_tsa(NULL, ModuleName, OPT_OUTDEVICE));
+ ptrW tszDeviceName(db_get_tsa(NULL, ModuleName, OPT_OUTDEVICE));
for (int i = 1; BASS_GetDeviceInfo(i + newBass, &info); i++) {
SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_ADDSTRING, 0, _A2T(info.name));
- if (!mir_tstrcmp(tszDeviceName, _A2T(info.name)))
+ if (!mir_wstrcmp(tszDeviceName, _A2T(info.name)))
SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_SETCURSEL, i, 0);
}
}
@@ -424,8 +424,8 @@ int ReloadColors(WPARAM, LPARAM) {
ColourIDT colourid = { 0 };
colourid.cbSize = sizeof(colourid);
- mir_tstrcpy(colourid.group, _A2W(ModuleName));
- mir_tstrcpy(colourid.name, LPGENW("Frame background"));
+ mir_wstrcpy(colourid.group, _A2W(ModuleName));
+ mir_wstrcpy(colourid.name, LPGENW("Frame background"));
clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, 0);
if (hBkgBrush)
@@ -499,7 +499,7 @@ void LoadBassLibrary(const wchar_t *ptszPath) BASS_DEVICEINFO info;
if (!db_get_ts(NULL, ModuleName, OPT_OUTDEVICE, &dbv))
for (size_t i = 1; BASS_GetDeviceInfo((DWORD)i, &info); i++)
- if (!mir_tstrcmp(dbv.ptszVal, _A2T(info.name)))
+ if (!mir_wstrcmp(dbv.ptszVal, _A2T(info.name)))
device = (int)i;
db_free(&dbv);
@@ -526,7 +526,7 @@ void LoadBassLibrary(const wchar_t *ptszPath) int OnFoldersChanged(WPARAM, LPARAM)
{
FoldersGetCustomPathT(hBASSFolder, CurrBassPath, MAX_PATH, L"");
- mir_tstrcat(CurrBassPath, L"\\bass.dll");
+ mir_wstrcat(CurrBassPath, L"\\bass.dll");
if (hBass != NULL) {
BASS_Free();
@@ -544,16 +544,16 @@ int OnModulesLoaded(WPARAM, LPARAM) {
if (hBASSFolder = FoldersRegisterCustomPathT(LPGEN("Bass Interface"), LPGEN("Bass library"), PLUGINS_PATHT L"\\Bass")) {
FoldersGetCustomPathT(hBASSFolder, CurrBassPath, MAX_PATH, L"");
- mir_tstrcat(CurrBassPath, L"\\bass.dll");
+ mir_wstrcat(CurrBassPath, L"\\bass.dll");
}
else {
DBVARIANT dbv;
if (db_get_ts(NULL, ModuleName, OPT_BASSPATH, &dbv)) {
- mir_tstrncpy(CurrBassPath, VARST(L"Plugins\\Bass\\bass.dll"), _countof(CurrBassPath));
+ mir_wstrncpy(CurrBassPath, VARST(L"Plugins\\Bass\\bass.dll"), _countof(CurrBassPath));
db_set_ts(NULL, ModuleName, OPT_BASSPATH, CurrBassPath);
}
else {
- mir_tstrcpy(CurrBassPath, dbv.ptszVal);
+ mir_wstrcpy(CurrBassPath, dbv.ptszVal);
db_free(&dbv);
}
}
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index eab014339e..bea541c11a 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -346,11 +346,11 @@ void HistoryEventList::InitNames() wchar_t str[200];
if (m_hContact) {
wcscpy_s(m_contactName, pcli->pfnGetContactDisplayName(m_hContact, 0));
- mir_sntprintf(str, TranslateT("History for %s"), m_contactName);
+ mir_snwprintf(str, TranslateT("History for %s"), m_contactName);
}
else {
wcscpy_s(m_contactName, TranslateT("System"));
- mir_sntprintf(str, TranslateT("History"));
+ mir_snwprintf(str, TranslateT("History"));
}
if (m_isWnd)
@@ -398,7 +398,7 @@ std::wstring HistoryEventList::GetContactName() std::wstring HistoryEventList::GetMyName()
{
- ptrT name(Contact_GetInfo(CNF_DISPLAY, NULL, GetContactProto(m_hContact)));
+ ptrW name(Contact_GetInfo(CNF_DISPLAY, NULL, GetContactProto(m_hContact)));
return (name == NULL) ? TranslateT("Me") : name;
}
@@ -431,13 +431,13 @@ std::string HistoryEventList::GetBaseProtocol() std::wstring HistoryEventList::GetMyId()
{
- ptrT id(Contact_GetInfo(CNF_DISPLAYUID, NULL, GetContactProto(m_hContact)));
+ ptrW id(Contact_GetInfo(CNF_DISPLAYUID, NULL, GetContactProto(m_hContact)));
return (id == NULL) ? L"" : id;
}
inline std::wstring GetContactId(MCONTACT hContact)
{
- ptrT id(Contact_GetInfo(CNF_DISPLAYUID, hContact));
+ ptrW id(Contact_GetInfo(CNF_DISPLAYUID, hContact));
return (id == NULL) ? L"" : id;
}
@@ -600,7 +600,7 @@ void HistoryEventList::AddImporter(MCONTACT hContact, IImport::ImportType type, mir_cslock lck(csEventList);
wchar_t buf[32];
- mir_sntprintf(buf, L"%016llx", (unsigned long long int)hContact);
+ mir_snwprintf(buf, L"%016llx", (unsigned long long int)hContact);
ImportDiscData data;
data.file = m_contactFileDir + buf;
data.type = type;
diff --git a/plugins/BasicHistory/src/ExportManager.cpp b/plugins/BasicHistory/src/ExportManager.cpp index c2168d861c..c7ac9b099c 100644 --- a/plugins/BasicHistory/src/ExportManager.cpp +++ b/plugins/BasicHistory/src/ExportManager.cpp @@ -41,16 +41,16 @@ std::wstring GetFile(const wchar_t* ext, HWND hwnd, bool open) wcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
- mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
- size_t len = mir_tstrlen(filter) + 1;
- mir_sntprintf(filter + len, _countof(filter) - len, L"*.%s", ext);
- len += mir_tstrlen(filter + len);
+ mir_snwprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
+ size_t len = mir_wstrlen(filter) + 1;
+ mir_snwprintf(filter + len, _countof(filter) - len, L"*.%s", ext);
+ len += mir_wstrlen(filter + len);
filter[++len] = 0;
wchar_t stzFilePath[1024];
wcscpy_s(stzFilePath, TranslateT("History"));
wcscat_s(stzFilePath, L".");
wcscat_s(stzFilePath, ext);
- len = mir_tstrlen(stzFilePath) + 1;
+ len = mir_wstrlen(stzFilePath) + 1;
stzFilePath[len] = 0;
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 499488c6e4..be1dac8781 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -1378,7 +1378,7 @@ void HistoryWindow::SelectEventGroup(int sel) }
TimeZone_PrintTimeStamp(NULL, data.timestamp, formatDate, str, MAXSELECTSTR, 0);
- *strLen = (unsigned int)mir_tstrlen(str) * sizeof(wchar_t);
+ *strLen = (unsigned int)mir_wstrlen(str) * sizeof(wchar_t);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
SetFontFromOptions(TextFont, caps, lastMe ? Options::OutTimestamp : Options::InTimestamp);
@@ -1387,8 +1387,8 @@ void HistoryWindow::SelectEventGroup(int sel) TextFont->Release();
if (isUser) {
- mir_sntprintf(str, MAXSELECTSTR, L"%s\n", (lastMe) ? m_myName : m_contactName);
- *strLen = (unsigned int)mir_tstrlen(str) * sizeof(wchar_t);
+ mir_snwprintf(str, MAXSELECTSTR, L"%s\n", (lastMe) ? m_myName : m_contactName);
+ *strLen = (unsigned int)mir_wstrlen(str) * sizeof(wchar_t);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
SetFontFromOptions(TextFont, caps, lastMe ? Options::OutName : Options::InName);
@@ -1945,7 +1945,7 @@ void HistoryWindow::Delete(int what) return;
wchar_t message[256];
- mir_sntprintf(message, TranslateT("Number of history items to delete: %d.\nAre you sure you want to do this?"), toDelete);
+ mir_snwprintf(message, TranslateT("Number of history items to delete: %d.\nAre you sure you want to do this?"), toDelete);
if (MessageBox(m_hWnd, message, TranslateT("Are You sure?"), MB_OKCANCEL | MB_ICONERROR) != IDOK)
return;
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 262b46e47c..4e243c3682 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -722,7 +722,7 @@ void SetEventCB(HWND hwndCB, int eventId) if (selCpIdx == -1) {
wchar_t buf[24];
- mir_sntprintf(buf, L"%d", eventId);
+ mir_snwprintf(buf, L"%d", eventId);
ComboBox_SetText(hwndCB, buf);
}
else ComboBox_SetCurSel(hwndCB, selCpIdx);
@@ -777,7 +777,7 @@ void ReloadEventLB(HWND hwndLB, const FilterOptions &sel) if (selCpIdx == -1) {
wchar_t buf[24];
- mir_sntprintf(buf, L"%d", *it);
+ mir_snwprintf(buf, L"%d", *it);
ListBox_AddString(hwndLB, buf);
}
else ListBox_AddString(hwndLB, TranslateTS(EventNames[selCpIdx].name));
@@ -805,25 +805,25 @@ bool OpenFileDlg(HWND hwndDlg, HWND hwndEdit, const wchar_t* defName, const wcha wchar_t extUpper[32];
wcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
- mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
- size_t len = mir_tstrlen(filter) + 1;
- mir_sntprintf(filter + len, _countof(filter) - len, L"*.%s", ext);
- len += mir_tstrlen(filter + len) + 1;
+ mir_snwprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
+ size_t len = mir_wstrlen(filter) + 1;
+ mir_snwprintf(filter + len, _countof(filter) - len, L"*.%s", ext);
+ len += mir_wstrlen(filter + len) + 1;
wcscpy_s(filter + len, 1024 - len, TranslateT("All Files (*.*)"));
- len += mir_tstrlen(filter + len) + 1;
+ len += mir_wstrlen(filter + len) + 1;
wcscpy_s(filter + len, 1024 - len, L"*.*");
- len += mir_tstrlen(filter + len) + 1;
+ len += mir_wstrlen(filter + len) + 1;
filter[len] = 0;
wchar_t stzFilePath[1024];
Edit_GetText(hwndEdit, stzFilePath, 1023);
if (stzFilePath[0] == 0) {
wcscpy_s(stzFilePath, defName);
- len = mir_tstrlen(stzFilePath) + 1;
+ len = mir_wstrlen(stzFilePath) + 1;
stzFilePath[len] = 0;
}
else {
- len = mir_tstrlen(stzFilePath) + 1;
+ len = mir_wstrlen(stzFilePath) + 1;
stzFilePath[len] = 0;
}
@@ -1283,7 +1283,7 @@ void InitCodepageCB(HWND hwndCB, unsigned int codepage, const std::wstring& name if (selCpIdx == -1) {
wchar_t buf[300];
- mir_sntprintf(buf, L"%d;%s", codepage, name.c_str());
+ mir_snwprintf(buf, L"%d;%s", codepage, name.c_str());
ComboBox_SetText(hwndCB, buf);
}
else ComboBox_SetCurSel(hwndCB, selCpIdx);
@@ -1701,7 +1701,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, wchar_t sep = ':';
if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIME, timeFormat, 10) > 0)
sep = timeFormat[0];
- mir_sntprintf(timeFormat, L"HH%cmm", sep);
+ mir_snwprintf(timeFormat, L"HH%cmm", sep);
}
SYSTEMTIME st;
@@ -1748,7 +1748,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, toCp.eventDeltaTime = GetDlgItemInt(hwndDlg, IDC_EVENT_TIME, &isOK, TRUE);
if (!isOK) {
wchar_t tszBuf[256];
- mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Events older than"));
+ mir_snwprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Events older than"));
MessageBox(hwndDlg, tszBuf, TranslateT("Error"), MB_ICONERROR);
break;
}
@@ -1779,7 +1779,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, if (!isOK) {
if (toCp.trigerType == TaskOptions::Monthly) {
wchar_t tszBuf[256];
- mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Day"));
+ mir_snwprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Day"));
MessageBox(hwndDlg, tszBuf, TranslateT("Error"), MB_ICONERROR);
break;
}
@@ -1789,7 +1789,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, if (!isOK) {
if (toCp.trigerType == TaskOptions::DeltaMin || toCp.trigerType == TaskOptions::DeltaHour) {
wchar_t tszBuf[256];
- mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Delta time"));
+ mir_snwprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Delta time"));
MessageBox(hwndDlg, tszBuf, TranslateT("Error"), MB_ICONERROR);
break;
}
@@ -1806,9 +1806,9 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, if (err.empty())
wcscpy_s(tszBuf, TranslateT("Some value is invalid"));
else if (errDescr.empty())
- mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), err.c_str());
+ mir_snwprintf(tszBuf, TranslateT("Invalid '%s' value."), err.c_str());
else
- mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value.\n%s"), err.c_str(), errDescr.c_str());
+ mir_snwprintf(tszBuf, TranslateT("Invalid '%s' value.\n%s"), err.c_str(), errDescr.c_str());
MessageBox(hwndDlg, tszBuf, TranslateT("Error"), MB_ICONERROR);
break;
}
diff --git a/plugins/BasicHistory/src/PlainHtmlExport.cpp b/plugins/BasicHistory/src/PlainHtmlExport.cpp index 52bf4fadd7..1f00085b7a 100644 --- a/plugins/BasicHistory/src/PlainHtmlExport.cpp +++ b/plugins/BasicHistory/src/PlainHtmlExport.cpp @@ -75,7 +75,7 @@ void PlainHtmlExport::WriteGroup(bool, const std::wstring &time, const std::wstr {
wchar_t buf[256];
EXP_FILE << L"<div class=mes id=session>\n";
- mir_sntprintf(buf, TranslateT("Conversation started at %s"), time.c_str());
+ mir_snwprintf(buf, TranslateT("Conversation started at %s"), time.c_str());
EXP_FILE << L"<div class=text>" << buf << L"</div>\n";
EXP_FILE << L"</div>\n";
}
diff --git a/plugins/BasicHistory/src/RichHtmlExport.cpp b/plugins/BasicHistory/src/RichHtmlExport.cpp index 45bc07ee5b..c1a639267e 100644 --- a/plugins/BasicHistory/src/RichHtmlExport.cpp +++ b/plugins/BasicHistory/src/RichHtmlExport.cpp @@ -256,7 +256,7 @@ void IcoSave(const std::wstring &fileName, HICON hicon) bool DeleteDirectory(LPCTSTR lpszDir, bool noRecycleBin = true)
{
- size_t len = mir_tstrlen(lpszDir);
+ size_t len = mir_wstrlen(lpszDir);
wchar_t *pszFrom = new wchar_t[len+2];
wcscpy_s(pszFrom, len+2, lpszDir);
pszFrom[len] = 0;
diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index 7ad20eb6b9..238a65cfdf 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -236,9 +236,9 @@ bool DoTask(TaskOptions& to) if (err.empty())
wcscpy_s(msg, TranslateT("Some value is invalid"));
else if (errDescr.empty())
- mir_sntprintf(msg, TranslateT("Invalid '%s' value."), err.c_str());
+ mir_snwprintf(msg, TranslateT("Invalid '%s' value."), err.c_str());
else
- mir_sntprintf(msg, TranslateT("Invalid '%s' value.\n%s"), err.c_str(), errDescr.c_str());
+ mir_snwprintf(msg, TranslateT("Invalid '%s' value.\n%s"), err.c_str(), errDescr.c_str());
DoError(to, msg);
return true;
@@ -395,7 +395,7 @@ bool DoTask(TaskOptions& to) errorStr += L"\n";
wchar_t msg[1024];
- mir_sntprintf(msg, TranslateT("Incorrect file format: %s."), GetName(*it).c_str());
+ mir_snwprintf(msg, TranslateT("Incorrect file format: %s."), GetName(*it).c_str());
errorStr += msg;
}
else {
@@ -404,7 +404,7 @@ bool DoTask(TaskOptions& to) wchar_t msg[1024];
- mir_sntprintf(msg, TranslateT("Unknown contact in file: %s."), GetName(*it).c_str());
+ mir_snwprintf(msg, TranslateT("Unknown contact in file: %s."), GetName(*it).c_str());
errorStr += msg;
}
}
@@ -460,7 +460,7 @@ bool DoTask(TaskOptions& to) wchar_t msg[1024];
- mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
+ mir_snwprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
errorStr += msg;
}
@@ -481,7 +481,7 @@ bool DoTask(TaskOptions& to) errorStr += L"\n";
wchar_t msg[1024];
- mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
+ mir_snwprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
errorStr += msg;
break;
}
@@ -586,7 +586,7 @@ std::wstring GetFileName(const std::wstring &baseName, std::wstring contactName, wchar_t time[256];
SYSTEMTIME st;
GetLocalTime(&st);
- mir_sntprintf(time, L"%d-%02d-%02d %02d%02d", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute);
+ mir_snwprintf(time, L"%d-%02d-%02d %02d%02d", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute);
std::wstring str1 = str.substr(0, pos);
str1 += time;
str1 += str.substr(pos + 6);
@@ -843,9 +843,9 @@ bool ExecuteCurrentTask(time_t now) size_t size = to.taskName.size() + 1024;
wchar_t *name = new wchar_t[size];
if (error)
- mir_sntprintf(name, size, TranslateT("Task '%s' execution failed"), to.taskName.c_str());
+ mir_snwprintf(name, size, TranslateT("Task '%s' execution failed"), to.taskName.c_str());
else
- mir_sntprintf(name, size, TranslateT("Task '%s' finished successfully"), to.taskName.c_str());
+ mir_snwprintf(name, size, TranslateT("Task '%s' finished successfully"), to.taskName.c_str());
QueueUserAPC(DoTaskFinishInMainAPCFunc, g_hMainThread, (ULONG_PTR) name);
}
}
@@ -1129,7 +1129,7 @@ bool FtpFiles(const std::wstring& dir, const std::wstring& filePath, const std:: DeleteFile(log.c_str());
wchar_t cmdLine[MAX_PATH];
- mir_sntprintf(cmdLine, L"\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc", Options::instance->ftpExePath.c_str(), log.c_str());
+ mir_snwprintf(cmdLine, L"\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc", Options::instance->ftpExePath.c_str(), log.c_str());
STARTUPINFO startupInfo = { 0 };
startupInfo.cb = sizeof(STARTUPINFO);
@@ -1220,7 +1220,7 @@ bool FtpGetFiles(const std::wstring& dir, const std::list<std::wstring>& files, CreateDirectory(GetDirectoryName(log).c_str(), NULL);
DeleteFile(log.c_str());
wchar_t cmdLine[MAX_PATH];
- mir_sntprintf(cmdLine, L"\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc", Options::instance->ftpExePath.c_str(), log.c_str());
+ mir_snwprintf(cmdLine, L"\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc", Options::instance->ftpExePath.c_str(), log.c_str());
STARTUPINFO startupInfo = { 0 };
PROCESS_INFORMATION processInfo;
startupInfo.cb = sizeof(STARTUPINFO);
@@ -1250,7 +1250,7 @@ void CreatePath(const wchar_t *szDir) DWORD dwAttributes;
wchar_t *pszLastBackslash, szTestDir[MAX_PATH];
- mir_tstrncpy(szTestDir, szDir, _countof(szTestDir));
+ mir_wstrncpy(szTestDir, szDir, _countof(szTestDir));
if ((dwAttributes = GetFileAttributes(szTestDir)) != INVALID_FILE_ATTRIBUTES && (dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
return;
@@ -1283,7 +1283,7 @@ INT_PTR ExecuteTaskService(WPARAM wParam, LPARAM) void DoError(const TaskOptions& to, const std::wstring _error)
{
wchar_t msg[256];
- mir_sntprintf(msg, TranslateT("Task '%s' execution failed:"), to.taskName.c_str());
+ mir_snwprintf(msg, TranslateT("Task '%s' execution failed:"), to.taskName.c_str());
if (Options::instance->schedulerHistoryAlerts) {
std::wstring error = msg;
error += L"\n";
diff --git a/plugins/BasicHistory/src/Searcher.cpp b/plugins/BasicHistory/src/Searcher.cpp index a3c8b4f093..97158d7796 100644 --- a/plugins/BasicHistory/src/Searcher.cpp +++ b/plugins/BasicHistory/src/Searcher.cpp @@ -75,7 +75,7 @@ bool Searcher::CompareStr(std::wstring str, wchar_t *strFind) return str.find(strFind) < str.length();
size_t findid = str.find(strFind);
- size_t findLen = mir_tstrlen(strFind);
+ size_t findLen = mir_wstrlen(strFind);
while(findid < str.length()) {
if ((findid == 0 || std::isspace(str[findid - 1], loc) || std::ispunct(str[findid - 1], loc)) &&
(findid + findLen >= str.length() || std::isspace(str[findid + findLen], loc) || std::ispunct(str[findid + findLen], loc)))
@@ -105,13 +105,13 @@ void Searcher::Find() GetWindowText(context->findWindow, str, _countof(str));
if (!str[0]) {
wchar_t buf[256];
- mir_sntprintf(buf, TranslateT("\"%s\" not found"), str);
+ mir_snwprintf(buf, TranslateT("\"%s\" not found"), str);
MessageBox(context->m_hWnd, buf, TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
return;
}
if (!matchCase) {
std::locale loc;
- std::transform(str, str + mir_tstrlen(str), str, std::bind2nd(std::ptr_fun(mytoupper), &loc));
+ std::transform(str, str + mir_wstrlen(str), str, std::bind2nd(std::ptr_fun(mytoupper), &loc));
}
bool findBack1 = findBack ^ !searchForInMes;
@@ -299,7 +299,7 @@ void Searcher::Find() if (isStart) {
wchar_t buf[256];
GetWindowText(context->findWindow, str, _countof(str));
- mir_sntprintf(buf, TranslateT("\"%s\" not found"), str);
+ mir_snwprintf(buf, TranslateT("\"%s\" not found"), str);
MessageBox(context->m_hWnd, buf, TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
}
else MessageBox(context->m_hWnd, TranslateTS(onlyGroup ? LPGENW("You have reached the end of the group.") : LPGENW("You have reached the end of the history.")), TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
diff --git a/plugins/Boltun/src/Engine/Mind.cpp b/plugins/Boltun/src/Engine/Mind.cpp index 120dbc85ef..cfee26fbf0 100644 --- a/plugins/Boltun/src/Engine/Mind.cpp +++ b/plugins/Boltun/src/Engine/Mind.cpp @@ -129,7 +129,7 @@ void Mind::Load(wstring filename) format(st);
count = st.length();
c = co = new wchar_t[count + 1];
- mir_tstrcpy(c, st.c_str());
+ mir_wstrcpy(c, st.c_str());
size_t pos = 0;
while (pos < count && iswspace(*c)) {
++pos;
@@ -209,25 +209,25 @@ void Mind::Load(wstring filename) ++c;
count -= 2;
c[count] = '\0';
- if (mir_tstrcmp(c, L"QUESTION") == 0) {
+ if (mir_wstrcmp(c, L"QUESTION") == 0) {
toLowerStr(c);
data->question.insert(s1);
}
- else if (mir_tstrcmp(c, L"IGNORED") == 0) {
+ else if (mir_wstrcmp(c, L"IGNORED") == 0) {
toLowerStr(c);
data->special.insert(s1);
}
- else if (mir_tstrcmp(c, L"ESCAPE") == 0) {
+ else if (mir_wstrcmp(c, L"ESCAPE") == 0) {
data->escape.push_back(s1);
}
- else if (mir_tstrcmp(c, L"FAILURE") == 0) {
+ else if (mir_wstrcmp(c, L"FAILURE") == 0) {
data->failure.push_back(s1);
}
- else if (mir_tstrcmp(c, L"REPEAT") == 0) {
+ else if (mir_wstrcmp(c, L"REPEAT") == 0) {
data->repeats.push_back(s1);
}
else {
- if (mir_tstrcmp(c, L"INITIAL") != 0)
+ if (mir_wstrcmp(c, L"INITIAL") != 0)
throw error;
data->initial.push_back(s1);
}
diff --git a/plugins/Boltun/src/Engine/TalkEngine.cpp b/plugins/Boltun/src/Engine/TalkEngine.cpp index 0f53403003..7d1ca265ed 100644 --- a/plugins/Boltun/src/Engine/TalkEngine.cpp +++ b/plugins/Boltun/src/Engine/TalkEngine.cpp @@ -264,7 +264,7 @@ wstring TalkBot::AllReplies(const wstring &incomingMessage, ContactData *contact TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, wstring incomingMessage, bool saveChoice)
{
wchar_t* str = new wchar_t[incomingMessage.length() + 1];
- mir_tstrcpy(str, incomingMessage.c_str());
+ mir_wstrcpy(str, incomingMessage.c_str());
CharLower(str);
incomingMessage = str;
delete[] str;
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 100c18b144..ebe6dd21d6 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -65,14 +65,14 @@ void UpdateEngine() wchar_t* GetFullName(const wchar_t *filename)
{
- size_t flen = mir_tstrlen(filename);
+ size_t flen = mir_wstrlen(filename);
wchar_t* fullname = const_cast<wchar_t*>(filename);
if (!wcschr(filename, ':')) {
- size_t plen = mir_tstrlen(tszPath);
+ size_t plen = mir_wstrlen(tszPath);
fullname = new wchar_t[plen + flen + 1];
fullname[0] = NULL;
- mir_tstrcat(fullname, tszPath);
- mir_tstrcat(fullname, filename);
+ mir_wstrcat(fullname, tszPath);
+ mir_wstrcat(fullname, filename);
}
return fullname;
}
@@ -361,7 +361,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP const size_t fileNameSize = 5000;
wchar_t *filename = new wchar_t[fileNameSize];
wchar_t *fullname = GetFullName(Config.MindFileName);
- mir_tstrcpy(filename, fullname);
+ mir_wstrcpy(filename, fullname);
if (fullname != Config.MindFileName)
delete[] fullname;
@@ -407,7 +407,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP bTranslated = blInit = LoadMind(c, line);
if (!bTranslated) {
wchar_t message[5000];
- mir_sntprintf(message, TranslateTS(FAILED_TO_LOAD_BASE), line, c);
+ mir_snwprintf(message, TranslateTS(FAILED_TO_LOAD_BASE), line, c);
MessageBox(NULL, message, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
}
@@ -575,7 +575,7 @@ extern "C" int __declspec(dllexport) Load(void) blInit = LoadMind(Config.MindFileName, line);
if (!blInit) {
wchar_t path[2000];
- mir_sntprintf(path, TranslateTS(FAILED_TO_LOAD_BASE), line, (const wchar_t*)Config.MindFileName);
+ mir_snwprintf(path, TranslateTS(FAILED_TO_LOAD_BASE), line, (const wchar_t*)Config.MindFileName);
MessageBox(NULL, path, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
return 0;
@@ -593,7 +593,7 @@ extern "C" int __declspec(dllexport) Unload(void) //So in case of saving error we will remain silent
#if 0
wchar_t path[MAX_PATH];
- mir_sntprintf(path, TranslateTS(FAILED_TO_SAVE_BASE), (const wchar_t*)Config.MindFileName);
+ mir_snwprintf(path, TranslateTS(FAILED_TO_SAVE_BASE), (const wchar_t*)Config.MindFileName);
wchar_t* err = TranslateTS(BOLTUN_ERROR);
MessageBox(NULL, path, err, MB_ICONERROR | MB_TASKMODAL | MB_OK); */
#endif
diff --git a/plugins/Boltun/src/config.cpp b/plugins/Boltun/src/config.cpp index dd821a886b..68d6035315 100644 --- a/plugins/Boltun/src/config.cpp +++ b/plugins/Boltun/src/config.cpp @@ -58,7 +58,7 @@ inline wchar_t* GetString(char* key, const wchar_t* def) inline const wchar_t* SetString(char* key, const wchar_t* value)
{
- size_t len = mir_tstrlen(value) + 1;
+ size_t len = mir_wstrlen(value) + 1;
wchar_t* val = new wchar_t[len];
wcscpy_s(val, len, value);
db_set_ts(NULL, BOLTUN_KEY, key, val);
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index bd725b6e8b..d1e1fab75e 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -174,12 +174,12 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM) wchar_t szTemp[32];
GetClassName(hWnd, szTemp, 32);
- if (mir_tstrcmp(szTemp, L"MirandaThumbsWnd") == 0) // hide floating contacts
+ if (mir_wstrcmp(szTemp, L"MirandaThumbsWnd") == 0) // hide floating contacts
{
CallService("FloatingContacts/MainHideAllThumbs", 0, 0);
g_bOldSetting |= OLD_FLTCONT;
}
- else if (mir_tstrcmp(szTemp, L"PopupWnd2") == 0 || mir_tstrcmp(szTemp, L"YAPPWinClass") == 0) // destroy opened popups
+ else if (mir_wstrcmp(szTemp, L"PopupWnd2") == 0 || mir_wstrcmp(szTemp, L"YAPPWinClass") == 0) // destroy opened popups
PUDeletePopup(hWnd);
else
{
@@ -398,7 +398,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara wchar_t szTemp[32];
GetClassName(pCurWnd->hWnd, szTemp, 32);
- if (IsWindow(pCurWnd->hWnd) && mir_tstrcmp(szTemp, L"SysShadow") != 0) // precaution
+ if (IsWindow(pCurWnd->hWnd) && mir_wstrcmp(szTemp, L"SysShadow") != 0) // precaution
ShowWindow(pCurWnd->hWnd, SW_SHOW);
delete pCurWnd; // bye-bye
@@ -503,7 +503,7 @@ static wchar_t *GetBossKeyText(void) BYTE shift = HIBYTE(wHotKey);
static wchar_t buf[128] = { 0 };
- mir_sntprintf(buf, L"%s%s%s%s%s",
+ mir_snwprintf(buf, L"%s%s%s%s%s",
(shift & HOTKEYF_CONTROL) ? L"Ctrl + " : L"",
(shift & HOTKEYF_SHIFT) ? L"Shift + " : L"",
(shift & HOTKEYF_ALT) ? L"Alt + " : L"",
@@ -522,7 +522,7 @@ static int GenMenuInit(WPARAM, LPARAM) // Modify menu item text before to show t {
if (g_hMenuItem) {
wchar_t buf[128];
- mir_sntprintf(buf, L"%s [%s]", TranslateT("Hide"), GetBossKeyText());
+ mir_snwprintf(buf, L"%s [%s]", TranslateT("Hide"), GetBossKeyText());
Menu_ModifyItem(g_hMenuItem, buf);
}
return 0;
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index cc3b479be4..4fc8a9e978 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -231,8 +231,8 @@ bool isContactGoneFor(MCONTACT hContact, int days) ppd.lchContact = hContact;
ppd.lchIcon = IcoLib_GetIcon("enabled_icon");
- mir_sntprintf(ppd.lptzContactName, TranslateT("Hiding %s (%S)"), pcli->pfnGetContactDisplayName(hContact, 0), GetContactProto(hContact));
- mir_sntprintf(ppd.lptzText, TranslateT("%d days since last message"), daysSinceMessage);
+ mir_snwprintf(ppd.lptzContactName, TranslateT("Hiding %s (%S)"), pcli->pfnGetContactDisplayName(hContact, 0), GetContactProto(hContact));
+ mir_snwprintf(ppd.lptzText, TranslateT("%d days since last message"), daysSinceMessage);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
@@ -286,7 +286,7 @@ void ReturnNotify(MCONTACT hContact, wchar_t *message) wchar_t* nick = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
wchar_t tmpMsg[512];
- mir_sntprintf(tmpMsg, L"%s %s", nick, message);
+ mir_snwprintf(tmpMsg, L"%s %s", nick, message);
cle.ptszTooltip = tmpMsg;
pcli->pfnAddEvent(&cle);
}
@@ -323,7 +323,7 @@ void GoneNotify(MCONTACT hContact, wchar_t *message) wchar_t* nick = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
wchar_t tmpMsg[512];
- mir_sntprintf(tmpMsg, L"%s %s", nick, message);
+ mir_snwprintf(tmpMsg, L"%s %s", nick, message);
cle.ptszTooltip = tmpMsg;
cle.flags = CLEF_TCHAR;
pcli->pfnAddEvent(&cle);
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index b0be57b26e..c2bdeb591c 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -327,7 +327,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP ppd.lchIcon = hIcon;
wcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
wchar_t szPreviewText[250];
- mir_sntprintf(szPreviewText, TranslateT("has returned after being absent since %d days"), rand() % 30);
+ mir_snwprintf(szPreviewText, TranslateT("has returned after being absent since %d days"), rand() % 30);
wcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
// Get current popups colors options
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index d17340cfb0..12a70ba570 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -16,7 +16,7 @@ void populateContacts(MCONTACT BPhContact, HWND hwnd2CB) char *szProto = GetContactProto(hContact);
if (szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) {
wchar_t name[300];
- mir_sntprintf(name, L"%s (%s)", pcli->pfnGetContactDisplayName(hContact, 0), _A2T(szProto));
+ mir_snwprintf(name, L"%s (%s)", pcli->pfnGetContactDisplayName(hContact, 0), _A2T(szProto));
int index = SendMessage(hwnd2CB, CB_ADDSTRING, 0, (LPARAM)name);
SendMessage(hwnd2CB, CB_SETITEMDATA, index, hContact);
if (BPhContact == hContact)
@@ -102,7 +102,7 @@ INT_PTR CALLBACK StatusModesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l |(IsDlgButtonChecked(hwnd, IDC_CHECK9)<<8)
|(IsDlgButtonChecked(hwnd, IDC_CHECK10)<<9);
- if (!mir_tstrcmp(type, L"Any")) {
+ if (!mir_wstrcmp(type, L"Any")) {
if (LOWORD(wParam) == IDOK)
db_set_w(wi->hContact, modname, "SendIfMyStatusIsFLAG", flag);
wi->SendIfMy = 0;
@@ -201,7 +201,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)lParam);
getDefaultMessage(hwnd, IDC_MESSAGE, hContact);
- mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_snwprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
return FALSE;
@@ -210,7 +210,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L case IDC_MESSAGE:
if (HIWORD(wParam) == EN_CHANGE) {
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE));
- mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), length);
+ mir_snwprintf(msg, TranslateT("The Message (%d Characters)"), length);
SetDlgItemText(hwnd, GRP_MSG, msg);
}
break;
@@ -258,7 +258,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)wi);
getDefaultMessage(hwnd, IDC_MESSAGE, wi->hContact);
- mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_snwprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
populateSettingsList(GetDlgItem(hwnd, IDC_SETTINGS));
@@ -272,7 +272,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case IDC_MESSAGE:
if (HIWORD(wParam) == EN_CHANGE) {
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE));
- mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), length);
+ mir_snwprintf(msg, TranslateT("The Message (%d Characters)"), length);
SetDlgItemText(hwnd, GRP_MSG, msg);
}
break;
@@ -315,7 +315,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case IDC_DEFAULT:
getDefaultMessage(hwnd, IDC_MESSAGE, wi->hContact);
- mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_snwprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
db_set_w(wi->hContact, modname, "SendIfMyStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfMyStatusIsFLAG",0));
@@ -390,7 +390,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)wi);
getDefaultMessage(hwnd, IDC_MESSAGE, wi->hContact);
- mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_snwprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
populateSettingsList(GetDlgItem(hwnd, IDC_SETTINGS));
SendDlgItemMessage(hwnd, IDC_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG((short)1024, (short)0));
@@ -433,7 +433,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, case IDC_MESSAGE:
if (HIWORD(wParam) == EN_CHANGE) {
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE));
- mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), length);
+ mir_snwprintf(msg, TranslateT("The Message (%d Characters)"), length);
SetDlgItemText(hwnd, GRP_MSG, msg);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
@@ -524,7 +524,7 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_TIMER:
{
wchar_t message[1024];
- mir_sntprintf(message, TranslateT("Pounce being sent to %s in %d seconds"), pcli->pfnGetContactDisplayName(spdps->hContact, 0), spdps->timer);
+ mir_snwprintf(message, TranslateT("Pounce being sent to %s in %d seconds"), pcli->pfnGetContactDisplayName(spdps->hContact, 0), spdps->timer);
SetDlgItemText(hwnd, LBL_CONTACT, message);
}
spdps->timer--;
@@ -582,7 +582,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP {
wchar_t text[2048];
GetDlgItemText(hwnd, IDOK, text, _countof(text));
- if (!mir_tstrcmp(text, TranslateT("Retry"))) {
+ if (!mir_wstrcmp(text, TranslateT("Retry"))) {
GetDlgItemText(hwnd, IDC_MESSAGE, text, _countof(text));
SendPounce(text, hContact);
}
@@ -601,12 +601,12 @@ void CreateMessageAcknowlegedWindow(MCONTACT hContact, int SentSuccess) HWND hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMSEND), 0, PounceSentDlgProc, hContact);
wchar_t msg[256];
if (SentSuccess) {
- mir_sntprintf(msg, TranslateT("Message successfully sent to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(msg, TranslateT("Message successfully sent to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetDlgItemText(hwnd, IDOK, TranslateT("OK"));
ShowWindow(GetDlgItem(hwnd, IDCANCEL), 0);
}
else {
- mir_sntprintf(msg, TranslateT("Message failed to send to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(msg, TranslateT("Message failed to send to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetDlgItemText(hwnd, IDOK, TranslateT("Retry"));
}
SetDlgItemText(hwnd, LBL_CONTACT, msg);
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 0d112acef5..35e6f5d9ba 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -169,7 +169,7 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) if (CheckDate(hContact)) {
if (db_get_w(hContact, modname, "ConfirmTimeout", 0)) {
SendPounceDlgProcStruct *spdps = (SendPounceDlgProcStruct *)mir_alloc(sizeof(SendPounceDlgProcStruct));
- wchar_t *message = mir_tstrdup(dbv.ptszVal); // will get free()ed in the send confirm window proc
+ wchar_t *message = mir_wstrdup(dbv.ptszVal); // will get free()ed in the send confirm window proc
spdps->hContact = hContact;
spdps->message = message;
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMSEND), 0, SendPounceDlgProc, (LPARAM)spdps);
@@ -215,10 +215,10 @@ INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
if (!db_get_ts(hContact, modname, "PounceMsg",&dbv))
{
- wchar_t* newPounce = (wchar_t*)mir_alloc(mir_tstrlen(dbv.ptszVal) + mir_tstrlen(message) + 1);
+ wchar_t* newPounce = (wchar_t*)mir_alloc(mir_wstrlen(dbv.ptszVal) + mir_wstrlen(message) + 1);
if (!newPounce) return 1;
- mir_tstrcpy(newPounce, dbv.ptszVal);
- mir_tstrcat(newPounce, message);
+ mir_wstrcpy(newPounce, dbv.ptszVal);
+ mir_wstrcat(newPounce, message);
db_set_ws(hContact, modname, "PounceMsg", newPounce);
mir_free(newPounce);
db_free(&dbv);
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index 77a43eff9f..ecb5941fea 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -262,14 +262,14 @@ void importCustomStatuses(CSWindow* csw, int result) mir_snprintf(bufTitle, "XStatus%dName", i); if (!db_get_ts(NULL, protoName, bufTitle, &dbv)) { - mir_tstrcpy(si->m_tszTitle, dbv.ptszVal); + mir_wstrcpy(si->m_tszTitle, dbv.ptszVal); db_free(&dbv); } else si->m_tszTitle[0] = 0; mir_snprintf(bufMessage, "XStatus%dMsg", i); if (!db_get_ts(NULL, protoName, bufMessage, &dbv)) { - mir_tstrcpy(si->m_tszMessage, dbv.ptszVal); + mir_wstrcpy(si->m_tszMessage, dbv.ptszVal); db_free(&dbv); } else si->m_tszMessage[0] = 0; @@ -391,10 +391,10 @@ BOOL CSWindow::itemPassedFilter(ListItem< StatusItem >* li) wchar_t filter[MAX_PATH]; GetDlgItemText(m_handle, IDC_FILTER_FIELD, filter, _countof(filter)); - if (mir_tstrlen(filter)) + if (mir_wstrlen(filter)) { wchar_t title[EXTRASTATUS_TITLE_LIMIT], message[EXTRASTATUS_MESSAGE_LIMIT]; - mir_tstrcpy(title, li->m_item->m_tszTitle); mir_tstrcpy(message, li->m_item->m_tszMessage); + mir_wstrcpy(title, li->m_item->m_tszTitle); mir_wstrcpy(message, li->m_item->m_tszMessage); if (strpos(wcslwr(title), wcslwr(filter)) == -1) if (strpos(wcslwr(message), wcslwr(filter)) == -1) return FALSE; @@ -532,13 +532,13 @@ void CSAMWindow::checkFieldLimit(WORD action, WORD item) GetDlgItemText(m_handle, item, ptszInputText, limit + 8); - if (mir_tstrlen(ptszInputText) > limit) + if (mir_wstrlen(ptszInputText) > limit) { wchar_t tszPopupTip[MAX_PATH]; EDITBALLOONTIP ebt = { 0 }; ebt.cbStruct = sizeof(ebt); ebt.pszTitle = TranslateT("Warning"); - mir_sntprintf(tszPopupTip, TranslateT("This field doesn't accept string longer than %d characters. The string will be truncated."), limit); + mir_snwprintf(tszPopupTip, TranslateT("This field doesn't accept string longer than %d characters. The string will be truncated."), limit); ebt.pszText = tszPopupTip; ebt.ttiIcon = TTI_WARNING; SendDlgItemMessage(m_handle, item, EM_SHOWBALLOONTIP, 0, (LPARAM)&ebt); @@ -578,10 +578,10 @@ void CSAMWindow::checkItemValidity() cs.ptszName = tszTitle; cs.wParam = &i; if (CallProtoService(pdescr->szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) == 0) - mir_tstrncpy(m_item->m_tszTitle, TranslateTS(tszTitle), _countof(m_item->m_tszTitle)); + mir_wstrncpy(m_item->m_tszTitle, TranslateTS(tszTitle), _countof(m_item->m_tszTitle)); - if (mir_tstrcmp(m_item->m_tszMessage, tszInputMessage)) - mir_tstrcpy(m_item->m_tszMessage, tszInputMessage), m_bChanged = true; + if (mir_wstrcmp(m_item->m_tszMessage, tszInputMessage)) + mir_wstrcpy(m_item->m_tszMessage, tszInputMessage), m_bChanged = true; } CSListView::CSListView(HWND hwnd, CSWindow* parent) @@ -713,10 +713,10 @@ int CSItemsList::compareItems(const StatusItem* p1, const StatusItem* p2) else if (p1->m_iIcon < p2->m_iIcon) icoRes = -1; - result = mir_tstrcmp(p1->m_tszTitle, p2->m_tszTitle); + result = mir_wstrcmp(p1->m_tszTitle, p2->m_tszTitle); ttlRes = result; - result = mir_tstrcmp(p1->m_tszMessage, p2->m_tszMessage); + result = mir_wstrcmp(p1->m_tszMessage, p2->m_tszMessage); msgRes = result; if (!icoRes && !ttlRes && !msgRes) @@ -748,14 +748,14 @@ void CSItemsList::loadItems(char *protoName) mir_snprintf(dbSetting, "%s_Item%dTitle", protoName, i); if (!getTString(dbSetting, &dbv)) { - mir_tstrcpy(item->m_tszTitle, dbv.ptszVal); + mir_wstrcpy(item->m_tszTitle, dbv.ptszVal); db_free(&dbv); } else item->m_tszTitle[0] = 0; mir_snprintf(dbSetting, "%s_Item%dMessage", protoName, i); if (!getTString(dbSetting, &dbv)) { - mir_tstrcpy(item->m_tszMessage, dbv.ptszVal); + mir_wstrcpy(item->m_tszMessage, dbv.ptszVal); db_free(&dbv); } else item->m_tszMessage[0] = 0; diff --git a/plugins/CSList/src/stdafx.h b/plugins/CSList/src/stdafx.h index a99e42fe2d..e64119f5ea 100644 --- a/plugins/CSList/src/stdafx.h +++ b/plugins/CSList/src/stdafx.h @@ -110,16 +110,16 @@ struct StatusItem // list item structure StatusItem()
{
m_iIcon = 0;
- mir_tstrcpy(m_tszTitle, L"");
- mir_tstrcpy(m_tszMessage, L"");
+ mir_wstrcpy(m_tszTitle, L"");
+ mir_wstrcpy(m_tszMessage, L"");
m_bFavourite = FALSE;
}
StatusItem(const StatusItem& p)
{
m_iIcon = p.m_iIcon;
- mir_tstrcpy(m_tszTitle, p.m_tszTitle);
- mir_tstrcpy(m_tszMessage, p.m_tszMessage);
+ mir_wstrcpy(m_tszTitle, p.m_tszTitle);
+ mir_wstrcpy(m_tszMessage, p.m_tszMessage);
m_bFavourite = p.m_bFavourite;
}
diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp index c0d2b34140..be5c8f100d 100644 --- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp +++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp @@ -101,14 +101,14 @@ int ModulesLoaded(WPARAM, LPARAM) for (int i = 0; i < bLayNum; i++) {
LPTSTR ptszCurrLayout = GenerateLayoutString(hklLayouts[i]);
LPSTR ptszTemp = GetNameOfLayout(hklLayouts[i]);
- ptrT tszValue(db_get_tsa(NULL, ModuleName, ptszTemp));
+ ptrW tszValue(db_get_tsa(NULL, ModuleName, ptszTemp));
if (tszValue == 0)
ptszLayStrings[i] = ptszCurrLayout;
- else if (!mir_tstrcmp(tszValue, ptszEmptySting))
+ else if (!mir_wstrcmp(tszValue, ptszEmptySting))
ptszLayStrings[i] = ptszCurrLayout;
else {
ptszLayStrings[i] = tszValue.detach();
- if (!mir_tstrcmp(ptszCurrLayout, ptszLayStrings[i]))
+ if (!mir_wstrcmp(ptszCurrLayout, ptszLayStrings[i]))
db_unset(NULL, ModuleName, ptszTemp);
mir_free(ptszCurrLayout);
}
diff --git a/plugins/ChangeKeyboardLayout/src/options.cpp b/plugins/ChangeKeyboardLayout/src/options.cpp index 1f1a5af025..a610cef0fe 100644 --- a/plugins/ChangeKeyboardLayout/src/options.cpp +++ b/plugins/ChangeKeyboardLayout/src/options.cpp @@ -205,12 +205,12 @@ INT_PTR CALLBACK DlgMainProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, LP GetDlgItemText(hWnd, IDC_EDIT_SET, ptszFormLay, MaxTextSize);
i = SendDlgItemMessage(hWnd, IDC_COMBO_LANG, CB_GETCURSEL, 0, 0);
ptszMemLay = ptszLayStrings[i];
- if (mir_tstrcmp(ptszMemLay, ptszFormLay) != 0) {
- mir_tstrcpy(ptszMemLay, ptszFormLay);
+ if (mir_wstrcmp(ptszMemLay, ptszFormLay) != 0) {
+ mir_wstrcpy(ptszMemLay, ptszFormLay);
ptszGenLay = GenerateLayoutString(hklLayouts[i]);
pszNameLay = GetNameOfLayout(hklLayouts[i]);
- if (mir_tstrcmp(ptszMemLay, ptszGenLay) != 0)
+ if (mir_wstrcmp(ptszMemLay, ptszGenLay) != 0)
db_set_ts(NULL, ModuleName, pszNameLay, ptszMemLay);
else
db_unset(NULL, ModuleName, pszNameLay);
@@ -382,7 +382,7 @@ INT_PTR CALLBACK DlgPopupsProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, pdtData.iSeconds = poOptionsTemp.bTimeout;
break;
}
- mir_tstrcpy(ptszPopupPreviewText, pdtData.lptzText);
+ mir_wstrcpy(ptszPopupPreviewText, pdtData.lptzText);
pdtData.PluginData = ptszPopupPreviewText;
pdtData.lchIcon = hPopupIcon;
poOptions.paActions[0].lchIcon = hCopyIcon;
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp index ed1cdf4460..c8c44b1042 100644 --- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp +++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp @@ -31,7 +31,7 @@ LPTSTR GeTStringFromStreamData(EditStreamData *esd) LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
LPTSTR ptszTemp = (wchar_t*)esd->pbBuff;
- for (i = k = 0; i < mir_tstrlen(ptszTemp); i++) {
+ for (i = k = 0; i < mir_wstrlen(ptszTemp); i++) {
if ((ptszTemp[i] == 0x0A) || (ptszTemp[i] == 0x2028))
ptszOutText[k++] = 0x0D;
else if (ptszTemp[i] == 0x0D) {
@@ -52,8 +52,8 @@ BOOL CopyTextToClipboard(LPTSTR ptszText) return FALSE;
EmptyClipboard();
- HGLOBAL hCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(ptszText) + 1)*sizeof(wchar_t));
- mir_tstrcpy((wchar_t*)GlobalLock(hCopy), ptszText);
+ HGLOBAL hCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_wstrlen(ptszText) + 1)*sizeof(wchar_t));
+ mir_wstrcpy((wchar_t*)GlobalLock(hCopy), ptszText);
GlobalUnlock(hCopy);
SetClipboardData(CF_UNICODETEXT, hCopy);
CloseClipboard();
@@ -97,7 +97,7 @@ LPTSTR GenerateLayoutString(HKL hklLayout) ptszTemp[0] = 0;
DWORD i;
- for (i = 0; i < mir_tstrlen(ptszKeybEng); i++) {
+ for (i = 0; i < mir_wstrlen(ptszKeybEng); i++) {
SHORT shVirtualKey = VkKeyScanEx(ptszKeybEng[i], hklEng);
UINT iScanCode = MapVirtualKeyEx(shVirtualKey & 0x00FF, 0, hklEng);
@@ -139,9 +139,9 @@ LPTSTR GetLayoutString(HKL hklLayout) LPTSTR ChangeTextCase(LPCTSTR ptszInText)
{
LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
- mir_tstrcpy(ptszOutText, ptszInText);
+ mir_wstrcpy(ptszOutText, ptszInText);
- for (DWORD i = 0; i < mir_tstrlen(ptszInText); i++) {
+ for (DWORD i = 0; i < mir_wstrlen(ptszInText); i++) {
CharUpperBuff(&ptszOutText[i], 1);
if (ptszOutText[i] == ptszInText[i])
CharLowerBuff(&ptszOutText[i], 1);
@@ -152,7 +152,7 @@ LPTSTR ChangeTextCase(LPCTSTR ptszInText) LPTSTR ChangeTextLayout(LPCTSTR ptszInText, HKL hklCurLay, HKL hklToLay, BOOL TwoWay)
{
LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
- mir_tstrcpy(ptszOutText, ptszInText);
+ mir_wstrcpy(ptszOutText, ptszInText);
if (hklCurLay == NULL || hklToLay == NULL)
return ptszOutText;
@@ -162,20 +162,20 @@ LPTSTR ChangeTextLayout(LPCTSTR ptszInText, HKL hklCurLay, HKL hklToLay, BOOL Tw if (ptszKeybCur == 0 || ptszKeybNext == 0)
return ptszOutText;
- for (DWORD i = 0; i < mir_tstrlen(ptszInText); i++) {
+ for (DWORD i = 0; i < mir_wstrlen(ptszInText); i++) {
BOOL Found = FALSE;
- for (DWORD j = 0; j < mir_tstrlen(ptszKeybCur) && !Found; j++)
+ for (DWORD j = 0; j < mir_wstrlen(ptszKeybCur) && !Found; j++)
if (ptszKeybCur[j] == ptszInText[i]) {
Found = TRUE;
- if (mir_tstrlen(ptszKeybNext) >= j)
+ if (mir_wstrlen(ptszKeybNext) >= j)
ptszOutText[i] = ptszKeybNext[j];
}
if (TwoWay && !Found)
- for (DWORD j = 0; j < mir_tstrlen(ptszKeybNext) && !Found; j++)
+ for (DWORD j = 0; j < mir_wstrlen(ptszKeybNext) && !Found; j++)
if (ptszKeybNext[j] == ptszInText[i]) {
Found = TRUE;
- if (mir_tstrlen(ptszKeybCur) >= j)
+ if (mir_wstrlen(ptszKeybCur) >= j)
ptszOutText[i] = ptszKeybCur[j];
}
}
@@ -188,7 +188,7 @@ HKL GetLayoutOfText(LPCTSTR ptszInText) LPTSTR ptszKeybBuff = ptszLayStrings[0];
DWORD dwMaxSymbols = 0, dwTemp = 0;
- for (DWORD j = 0; j < mir_tstrlen(ptszInText); j++)
+ for (DWORD j = 0; j < mir_wstrlen(ptszInText); j++)
if (wcschr(ptszKeybBuff, ptszInText[j]) != NULL)
++dwMaxSymbols;
@@ -196,7 +196,7 @@ HKL GetLayoutOfText(LPCTSTR ptszInText) ptszKeybBuff = ptszLayStrings[i];
DWORD dwCountSymbols = 0;
- for (DWORD j = 0; j<mir_tstrlen(ptszInText); j++)
+ for (DWORD j = 0; j<mir_wstrlen(ptszInText); j++)
if (wcschr(ptszKeybBuff, ptszInText[j]) != NULL)
++dwCountSymbols;
@@ -218,7 +218,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) {
HKL hklCurLay = 0, hklToLay = 0;
- ptrT ptszInText;
+ ptrW ptszInText;
CHARRANGE crSelection = { 0 }, crTemp = { 0 };
DWORD dwStartWord, dwEndWord;
int i, iRes;
@@ -256,7 +256,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) }
if (WindowType == WTYPE_Unknown) {
- ptrT ptszTemp((LPTSTR)mir_alloc(255 * sizeof(wchar_t)));
+ ptrW ptszTemp((LPTSTR)mir_alloc(255 * sizeof(wchar_t)));
i = GetClassName(hTextWnd, ptszTemp, 255);
ptszTemp[i] = 0;
@@ -297,7 +297,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) }
}
if (WindowType == WTYPE_Edit) {
- ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
+ ptrW ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
ptszInText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
iRes = GetWindowText(hTextWnd, ptszTemp, MaxTextSize);
if (!IsBadStringPtr(ptszInText, MaxTextSize) && (iRes > 0)) {
@@ -339,7 +339,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) if (!IsBadStringPtr(ptszInText, MaxTextSize) && (iRes > 0)) {
crTemp.cpMin = 0;
- crTemp.cpMax = (int)mir_tstrlen(ptszInText);
+ crTemp.cpMax = (int)mir_wstrlen(ptszInText);
}
else {
SendMessage(hTextWnd, EM_EXSETSEL, 0, (LPARAM)&crSelection);
@@ -351,7 +351,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) // Ïîëó÷àåì òåêóùåå ñëîâî
if (CurrentWord) {
for (dwStartWord = crSelection.cpMin; (dwStartWord > 0) && (wcschr(ptszSeparators, ptszInText[dwStartWord - 1]) == NULL); dwStartWord--);
- for (dwEndWord = crSelection.cpMin; (dwEndWord < (mir_tstrlen(ptszInText))) && (wcschr(ptszSeparators, ptszInText[dwEndWord]) == NULL); dwEndWord++);
+ for (dwEndWord = crSelection.cpMin; (dwEndWord < (mir_wstrlen(ptszInText))) && (wcschr(ptszSeparators, ptszInText[dwEndWord]) == NULL); dwEndWord++);
crTemp.cpMin = dwStartWord;
crTemp.cpMax = dwEndWord;
@@ -374,12 +374,12 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) }
if (WindowType == WTYPE_Edit) {
- ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
+ ptrW ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
wcsncpy(ptszTemp, &ptszInText[crTemp.cpMin], crTemp.cpMax - crTemp.cpMin);
ptszTemp[crTemp.cpMax - crTemp.cpMin] = 0;
- mir_tstrcpy(ptszInText, ptszTemp);
+ mir_wstrcpy(ptszInText, ptszTemp);
- if (mir_tstrlen(ptszInText) == 0) {
+ if (mir_wstrlen(ptszInText) == 0) {
SendMessage(hTextWnd, EM_EXSETSEL, 0, (LPARAM)&crSelection);
SendMessage(hTextWnd, WM_SETREDRAW, TRUE, 0);
InvalidateRect(hTextWnd, NULL, FALSE);
@@ -403,7 +403,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) // Ëîã Èåâüþ è ÕèñòîðèÏÏ â ðåæèìå ýìóëÿöèè Èåâüþ è ïîëÿ òîëüêî äëÿ ÷òåíèÿ.
if (WindowType != WTYPE_Unknown && !IsBadStringPtr(ptszInText, MaxTextSize))
if (WindowIsReadOnly) {
- ptrT ptszMBox((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
+ ptrW ptszMBox((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
ptszMBox[0] = 0;
if (TextOperation == TOT_Layout) {
@@ -416,13 +416,13 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) else {
for (i = 0; i < bLayNum; i++)
if (hklLayouts[i] != hklCurLay) {
- if (mir_tstrlen(ptszMBox) != 0)
- mir_tstrcat(ptszMBox, L"\n\n");
- ptrT ptszTemp(GetShortNameOfLayout(hklLayouts[i]));
- mir_tstrcat(ptszMBox, ptszTemp);
- mir_tstrcat(ptszMBox, L":\n");
- ptrT ptszOutText(ChangeTextLayout(ptszInText, hklCurLay, hklLayouts[i], FALSE));
- mir_tstrcat(ptszMBox, ptszOutText);
+ if (mir_wstrlen(ptszMBox) != 0)
+ mir_wstrcat(ptszMBox, L"\n\n");
+ ptrW ptszTemp(GetShortNameOfLayout(hklLayouts[i]));
+ mir_wstrcat(ptszMBox, ptszTemp);
+ mir_wstrcat(ptszMBox, L":\n");
+ ptrW ptszOutText(ChangeTextLayout(ptszInText, hklCurLay, hklLayouts[i], FALSE));
+ mir_wstrcat(ptszMBox, ptszOutText);
}
}
}
@@ -446,7 +446,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) //-------------------------------Ïîêàæåì ïîïàïû------------------------------------------
if (moOptions.ShowPopup) {
LPTSTR ptszPopupText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
- mir_tstrcpy(ptszPopupText, ptszMBox);
+ mir_wstrcpy(ptszPopupText, ptszMBox);
POPUPDATAT_V2 pdtData = { 0 };
pdtData.cbSize = sizeof(pdtData);
@@ -494,7 +494,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) }
//------------------Ðåäàêòèðóåìûå ïîëÿ ----------------------------
else {
- ptrT ptszOutText;
+ ptrW ptszOutText;
if (TextOperation == TOT_Layout) {
hklCurLay = GetLayoutOfText(ptszInText);
hklToLay = GetNextLayout(hklCurLay);
@@ -510,7 +510,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) SendMessage(hTextWnd, EM_EXSETSEL, 0, (LPARAM)&crSelection);
}
else {
- ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
+ ptrW ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
GetWindowText(hTextWnd, ptszTemp, MaxTextSize);
for (i = crTemp.cpMin; i < crTemp.cpMax; i++)
ptszTemp[i] = ptszOutText[i - crTemp.cpMin];
diff --git a/plugins/ClientChangeNotify/src/CString.cpp b/plugins/ClientChangeNotify/src/CString.cpp index 2427c06aea..4f4064d60a 100644 --- a/plugins/ClientChangeNotify/src/CString.cpp +++ b/plugins/ClientChangeNotify/src/CString.cpp @@ -280,7 +280,7 @@ CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{
- ptrT p( db_get_tsa(hContact, szModule, szSetting));
+ ptrW p( db_get_tsa(hContact, szModule, szSetting));
return TCString(p == NULL ? szDefaultValue : p);
}
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 33e4e1f5d5..f70270d757 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -149,11 +149,11 @@ void ShowPopup(SHOWPOPUP_DATA *sd) {
TCString PopupText;
if (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_SHOWPREVCLIENT)) {
- mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s (was %s)"), (const wchar_t*)sd->MirVer, (const wchar_t*)sd->OldMirVer);
+ mir_snwprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s (was %s)"), (const wchar_t*)sd->MirVer, (const wchar_t*)sd->OldMirVer);
PopupText.ReleaseBuffer();
}
else {
- mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s"), (const wchar_t*)sd->MirVer);
+ mir_snwprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s"), (const wchar_t*)sd->MirVer);
PopupText.ReleaseBuffer();
}
@@ -257,7 +257,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (hContact) {
TCString ClientName;
if (PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWPREVCLIENT) && sd.OldMirVer.GetLen()) {
- mir_sntprintf(ClientName.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("%s (was %s)"), (const wchar_t*)sd.MirVer, (const wchar_t*)sd.OldMirVer);
+ mir_snwprintf(ClientName.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("%s (was %s)"), (const wchar_t*)sd.MirVer, (const wchar_t*)sd.OldMirVer);
ClientName.ReleaseBuffer();
}
else ClientName = sd.MirVer;
diff --git a/plugins/ClientChangeNotify/src/Misc.h b/plugins/ClientChangeNotify/src/Misc.h index 7d1b1eb238..11b323ada1 100644 --- a/plugins/ClientChangeNotify/src/Misc.h +++ b/plugins/ClientChangeNotify/src/Misc.h @@ -26,8 +26,8 @@ __inline void ShowMsg(wchar_t *FirstLine, wchar_t *SecondLine = L"", bool IsErro {
POPUPDATAT ppd = {0};
ppd.lchIcon = LoadIcon(NULL, IsErrorMsg ? IDI_EXCLAMATION : IDI_INFORMATION);
- mir_tstrcpy(ppd.lptzContactName, FirstLine);
- mir_tstrcpy(ppd.lptzText, SecondLine);
+ mir_wstrcpy(ppd.lptzContactName, FirstLine);
+ mir_wstrcpy(ppd.lptzText, SecondLine);
ppd.colorBack = IsErrorMsg ? 0x0202E3 : 0xE8F1FD;
ppd.colorText = IsErrorMsg ? 0xE8F1FD : 0x000000;
ppd.iSeconds = Timeout;
@@ -44,7 +44,7 @@ __inline void ShowLog(TCString &LogFilePath) if (Result <= 32) // Error
{
wchar_t szError[64];
- mir_sntprintf(szError, TranslateT("Error #%d"), Result);
+ mir_snwprintf(szError, TranslateT("Error #%d"), Result);
ShowMsg(szError, TranslateT("Can't open log file ") + LogFilePath, true);
}
}
diff --git a/plugins/Clist_blind/src/clcpaint.cpp b/plugins/Clist_blind/src/clcpaint.cpp index 0c9824e4eb..e70a8e024c 100644 --- a/plugins/Clist_blind/src/clcpaint.cpp +++ b/plugins/Clist_blind/src/clcpaint.cpp @@ -304,14 +304,14 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) ChangeToFont(hdcMem, dat, FONTID_OFFLINE, &fontHeight);
else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
- GetTextExtentPoint32(hdcMem, cc->szText, (int)mir_tstrlen(cc->szText), &textSize);
+ GetTextExtentPoint32(hdcMem, cc->szText, (int)mir_wstrlen(cc->szText), &textSize);
width = textSize.cx;
if (cc->type == CLCIT_GROUP) {
szCounts = pcli->pfnGetGroupCountsText(dat, cc);
if (szCounts[0]) {
GetTextExtentPoint32(hdcMem, L" ", 1, &spaceSize);
ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
- GetTextExtentPoint32(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &countsSize);
+ GetTextExtentPoint32(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &countsSize);
width += spaceSize.cx + countsSize.cx;
}
}
@@ -374,7 +374,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) rc.right = rc.left + ((clRect.right - rc.left - textSize.cx) >> 1) - 3;
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
TextOut(hdcMem, rc.right + 3, y + ((dat->rowHeight - fontHeight) >> 1), cc->szText,
- (int)mir_tstrlen(cc->szText));
+ (int)mir_wstrlen(cc->szText));
rc.left = rc.right + 6 + textSize.cx;
rc.right = clRect.right;
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
@@ -390,7 +390,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) if (rc.right < rc.left + 4)
rc.right = clRect.right + 1;
else
- TextOut(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, (int)mir_tstrlen(szCounts));
+ TextOut(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, (int)mir_wstrlen(szCounts));
ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
@@ -398,12 +398,12 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) SetHotTrackColour(hdcMem, dat);
rc.right--;
ExtTextOut(hdcMem, rc.left, rc.top, ETO_CLIPPED, &rc, cc->szText,
- (int)mir_tstrlen(cc->szText), NULL);
+ (int)mir_wstrlen(cc->szText), NULL);
}
else
TextOut(hdcMem, dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace,
y + ((dat->rowHeight - fontHeight) >> 1), cc->szText,
- (int)mir_tstrlen(cc->szText));
+ (int)mir_wstrlen(cc->szText));
if (dat->exStyle & CLS_EX_LINEWITHGROUPS) {
rc.top = y + (dat->rowHeight >> 1);
rc.bottom = rc.top + 2;
@@ -426,7 +426,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) if (cc->type != CLCIT_DIVIDER) {
wchar_t *szText = cc->szText;
RECT rc;
- int qlen = (int)mir_tstrlen(dat->szQuickSearch);
+ int qlen = (int)mir_wstrlen(dat->szQuickSearch);
SetTextColor(hdcMem, dat->quickSearchColour);
rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace;
rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
diff --git a/plugins/Clist_blind/src/contact.cpp b/plugins/Clist_blind/src/contact.cpp index 3adbd0c4da..6fa199fdd0 100644 --- a/plugins/Clist_blind/src/contact.cpp +++ b/plugins/Clist_blind/src/contact.cpp @@ -90,5 +90,5 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2) nameb = pcli->pfnGetContactDisplayName(b, 0);
//otherwise just compare names
- return mir_tstrcmpi(namea, nameb);
+ return mir_wstrcmpi(namea, nameb);
}
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index 30ccfa6c0c..d1889144f1 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -188,15 +188,15 @@ wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* set else if (dbv.type == DBVT_UTF8)
MultiByteToWideChar(CP_UTF8, 0, dbv.pszVal, -1, out, (int)len);
else if (dbv.type == DBVT_WCHAR)
- mir_tstrncpy(out, dbv.pwszVal, (int)len);
+ mir_wstrncpy(out, dbv.pwszVal, (int)len);
else if (def != NULL)
- mir_tstrncpy(out, def, (int)len);
+ mir_wstrncpy(out, def, (int)len);
db_free(&dbv);
}
else {
if (def != NULL)
- mir_tstrncpy(out, def, (int)len);
+ mir_wstrncpy(out, def, (int)len);
}
return out;
@@ -260,7 +260,7 @@ wchar_t * ParseText(const wchar_t *text, const wchar_t **variables, size_t variablesSize,
const wchar_t **data, size_t dataSize)
{
- size_t length = mir_tstrlen(text);
+ size_t length = mir_wstrlen(text);
size_t nextPos = 0;
StringHelper ret = { 0 };
size_t i;
@@ -287,10 +287,10 @@ wchar_t * ParseText(const wchar_t *text, // See if can find it
for (j = 0; j < size; j++) {
- size_t vlen = mir_tstrlen(variables[j]);
+ size_t vlen = mir_wstrlen(variables[j]);
if (wcsnicmp(&text[i], variables[j], vlen) == 0) {
- if (CopyData(&ret, data[j], mir_tstrlen(data[j])))
+ if (CopyData(&ret, data[j], mir_wstrlen(data[j])))
return NULL;
i += vlen - 1;
@@ -423,7 +423,7 @@ wchar_t* GetStatusName(struct ClcContact *item) // Get status name
status = db_get_w(item->hContact, item->proto, "Status", ID_STATUS_OFFLINE);
- mir_tstrncpy(status_name, pcli->pfnGetStatusModeDescription(status, 0), _countof(status_name));
+ mir_wstrncpy(status_name, pcli->pfnGetStatusModeDescription(status, 0), _countof(status_name));
return status_name;
}
@@ -457,7 +457,7 @@ wchar_t* GetProtoName(struct ClcContact *item) proto_name[0] = '\0';
if (item->hContact == NULL || item->proto == NULL) {
- mir_tstrncpy(proto_name, TranslateT("Unknown protocol"), _countof(proto_name));
+ mir_wstrncpy(proto_name, TranslateT("Unknown protocol"), _countof(proto_name));
return proto_name;
}
@@ -465,14 +465,14 @@ wchar_t* GetProtoName(struct ClcContact *item) if (acc == NULL) {
#ifdef UNICODE
CallProtoService(item->proto, PS_GETNAME, sizeof(description), (LPARAM)description);
- mir_sntprintf(proto_name, L"%S", description);
+ mir_snwprintf(proto_name, L"%S", description);
#else
CallProtoService(item->proto, PS_GETNAME, sizeof(proto_name), (LPARAM)proto_name);
#endif
return proto_name;
}
- mir_tstrncpy(proto_name, acc->tszAccountName, _countof(proto_name));
+ mir_wstrncpy(proto_name, acc->tszAccountName, _countof(proto_name));
return proto_name;
}
@@ -539,13 +539,13 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) };
if (szCounts[0] != '\0')
- mir_sntprintf(count, L"%s ", szCounts);
+ mir_snwprintf(count, L"%s ", szCounts);
else
count[0] = '\0';
wchar_t *txt = ParseText(template_group, t, _countof(t), v, _countof(v));
if (txt != NULL)
- mir_tstrncpy(text, txt, size);
+ mir_wstrncpy(text, txt, size);
mir_free(txt);
}
break;
@@ -567,17 +567,17 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) wchar_t *txt = ParseText(template_contact, t, _countof(t), v, _countof(v));
if (txt != NULL)
- mir_tstrncpy(text, txt, size);
+ mir_wstrncpy(text, txt, size);
mir_free(txt);
}
break;
case CLCIT_DIVIDER:
- mir_sntprintf(text, size, template_divider, item->szText);
+ mir_snwprintf(text, size, template_divider, item->szText);
break;
case CLCIT_INFO:
- mir_sntprintf(text, size, template_info, item->szText);
+ mir_snwprintf(text, size, template_info, item->szText);
break;
}
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index 38d402c835..4cd01abef0 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -681,7 +681,7 @@ static int LocateStorePosition(int Frameid, int maxstored) if (db_get_ts(NULL, CLUIFrameModule, settingname, &dbv))
continue;
- if (mir_tstrcmpi(dbv.ptszVal, g_pfwFrames[Frameid].name) == 0) {
+ if (mir_wstrcmpi(dbv.ptszVal, g_pfwFrames[Frameid].name) == 0) {
db_free(&dbv);
return i;
}
@@ -1049,9 +1049,9 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam) mir_free(fw.name);
if (bUnicodeText)
- fw.name = mir_tstrdup((LPTSTR)lParam);
+ fw.name = mir_wstrdup((LPTSTR)lParam);
else
- fw.name = mir_a2t((char *)lParam);
+ fw.name = mir_a2u((char *)lParam);
return 0;
case FO_TBNAME:
@@ -1060,9 +1060,9 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam) mir_free(fw.TitleBar.tbname);
if (bUnicodeText)
- fw.TitleBar.tbname = mir_tstrdup((LPTSTR)lParam);
+ fw.TitleBar.tbname = mir_wstrdup((LPTSTR)lParam);
else
- fw.TitleBar.tbname = mir_a2t((char*)lParam);
+ fw.TitleBar.tbname = mir_a2u((char*)lParam);
if (fw.floating && (fw.TitleBar.tbname != NULL))
SetWindowText(fw.ContainerWnd, fw.TitleBar.tbname);
@@ -1075,9 +1075,9 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam) if (fw.TitleBar.tooltip != NULL)
mir_free_and_nil(fw.TitleBar.tooltip);
if (bUnicodeText)
- fw.TitleBar.tooltip = mir_tstrdup((LPTSTR)lParam);
+ fw.TitleBar.tooltip = mir_wstrdup((LPTSTR)lParam);
else
- fw.TitleBar.tooltip = mir_a2t((char*)lParam);
+ fw.TitleBar.tooltip = mir_a2u((char*)lParam);
UpdateTBToolTip(pos);
return 0;
@@ -1568,13 +1568,13 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) g_pfwFrames[g_nFramesCount].name = (LPTSTR)mir_alloc(255 * sizeof(wchar_t));
GetClassName(g_pfwFrames[g_nFramesCount].hWnd, g_pfwFrames[g_nFramesCount].name, 255);
}
- else g_pfwFrames[g_nFramesCount].name = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->wname) : mir_a2t(clfrm->name);
+ else g_pfwFrames[g_nFramesCount].name = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->wname) : mir_a2u(clfrm->name);
if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname == NULL
|| ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->TBwname) : mir_strlen(clfrm->TBname)) == 0)
- g_pfwFrames[g_nFramesCount].TitleBar.tbname = mir_tstrdup(g_pfwFrames[g_nFramesCount].name);
+ g_pfwFrames[g_nFramesCount].TitleBar.tbname = mir_wstrdup(g_pfwFrames[g_nFramesCount].name);
else
- g_pfwFrames[g_nFramesCount].TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->TBwname) : mir_a2t(clfrm->TBname);
+ g_pfwFrames[g_nFramesCount].TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->TBwname) : mir_a2u(clfrm->TBname);
g_pfwFrames[g_nFramesCount].needhide = FALSE;
g_pfwFrames[g_nFramesCount].TitleBar.ShowTitleBar = (clfrm->Flags & F_SHOWTB ? TRUE : FALSE);
@@ -2362,7 +2362,7 @@ int OnFrameTitleBarBackgroundChange(WPARAM, LPARAM) }
if (g_CluiData.fDisableSkinEngine) {
if (db_get_b(NULL, "FrameTitleBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrT tszBitmapName(db_get_tsa(NULL, "FrameTitleBar", "BkBitmap"));
+ ptrW tszBitmapName(db_get_tsa(NULL, "FrameTitleBar", "BkBitmap"));
if (tszBitmapName)
sttBmpBackground = Bitmap_Load(tszBitmapName);
}
@@ -2552,7 +2552,7 @@ int DrawTitleBar(HDC hdcMem2, RECT *rect, int Frameid) textrc.left += GetSystemMetrics(SM_CXSMICON) + 2;
textrc.top += 2;
}
- ske_TextOut(hdcMem, textrc.left, textrc.top, g_pfwFrames[pos].TitleBar.tbname, (int)mir_tstrlen(g_pfwFrames[pos].TitleBar.tbname));
+ ske_TextOut(hdcMem, textrc.left, textrc.top, g_pfwFrames[pos].TitleBar.tbname, (int)mir_wstrlen(g_pfwFrames[pos].TitleBar.tbname));
if (!AlignCOLLIconToLeft)
ske_DrawIconEx(hdcMem, g_pfwFrames[pos].TitleBar.wndSize.right - GetSystemMetrics(SM_CXSMICON) - 2, rc.top + ((g_nTitleBarHeight >> 1) - (GetSystemMetrics(SM_CXSMICON) >> 1)), g_pfwFrames[pos].collapsed ? Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN) : Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT), GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
@@ -2735,7 +2735,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam if (pos != -1) {
int oldflags;
- mir_sntprintf(TBcapt, L"%s - h:%d, vis:%d, fl:%d, fl:(%d,%d,%d,%d),or: %d",
+ mir_snwprintf(TBcapt, L"%s - h:%d, vis:%d, fl:%d, fl:(%d,%d,%d,%d),or: %d",
g_pfwFrames[pos].name, g_pfwFrames[pos].height, g_pfwFrames[pos].visible, g_pfwFrames[pos].floating,
g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y,
g_pfwFrames[pos].FloatingSize.x, g_pfwFrames[pos].FloatingSize.y,
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index 9eb5a578f8..74e4809ab5 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -153,7 +153,7 @@ static int _AniAva_SortAvatarInfo(const ANIAVA_INFO *aai1, const ANIAVA_INFO *aa {
int res;
if (aai1 && aai1->tcsFilename && aai2 && aai2->tcsFilename)
- res = mir_tstrcmpi(aai2->tcsFilename, aai1->tcsFilename);
+ res = mir_wstrcmpi(aai2->tcsFilename, aai1->tcsFilename);
else {
int a1 = (aai1 != NULL && aai1->tcsFilename != NULL);
int a2 = (aai2 != NULL && aai2->tcsFilename != NULL);
@@ -351,7 +351,7 @@ static int _AniAva_LoadAvatarFromImage(wchar_t * szFileName, int width, int heig int idx = s_AniAvatarList.getIndex(&aai);
if (idx == -1) { //item not present in list
paai = (ANIAVA_INFO *)mir_calloc(sizeof(ANIAVA_INFO));
- paai->tcsFilename = mir_tstrdup(szFileName);
+ paai->tcsFilename = mir_wstrdup(szFileName);
paai->dwAvatarUniqId = rand();
// get image strip
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 95e2a7f196..2406754e47 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -79,7 +79,7 @@ void CSmileyString::AddListeningToIcon(ClcData *dat, wchar_t *szText) if (szText == NULL) return; - int text_size = (int)mir_tstrlen(szText); + int text_size = (int)mir_wstrlen(szText); plText = List_Create(0, 1); @@ -180,7 +180,7 @@ void CSmileyString::ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, wchar_t * if (!dat->text_replace_smileys || !replace_smileys || szText == NULL) return; - int text_size = (int)mir_tstrlen(szText); + int text_size = (int)mir_wstrlen(szText); // Call service for the first time to see if needs to be used... SMADD_BATCHPARSE2 sp = { 0 }; @@ -283,7 +283,7 @@ int GetStatusName(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xstat if (!noAwayMsg && !noXstatus && xstatus_has_priority && pdnce->hContact && pdnce->m_pszProto) { DBVARIANT dbv = { 0 }; if (!db_get_ts(pdnce->hContact, pdnce->m_pszProto, "XStatusName", &dbv)) { - //mir_tstrncpy(text, dbv.pszVal, text_size); + //mir_wstrncpy(text, dbv.pszVal, text_size); CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1); db_free(&dbv); @@ -295,7 +295,7 @@ int GetStatusName(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xstat // Get Status name wchar_t *tmp = pcli->pfnGetStatusModeDescription(nStatus, 0); if (tmp && *tmp) { - mir_tstrncpy(text, tmp, text_size); + mir_wstrncpy(text, tmp, text_size); return 1; } @@ -324,7 +324,7 @@ void GetListeningTo(wchar_t *text, int text_size, ClcCacheEntry *pdnce) if (pdnce->m_iStatus == ID_STATUS_OFFLINE || pdnce->m_iStatus == 0) return; - ptrT tszValue(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "ListeningTo")); + ptrW tszValue(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "ListeningTo")); if (tszValue != NULL) CopySkipUnprintableChars(text, tszValue, text_size - 1); } @@ -345,7 +345,7 @@ int GetStatusMessage(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xs // Get XStatusMsg if (!noAwayMsg && xstatus_has_priority && pdnce->hContact && pdnce->m_pszProto) { - ptrT tszXStatusMsg(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); + ptrW tszXStatusMsg(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); if (tszXStatusMsg != NULL) { CopySkipUnprintableChars(text, tszXStatusMsg, text_size - 1); if (text[0] != '\0') @@ -355,7 +355,7 @@ int GetStatusMessage(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xs // Get StatusMsg if (pdnce->hContact && text[0] == '\0') { - ptrT tszStatusMsg(db_get_tsa(pdnce->hContact, "CList", "StatusMsg")); + ptrW tszStatusMsg(db_get_tsa(pdnce->hContact, "CList", "StatusMsg")); if (tszStatusMsg != NULL) { CopySkipUnprintableChars(text, tszStatusMsg, text_size - 1); if (text[0] != '\0') @@ -366,7 +366,7 @@ int GetStatusMessage(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xs // Get XStatusMsg if (!noAwayMsg && !xstatus_has_priority && pdnce->hContact && pdnce->m_pszProto && text[0] == '\0') { // Try to get XStatusMsg - ptrT tszXStatusMsg(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); + ptrW tszXStatusMsg(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); if (tszXStatusMsg != NULL) { CopySkipUnprintableChars(text, tszXStatusMsg, text_size - 1); if (text[0] != '\0') @@ -391,10 +391,10 @@ int Cache_GetLineText(ClcCacheEntry *pdnce, int type, LPTSTR text, int text_size LBL_Status: if (GetStatusName(text, text_size, pdnce, line.xstatus_has_priority) == -1 && line.use_name_and_message_for_xstatus) { // Try to get XStatusMsg - ptrT tszXStatusMsg(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); + ptrW tszXStatusMsg(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); if (tszXStatusMsg != NULL && tszXStatusMsg[0] != 0) { wchar_t *tmp = NEWWSTR_ALLOCA(text); - mir_sntprintf(text, text_size, L"%s: %s", tmp, tszXStatusMsg); + mir_snwprintf(text, text_size, L"%s: %s", tmp, tszXStatusMsg); CopySkipUnprintableChars(text, text, text_size - 1); } } @@ -402,9 +402,9 @@ LBL_Status: case TEXT_NICKNAME: if (pdnce->hContact && pdnce->m_pszProto) { - ptrT tszNick(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "Nick")); + ptrW tszNick(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "Nick")); if (tszNick != NULL) { - mir_tstrncpy(text, tszNick, text_size); + mir_wstrncpy(text, tszNick, text_size); CopySkipUnprintableChars(text, text, text_size - 1); } } @@ -413,18 +413,18 @@ LBL_Status: case TEXT_STATUS_MESSAGE: if (GetStatusMessage(text, text_size, pdnce, line.xstatus_has_priority) == -1 && line.use_name_and_message_for_xstatus) { // Try to get XStatusName - ptrT tszXStatusName(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusName")); + ptrW tszXStatusName(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusName")); if (tszXStatusName != NULL && tszXStatusName[0] != 0) { wchar_t *tmp = NEWWSTR_ALLOCA(text); - mir_sntprintf(text, text_size, L"%s: %s", tszXStatusName, tmp); + mir_snwprintf(text, text_size, L"%s: %s", tszXStatusName, tmp); CopySkipUnprintableChars(text, text, text_size - 1); } } else if (line.use_name_and_message_for_xstatus && line.xstatus_has_priority) { // Try to get XStatusName - ptrT tszXStatusName(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusName")); + ptrW tszXStatusName(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusName")); if (tszXStatusName != NULL && tszXStatusName[0] != 0) { - mir_tstrncpy(text, tszXStatusName, text_size); + mir_wstrncpy(text, tszXStatusName, text_size); CopySkipUnprintableChars(text, text, text_size - 1); } } @@ -447,8 +447,8 @@ LBL_Status: case TEXT_TEXT: { - ptrT tmp(variables_parsedup(line.text, pdnce->tszName, pdnce->hContact)); - mir_tstrncpy(text, tmp, text_size); + ptrW tmp(variables_parsedup(line.text, pdnce->tszName, pdnce->hContact)); + mir_wstrncpy(text, tmp, text_size); CopySkipUnprintableChars(text, text, text_size - 1); } return TEXT_TEXT; @@ -479,18 +479,18 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact) DBVARIANT dbv = { 0 }; if (!db_get_ts(pdnce->hContact, pdnce->m_pszProto, "Nick", &dbv)) { wchar_t nick[_countof(contact->szText)]; - mir_tstrncpy(nick, dbv.ptszVal, _countof(contact->szText)); + mir_wstrncpy(nick, dbv.ptszVal, _countof(contact->szText)); db_free(&dbv); // They are the same -> use the name to keep the case - if (mir_tstrcmpi(name, nick) == 0) - mir_tstrncpy(contact->szText, name, _countof(contact->szText)); + if (mir_wstrcmpi(name, nick) == 0) + mir_wstrncpy(contact->szText, name, _countof(contact->szText)); else // Append then - mir_sntprintf(contact->szText, L"%s - %s", name, nick); + mir_snwprintf(contact->szText, L"%s - %s", name, nick); } - else mir_tstrncpy(contact->szText, name, _countof(contact->szText)); + else mir_wstrncpy(contact->szText, name, _countof(contact->szText)); } - else mir_tstrncpy(contact->szText, name, _countof(contact->szText)); + else mir_wstrncpy(contact->szText, name, _countof(contact->szText)); if (!dat->bForceInDialog) contact->ssText.ReplaceSmileys(dat, pdnce, contact->szText, dat->first_line_draw_smileys); @@ -505,20 +505,20 @@ void Cache_GetNthLineText(ClcData *dat, ClcCacheEntry *pdnce, int n) ClcLineInfo &line = (n == 2) ? dat->secondLine : dat->thirdLine; wchar_t* &szText = (n == 2) ? pdnce->szSecondLineText : pdnce->szThirdLineText; - // in most cases replaceStrT does nothing + // in most cases replaceStrW does nothing if (!line.show) { - replaceStrT(szText, NULL); + replaceStrW(szText, NULL); return; } int type = Cache_GetLineText(pdnce, line.type, Text, _countof(Text), line); if (Text[0] == 0) { - replaceStrT(szText, NULL); + replaceStrW(szText, NULL); return; } Text[_countof(Text) - 1] = 0; //to be sure that it is null terminated string - replaceStrT(szText, Text); + replaceStrW(szText, Text); CSmileyString &ss = (n == 2) ? pdnce->ssSecondLine : pdnce->ssThirdLine; if (type == TEXT_LISTENING_TO && szText[0] != '\0') @@ -532,8 +532,8 @@ void Cache_GetNthLineText(ClcData *dat, ClcCacheEntry *pdnce, int n) void RemoveTag(wchar_t *to, wchar_t *tag) { wchar_t *st = to; - int len = (int)mir_tstrlen(tag); - int lastsize = (int)mir_tstrlen(to) + 1; + int len = (int)mir_wstrlen(tag); + int lastsize = (int)mir_wstrlen(to) + 1; while (st = wcsstr(st, tag)) { lastsize -= len; memmove((void*)st, (void*)(st + len), (lastsize)*sizeof(wchar_t)); @@ -669,7 +669,7 @@ void Cache_ProceedAvatarInList(ClcData *dat, ClcContact *contact) else height_clip = width_clip * ace->bmHeight / ace->bmWidth; - if (wildcmpit(contact->avatar_data->szFilename, L"*.gif")) { + if (wildcmpiw(contact->avatar_data->szFilename, L"*.gif")) { if (old_pos == AVATAR_POS_ANIMATED) AniAva_RemoveAvatar(contact->hContact); diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index b2c4001665..ed48ac41bc 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -205,7 +205,7 @@ static int clcProceedDragToScroll(HWND hwnd, int Y) static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const wchar_t *text, int prefixOk, BOOL fSearchUp)
{
ClcGroup *group = &dat->list;
- int testlen = (int)mir_tstrlen(text);
+ int testlen = (int)mir_wstrlen(text);
BOOL fReturnAsFound = FALSE;
int nLastFound = -1;
if (index == -1) fReturnAsFound = TRUE;
@@ -229,7 +229,7 @@ static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const wchar_ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
found = wcsstr(lowered_szText, lowered_search) != NULL;
}
- else found = ((prefixOk && CSTR_EQUAL == CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, text, -1, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText)));
+ else found = ((prefixOk && CSTR_EQUAL == CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, text, -1, cc->szText, testlen)) || (!prefixOk && !mir_wstrcmpi(text, cc->szText)));
if (found) {
ClcGroup *contactGroup = group;
@@ -1083,7 +1083,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (mir_strcmp(contSour->proto, META_PROTO)) {
if (!contSour->iSubNumber) {
MCONTACT hDest = contDest->hContact;
- mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it?"), contDest->szText, contSour->szText);
+ mir_snwprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it?"), contDest->szText, contSour->szText);
int res = MessageBox(hwnd, Wording, TranslateT("Converting to metacontact"), MB_OKCANCEL | MB_ICONQUESTION);
if (res == 1) {
MCONTACT handle = CallService(MS_MC_CONVERTTOMETA, hDest, 0);
@@ -1096,7 +1096,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, else {
hcontact = contSour->hContact;
MCONTACT hdest = contDest->hContact;
- mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it (remove it from '%s')?"), contDest->szText, contSour->szText, contSour->subcontacts->szText);
+ mir_snwprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it (remove it from '%s')?"), contDest->szText, contSour->szText, contSour->subcontacts->szText);
int res = MessageBox(hwnd, Wording, TranslateT("Converting to metacontact (moving)"), MB_OKCANCEL | MB_ICONQUESTION);
if (res == 1) {
MCONTACT handle = (MCONTACT)CallService(MS_MC_CONVERTTOMETA, (WPARAM)hdest, 0);
@@ -1122,7 +1122,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (!contSour->iSubNumber) {
MCONTACT hcontact = contSour->hContact;
MCONTACT handle = contDest->hContact;
- mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->szText);
+ mir_snwprintf(Wording, TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->szText);
int res = MessageBox(hwnd, Wording, TranslateT("Adding contact to metacontact"), MB_OKCANCEL | MB_ICONQUESTION);
if (res == 1) {
if (!handle)
@@ -1132,7 +1132,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, }
else if (contSour->subcontacts == contDest) {
MCONTACT hsour = contSour->hContact;
- mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be default?"), contSour->szText);
+ mir_snwprintf(Wording, TranslateT("Do you want contact '%s' to be default?"), contSour->szText);
int res = MessageBox(hwnd, Wording, TranslateT("Set default contact"), MB_OKCANCEL | MB_ICONQUESTION);
if (res == 1)
db_mc_setDefault(contDest->hContact, hsour, true);
@@ -1140,7 +1140,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, else {
MCONTACT hcontact = contSour->hContact;
MCONTACT handle = contDest->hContact;
- mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->szText);
+ mir_snwprintf(Wording, TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->szText);
int res = MessageBox(hwnd, Wording, TranslateT("Changing metacontacts (moving)"), MB_OKCANCEL | MB_ICONQUESTION);
if (res == 1) {
if (!handle)
@@ -1164,7 +1164,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (!contSour->iSubNumber) {
MCONTACT hcontact = contSour->hContact;
MCONTACT handle = contDest->subcontacts->hContact;
- mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->subcontacts->szText);
+ mir_snwprintf(Wording, TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->subcontacts->szText);
int res = MessageBox(hwnd, Wording, TranslateT("Changing metacontacts (moving)"), MB_OKCANCEL | MB_ICONQUESTION);
if (res == 1) {
if (!handle)
@@ -1176,7 +1176,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, else if (contSour->subcontacts != contDest->subcontacts) {
MCONTACT hcontact = contSour->hContact;
MCONTACT handle = contDest->subcontacts->hContact;
- mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->subcontacts->szText);
+ mir_snwprintf(Wording, TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->subcontacts->szText);
int res = MessageBox(hwnd, Wording, TranslateT("Changing metacontacts (moving)"), MB_OKCANCEL | MB_ICONQUESTION);
if (res == 1) {
if (!handle)
@@ -1202,11 +1202,11 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
int i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
if (i != -1 && group->groupId != destgroup->groupId) {
- wchar_t *groupName = mir_tstrdup(Clist_GroupGetName(contact->groupId, 0));
+ wchar_t *groupName = mir_wstrdup(Clist_GroupGetName(contact->groupId, 0));
wchar_t *shortGroup = NULL;
- wchar_t *sourceGrName = mir_tstrdup(Clist_GroupGetName(destgroup->groupId, 0));
+ wchar_t *sourceGrName = mir_wstrdup(Clist_GroupGetName(destgroup->groupId, 0));
if (groupName) {
- int len = (int)mir_tstrlen(groupName);
+ int len = (int)mir_wstrlen(groupName);
do { len--; } while (len >= 0 && groupName[len] != '\\');
if (len >= 0)
shortGroup = groupName + len + 1;
@@ -1216,9 +1216,9 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (shortGroup) {
NeedRename = TRUE;
if (sourceGrName)
- mir_sntprintf(newName, L"%s\\%s", sourceGrName, shortGroup);
+ mir_snwprintf(newName, L"%s\\%s", sourceGrName, shortGroup);
else
- mir_tstrncpy(newName, shortGroup, _countof(newName));
+ mir_wstrncpy(newName, shortGroup, _countof(newName));
}
mir_free(groupName);
mir_free(sourceGrName);
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index e2a5cb896f..d23703ba0a 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -433,10 +433,10 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat) }
if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
- ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
wchar_t szGroupMask[256];
- mir_sntprintf(szGroupMask, L"%s|", tszGroup);
+ mir_snwprintf(szGroupMask, L"%s|", tszGroup);
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (wcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (wcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0));
}
else if (g_CluiData.filterFlags & CLVM_INCLUDED_UNGROUPED)
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 4abc781b90..bacc564cc9 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -138,8 +138,8 @@ void RegisterCLUIFonts(void) fontid.flags = FIDF_DEFAULTVALID | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_ALLOWREREGISTER | FIDF_NOAS;
fontid.flags |= fontOptionsList[i].dwFlags;
- mir_tstrncpy(fontid.group, fontOptionsList[i].szGroup, _countof(fontid.group));
- mir_tstrncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name));
+ mir_wstrncpy(fontid.group, fontOptionsList[i].szGroup, _countof(fontid.group));
+ mir_wstrncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name));
mir_snprintf(idstr, "Font%d", fontOptionsList[i].fontID);
mir_strncpy(fontid.prefix, idstr, _countof(fontid.prefix));
fontid.order = i + 1;
@@ -148,12 +148,12 @@ void RegisterCLUIFonts(void) fontid.deffontsettings.colour = fontOptionsList[i].defColour;
fontid.deffontsettings.size = fontOptionsList[i].defSize;
fontid.deffontsettings.style = fontOptionsList[i].defStyle;
- mir_tstrncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace));
+ mir_wstrncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace));
FontRegisterT(&fontid);
- mir_tstrncpy(effectid.group, fontOptionsList[i].szGroup, _countof(effectid.group));
- mir_tstrncpy(effectid.name, fontOptionsList[i].szDescr, _countof(effectid.name));
+ mir_wstrncpy(effectid.group, fontOptionsList[i].szGroup, _countof(effectid.group));
+ mir_wstrncpy(effectid.name, fontOptionsList[i].szDescr, _countof(effectid.name));
mir_snprintf(idstr, "Font%d", fontOptionsList[i].fontID);
mir_strncpy(effectid.setting, idstr, _countof(effectid.setting));
effectid.order = i + 1;
@@ -169,8 +169,8 @@ void RegisterCLUIFonts(void) colourid.cbSize = sizeof(colourid);
for (int i = 0; i < _countof(colourOptionsList); i++) {
- mir_tstrncpy(colourid.group, colourOptionsList[i].szGroup, _countof(colourid.group));
- mir_tstrncpy(colourid.name, colourOptionsList[i].szDescr, _countof(colourid.group));
+ mir_wstrncpy(colourid.group, colourOptionsList[i].szGroup, _countof(colourid.group));
+ mir_wstrncpy(colourid.name, colourOptionsList[i].szDescr, _countof(colourid.group));
mir_strncpy(colourid.setting, colourOptionsList[i].chName, _countof(colourid.setting));
mir_strncpy(colourid.dbSettingsGroup, colourOptionsList[i].chGroup, _countof(colourid.dbSettingsGroup));
colourid.defcolour = colourOptionsList[i].defColour;
@@ -205,8 +205,8 @@ void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF FontIDT fontid = { 0 };
fontid.cbSize = sizeof(fontid);
- mir_tstrncpy(fontid.group, fontOptionsList[index].szGroup, _countof(fontid.group));
- mir_tstrncpy(fontid.name, fontOptionsList[index].szDescr, _countof(fontid.name));
+ mir_wstrncpy(fontid.group, fontOptionsList[index].szGroup, _countof(fontid.group));
+ mir_wstrncpy(fontid.name, fontOptionsList[index].szDescr, _countof(fontid.name));
COLORREF col = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf);
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index e03c992085..babe45df32 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -199,7 +199,7 @@ void CLCPaint::GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, wchar_ free_height = text_rc.bottom - text_rc.top;
// Always need cy...
- text_size->cy = ske_DrawText(hdcMem, szText, (int)mir_tstrlen(szText), &text_rc, DT_CALCRECT | uTextFormat);
+ text_size->cy = ske_DrawText(hdcMem, szText, (int)mir_wstrlen(szText), &text_rc, DT_CALCRECT | uTextFormat);
text_size->cy = min(text_size->cy, free_height);
if (plText == NULL)
text_size->cx = min(text_rc.right - text_rc.left + 2, free_width);
@@ -419,7 +419,7 @@ void CLCPaint::_DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, wcha int pos_x = 0;
int row_height;
RECT tmp_rc = *free_rc;
- if (len == -1) len = (int)mir_tstrlen(szText);
+ if (len == -1) len = (int)mir_wstrlen(szText);
if (uTextFormat & DT_RTLREADING)
i = plText->realCount - 1;
else
@@ -783,7 +783,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R int space_width = 0;
szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
- if (szCounts && mir_tstrlen(szCounts) > 0) {
+ if (szCounts && mir_wstrlen(szCounts) > 0) {
// calc width and height
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
ske_DrawText(hdcMem, L" ", 1, &count_rc, DT_CALCRECT | DT_NOPREFIX);
@@ -791,7 +791,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R space_width = count_size.cx;
count_rc.right = 0;
count_rc.left = 0;
- ske_DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &count_rc, DT_CALCRECT);
+ ske_DrawText(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &count_rc, DT_CALCRECT);
count_size.cx += count_rc.right - count_rc.left;
count_size.cy = count_rc.bottom - count_rc.top;
}
@@ -833,21 +833,21 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R else if (hottrack)
_SetHotTrackColour(hdcMem, dat);
if (dat->text_rtl != 0) _RTLRect(&nameRect, free_row_rc.right);
- _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, (int)mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, (int)mir_wstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
if (selected && !dat->bFilterSearch) {
SetTextColor(hdcMem, dat->quickSearchColour);
- _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, (int)mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, (int)mir_wstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
- if (szCounts && mir_tstrlen(szCounts) > 0) {
+ if (szCounts && mir_wstrlen(szCounts) > 0) {
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
else if (hottrack)
_SetHotTrackColour(hdcMem, dat);
if (dat->text_rtl != 0) _RTLRect(&countRect, free_row_rc.right);
- ske_DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &countRect, uTextFormat);
+ ske_DrawText(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &countRect, uTextFormat);
}
Drawing->pos_label = nameRect;
return;
@@ -869,7 +869,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R space_size.cy = min(space_rc.bottom - space_rc.top, fr_rc.bottom - fr_rc.top);
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
- DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &counts_rc, DT_CALCRECT);
+ DrawText(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &counts_rc, DT_CALCRECT);
counts_size.cx = counts_rc.right - counts_rc.left;
counts_size.cy = min(counts_rc.bottom - counts_rc.top, fr_rc.bottom - fr_rc.top);
@@ -899,7 +899,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R else if (hottrack)
_SetHotTrackColour(hdcMem, dat);
if (dat->text_rtl != 0) _RTLRect(&text_rect, free_row_rc.right);
- _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, 0, (int)mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, 0, (int)mir_wstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
if (((dat->bFilterSearch && Drawing->type != CLCIT_GROUP) || selected) && dat->szQuickSearch[0] != '\0') {
int idx = 0;
if (dat->bFilterSearch) {
@@ -910,12 +910,12 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R idx = int(p1 - lowered);
}
SetTextColor(hdcMem, dat->quickSearchColour);
- _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, idx, (int)mir_tstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, idx, (int)mir_wstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
if (Drawing->type == CLCIT_GROUP && szCounts && szCounts[0] && counts_rc.right - counts_rc.left > 0) {
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
if (dat->text_rtl != 0) _RTLRect(&counts_rc, free_row_rc.right);
- ske_DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &counts_rc, uTextFormat);
+ ske_DrawText(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &counts_rc, uTextFormat);
if (dat->text_rtl == 0)
text_rect.right = counts_rc.right;
else
@@ -977,7 +977,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R SetTextColor(hdcMem, dat->selTextColour);
else if (hottrack)
_SetHotTrackColour(hdcMem, dat);
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, 0, (int)mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, 0, (int)mir_wstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
if ((dat->bFilterSearch || selected) && dat->szQuickSearch[0] != '\0') {
int idx = 0;
if (dat->bFilterSearch) {
@@ -988,7 +988,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R idx = int(p1 - lowered);
}
SetTextColor(hdcMem, dat->quickSearchColour);
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, idx, (int)mir_tstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, idx, (int)mir_wstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
SIZE size;
@@ -1004,7 +1004,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R int space_width = 0;
wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
- if (szCounts && mir_tstrlen(szCounts) > 0) {
+ if (szCounts && mir_wstrlen(szCounts) > 0) {
// calc width and height
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
ske_DrawText(hdcMem, L" ", 1, &count_rc, DT_CALCRECT | DT_NOPREFIX);
@@ -1012,7 +1012,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R space_width = count_size.cx;
count_rc.right = 0;
count_rc.left = 0;
- ske_DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &count_rc, DT_CALCRECT);
+ ske_DrawText(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &count_rc, DT_CALCRECT);
count_size.cx += count_rc.right - count_rc.left;
count_size.cy = count_rc.bottom - count_rc.top;
}
@@ -1053,18 +1053,18 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R SetTextColor(hdcMem, dat->selTextColour);
else if (hottrack)
_SetHotTrackColour(hdcMem, dat);
- _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, (int)mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, (int)mir_wstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
if (selected && !dat->bFilterSearch) {
SetTextColor(hdcMem, dat->quickSearchColour);
- _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, (int)mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, (int)mir_wstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
- if (szCounts && mir_tstrlen(szCounts) > 0) {
+ if (szCounts && mir_wstrlen(szCounts) > 0) {
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
else if (hottrack)
_SetHotTrackColour(hdcMem, dat);
- ske_DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &countRect, uTextFormat);
+ ske_DrawText(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &countRect, uTextFormat);
}
Drawing->pos_label = nameRect;
}
@@ -1084,7 +1084,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R mir_free_and_nil(pdnce->szSecondLineText);
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
- pdnce->szSecondLineText = mir_tstrdup(buf);
+ pdnce->szSecondLineText = mir_wstrdup(buf);
}
uTextFormat |= (gl_RowTabAccess[i]->valign == TC_VCENTER) ? DT_VCENTER : (gl_RowTabAccess[i]->valign == TC_BOTTOM) ? DT_BOTTOM : 0;
@@ -1096,7 +1096,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R ChangeToFont(hdcMem, dat, FONTID_SECONDLINE, NULL);
uTextFormat = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
if (Drawing->type == CLCIT_CONTACT)
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szSecondLineText, 0, (int)mir_tstrlen(pdnce->szSecondLineText), pdnce->ssSecondLine.plText, uTextFormat, dat->text_resize_smileys);
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szSecondLineText, 0, (int)mir_wstrlen(pdnce->szSecondLineText), pdnce->ssSecondLine.plText, uTextFormat, dat->text_resize_smileys);
}
break;
@@ -1112,7 +1112,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R mir_free(pdnce->szThirdLineText);
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
- pdnce->szThirdLineText = mir_tstrdup(buf);
+ pdnce->szThirdLineText = mir_wstrdup(buf);
}
uTextFormat |= (gl_RowTabAccess[i]->valign == TC_VCENTER) ? DT_VCENTER : (gl_RowTabAccess[i]->valign == TC_BOTTOM) ? DT_BOTTOM : 0;
@@ -1124,7 +1124,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R ChangeToFont(hdcMem, dat, FONTID_THIRDLINE, NULL);
uTextFormat = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
if (Drawing->type == CLCIT_CONTACT)
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szThirdLineText, 0, (int)mir_tstrlen(pdnce->szThirdLineText), pdnce->ssThirdLine.plText, uTextFormat, dat->text_resize_smileys);
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szThirdLineText, 0, (int)mir_wstrlen(pdnce->szThirdLineText), pdnce->ssThirdLine.plText, uTextFormat, dat->text_resize_smileys);
}
break;
@@ -1395,7 +1395,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R if (!TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", szResult, _countof(szResult), 0)) {
// Select font
ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL);
- ske_DrawText(hdcMem, szResult, (int)mir_tstrlen(szResult), &p_rect, DT_NOPREFIX | DT_SINGLELINE | (dat->text_rtl ? DT_RTLREADING : 0));
+ ske_DrawText(hdcMem, szResult, (int)mir_wstrlen(szResult), &p_rect, DT_NOPREFIX | DT_SINGLELINE | (dat->text_rtl ? DT_RTLREADING : 0));
}
break;
}
@@ -2112,7 +2112,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT // Get text size
RECT rc;
SIZE text_size;
- text_size.cy = ske_DrawText(hdcMem, szResult, (int)mir_tstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
+ text_size.cy = ske_DrawText(hdcMem, szResult, (int)mir_wstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
text_size.cy = min(text_size.cy, free_row_rc.bottom - free_row_rc.top);
text_size.cx = rc.right - rc.left;
@@ -2213,7 +2213,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT space_size.cy = min(space_rc.bottom - space_rc.top, free_height);
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
- DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &counts_rc, DT_CALCRECT);
+ DrawText(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &counts_rc, DT_CALCRECT);
counts_size.cx = counts_rc.right - counts_rc.left;
counts_size.cy = min(counts_rc.bottom - counts_rc.top, free_height);
@@ -2267,7 +2267,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT // Get contact time
wchar_t buf[70] = L"";
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
- replaceStrT(pdnce->szSecondLineText, buf);
+ replaceStrW(pdnce->szSecondLineText, buf);
}
if (pdnce->szSecondLineText && pdnce->szSecondLineText[0] && free_height > dat->secondLine.top_space) {
@@ -2300,7 +2300,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT // Get contact time
wchar_t buf[70] = L"";
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
- replaceStrT(pdnce->szThirdLineText, buf);
+ replaceStrW(pdnce->szThirdLineText, buf);
}
if (pdnce->szThirdLineText != NULL && pdnce->szThirdLineText[0] && free_height > dat->thirdLine.top_space) {
ChangeToFont(hdcMem, dat, FONTID_THIRDLINE, NULL);
@@ -2652,7 +2652,7 @@ void CLCPaint::_DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, i ske_DrawText(hdcMem, Drawing->szText, -1, prcItem, uTextFormat);
if (selected && !dat->bFilterSearch) {
SetTextColor(hdcMem, dat->quickSearchColour);
- ske_DrawText(hdcMem, Drawing->szText, (int)mir_tstrlen(dat->szQuickSearch), prcItem, uTextFormat);
+ ske_DrawText(hdcMem, Drawing->szText, (int)mir_wstrlen(dat->szQuickSearch), prcItem, uTextFormat);
}
}
else if (Drawing->type == CLCIT_CONTACT) {
@@ -2672,7 +2672,7 @@ void CLCPaint::_DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, i idx = int(p1 - lowered);
}
SetTextColor(hdcMem, dat->quickSearchColour);
- _DrawTextSmiley(hdcMem, prcItem, &text_size, Drawing->szText, idx, (int)mir_tstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ _DrawTextSmiley(hdcMem, prcItem, &text_size, Drawing->szText, idx, (int)mir_wstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
}
else ske_DrawText(hdcMem, Drawing->szText, -1, prcItem, uTextFormat);
@@ -2726,7 +2726,7 @@ void CLCPaint::_DrawContactTime(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R if (!TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", szResult, _countof(szResult), 0)) {
// Select font
ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL);
- ske_DrawText(hdcMem, szResult, (int)mir_tstrlen(szResult), prcItem, DT_NOPREFIX | DT_SINGLELINE);
+ ske_DrawText(hdcMem, szResult, (int)mir_wstrlen(szResult), prcItem, DT_NOPREFIX | DT_SINGLELINE);
}
}
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index c20e9740e8..1d99f11abf 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -560,9 +560,9 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->secondLine.draw_smileys = db_get_b(NULL, "CList", "SecondLineDrawSmileys", SETTING_SECONDLINE_SMILEYS_DEFAULT);
dat->secondLine.type = db_get_w(NULL, "CList", "SecondLineType", SETTING_SECONDLINE_TYPE_DEFAULT);
- ptrT tszLineText(db_get_tsa(NULL, "CList", "SecondLineText"));
+ ptrW tszLineText(db_get_tsa(NULL, "CList", "SecondLineText"));
if (tszLineText)
- mir_tstrncpy(dat->secondLine.text, tszLineText, _countof(dat->secondLine.text));
+ mir_wstrncpy(dat->secondLine.text, tszLineText, _countof(dat->secondLine.text));
else
dat->secondLine.text[0] = '\0';
@@ -580,9 +580,9 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->thirdLine.draw_smileys = db_get_b(NULL, "CList", "ThirdLineDrawSmileys", SETTING_THIRDLINE_SMILEYS_DEFAULT);
dat->thirdLine.type = db_get_w(NULL, "CList", "ThirdLineType", SETTING_THIRDLINE_TYPE_DEFAULT);
- ptrT tszLineText(db_get_tsa(NULL, "CList", "ThirdLineText"));
+ ptrW tszLineText(db_get_tsa(NULL, "CList", "ThirdLineText"));
if (tszLineText)
- mir_tstrncpy(dat->thirdLine.text, tszLineText, _countof(dat->thirdLine.text));
+ mir_wstrncpy(dat->thirdLine.text, tszLineText, _countof(dat->thirdLine.text));
else
dat->thirdLine.text[0] = '\0';
@@ -608,7 +608,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->MenuTextHiColor = cliGetColor("Menu", "SelTextColour", CLCDEFAULT_MODERN_SELTEXTCOLOUR);
if (db_get_b(NULL, "Menu", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrT tszBitmap(db_get_tsa(NULL, "Menu", "BkBitmap"));
+ ptrW tszBitmap(db_get_tsa(NULL, "Menu", "BkBitmap"));
if (tszBitmap != NULL)
dat->hMenuBackground = Bitmap_Load(tszBitmap);
}
@@ -657,7 +657,7 @@ int ExpandMetaContact(HWND hwnd, ClcContact *contact, ClcData *dat) int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk)
{
ClcGroup *group = &dat->list;
- int testlen = (int)mir_tstrlen(text);
+ int testlen = (int)mir_wstrlen(text);
int SubCount = 0;
group->scanIndex = 0;
@@ -677,7 +677,7 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk) wchar_t *lowered_text = CharLowerW(NEWWSTR_ALLOCA(text));
found = wcsstr(lowered_szText, lowered_text) != NULL;
}
- else found = (prefixOk && !wcsnicmp(text, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText));
+ else found = (prefixOk && !wcsnicmp(text, cc->szText, testlen)) || (!prefixOk && !mir_wstrcmpi(text, cc->szText));
if (found) {
ClcGroup *ccGroup = group;
@@ -708,7 +708,7 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk) wchar_t *lowered_text = CharLowerW(NEWWSTR_ALLOCA(text));
found = wcsstr(lowered_szText, lowered_text) != NULL;
}
- else found = (prefixOk && !wcsnicmp(text, ccSub.szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, ccSub.szText));
+ else found = (prefixOk && !wcsnicmp(text, ccSub.szText, testlen)) || (!prefixOk && !mir_wstrcmpi(text, ccSub.szText));
if (found) {
ClcGroup *ccGroup = group;
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 24cc1f273c..2585918e00 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -119,7 +119,7 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) wchar_t szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
- mir_sntprintf(szBuffer, L"%s: %s (%s)", szwProto, szName, szStatus);
+ mir_snwprintf(szBuffer, L"%s: %s (%s)", szwProto, szName, szStatus);
szBuffer[127] = 0;
AppendMenu(g_CluiData.hMenuNotify, MF_BYCOMMAND | MF_STRING, g_CluiData.wNextMenuID, szBuffer);
mii.hbmpItem = HBMMENU_CALLBACK;
@@ -249,7 +249,7 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM, LPARAM) if (g_CluiData.fDisableSkinEngine) {
event_area.bkColour = cliGetColor("EventArea", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "EventArea", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrT tszBitmap(db_get_tsa(NULL, "EventArea", "BkBitmap"));
+ ptrW tszBitmap(db_get_tsa(NULL, "EventArea", "BkBitmap"));
if (tszBitmap != NULL)
event_area.hBmpBackground = Bitmap_Load(tszBitmap);
}
@@ -321,7 +321,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC) else {
HICON hIcon = (HICON)LoadImage(g_hMirApp, MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0);
wchar_t *ptszEvents = TranslateT("No events");
- ske_DrawText(hDC, ptszEvents, (int)mir_tstrlen(ptszEvents), &rc, DT_VCENTER | DT_SINGLELINE);
+ ske_DrawText(hDC, ptszEvents, (int)mir_wstrlen(ptszEvents), &rc, DT_VCENTER | DT_SINGLELINE);
ske_DrawIconEx(hDC, 4, (rc.bottom + rc.top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT);
DestroyIcon(hIcon);
}
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index 5e8f223061..bc23afacfe 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -292,7 +292,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) if (hAuxOld == hAux) {
wchar_t buf[255];
GetClassName(hAux, buf, _countof(buf));
- if (!mir_tstrcmp(buf, CLUIFrameSubContainerClassName)) {
+ if (!mir_wstrcmp(buf, CLUIFrameSubContainerClassName)) {
hWndFound = TRUE;
break;
}
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index ed7b571b64..051ef974a9 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -584,7 +584,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(NULL, "CList", "SecondLineDrawSmileys", SETTING_SECONDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
{
- ptrT tszText(db_get_tsa(NULL, "CList", "SecondLineText"));
+ ptrW tszText(db_get_tsa(NULL, "CList", "SecondLineText"));
if (tszText)
SetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, tszText);
}
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index a212170259..71e4dc11c6 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -57,7 +57,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce) if (pdnce->tszName == NULL) {
pdnce->tszName = pcli->pfnGetContactDisplayName(pdnce->hContact, GCDNF_NOCACHE);
- pdnce->m_bIsUnknown = !mir_tstrcmp(pdnce->tszName, UnknownConctactTranslatedName);
+ pdnce->m_bIsUnknown = !mir_wstrcmp(pdnce->tszName, UnknownConctactTranslatedName);
}
if (pdnce->m_iStatus == 0) //very strange look status sort is broken let always reread status
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 6ab0f4926f..30c489ca90 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -461,7 +461,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) trayIconInfo_t &p = pcli->trayIcon[i];
DestroyIcon(p.hBaseIcon);
p.hBaseIcon = hIcon;
- replaceStrT(p.ptszToolTip, pcli->szTip);
+ replaceStrW(p.ptszToolTip, pcli->szTip);
NOTIFYICONDATA nid = { sizeof(NOTIFYICONDATA) };
nid.hWnd = pcli->hwndContactList;
@@ -471,7 +471,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) // if Tipper is missing or turned off for tray, use system tooltips
if (!ServiceExists("mToolTip/ShowTip") || !db_get_b(NULL, "Tipper", "TrayTip", 1))
- mir_tstrncpy(nid.szTip, pcli->szTip, _countof(nid.szTip));
+ mir_wstrncpy(nid.szTip, pcli->szTip, _countof(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 9256ecf893..6fd42fbb23 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -186,7 +186,7 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM, LPARAM) HWND hwndClist = GetFocus();
wchar_t cls[128];
GetClassName(hwndClist, cls, _countof(cls));
- if (mir_tstrcmp(CLISTCONTROL_CLASSW, cls))
+ if (mir_wstrcmp(CLISTCONTROL_CLASSW, cls))
hwndClist = pcli->hwndContactList;
MCONTACT hItem = (MCONTACT)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
@@ -498,7 +498,7 @@ BOOL CLUI_CheckOwnedByClui(HWND hWnd) wchar_t buf[255];
GetClassName(hWndMid, buf, 254);
- if (!mir_tstrcmpi(buf, CLUIFrameSubContainerClassName))
+ if (!mir_wstrcmpi(buf, CLUIFrameSubContainerClassName))
return TRUE;
return FALSE;
@@ -667,9 +667,9 @@ void CLUI_ChangeWindowMode() wchar_t titleText[255] = { 0 };
DBVARIANT dbv;
if (db_get_ts(NULL, "CList", "TitleText", &dbv))
- mir_tstrncpy(titleText, _A2W(MIRANDANAME), _countof(titleText));
+ mir_wstrncpy(titleText, _A2W(MIRANDANAME), _countof(titleText));
else {
- mir_tstrncpy(titleText, dbv.ptszVal, _countof(titleText));
+ mir_wstrncpy(titleText, dbv.ptszVal, _countof(titleText));
db_free(&dbv);
}
SetWindowText(pcli->hwndContactList, titleText);
@@ -893,7 +893,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) if (szAccoName) {
// first of all try to find by account name( or empty - global )
- mir_sntprintf(fileFull, L"%s\\Icons\\proto_conn_%S.dll", tszFolderPath, szAccoName);
+ mir_snwprintf(fileFull, L"%s\\Icons\\proto_conn_%S.dll", tszFolderPath, szAccoName);
if (count = ExtractIconEx(fileFull, -1, NULL, NULL, 1))
return count;
@@ -901,7 +901,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) // second try to find by protocol name
PROTOACCOUNT *acc = Proto_GetAccount(szAccoName);
if (acc && !acc->bOldProto) {
- mir_sntprintf(fileFull, L"%s\\Icons\\proto_conn_%S.dll", tszFolderPath, acc->szProtoName);
+ mir_snwprintf(fileFull, L"%s\\Icons\\proto_conn_%S.dll", tszFolderPath, acc->szProtoName);
if (count = ExtractIconEx(fileFull, -1, NULL, NULL, 1))
return count;
}
@@ -909,7 +909,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) }
// third try global
- mir_sntprintf(fileFull, L"%s\\Icons\\proto_conn.dll", tszFolderPath);
+ mir_snwprintf(fileFull, L"%s\\Icons\\proto_conn.dll", tszFolderPath);
if (count = ExtractIconEx(fileFull, -1, NULL, NULL, 1))
return count;
@@ -919,7 +919,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) static HICON CLUI_LoadIconFromExternalFile(wchar_t *filename, int i)
{
wchar_t szPath[MAX_PATH], szFullPath[MAX_PATH];
- mir_sntprintf(szPath, L"Icons\\%s", filename);
+ mir_snwprintf(szPath, L"Icons\\%s", filename);
PathToAbsoluteT(szPath, szFullPath);
if (_waccess(szPath, 0))
return NULL;
@@ -935,7 +935,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx) HICON hIcon;
if (szAccoName) {
- mir_sntprintf(szFullPath, L"proto_conn_%S.dll", szAccoName);
+ mir_snwprintf(szFullPath, L"proto_conn_%S.dll", szAccoName);
if (hIcon = CLUI_LoadIconFromExternalFile(szFullPath, idx))
return hIcon;
@@ -943,7 +943,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx) // second try to find by protocol name
PROTOACCOUNT *acc = Proto_GetAccount(szAccoName);
if (acc && !acc->bOldProto) {
- mir_sntprintf(szFullPath, L"proto_conn_%S.dll", acc->szProtoName);
+ mir_snwprintf(szFullPath, L"proto_conn_%S.dll", acc->szProtoName);
if (hIcon = CLUI_LoadIconFromExternalFile(szFullPath, idx))
return hIcon;
}
@@ -951,7 +951,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx) }
// third try global
- mir_tstrncpy(szFullPath, L"proto_conn.dll", _countof(szFullPath));
+ mir_wstrncpy(szFullPath, L"proto_conn.dll", _countof(szFullPath));
if (hIcon = CLUI_LoadIconFromExternalFile(szFullPath, idx))
return hIcon;
@@ -2421,7 +2421,7 @@ LRESULT CLUI::OnMeasureItem(UINT, WPARAM, LPARAM lParam) HDC hdc = GetDC(m_hWnd);
wchar_t *ptszStr = TranslateT("Status");
SIZE textSize;
- GetTextExtentPoint32(hdc, ptszStr, (int)mir_tstrlen(ptszStr), &textSize);
+ GetTextExtentPoint32(hdc, ptszStr, (int)mir_wstrlen(ptszStr), &textSize);
pmis->itemWidth = textSize.cx;
pmis->itemHeight = 0;
ReleaseDC(m_hWnd, hdc);
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index 33c21ce24c..6d6d5698e0 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -118,7 +118,7 @@ int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2) switch (by) {
case SORTBY_NAME: // name
- r = mir_tstrcmpi(contact1->szText, contact2->szText);
+ r = mir_wstrcmpi(contact1->szText, contact2->szText);
break;
case SORTBY_NAME_LOCALE: // name
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp index 1fe7d491fb..a6dedca8db 100644 --- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp @@ -109,7 +109,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item) g_clcPainter.GetTextSize(&size, hdc, dummyRect, contact->szText, contact->ssText.plText, 0, dat->text_resize_smileys ? 0 : contact->ssText.iMaxSmileyHeight);
if (contact->type == CLCIT_GROUP) {
wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
- if (szCounts && mir_tstrlen(szCounts) > 0) {
+ if (szCounts && mir_wstrlen(szCounts) > 0) {
RECT count_rc = { 0 };
// calc width and height
g_clcPainter.ChangeToFont(hdc, dat, contact->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
@@ -117,7 +117,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item) size.cx += count_rc.right - count_rc.left;
count_rc.right = 0;
count_rc.left = 0;
- ske_DrawText(hdc, szCounts, (int)mir_tstrlen(szCounts), &count_rc, DT_CALCRECT);
+ ske_DrawText(hdc, szCounts, (int)mir_wstrlen(szCounts), &count_rc, DT_CALCRECT);
size.cx += count_rc.right - count_rc.left;
pCell->h = max(pCell->h, count_rc.bottom - count_rc.top);
}
@@ -249,7 +249,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item) g_clcPainter.ChangeToFont(hdc, dat, FONTID_CONTACT_TIME, NULL);
// Get text size
- text_size.cy = ske_DrawText(hdc, szResult, (int)mir_tstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
+ text_size.cy = ske_DrawText(hdc, szResult, (int)mir_wstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
ske_ResetTextEffect(hdc);
DeleteDC(hdc);
diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp index a83baa7089..2cbabaafe4 100644 --- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp +++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp @@ -312,18 +312,18 @@ void RefreshTree(HWND hwndDlg, HTREEITEM hti) if (!cell->child)
{
if (cell->type == 0)
- mir_sntprintf(buf, TranslateT("Empty %s cell"), cell->cont == TC_COL ? TranslateT("column") : TranslateT("line"));
+ mir_snwprintf(buf, TranslateT("Empty %s cell"), cell->cont == TC_COL ? TranslateT("column") : TranslateT("line"));
else
- mir_tstrncpy(buf, TranslateTS(types[cell->type]), _countof(buf));
+ mir_wstrncpy(buf, TranslateTS(types[cell->type]), _countof(buf));
}
else
{
if (cell->type == 0)
- mir_tstrncpy(buf, (cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines")), _countof(buf));
+ mir_wstrncpy(buf, (cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines")), _countof(buf));
else
- mir_sntprintf(buf, TranslateT("%s, contain %s"), TranslateTS(types[cell->type]), cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines"));
+ mir_snwprintf(buf, TranslateT("%s, contain %s"), TranslateTS(types[cell->type]), cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines"));
}
- if (cell->layer) mir_tstrncat(buf, TranslateT(" layered"), _countof(buf) - mir_tstrlen(buf));
+ if (cell->layer) mir_wstrncat(buf, TranslateT(" layered"), _countof(buf) - mir_wstrlen(buf));
tvi.mask = TVIF_HANDLE | TVIF_TEXT;
tvi.pszText = buf;
TreeView_SetItem(htree, &tvi);
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp index f37a2a4715..5d9b79ddfe 100644 --- a/plugins/Clist_modern/src/modern_skinbutton.cpp +++ b/plugins/Clist_modern/src/modern_skinbutton.cpp @@ -561,7 +561,7 @@ int ModernSkinButton_AddButton(HWND parent, if (DBkey && *DBkey != '\0') bct->ValueDBSection = mir_strdup(DBkey); else bct->ValueDBSection = NULL; if (TypeDef && *TypeDef != '\0') bct->ValueTypeDef = mir_strdup(TypeDef); else bct->ValueTypeDef = mir_strdup("sDefault"); bct->ID = mir_strdup(ID); - bct->Hint = mir_tstrdup(Hint); + bct->Hint = mir_wstrdup(Hint); Buttons[ButtonsCount].bct = bct; Buttons[ButtonsCount].hwnd = NULL; Buttons[ButtonsCount].OrL = Left; diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index cc28081cb1..f493876e60 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -202,22 +202,22 @@ HRESULT IniParser::WriteStrToDb(const char * szSection, const char * szName, con int IniParser::GetSkinFolder(IN const wchar_t * szFileName, OUT wchar_t * pszFolderName) { - wchar_t *szBuff = mir_tstrdup(szFileName); - wchar_t *pszPos = szBuff + mir_tstrlen(szBuff); + wchar_t *szBuff = mir_wstrdup(szFileName); + wchar_t *pszPos = szBuff + mir_wstrlen(szBuff); while (pszPos > szBuff && *pszPos != '.') { pszPos--; } *pszPos = '\0'; - mir_tstrcpy(pszFolderName, szBuff); + mir_wstrcpy(pszFolderName, szBuff); wchar_t custom_folder[MAX_PATH], cus[MAX_PATH]; wchar_t *b3; - mir_tstrncpy(custom_folder, pszFolderName, _countof(custom_folder)); - b3 = custom_folder + mir_tstrlen(custom_folder); + mir_wstrncpy(custom_folder, pszFolderName, _countof(custom_folder)); + b3 = custom_folder + mir_wstrlen(custom_folder); while (b3 > custom_folder && *b3 != '\\') { b3--; } *b3 = '\0'; GetPrivateProfileString(L"Skin_Description_Section", L"SkinFolder", L"", cus, _countof(custom_folder), szFileName); if (cus[0] != 0) - mir_sntprintf(pszFolderName, MAX_PATH, L"%s\\%s", custom_folder, cus); + mir_snwprintf(pszFolderName, MAX_PATH, L"%s\\%s", custom_folder, cus); mir_free(szBuff); PathToRelativeT(pszFolderName, pszFolderName); @@ -1471,13 +1471,13 @@ int ske_GetFullFilename(wchar_t *buf, const wchar_t *file, wchar_t *skinfolder, { wchar_t *SkinPlace = db_get_tsa(NULL, SKIN, "SkinFolder"); if (SkinPlace == NULL) - SkinPlace = mir_tstrdup(L"\\Skin\\default"); + SkinPlace = mir_wstrdup(L"\\Skin\\default"); wchar_t b2[MAX_PATH]; if (file[0] != '\\' && file[1] != ':') - mir_sntprintf(b2, L"%s\\%s", (skinfolder == NULL) ? SkinPlace : ((INT_PTR)skinfolder != -1) ? skinfolder : L"", file); + mir_snwprintf(b2, L"%s\\%s", (skinfolder == NULL) ? SkinPlace : ((INT_PTR)skinfolder != -1) ? skinfolder : L"", file); else - mir_tstrncpy(b2, file, _countof(b2)); + mir_wstrncpy(b2, file, _countof(b2)); if (madeAbsolute) { if (b2[0] == '\\' && b2[1] != '\\') @@ -1485,7 +1485,7 @@ int ske_GetFullFilename(wchar_t *buf, const wchar_t *file, wchar_t *skinfolder, else PathToAbsoluteT(b2, buf); } - else mir_tstrncpy(buf, b2, MAX_PATH); + else mir_wstrncpy(buf, b2, MAX_PATH); mir_free(SkinPlace); return 0; @@ -1564,7 +1564,7 @@ static HBITMAP ske_LoadGlyphImage_TGA(const wchar_t *szFilename) BOOL err = FALSE; tga_header_t header; if (!szFilename) return NULL; - if (!wildcmpit(szFilename, L"*\\*%.tga")) { + if (!wildcmpiw(szFilename, L"*\\*%.tga")) { //Loading TGA image from file FILE *fp = _wfopen(szFilename, L"rb"); if (!fp) { @@ -1631,7 +1631,7 @@ static HBITMAP ske_LoadGlyphImageByDecoders(const wchar_t *tszFileName) HBITMAP hBitmap; bool f = false; - if (!mir_tstrcmpi(ext, L".tga")) { + if (!mir_wstrcmpi(ext, L".tga")) { hBitmap = ske_LoadGlyphImage_TGA(tszFileName); f = true; } @@ -1663,7 +1663,7 @@ static HBITMAP ske_LoadGlyphImageByDecoders(const wchar_t *tszFileName) static HBITMAP ske_skinLoadGlyphImage(const wchar_t *tszFileName) { - if (!wildcmpit(tszFileName, L"*.tga")) + if (!wildcmpiw(tszFileName, L"*.tga")) return GDIPlus_LoadGlyphImage(tszFileName); return ske_LoadGlyphImageByDecoders(tszFileName); @@ -1679,7 +1679,7 @@ HBITMAP ske_LoadGlyphImage(const wchar_t *tszFileName) if (pLoadedImages) { for (DWORD i = 0; i < dwLoadedImagesCount; i++) { - if (!mir_tstrcmpi(pLoadedImages[i].szFileName, szFile)) { + if (!mir_wstrcmpi(pLoadedImages[i].szFileName, szFile)) { pLoadedImages[i].dwLoadedTimes++; return pLoadedImages[i].hGlyph; } @@ -1701,7 +1701,7 @@ HBITMAP ske_LoadGlyphImage(const wchar_t *tszFileName) pLoadedImages[dwLoadedImagesCount].dwLoadedTimes = 1; pLoadedImages[dwLoadedImagesCount].hGlyph = hbmp; - pLoadedImages[dwLoadedImagesCount].szFileName = mir_tstrdup(szFile); + pLoadedImages[dwLoadedImagesCount].szFileName = mir_wstrdup(szFile); dwLoadedImagesCount++; return hbmp; } @@ -1918,7 +1918,7 @@ static int ske_GetSkinFromDB(char *, SKINOBJECTSLIST *Skin) if (Skin->szSkinPlace && wcschr(Skin->szSkinPlace, '%')) bOnlyObjects = TRUE; mir_free(Skin->szSkinPlace); - Skin->szSkinPlace = mir_tstrdup(L"%Default%"); + Skin->szSkinPlace = mir_wstrdup(L"%Default%"); ske_LoadSkinFromResource(bOnlyObjects); } @@ -2217,7 +2217,7 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, // Calc len of input string if (nCount == -1) - nCount = (int)mir_tstrlen(lpString); + nCount = (int)mir_wstrlen(lpString); // retrieve destination bitmap bits HBITMAP hDestBitmap = (HBITMAP)GetCurrentObject(hDC, OBJ_BITMAP); @@ -3299,8 +3299,8 @@ static DWORD ske_HexToARGB(char * Hex) static wchar_t *ske_ReAppend(wchar_t *lfirst, wchar_t * lsecond, int len) { - size_t l1 = lfirst ? mir_tstrlen(lfirst) : 0; - size_t l2 = (len ? len : (mir_tstrlen(lsecond) + 1)); + size_t l1 = lfirst ? mir_wstrlen(lfirst) : 0; + size_t l2 = (len ? len : (mir_wstrlen(lsecond) + 1)); wchar_t *buf = (wchar_t *)mir_alloc((l1 + l2 + 1)*sizeof(wchar_t)); if (lfirst) memmove(buf, lfirst, l1*sizeof(wchar_t)); memmove(buf + l1, lsecond, l2*sizeof(wchar_t)); @@ -3311,8 +3311,8 @@ static wchar_t *ske_ReAppend(wchar_t *lfirst, wchar_t * lsecond, int len) wchar_t* ske_ReplaceVar(wchar_t *var) { - if (!var) return mir_tstrdup(L""); - if (!mir_tstrcmpi(var, L"Profile")) { + if (!var) return mir_wstrdup(L""); + if (!mir_wstrcmpi(var, L"Profile")) { char buf[MAX_PATH] = { 0 }; CallService(MS_DB_GETPROFILENAME, (WPARAM)MAX_PATH, (LPARAM)buf); @@ -3324,12 +3324,12 @@ wchar_t* ske_ReplaceVar(wchar_t *var) } mir_free(var); - return mir_tstrdup(L""); + return mir_wstrdup(L""); } wchar_t *ske_ParseText(wchar_t *stzText) { - size_t len = mir_tstrlen(stzText); + size_t len = mir_wstrlen(stzText); wchar_t *result = NULL; size_t stpos = 0, curpos = 0; diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 1b2514e0f7..5207c15c8b 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -123,11 +123,11 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara GetPrivateProfileString(L"Skin_Description_Section", L"URL", L"", URL, _countof(URL), sd->File); GetPrivateProfileString(L"Skin_Description_Section", L"Contact", L"", Contact, _countof(Contact), sd->File); GetPrivateProfileString(L"Skin_Description_Section", L"Description", L"", Description, _countof(Description), sd->File); - mir_sntprintf(text, TranslateT("%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), + mir_snwprintf(text, TranslateT("%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), sd->Name, Description, Author, Contact, URL, sd->File); } else { - mir_sntprintf(text, TranslateT("%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), + mir_snwprintf(text, TranslateT("%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), TranslateT("reVista for Modern v0.5"), TranslateT("This is second default Modern Contact list skin in Vista Aero style"), TranslateT("Angeli-Ka (graphics), FYR (template)"), @@ -261,7 +261,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara wchar_t prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 }; GetPrivateProfileString(L"Skin_Description_Section", L"Preview", L"", imfn, _countof(imfn), sd->File); IniParser::GetSkinFolder(sd->File, skinfolder); - mir_sntprintf(prfn, L"%s\\%s", skinfolder, imfn); + mir_snwprintf(prfn, L"%s\\%s", skinfolder, imfn); PathToAbsoluteT(prfn, imfn); hPreviewBitmap = ske_LoadGlyphImage(imfn); @@ -288,11 +288,11 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara GetPrivateProfileString(L"Skin_Description_Section", L"URL", L"", URL, _countof(URL), sd2->File); GetPrivateProfileString(L"Skin_Description_Section", L"Contact", L"", Contact, _countof(Contact), sd2->File); GetPrivateProfileString(L"Skin_Description_Section", L"Description", L"", Description, _countof(Description), sd2->File); - mir_sntprintf(text, TranslateT("Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s"), + mir_snwprintf(text, TranslateT("Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s"), sd2->Name, Description, Author, Contact, URL); } else { - mir_sntprintf(text, TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"), + mir_snwprintf(text, TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"), TranslateT("reVista for Modern v0.5"), TranslateT("This is second default Modern Contact list skin in Vista Aero style"), TranslateT("graphics by Angeli-Ka\ntemplate by FYR"), @@ -330,7 +330,7 @@ int SearchSkinFiles(HWND hwndDlg, wchar_t * Folder) struct _wfinddata_t fd = { 0 }; wchar_t mask[MAX_PATH]; long hFile; - mir_sntprintf(mask, L"%s\\*.msf", Folder); + mir_snwprintf(mask, L"%s\\*.msf", Folder); //fd.attrib = _A_SUBDIR; hFile = _wfindfirst(mask, &fd); if (hFile != -1) { @@ -339,13 +339,13 @@ int SearchSkinFiles(HWND hwndDlg, wchar_t * Folder) } while (!_wfindnext(hFile, &fd)); _findclose(hFile); } - mir_sntprintf(mask, L"%s\\*", Folder); + mir_snwprintf(mask, L"%s\\*", Folder); hFile = _wfindfirst(mask, &fd); do { - if (fd.attrib&_A_SUBDIR && !(mir_tstrcmpi(fd.name, L".") == 0 || mir_tstrcmpi(fd.name, L"..") == 0)) {//Next level of subfolders + if (fd.attrib&_A_SUBDIR && !(mir_wstrcmpi(fd.name, L".") == 0 || mir_wstrcmpi(fd.name, L"..") == 0)) {//Next level of subfolders wchar_t path[MAX_PATH]; - mir_sntprintf(path, L"%s\\%s", Folder, fd.name); + mir_snwprintf(path, L"%s\\%s", Folder, fd.name); SearchSkinFiles(hwndDlg, path); } } while (!_wfindnext(hFile, &fd)); @@ -367,7 +367,7 @@ HTREEITEM FillAvailableSkinList(HWND hwndDlg) SearchSkinFiles(hwndDlg, SkinsFolder); { wchar_t skinfull[MAX_PATH]; - ptrT skinfile(db_get_tsa(NULL, SKIN, "SkinFile")); + ptrW skinfile(db_get_tsa(NULL, SKIN, "SkinFile")); if (skinfile) { PathToAbsoluteT(skinfile, skinfull); res = AddSkinToListFullName(hwndDlg, skinfull); @@ -380,8 +380,8 @@ HTREEITEM AddSkinToListFullName(HWND hwndDlg, wchar_t * fullName) wchar_t path[MAX_PATH] = { 0 }; wchar_t file[MAX_PATH] = { 0 }; wchar_t *buf; - mir_tstrncpy(path, fullName, _countof(path)); - buf = path + mir_tstrlen(path); + mir_wstrncpy(path, fullName, _countof(path)); + buf = path + mir_wstrlen(path); while (buf > path) { if (*buf == '\\') { *buf = '\0'; @@ -390,7 +390,7 @@ HTREEITEM AddSkinToListFullName(HWND hwndDlg, wchar_t * fullName) buf--; } buf++; - mir_tstrncpy(file, buf, _countof(file)); + mir_wstrncpy(file, buf, _countof(file)); return AddSkinToList(hwndDlg, path, file); } @@ -403,12 +403,12 @@ HTREEITEM AddSkinToList(HWND hwndDlg, wchar_t * path, wchar_t* file) return 0; if (!file || wcschr(file, '%')) { - mir_sntprintf(sd->File, L"%%Default Skin%%"); - mir_sntprintf(sd->Name, TranslateT("%Default Skin%")); + mir_snwprintf(sd->File, L"%%Default Skin%%"); + mir_snwprintf(sd->Name, TranslateT("%Default Skin%")); wcsncpy_s(fullName, TranslateT("Default Skin"), _TRUNCATE); } else { - mir_sntprintf(fullName, L"%s\\%s", path, file); + mir_snwprintf(fullName, L"%s\\%s", path, file); wcsncpy_s(defskinname, file, _TRUNCATE); wchar_t *p = wcsrchr(defskinname, '.'); if (p) *p = 0; GetPrivateProfileString(L"Skin_Description_Section", L"Name", defskinname, sd->Name, _countof(sd->Name), fullName); @@ -433,7 +433,7 @@ HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, wchar_t * Caption, void * data tvi.pszText = buf; tvi.cchTextMax = _countof(buf); TreeView_GetItem(hTree, &tvi); - if (mir_tstrcmpi(Caption, tvi.pszText) == 0) { + if (mir_wstrcmpi(Caption, tvi.pszText) == 0) { if (!data) return tmp; @@ -443,7 +443,7 @@ HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, wchar_t * Caption, void * data TreeView_GetItem(hTree, &tvi2); SkinListData *sd = (SkinListData*)tvi2.lParam; if (sd) - if (!mir_tstrcmpi(sd->File, ((SkinListData*)data)->File)) + if (!mir_wstrcmpi(sd->File, ((SkinListData*)data)->File)) return tmp; } tmp = TreeView_GetNextSibling(hTree, tmp); @@ -471,11 +471,11 @@ HTREEITEM AddItemToTree(HWND hTree, wchar_t *itemName, void *data) INT_PTR SvcActiveSkin(WPARAM, LPARAM) { - ptrT skinfile(db_get_tsa(NULL, SKIN, "SkinFile")); + ptrW skinfile(db_get_tsa(NULL, SKIN, "SkinFile")); if (skinfile) { wchar_t skinfull[MAX_PATH]; PathToAbsoluteT(skinfile, skinfull); - return (INT_PTR)mir_tstrdup(skinfull); + return (INT_PTR)mir_wstrdup(skinfull); } return NULL; @@ -524,7 +524,7 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam) wchar_t skinfolder[MAX_PATH] = { 0 }; GetPrivateProfileString(L"Skin_Description_Section", L"Preview", L"", imfn, _countof(imfn), (LPCTSTR)lParam); IniParser::GetSkinFolder((LPCTSTR)lParam, skinfolder); - mir_sntprintf(prfn, L"%s\\%s", skinfolder, imfn); + mir_snwprintf(prfn, L"%s\\%s", skinfolder, imfn); PathToAbsoluteT(prfn, imfn); hPreviewBitmap = ske_LoadGlyphImage(imfn); diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp index d6a4a80fc5..119ceb7f8d 100644 --- a/plugins/Clist_modern/src/modern_skinselector.cpp +++ b/plugins/Clist_modern/src/modern_skinselector.cpp @@ -375,7 +375,7 @@ wchar_t* GetParamNT(char *string, wchar_t *buf, int buflen, BYTE paramN, char De WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim, BOOL SkipSpaces)
{
size_t i = 0, start = 0, CurentCount = 0, len;
- while (i < mir_tstrlen(string)) {
+ while (i < mir_wstrlen(string)) {
if (string[i] == Delim) {
if (CurentCount == paramN) break;
start = i + 1;
@@ -385,13 +385,13 @@ WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim }
if (CurentCount == paramN) {
if (SkipSpaces) { //remove spaces
- while (string[start] == ' ' && (int)start < mir_tstrlen(string))
+ while (string[start] == ' ' && (int)start < mir_wstrlen(string))
start++;
while (i > 1 && string[i - 1] == ' ' && i > (int)start)
i--;
}
len = ((int)(i - start) < buflen) ? i - start : buflen;
- mir_tstrncpy(buf, string + start, len);
+ mir_wstrncpy(buf, string + start, len);
buf[len] = '\0';
}
else buf[0] = '\0';
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index f49faaa894..8e2e364a9b 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -28,10 +28,10 @@ struct ProtoItemData : public MZeroedObject ptrA szProtoName;
ptrA szAccountName;
int iProtoStatus;
- ptrT tszProtoHumanName;
- ptrT szProtoEMailCount;
- ptrT tszProtoStatusText;
- ptrT tszProtoXStatus;
+ ptrW tszProtoHumanName;
+ ptrW szProtoEMailCount;
+ ptrW tszProtoStatusText;
+ ptrW tszProtoXStatus;
int iProtoPos;
int fullWidth;
RECT protoRect;
@@ -106,7 +106,7 @@ int LoadStatusBarData() if (g_CluiData.fDisableSkinEngine) {
g_StatusBarData.bkColour = cliGetColor("StatusBar", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "StatusBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrT tszBitmapName(db_get_tsa(NULL, "StatusBar", "BkBitmap"));
+ ptrW tszBitmapName(db_get_tsa(NULL, "StatusBar", "BkBitmap"));
if (tszBitmapName)
g_StatusBarData.hBmpBackground = Bitmap_Load(tszBitmapName);
}
@@ -241,15 +241,15 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) int nEmails = (int)CallProtoService(szProto, PS_GETUNREADEMAILCOUNT, 0, 0);
if (nEmails > 0) {
wchar_t str[40];
- mir_sntprintf(str, L"[%d]", nEmails);
- p->szProtoEMailCount = mir_tstrdup(str);
+ mir_snwprintf(str, L"[%d]", nEmails);
+ p->szProtoEMailCount = mir_wstrdup(str);
}
}
- p->tszProtoHumanName = mir_tstrdup(accs[i]->tszAccountName);
+ p->tszProtoHumanName = mir_wstrdup(accs[i]->tszAccountName);
p->szAccountName = mir_strdup(szProto);
p->szProtoName = mir_strdup(accs[i]->szProtoName);
- p->tszProtoStatusText = mir_tstrdup(pcli->pfnGetStatusModeDescription(p->iProtoStatus, 0));
+ p->tszProtoStatusText = mir_wstrdup(pcli->pfnGetStatusModeDescription(p->iProtoStatus, 0));
p->iProtoPos = iProtoInStatusMenu++;
p->bIsDimmed = 0;
@@ -348,7 +348,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) cs.flags = CSSF_MASK_NAME | CSSF_TCHAR;
cs.ptszName = str;
if (CallProtoService(p.szAccountName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) == 0)
- p.tszProtoXStatus = mir_tstrdup(str);
+ p.tszProtoXStatus = mir_wstrdup(str);
}
if ((p.xStatusMode & 3)) {
@@ -363,22 +363,22 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) SIZE txtSize;
if (p.bShowProtoName) {
- GetTextExtentPoint32(hDC, p.tszProtoHumanName, (int)mir_tstrlen(p.tszProtoHumanName), &txtSize);
+ GetTextExtentPoint32(hDC, p.tszProtoHumanName, (int)mir_wstrlen(p.tszProtoHumanName), &txtSize);
w += txtSize.cx + 3 + spaceWidth;
}
if (p.bShowProtoEmails && p.szProtoEMailCount) {
- GetTextExtentPoint32(hDC, p.szProtoEMailCount, (int)mir_tstrlen(p.szProtoEMailCount), &txtSize);
+ GetTextExtentPoint32(hDC, p.szProtoEMailCount, (int)mir_wstrlen(p.szProtoEMailCount), &txtSize);
w += txtSize.cx + 3 + spaceWidth;
}
if (p.bShowStatusName) {
- GetTextExtentPoint32(hDC, p.tszProtoStatusText, (int)mir_tstrlen(p.tszProtoStatusText), &txtSize);
+ GetTextExtentPoint32(hDC, p.tszProtoStatusText, (int)mir_wstrlen(p.tszProtoStatusText), &txtSize);
w += txtSize.cx + 3 + spaceWidth;
}
if ((p.xStatusMode & 8) && p.tszProtoXStatus) {
- GetTextExtentPoint32(hDC, p.tszProtoXStatus, (int)mir_tstrlen(p.tszProtoXStatus), &txtSize);
+ GetTextExtentPoint32(hDC, p.tszProtoXStatus, (int)mir_wstrlen(p.tszProtoXStatus), &txtSize);
w += txtSize.cx + 3 + spaceWidth;
}
@@ -517,7 +517,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) }
if (p.bShowProtoName) {
- int cbLen = (int)mir_tstrlen(p.tszProtoHumanName);
+ int cbLen = (int)mir_wstrlen(p.tszProtoHumanName);
RECT rt = r;
rt.left = x + (spaceWidth >> 1);
rt.top = textY;
@@ -531,7 +531,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) }
if (p.bShowProtoEmails && p.szProtoEMailCount != NULL) {
- int cbLen = (int)mir_tstrlen(p.szProtoEMailCount);
+ int cbLen = (int)mir_wstrlen(p.szProtoEMailCount);
RECT rt = r;
rt.left = x + (spaceWidth >> 1);
rt.top = textY;
@@ -544,7 +544,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) }
if (p.bShowStatusName) {
- int cbLen = (int)mir_tstrlen(p.tszProtoStatusText);
+ int cbLen = (int)mir_wstrlen(p.tszProtoStatusText);
RECT rt = r;
rt.left = x + (spaceWidth >> 1);
rt.top = textY;
@@ -560,7 +560,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) RECT rt = r;
rt.left = x + (spaceWidth >> 1);
rt.top = textY;
- ske_DrawText(hDC, p.tszProtoXStatus, (int)mir_tstrlen(p.tszProtoXStatus), &rt, 0);
+ ske_DrawText(hDC, p.tszProtoXStatus, (int)mir_wstrlen(p.tszProtoXStatus), &rt, 0);
}
p.protoRect = r;
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp index 0ea00a70be..24b642d0d9 100644 --- a/plugins/Clist_modern/src/modern_tbbutton.cpp +++ b/plugins/Clist_modern/src/modern_tbbutton.cpp @@ -238,7 +238,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam break;
case WM_SETTEXT:
- mir_tstrncpy(bct->szText, (wchar_t*)lParam, _countof(bct->szText));
+ mir_wstrncpy(bct->szText, (wchar_t*)lParam, _countof(bct->szText));
break;
case WM_SETFONT:
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp index 7db4523adb..3009c46d0c 100644 --- a/plugins/Clist_modern/src/modern_toolbar.cpp +++ b/plugins/Clist_modern/src/modern_toolbar.cpp @@ -138,7 +138,7 @@ static int ehhToolBarBackgroundSettingsChanged(WPARAM, LPARAM) if (g_CluiData.fDisableSkinEngine) {
tbdat.mtb_bkColour = cliGetColor("ToolBar", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "ToolBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrT tszBitmapName(db_get_tsa(NULL, "ToolBar", "BkBitmap"));
+ ptrW tszBitmapName(db_get_tsa(NULL, "ToolBar", "BkBitmap"));
if (tszBitmapName)
tbdat.mtb_hBmpBackground = Bitmap_Load(tszBitmapName);
}
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 8c4a49db88..bcfec081be 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -116,7 +116,7 @@ int FillModes(char *szsetting) if (szsetting[0] == 13)
return 1;
- ptrT temp(mir_utf8decodeT(szsetting));
+ ptrW temp(mir_utf8decodeW(szsetting));
if (temp != NULL)
SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_INSERTSTRING, -1, (LPARAM)temp);
return 1;
@@ -413,8 +413,8 @@ void SaveState() item.cchTextMax = _countof(szTemp);
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- mir_tstrncat(newGroupFilter, szTemp, _countof(newGroupFilter) - mir_tstrlen(newGroupFilter));
- mir_tstrncat(newGroupFilter, L"|", _countof(newGroupFilter) - mir_tstrlen(newGroupFilter));
+ mir_wstrncat(newGroupFilter, szTemp, _countof(newGroupFilter) - mir_wstrlen(newGroupFilter));
+ mir_wstrncat(newGroupFilter, L"|", _countof(newGroupFilter) - mir_wstrlen(newGroupFilter));
newGroupFilter[2047] = 0;
}
}
@@ -502,7 +502,7 @@ static void UpdateFilters() mir_strncpy(g_szModename, szBuf, _countof(g_szModename));
{
wchar_t szTemp[100];
- mir_sntprintf(szTemp, TranslateT("Configuring view mode: %s"), szTempBuf);
+ mir_snwprintf(szTemp, TranslateT("Configuring view mode: %s"), szTempBuf);
SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
}
mir_snprintf(szSetting, "%c%s_PF", 246, szBuf);
@@ -511,7 +511,7 @@ static void UpdateFilters() return;
mir_snprintf(szSetting, "%c%s_GF", 246, szBuf);
- ptrT szGF(db_get_tsa(NULL, CLVM_MODULE, szSetting));
+ ptrW szGF(db_get_tsa(NULL, CLVM_MODULE, szSetting));
if (szGF == NULL)
return;
@@ -561,7 +561,7 @@ static void UpdateFilters() for (i = 1; i < ListView_GetItemCount(hwndList); i++) {
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- mir_sntprintf(szMask, L"%s|", szTemp);
+ mir_snwprintf(szMask, L"%s|", szTemp);
if (szGF && wcsstr(szGF, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
@@ -890,7 +890,7 @@ static int FillMenuCallback(char *szSetting) if (szSetting[0] == 13)
return 1;
- wchar_t *temp = mir_utf8decodeT(szSetting);
+ wchar_t *temp = mir_utf8decodeW(szSetting);
if (temp) {
AppendMenu(hViewModeMenu, MFT_STRING, menuCounter++, temp);
mir_free(temp);
@@ -987,7 +987,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
if (g_CluiData.bFilterEffective)
- SetDlgItemText(hwnd, IDC_SELECTMODE, ptrT(mir_utf8decodeT(g_CluiData.current_viewmode)));
+ SetDlgItemText(hwnd, IDC_SELECTMODE, ptrW(mir_utf8decodeW(g_CluiData.current_viewmode)));
else
SetDlgItemText(hwnd, IDC_SELECTMODE, TranslateT("All contacts"));
break;
@@ -1167,7 +1167,7 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM, LPARAM) if (g_CluiData.fDisableSkinEngine) {
view_mode.bkColour = cliGetColor("ViewMode", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "ViewMode", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrT tszBitmapName(db_get_tsa(NULL, "ViewMode", "BkBitmap"));
+ ptrW tszBitmapName(db_get_tsa(NULL, "ViewMode", "BkBitmap"));
if (tszBitmapName)
view_mode.hBmpBackground = Bitmap_Load(tszBitmapName);
}
@@ -1268,8 +1268,8 @@ void ApplyViewMode(const char *Name, bool onlySelector) }
mir_snprintf(szSetting, "%c%s_GF", 246, Name);
if (!db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv)) {
- if (mir_tstrlen(dbv.ptszVal) >= 2) {
- mir_tstrncpy(g_CluiData.groupFilter, dbv.ptszVal, _countof(g_CluiData.groupFilter));
+ if (mir_wstrlen(dbv.ptszVal) >= 2) {
+ mir_wstrncpy(g_CluiData.groupFilter, dbv.ptszVal, _countof(g_CluiData.groupFilter));
g_CluiData.groupFilter[_countof(g_CluiData.groupFilter) - 1] = 0;
g_CluiData.bFilterEffective |= CLVM_FILTER_GROUPS;
}
@@ -1360,7 +1360,7 @@ void ApplyViewMode(const char *Name, bool onlySelector) }
}
- SetWindowText(hwndSelector, ptrT(mir_utf8decodeW((Name[0] == 13) ? Name + 1 : Name)));
+ SetWindowText(hwndSelector, ptrW(mir_utf8decodeW((Name[0] == 13) ? Name + 1 : Name)));
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
cliInvalidateRect(pcli->hwndStatus, NULL, FALSE);
diff --git a/plugins/Clist_modern/src/stdafx.h b/plugins/Clist_modern/src/stdafx.h index 814eed1ffa..3f58571406 100644 --- a/plugins/Clist_modern/src/stdafx.h +++ b/plugins/Clist_modern/src/stdafx.h @@ -181,7 +181,7 @@ void MakeButtonSkinned(HWND hWnd); #endif
#define strsetA(a,b) {if (a) mir_free_and_nill(a); a=mir_strdup(b);}
-#define strsetT(a,b) {if (a) mir_free_and_nill(a); a=mir_tstrdup(b);}
+#define strsetT(a,b) {if (a) mir_free_and_nill(a); a=mir_wstrdup(b);}
void TRACE_ERROR();
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index fef024d3b1..42ce47c46c 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -326,7 +326,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) ctl->sLabel.cx = ctl->sLabel.cy = 0;
}
else {
- GetTextExtentPoint32(hdcMem, ctl->szText, (int)mir_tstrlen(ctl->szText), &ctl->sLabel);
+ GetTextExtentPoint32(hdcMem, ctl->szText, (int)mir_wstrlen(ctl->szText), &ctl->sLabel);
if (g_cxsmIcon + ctl->sLabel.cx + 8 > rcClient.right - rcClient.left)
ctl->sLabel.cx = (rcClient.right - rcClient.left) - g_cxsmIcon - 8;
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index cc7ec10771..7d25e6faf0 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -404,7 +404,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case INTM_NAMECHANGED:
if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
break;
- mir_tstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
+ mir_wstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
RTL_DetectAndSet(contact, 0);
@@ -490,7 +490,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L contact->proto = GetContactProto(wParam);
pcli->pfnInvalidateDisplayNameCacheEntry(wParam);
- mir_tstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
+ mir_wstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
RTL_DetectAndSet(contact, 0);
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index d46f474e20..4aeb70399c 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -164,7 +164,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) DBVARIANT dbv = { 0 };
INT_PTR result = db_get_ts(hContact, "CList", "StatusMsg", &dbv);
- if (!result && mir_tstrlen(dbv.ptszVal) > 0)
+ if (!result && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_CLIST;
else {
if (!szProto)
@@ -172,11 +172,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (szProto) {
if (!result)
db_free(&dbv);
- if (!(result = db_get_ts(hContact, szProto, "YMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ if (!(result = db_get_ts(hContact, szProto, "YMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_YIM;
- else if (!(result = db_get_ts(hContact, szProto, "StatusDescr", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ts(hContact, szProto, "StatusDescr", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_GG;
- else if (!(result = db_get_ts(hContact, szProto, "XStatusMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ts(hContact, szProto, "XStatusMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_XSTATUS;
}
}
@@ -185,8 +185,8 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (!result)
db_free(&dbv);
result = db_get_ts(hContact, szProto, "XStatusName", &dbv);
- if (!result && mir_tstrlen(dbv.ptszVal) > 1) {
- size_t iLen = mir_tstrlen(dbv.ptszVal);
+ if (!result && mir_wstrlen(dbv.ptszVal) > 1) {
+ size_t iLen = mir_wstrlen(dbv.ptszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
p->statusMsg = (wchar_t *)realloc(p->statusMsg, (iLen + 2) * sizeof(wchar_t));
wcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
@@ -205,8 +205,8 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) cst.ptszName = xStatusName;
if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, hContact, (LPARAM)&cst)) {
wchar_t *szwXstatusName = TranslateTS(xStatusName);
- p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_tstrlen(szwXstatusName) + 2) * sizeof(wchar_t));
- wcsncpy(p->statusMsg, szwXstatusName, mir_tstrlen(szwXstatusName) + 1);
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_wstrlen(szwXstatusName) + 2) * sizeof(wchar_t));
+ wcsncpy(p->statusMsg, szwXstatusName, mir_wstrlen(szwXstatusName) + 1);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
}
}
@@ -215,7 +215,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (p->bStatusMsgValid > STATUSMSG_XSTATUSNAME) {
int j = 0;
- p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_tstrlen(dbv.ptszVal) + 2) * sizeof(wchar_t));
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_wstrlen(dbv.ptszVal) + 2) * sizeof(wchar_t));
for (int i = 0; dbv.ptszVal[i]; i++) {
if (dbv.ptszVal[i] == (wchar_t)0x0d)
continue;
@@ -407,10 +407,10 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, struct ClcData }
if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
- ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
wchar_t szGroupMask[256];
- mir_sntprintf(szGroupMask, L"%s|", tszGroup);
+ mir_snwprintf(szGroupMask, L"%s|", tszGroup);
int bHasGroup = wcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0;
filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | bHasGroup) : (filterResult & bHasGroup);
}
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index 76d2aa23ed..e8f3488f7b 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -485,7 +485,7 @@ set_bg_l: }
else if (type == CLCIT_DIVIDER) {
ChangeToFont(hdcMem, dat, FONTID_DIVIDERS, &fontHeight);
- GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_tstrlen(contact->szText), &textSize);
+ GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_wstrlen(contact->szText), &textSize);
}
else if (type == CLCIT_CONTACT && flags & CONTACTF_NOTONLIST)
ChangeToFont(hdcMem, dat, FONTID_NOTONLIST, &fontHeight);
@@ -501,13 +501,13 @@ set_bg_l: wchar_t *szCounts = NULL;
if (type == CLCIT_GROUP) {
- GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_tstrlen(contact->szText), &textSize);
+ GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_wstrlen(contact->szText), &textSize);
int width = textSize.cx;
szCounts = pcli->pfnGetGroupCountsText(dat, contact);
if (szCounts[0]) {
GetTextExtentPoint32(hdcMem, L" ", 1, &spaceSize);
ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
- GetTextExtentPoint32(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &countsSize);
+ GetTextExtentPoint32(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &countsSize);
width += spaceSize.cx + countsSize.cx;
}
}
@@ -969,7 +969,7 @@ bgskipped: rc2.left = rcContent.left;
rc2.right = rc2.left - dat->rightMargin + ((clRect->right - rc2.left - textSize.cx) >> 1) - 3;
DrawEdge(hdcMem, &rc2, BDR_SUNKENOUTER, BF_RECT);
- TextOut(hdcMem, rc2.right + 3, y + ((rowHeight - fontHeight) >> 1), contact->szText, (int)mir_tstrlen(contact->szText));
+ TextOut(hdcMem, rc2.right + 3, y + ((rowHeight - fontHeight) >> 1), contact->szText, (int)mir_wstrlen(contact->szText));
rc2.left = rc2.right + 6 + textSize.cx;
rc2.right = clRect->right - dat->rightMargin;
DrawEdge(hdcMem, &rc2, BDR_SUNKENOUTER, BF_RECT);
@@ -1002,7 +1002,7 @@ bgskipped: int labelWidth = textSize.cx + countsSize.cx + spaceSize.cx;
int offset = (g_center) ? ((rc2.right - rc2.left) - labelWidth) / 2 : 0;
- TextOut(hdcMem, rc2.left + offset + textSize.cx + spaceSize.cx, rc2.top + groupCountsFontTopShift, szCounts, (int)mir_tstrlen(szCounts));
+ TextOut(hdcMem, rc2.left + offset + textSize.cx + spaceSize.cx, rc2.top + groupCountsFontTopShift, szCounts, (int)mir_wstrlen(szCounts));
rightLineStart = rc2.left + offset + textSize.cx + spaceSize.cx + countsSize.cx + 2;
if (selected && !g_ignoreselforgroups)
@@ -1110,7 +1110,7 @@ bgskipped: COLORREF oldColor = GetTextColor(hdcMem);
int idOldFont = dat->currentFontID;
ChangeToFont(hdcMem, dat, FONTID_TIMESTAMP, &fHeight);
- GetTextExtentPoint32(hdcMem, szResult, (int)mir_tstrlen(szResult), &szTime);
+ GetTextExtentPoint32(hdcMem, szResult, (int)mir_wstrlen(szResult), &szTime);
verticalfit = (rowHeight - fHeight >= g_cysmIcon + 1);
if (av_right) {
@@ -1191,7 +1191,7 @@ bgskipped: LONG rightIconsTop = rcContent.bottom - g_cysmIcon;
LONG old_right = rcContent.right;
ULONG textCounter = 0;
- size_t ulLen = mir_tstrlen(szText);
+ size_t ulLen = mir_wstrlen(szText);
LONG old_bottom = rcContent.bottom;
DWORD i_dtFlags = DT_WORDBREAK | DT_NOPREFIX | dt_2ndrowflags;
dtp.cbSize = sizeof(dtp);
@@ -1215,7 +1215,7 @@ bgskipped: if (selected) {
if (type != CLCIT_DIVIDER) {
RECT rc2;
- int qlen = (int)mir_tstrlen(dat->szQuickSearch);
+ int qlen = (int)mir_wstrlen(dat->szQuickSearch);
if (hPreviousFont)
SelectObject(hdcMem, hPreviousFont);
SetTextColor(hdcMem, dat->quickSearchColour);
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 576642bf86..3bfc67c656 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -37,7 +37,7 @@ extern void ( *saveRecalcScrollBar )(HWND hwnd, struct ClcData *dat); static int MY_pathIsAbsolute(const wchar_t *path)
{
- if (!path || !(mir_tstrlen(path) > 2))
+ if (!path || !(mir_wstrlen(path) > 2))
return 0;
if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
@@ -52,7 +52,7 @@ size_t MY_pathToRelative(const wchar_t *pSrc, wchar_t *pOut) if (!pSrc || !pOut)
return 0;
- dwSrcLen = mir_tstrlen(pSrc);
+ dwSrcLen = mir_wstrlen(pSrc);
if (!dwSrcLen || dwSrcLen > (MAX_PATH - 1))
return 0;
if (!MY_pathIsAbsolute(pSrc))
@@ -63,7 +63,7 @@ size_t MY_pathToRelative(const wchar_t *pSrc, wchar_t *pOut) szTmp[dwSrcLen] = 0;
wcslwr(szTmp);
if (wcsstr(szTmp, cfg::dat.tszProfilePath)) {
- dwProfilePathLen = mir_tstrlen(cfg::dat.tszProfilePath);
+ dwProfilePathLen = mir_wstrlen(cfg::dat.tszProfilePath);
memcpy(pOut, (pSrc + (dwProfilePathLen - 1)), ((dwSrcLen - (dwProfilePathLen - 1)) * sizeof(wchar_t)));
pOut[0] = '.';
pOut[dwSrcLen] = 0;
@@ -82,7 +82,7 @@ size_t MY_pathToAbsolute(const wchar_t *pSrc, wchar_t *pOut) if (!pSrc || !pOut)
return 0;
- dwSrcLen = mir_tstrlen(pSrc);
+ dwSrcLen = mir_wstrlen(pSrc);
if (!dwSrcLen || dwSrcLen > (MAX_PATH - 1))
return 0;
@@ -92,7 +92,7 @@ size_t MY_pathToAbsolute(const wchar_t *pSrc, wchar_t *pOut) return dwSrcLen;
}
if (pSrc[0] == '.')
- return (mir_sntprintf(pOut, MAX_PATH, L"%s\\%s", cfg::dat.tszProfilePath, pSrc));
+ return (mir_snwprintf(pOut, MAX_PATH, L"%s\\%s", cfg::dat.tszProfilePath, pSrc));
return 0;
}
@@ -164,7 +164,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, ClcContact *hitcontac hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_GROUPS].hFont));
else
hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_CONTACTS].hFont));
- GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
+ GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_wstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
wchar_t *szCounts;
@@ -173,7 +173,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, ClcContact *hitcontac GetTextExtentPoint32(hdc, L" ", 1, &textSize);
width += textSize.cx;
SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont);
- GetTextExtentPoint32(hdc, szCounts, (int)mir_tstrlen(szCounts), &textSize);
+ GetTextExtentPoint32(hdc, szCounts, (int)mir_wstrlen(szCounts), &textSize);
width += textSize.cx;
}
}
@@ -305,7 +305,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_GROUPS].hFont));
else
hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_CONTACTS].hFont));
- GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
+ GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_wstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
wchar_t *szCounts;
@@ -314,7 +314,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c GetTextExtentPoint32(hdc, L" ", 1, &textSize);
width += textSize.cx;
SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont);
- GetTextExtentPoint32(hdc, szCounts, (int)mir_tstrlen(szCounts), &textSize);
+ GetTextExtentPoint32(hdc, szCounts, (int)mir_wstrlen(szCounts), &textSize);
width += textSize.cx;
}
}
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index 6a504da5b3..01f6882ce7 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -264,7 +264,7 @@ CListEvent* AddEvent(CLISTEVENT *cle) wchar_t szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
- mir_sntprintf(szBuffer, L"%s: %s (%s)", szwProto, szName, szStatus);
+ mir_snwprintf(szBuffer, L"%s: %s (%s)", szwProto, szName, szStatus);
szBuffer[127] = 0;
AppendMenu(cfg::dat.hMenuNotify, MF_BYCOMMAND | MF_STRING, cfg::dat.wNextMenuID, szBuffer);
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index 94cfbf6e52..8f8f9b6018 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -102,7 +102,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA DWORD dwFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0);
BYTE bSecondLine = db_get_b(hContact, "CList", "CLN_2ndline", -1);
- mir_sntprintf(szTitle, TranslateT("Contact list display and ignore options for %s"), contact ? contact->szText : pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szTitle, TranslateT("Contact list display and ignore options for %s"), contact ? contact->szText : pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hWnd, szTitle);
Window_SetSkinIcon_IcoLib(hWnd, SKINICON_OTHER_MIRANDA);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 954d08a5bd..639cffa96e 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -267,7 +267,7 @@ static void InitIcoLib() continue; wchar_t szDescr[128]; - mir_sntprintf(szDescr, TranslateT("%s connecting"), accs[k]->tszAccountName); + mir_snwprintf(szDescr, TranslateT("%s connecting"), accs[k]->tszAccountName); IconItemT icon = { szDescr, "conn", IDI_PROTOCONNECTING }; Icon_RegisterT(g_hInst, LPGENW("Contact list") L"/" LPGENW("Connecting icons"), &icon, 1, accs[k]->szModuleName); } @@ -1416,7 +1416,7 @@ skipbg: MessageBox(0, TranslateT("The requested action requires a valid contact selection. Please select a contact from the contact list and repeat."), TranslateT("Parameter mismatch"), MB_OK); if (serviceFailure) { wchar_t szError[512]; - mir_sntprintf(szError, TranslateT("The service %S specified by the %S button definition was not found. You may need to install additional plugins."), item->szService, item->szName); + mir_snwprintf(szError, TranslateT("The service %S specified by the %S button definition was not found. You may need to install additional plugins."), item->szService, item->szName); MessageBox(NULL, szError, TranslateT("Service failure"), MB_OK); } break; @@ -1709,22 +1709,22 @@ buttons_done: wchar_t szName[64]; PROTOACCOUNT *pa = Proto_GetAccount(szProto); if (pa) { - mir_tstrncpy(szName, pa->tszAccountName, _countof(szName)); + mir_wstrncpy(szName, pa->tszAccountName, _countof(szName)); szName[_countof(szName) - 1] = 0; } else szName[0] = 0; - if (mir_tstrlen(szName) < sizeof(szName) - 1) - mir_tstrcat(szName, L" "); - GetTextExtentPoint32(dis->hDC, szName, (int)mir_tstrlen(szName), &textSize); - TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szName, (int)mir_tstrlen(szName)); + if (mir_wstrlen(szName) < sizeof(szName) - 1) + mir_wstrcat(szName, L" "); + GetTextExtentPoint32(dis->hDC, szName, (int)mir_wstrlen(szName), &textSize); + TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szName, (int)mir_wstrlen(szName)); x += textSize.cx; } if (showOpts & 4) { wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0); - GetTextExtentPoint32(dis->hDC, szStatus, (int)mir_tstrlen(szStatus), &textSize); - TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, (int)mir_tstrlen(szStatus)); + GetTextExtentPoint32(dis->hDC, szStatus, (int)mir_wstrlen(szStatus), &textSize); + TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, (int)mir_wstrlen(szStatus)); } } else if (dis->CtlType == ODT_MENU) { @@ -1827,7 +1827,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar { wchar_t str[64]; DWORD v = pluginInfo.version; - mir_sntprintf(str, L"%s %d.%d.%d.%d", TranslateT("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v))); + mir_snwprintf(str, L"%s %d.%d.%d.%d", TranslateT("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v))); SetDlgItemText(hwndDlg, IDC_VERSION, str); } { diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index 53e2692258..4e7b17a37f 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -472,9 +472,9 @@ int LocateStorePosition(int Frameid, int maxstored) for (int i = 0; i < maxstored; i++) { char settingname[255]; mir_snprintf(settingname, "Name%d", i); - ptrT frmname(db_get_tsa(0, CLUIFrameModule, settingname)); + ptrW frmname(db_get_tsa(0, CLUIFrameModule, settingname)); if (frmname == NULL) continue; - if (mir_tstrcmpi(frmname, Frames[Frameid].name) == 0) + if (mir_wstrcmpi(frmname, Frames[Frameid].name) == 0) return i; } return -1; @@ -867,7 +867,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) return -1; mir_free(Frames[pos].name); - Frames[pos].name = (wParam & FO_UNICODETEXT) ? mir_u2t((LPWSTR)lParam) : mir_a2t((LPSTR)lParam); + Frames[pos].name = (wParam & FO_UNICODETEXT) ? mir_wstrdup((LPWSTR)lParam) : mir_a2u((LPSTR)lParam); return 0; case FO_TBNAME: @@ -875,7 +875,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) return -1; mir_free(Frames[pos].TitleBar.tbname); - Frames[pos].TitleBar.tbname = (wParam & FO_UNICODETEXT) ? mir_u2t((LPWSTR)lParam) : mir_a2t((LPSTR)lParam); + Frames[pos].TitleBar.tbname = (wParam & FO_UNICODETEXT) ? mir_wstrdup((LPWSTR)lParam) : mir_a2u((LPSTR)lParam); lck.unlock(); if (Frames[pos].floating && (Frames[pos].TitleBar.tbname != NULL)) @@ -887,7 +887,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) return -1; mir_free(Frames[pos].TitleBar.tooltip); - Frames[pos].TitleBar.tooltip = (wParam & FO_UNICODETEXT) ? mir_u2t((LPWSTR)lParam) : mir_a2t((LPSTR)lParam); + Frames[pos].TitleBar.tooltip = (wParam & FO_UNICODETEXT) ? mir_wstrdup((LPWSTR)lParam) : mir_a2u((LPSTR)lParam); UpdateTBToolTip(pos); return 0; @@ -1014,7 +1014,7 @@ INT_PTR CLUIFramesShowHideFrame(WPARAM frameId, LPARAM) { mir_cslock lck(csFrameHook); pos = id2pos(frameId); - if (pos >= 0 && !mir_tstrcmp(Frames[pos].name, L"My contacts")) + if (pos >= 0 && !mir_wstrcmp(Frames[pos].name, L"My contacts")) Frames[pos].visible = 1; else { if (pos >= 0 && (int)pos < nFramescount) @@ -1599,15 +1599,15 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) { wchar_t ptszClassName[256]; GetClassName(Frames[nFramescount].hWnd, ptszClassName, _countof(ptszClassName)); - Frames[nFramescount].name = mir_tstrdup(ptszClassName); + Frames[nFramescount].name = mir_wstrdup(ptszClassName); } - else Frames[nFramescount].name = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->wname) : mir_a2t(clfrm->name); + else Frames[nFramescount].name = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->wname) : mir_a2u(clfrm->name); if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname == NULL || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->TBwname) : mir_strlen(clfrm->TBname)) == 0) - Frames[nFramescount].TitleBar.tbname = mir_tstrdup(Frames[nFramescount].name); + Frames[nFramescount].TitleBar.tbname = mir_wstrdup(Frames[nFramescount].name); else - Frames[nFramescount].TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->TBwname) : mir_a2t(clfrm->TBname); + Frames[nFramescount].TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->TBwname) : mir_a2u(clfrm->TBname); Frames[nFramescount].needhide = FALSE; Frames[nFramescount].TitleBar.ShowTitleBar = (clfrm->Flags & F_SHOWTB ? TRUE : FALSE); Frames[nFramescount].TitleBar.ShowTitleBarTip = (clfrm->Flags & F_SHOWTBTIP ? TRUE : FALSE); @@ -2153,7 +2153,7 @@ int OnFrameTitleBarBackgroundChange() hBmpBackground = NULL; } if (db_get_b(NULL, "FrameTitleBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) { - ptrT tszBitmapName(db_get_tsa(NULL, "FrameTitleBar", "BkBitmap")); + ptrW tszBitmapName(db_get_tsa(NULL, "FrameTitleBar", "BkBitmap")); if (tszBitmapName != NULL) hBmpBackground = Bitmap_Load(tszBitmapName); } @@ -2224,11 +2224,11 @@ static int DrawTitleBar(HDC dc, RECT rect, int Frameid) if (!AlignCOLLIconToLeft) { if (Frames[pos].TitleBar.hicon != NULL) { DrawIconEx(hdcMem, 6 + cfg::dat.bClipBorder, ((TitleBarH >> 1) - 8), Frames[pos].TitleBar.hicon, 16, 16, 0, NULL, DI_NORMAL); - TextOut(hdcMem, 24 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_tstrlen(Frames[pos].TitleBar.tbname)); + TextOut(hdcMem, 24 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_wstrlen(Frames[pos].TitleBar.tbname)); } - else TextOut(hdcMem, 6 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_tstrlen(Frames[pos].TitleBar.tbname)); + else TextOut(hdcMem, 6 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_wstrlen(Frames[pos].TitleBar.tbname)); } - else TextOut(hdcMem, 18 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_tstrlen(Frames[pos].TitleBar.tbname)); + else TextOut(hdcMem, 18 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_wstrlen(Frames[pos].TitleBar.tbname)); if (!AlignCOLLIconToLeft) DrawIconEx(hdcMem, Frames[pos].TitleBar.wndSize.right - 22, ((TitleBarH >> 1) - 8), Frames[pos].collapsed ? Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN) : Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT), 16, 16, 0, NULL, DI_NORMAL); @@ -2896,7 +2896,7 @@ wchar_t g_ptszEventName[100]; static int CLUIFrameOnModulesLoad(WPARAM, LPARAM) { - mir_sntprintf(g_ptszEventName, L"mf_update_evt_%d", GetCurrentThreadId()); + mir_snwprintf(g_ptszEventName, L"mf_update_evt_%d", GetCurrentThreadId()); g_hEventThread = CreateEvent(NULL, TRUE, FALSE, g_ptszEventName); hThreadMFUpdate = mir_forkthread(MF_UpdateThread, NULL); SetThreadPriority(hThreadMFUpdate, THREAD_PRIORITY_IDLE); diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index fe8f5e380f..f3cdc54267 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -84,7 +84,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l Utils::enableDlgControl(hwndDlg, IDC_AUTOSIZEUPWARD, FALSE);
}
{
- ptrT tszTitle(db_get_tsa(NULL, "CList", "TitleText"));
+ ptrW tszTitle(db_get_tsa(NULL, "CList", "TitleText"));
if (tszTitle != NULL)
SetDlgItemText(hwndDlg, IDC_TITLETEXT, tszTitle);
else
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index 826fcdfcab..e4116b900a 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -131,16 +131,16 @@ void CluiProtocolStatusChanged(int, const char*) if (showOpts & 1)
x += 16;
if (showOpts & 2) {
- mir_tstrncpy(szName, pa->tszAccountName, _countof(szName));
+ mir_wstrncpy(szName, pa->tszAccountName, _countof(szName));
szName[_countof(szName) - 1] = 0;
- if ((showOpts & 4) && mir_tstrlen(szName) < sizeof(szName) - 1)
- mir_tstrcat(szName, L" ");
- GetTextExtentPoint32(hdc, szName, (int)mir_tstrlen(szName), &textSize);
+ if ((showOpts & 4) && mir_wstrlen(szName) < sizeof(szName) - 1)
+ mir_wstrcat(szName, L" ");
+ GetTextExtentPoint32(hdc, szName, (int)mir_wstrlen(szName), &textSize);
x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
if (showOpts & 4) {
wchar_t* modeDescr = pcli->pfnGetStatusModeDescription(CallProtoService(accs[i]->szModuleName, PS_GETSTATUS, 0, 0), 0);
- GetTextExtentPoint32(hdc, modeDescr, (int)mir_tstrlen(modeDescr), &textSize);
+ GetTextExtentPoint32(hdc, modeDescr, (int)mir_wstrlen(modeDescr), &textSize);
x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
partWidths[partCount] = (partCount ? partWidths[partCount - 1] : cfg::dat.bCLeft) + x + 2;
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 663e4dadef..b42c4a24ab 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -202,7 +202,7 @@ int API::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, wch memcpy(&exCtx, ep->ContextRecord, sizeof(CONTEXT));
mir_snprintf(exSzFile, "%s%s", szName, szExt);
- mir_sntprintf(exReason, L"An application error has occured: %s", szReason);
+ mir_snwprintf(exReason, L"An application error has occured: %s", szReason);
exLine = line;
exLastResult = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_EXCEPTION), 0, Ex_DlgProc, 0);
exAllowContinue = fAllowContinue;
@@ -240,10 +240,10 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename, bool useGetHandle) throw(CRTException("Error while loading system library", szFilename));
sysPathName[MAX_PATH - 1] = 0;
- if (mir_tstrlen(sysPathName) + mir_tstrlen(szFilename) >= MAX_PATH)
+ if (mir_wstrlen(sysPathName) + mir_wstrlen(szFilename) >= MAX_PATH)
throw(CRTException("Error while loading system library", szFilename));
- mir_tstrcat(sysPathName, szFilename);
+ mir_wstrcat(sysPathName, szFilename);
if (useGetHandle)
_h = ::GetModuleHandle(sysPathName);
else
@@ -260,15 +260,15 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename, bool useGetHandle) CRTException::CRTException(const char *szMsg, const wchar_t *szParam) : std::runtime_error(std::string(szMsg))
{
- mir_sntprintf(m_szParam, MAX_PATH, szParam);
+ mir_snwprintf(m_szParam, MAX_PATH, szParam);
}
void CRTException::display() const
{
- wchar_t *tszMsg = mir_a2t(what());
+ wchar_t *tszMsg = mir_a2u(what());
wchar_t tszBoxMsg[500];
- mir_sntprintf(tszBoxMsg, L"%s\n\n(%s)", tszMsg, m_szParam);
+ mir_snwprintf(tszBoxMsg, L"%s\n\n(%s)", tszMsg, m_szParam);
::MessageBox(0, tszBoxMsg, L"Clist_nicer runtime error", MB_OK | MB_ICONERROR);
mir_free(tszMsg);
}
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 5ed6ee4347..f25aa3dc81 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -1543,7 +1543,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L DBVARIANT dbv = { 0 };
if (!db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv)) {
- if (mir_tstrcmp(dbv.ptszVal, final_path))
+ if (mir_wstrcmp(dbv.ptszVal, final_path))
skinChanged = TRUE;
db_free(&dbv);
}
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index 6484ccba6a..0bdf030fb0 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -160,7 +160,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM BYTE isLocked = db_get_b(NULL, PD->RealName, "LockMainStatus", 0);
wchar_t szTipText[256];
- mir_sntprintf(szTipText, L"<b>%s</b>: %s%s",
+ mir_snwprintf(szTipText, L"<b>%s</b>: %s%s",
PD->RealName, pcli->pfnGetStatusModeDescription(wStatus, 0), isLocked ? L" (LOCKED)" : L"");
CLCINFOTIP ti = { sizeof(ti) };
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 772f2e0fa0..8a0e588ce9 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -434,7 +434,7 @@ void UpdateFilters() mir_strncpy(sttModeName, szBuf, sizeof(sttModeName));
{
wchar_t szTemp[100];
- mir_sntprintf(szTemp, TranslateT("Current view mode: %S"), sttModeName);
+ mir_snwprintf(szTemp, TranslateT("Current view mode: %S"), sttModeName);
SetDlgItemText(sttClvmHwnd, IDC_CURVIEWMODE2, szTemp);
}
@@ -493,7 +493,7 @@ void UpdateFilters() for (int i = 1; i < ListView_GetItemCount(hwndList); i++) {
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- mir_sntprintf(szMask, L"%s|", szTemp);
+ mir_snwprintf(szMask, L"%s|", szTemp);
if (dbv_gf.ptszVal && wcsstr(dbv_gf.ptszVal, szMask)) {
ListView_SetCheckState(hwndList, i, TRUE);
}
@@ -1042,8 +1042,8 @@ void ApplyViewMode(const char *name) }
mir_snprintf(szSetting, "%c%s_GF", 246, name);
- ptrT tszGroups(db_get_tsa(NULL, CLVM_MODULE, szSetting));
- if (mir_tstrlen(tszGroups) >= 2) {
+ ptrW tszGroups(db_get_tsa(NULL, CLVM_MODULE, szSetting));
+ if (mir_wstrlen(tszGroups) >= 2) {
wcsncpy_s(cfg::dat.groupFilter, tszGroups, _TRUNCATE);
cfg::dat.bFilterEffective |= CLVM_FILTER_GROUPS;
}
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index 69d3d93578..066dc41aa0 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -152,7 +152,7 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, #pragma warning (disable: 4312)
char* GetContactName(MCONTACT hContact, char *szProto)
{
- ptrT name(Contact_GetInfo(CNF_DISPLAY, hContact, szProto));
+ ptrW name(Contact_GetInfo(CNF_DISPLAY, hContact, szProto));
return (name == NULL) ? NULL : strdup(_T2A(name));
}
#pragma warning (default: 4312)
@@ -175,7 +175,7 @@ char* GetContactID(MCONTACT hContact) char* GetContactID(MCONTACT hContact, char *szProto)
{
- ptrT name(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto));
+ ptrW name(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto));
return (name == NULL) ? NULL : strdup(_T2A(name));
}
#pragma warning (default: 4312)
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 51371d27fc..e62f6c83b9 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -76,11 +76,11 @@ BOOL strrep(wchar_t *src, wchar_t *needle, wchar_t *newstring) wcsncpy_s(begining, src, pos);
begining[pos] = 0;
- pos = pos + mir_tstrlen(needle);
+ pos = pos + mir_wstrlen(needle);
wcsncpy_s(tail, src + pos, _TRUNCATE);
begining[pos] = 0;
- pos = mir_sntprintf(src, mir_tstrlen(src), L"%s%s%s", begining, newstring, tail);
+ pos = mir_snwprintf(src, mir_wstrlen(src), L"%s%s%s", begining, newstring, tail);
return TRUE;
}
@@ -194,16 +194,16 @@ void fillExceptionsListView(HWND hwndDlg) ListView_InsertItem(hwndList, &lvI);
lvI.iSubItem = 1;
if (tmp->intIntPort == -1)
- mir_sntprintf(tmpAddress, L"%s:*", tmp->strIntIp);
+ mir_snwprintf(tmpAddress, L"%s:*", tmp->strIntIp);
else
- mir_sntprintf(tmpAddress, L"%s:%d", tmp->strIntIp, tmp->intIntPort);
+ mir_snwprintf(tmpAddress, L"%s:%d", tmp->strIntIp, tmp->intIntPort);
lvI.pszText = tmpAddress;
ListView_SetItem(hwndList, &lvI);
lvI.iSubItem = 2;
if (tmp->intExtPort == -1)
- mir_sntprintf(tmpAddress, L"%s:*", tmp->strExtIp);
+ mir_snwprintf(tmpAddress, L"%s:*", tmp->strExtIp);
else
- mir_sntprintf(tmpAddress, L"%s:%d", tmp->strExtIp, tmp->intExtPort);
+ mir_snwprintf(tmpAddress, L"%s:%d", tmp->strExtIp, tmp->intExtPort);
lvI.pszText = tmpAddress;
ListView_SetItem(hwndList, &lvI);
lvI.iSubItem = 3;
@@ -298,9 +298,9 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar bOptionsOpen = TRUE;
TranslateDialogDefault(hwndDlg);//translate miranda function
#ifdef _WIN64
- mir_sntprintf(buff, L"%d.%d.%d.%d/64", HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
+ mir_snwprintf(buff, L"%d.%d.%d.%d/64", HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
#else
- mir_sntprintf(buff, L"%d.%d.%d.%d/32", HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
+ mir_snwprintf(buff, L"%d.%d.%d.%d/32", HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
#endif
SetDlgItemText(hwndDlg, IDC_VERSION, buff);
LoadSettings();
@@ -699,7 +699,7 @@ static unsigned __stdcall checkthread(void *) #ifdef _DEBUG
wchar_t msg[1024];
- mir_sntprintf(msg, L"%s:%d\n%s:%d", cur->strIntIp, cur->intIntPort, cur->strExtIp, cur->intExtPort);
+ mir_snwprintf(msg, L"%s:%d\n%s:%d", cur->strIntIp, cur->intIntPort, cur->strExtIp, cur->intExtPort);
_OutputDebugString(L"New connection: %s", msg);
#endif
pid2name(cur->Pid, cur->PName, _countof(cur->PName));
@@ -769,7 +769,7 @@ void showMsg(wchar_t *pName, DWORD pid, wchar_t *intIp, wchar_t *extIp, int intP //99% of the times you'll just copy this line.
//1% of the times you may wish to change the contact's name. I don't know why you should, but you can.
//char * lpzText;
- //The text for the second line. You could even make something like: char lpzText[128]; mir_tstrcpy(lpzText, "Hello world!"); It's your choice.
+ //The text for the second line. You could even make something like: char lpzText[128]; mir_wstrcpy(lpzText, "Hello world!"); It's your choice.
struct CONNECTION *mpd = (struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION));
//MessageBox(NULL,"aaa","aaa",1);
@@ -779,11 +779,11 @@ void showMsg(wchar_t *pName, DWORD pid, wchar_t *intIp, wchar_t *extIp, int intP if (settingResolveIp) {
wchar_t hostName[128];
getDnsName(extIp, hostName, _countof(hostName));
- mir_sntprintf(ppd.lptzText, L"%s:%d\n%s:%d", hostName, extPort, intIp, intPort);
+ mir_snwprintf(ppd.lptzText, L"%s:%d\n%s:%d", hostName, extPort, intIp, intPort);
}
- else mir_sntprintf(ppd.lptzText, L"%s:%d\n%s:%d", extIp, extPort, intIp, intPort);
+ else mir_snwprintf(ppd.lptzText, L"%s:%d\n%s:%d", extIp, extPort, intIp, intPort);
- mir_sntprintf(ppd.lptzContactName, L"%s (%s)", pName, tcpStates[state - 1]);
+ mir_snwprintf(ppd.lptzContactName, L"%s (%s)", pName, tcpStates[state - 1]);
if (settingSetColours) {
ppd.colorBack = settingBgColor;
diff --git a/plugins/ConnectionNotify/src/filter.cpp b/plugins/ConnectionNotify/src/filter.cpp index f0c40dfed8..db9b205e0f 100644 --- a/plugins/ConnectionNotify/src/filter.cpp +++ b/plugins/ConnectionNotify/src/filter.cpp @@ -133,7 +133,7 @@ static INT_PTR CALLBACK ConnectionFilterEditProc(HWND hWnd, UINT message, WPARAM BOOL checkFilter(struct CONNECTION *head, struct CONNECTION *conn)
{
for (struct CONNECTION *cur = head; cur != NULL; cur = cur->next)
- if (wildcmpt(conn->PName, cur->PName) && wildcmpt(conn->strIntIp, cur->strIntIp) && wildcmpt(conn->strExtIp, cur->strExtIp)
+ if (wildcmpw(conn->PName, cur->PName) && wildcmpw(conn->strIntIp, cur->strIntIp) && wildcmpw(conn->strExtIp, cur->strExtIp)
&& (cur->intIntPort == -1 || cur->intIntPort == conn->intIntPort) && (cur->intExtPort == -1 || cur->intExtPort == conn->intExtPort))
return cur->Pid;
diff --git a/plugins/ConnectionNotify/src/netstat.cpp b/plugins/ConnectionNotify/src/netstat.cpp index a9827bf7f4..663e22a16e 100644 --- a/plugins/ConnectionNotify/src/netstat.cpp +++ b/plugins/ConnectionNotify/src/netstat.cpp @@ -41,14 +41,14 @@ struct CONNECTION *GetConnectionsTable() if (pTcpTable->table[i].dwLocalAddr) { IpAddr.S_un.S_addr = (ULONG)pTcpTable->table[i].dwLocalAddr; //_snprintf(newConn->strIntIp,_countof(newConn->strIntIp),"%d.%d.%d.%d",IpAddr.S_un.S_un_b.s_b1,IpAddr.S_un.S_un_b.s_b2,IpAddr.S_un.S_un_b.s_b3,IpAddr.S_un.S_un_b.s_b4); - wchar_t *strIntIp = mir_a2t(inet_ntoa(IpAddr)); + wchar_t *strIntIp = mir_a2u(inet_ntoa(IpAddr)); wcsncpy(newConn->strIntIp, strIntIp, _countof(newConn->strIntIp) - 1); mir_free(strIntIp); } if (pTcpTable->table[i].dwRemoteAddr) { IpAddr.S_un.S_addr = (u_long)pTcpTable->table[i].dwRemoteAddr; - wchar_t *strExtIp = mir_a2t(inet_ntoa(IpAddr)); + wchar_t *strExtIp = mir_a2u(inet_ntoa(IpAddr)); wcsncpy(newConn->strExtIp, strExtIp, _countof(newConn->strExtIp) - 1); mir_free(strExtIp); } @@ -126,8 +126,8 @@ void deleteConnectionsTable(struct CONNECTION *head) struct CONNECTION *searchConnection(struct CONNECTION *head, wchar_t *intIp, wchar_t *extIp, int intPort, int extPort, int state) { for (struct CONNECTION *cur = head; cur != NULL; cur = cur->next) { - if (mir_tstrcmp(cur->strIntIp, intIp) == 0 && - mir_tstrcmp(cur->strExtIp, extIp) == 0 && + if (mir_wstrcmp(cur->strIntIp, intIp) == 0 && + mir_wstrcmp(cur->strExtIp, extIp) == 0 && cur->intExtPort == extPort && cur->intIntPort == intPort && cur->state == state) @@ -140,7 +140,7 @@ void getDnsName(wchar_t *strIp, wchar_t *strHostName, size_t len) { in_addr iaHost; - char *szStrIP = mir_t2a(strIp); + char *szStrIP = mir_u2a(strIp); iaHost.s_addr = inet_addr(szStrIP); mir_free(szStrIP); hostent *h = gethostbyaddr((char *)&iaHost, sizeof(struct in_addr), AF_INET); diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 5c3d44da55..856a2752c7 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -404,7 +404,7 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP while (str != NULL) {
lvi.pszText = &str[0];
- tmplen = len = (DWORD)mir_tstrlen(lvi.pszText);
+ tmplen = len = (DWORD)mir_wstrlen(lvi.pszText);
while (len > wraplen) {
szBreak = lvi.pszText[wraplen];
@@ -505,7 +505,7 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP HGLOBAL hClipboardData = GlobalAlloc(GMEM_DDESHARE, (dst - buf + 1) * sizeof(wchar_t));
if (hClipboardData) {
wchar_t *pchData = (wchar_t *)GlobalLock(hClipboardData);
- mir_tstrcpy(pchData, buf);
+ mir_wstrcpy(pchData, buf);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_UNICODETEXT, hClipboardData);
}
@@ -621,7 +621,7 @@ static INT_PTR CALLBACK ConsoleDlgProc(HWND hwndDlg, UINT message, WPARAM wParam CallService(MS_DB_GETPROFILEPATHT, (WPARAM)_countof(path), (LPARAM)path);
- mir_sntprintf(title, L"%s - %s\\%s", TranslateT("Miranda Console"), path, name);
+ mir_snwprintf(title, L"%s - %s\\%s", TranslateT("Miranda Console"), path, name);
SetWindowText(hwndDlg, title);
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcons[0]);
@@ -1096,8 +1096,8 @@ static int OnFontChange(WPARAM, LPARAM) FontIDT fid = { 0 };
fid.cbSize = sizeof(fid);
- mir_tstrncpy(fid.group, LPGENW("Console"), _countof(fid.group));
- mir_tstrncpy(fid.name, LPGENW("Text"), _countof(fid.name));
+ mir_wstrncpy(fid.group, LPGENW("Console"), _countof(fid.group));
+ mir_wstrncpy(fid.name, LPGENW("Text"), _countof(fid.name));
colLogFont = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&LogFont);
@@ -1120,26 +1120,26 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) FontIDT fid = { 0 };
fid.cbSize = sizeof(fid);
- mir_tstrncpy(fid.group, LPGENW("Console"), _countof(fid.group));
- mir_tstrncpy(fid.name, LPGENW("Text"), _countof(fid.name));
+ mir_wstrncpy(fid.group, LPGENW("Console"), _countof(fid.group));
+ mir_wstrncpy(fid.name, LPGENW("Text"), _countof(fid.name));
mir_strncpy(fid.dbSettingsGroup, "Console", _countof(fid.dbSettingsGroup));
mir_strncpy(fid.prefix, "ConsoleFont", _countof(fid.prefix));
- mir_tstrncpy(fid.backgroundGroup, LPGENW("Console"), _countof(fid.backgroundGroup));
- mir_tstrncpy(fid.backgroundName, LPGENW("Background"), _countof(fid.backgroundName));
+ mir_wstrncpy(fid.backgroundGroup, LPGENW("Console"), _countof(fid.backgroundGroup));
+ mir_wstrncpy(fid.backgroundName, LPGENW("Background"), _countof(fid.backgroundName));
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.colour = RGB(0, 0, 0);
fid.deffontsettings.size = 10;
fid.deffontsettings.style = 0;
- mir_tstrncpy(fid.deffontsettings.szFace, L"Courier", _countof(fid.deffontsettings.szFace));
+ mir_wstrncpy(fid.deffontsettings.szFace, L"Courier", _countof(fid.deffontsettings.szFace));
FontRegisterT(&fid);
HookEvent(ME_FONT_RELOAD, OnFontChange);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(cid);
- mir_tstrncpy(cid.group, LPGENW("Console"), _countof(cid.group));
- mir_tstrncpy(cid.name, LPGENW("Background"), _countof(cid.name));
+ mir_wstrncpy(cid.group, LPGENW("Console"), _countof(cid.group));
+ mir_wstrncpy(cid.name, LPGENW("Background"), _countof(cid.name));
mir_strncpy(cid.dbSettingsGroup, "Console", _countof(cid.dbSettingsGroup));
mir_strncpy(cid.setting, "BgColor", _countof(cid.setting));
cid.defcolour = RGB(255, 255, 255);
@@ -1259,8 +1259,8 @@ void ShutdownConsole(void) ////////////////////////////////////////////////////////////////////////////////
wchar_t *addstring(wchar_t *str, wchar_t *add) {
- mir_tstrcpy(str, add);
- return str + mir_tstrlen(add) + 1;
+ mir_wstrcpy(str, add);
+ return str + mir_wstrlen(add) + 1;
}
@@ -1272,7 +1272,7 @@ static int Openfile(wchar_t *outputFile, int selection) wchar_t *filter, *tmp, *tmp1, *tmp2;
tmp1 = TranslateT("Text Files (*.txt)");
tmp2 = TranslateT("All Files");
- filter = tmp = (wchar_t*)_alloca((mir_tstrlen(tmp1) + mir_tstrlen(tmp2) + 11)*sizeof(wchar_t));
+ filter = tmp = (wchar_t*)_alloca((mir_wstrlen(tmp1) + mir_wstrlen(tmp2) + 11)*sizeof(wchar_t));
tmp = addstring(tmp, tmp1);
tmp = addstring(tmp, L"*.TXT");
tmp = addstring(tmp, tmp2);
@@ -1296,7 +1296,7 @@ static int Openfile(wchar_t *outputFile, int selection) if (!GetSaveFileName(&ofn))
return 0;
- mir_tstrcpy(outputFile, filename);
+ mir_wstrcpy(outputFile, filename);
return 1;
}
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 8852ad0eea..2117b37bb1 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -74,7 +74,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent) {
//add event to the contact list
wchar_t caToolTip[128];
- mir_sntprintf(caToolTip, L"%s %s", TranslateT("Contacts received from"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(caToolTip, L"%s %s", TranslateT("Contacts received from"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = {};
cle.hContact = hContact;
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index 0373609632..fe354361d6 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -141,9 +141,9 @@ static MCONTACT CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *w wchar_t *caUIN = ListView_GetItemTextEx(GetDlgItem(hwndDlg, IDC_CONTACTS), iItem, 0);
char *szProto = GetContactProto(wndData->mhContact);
wndData->rhSearch = (HANDLE)CallProtoService(szProto, PS_BASICSEARCH, 0, (LPARAM)caUIN); // find it
- replaceStrT(wndData->haUin, caUIN);
+ replaceStrW(wndData->haUin, caUIN);
for (int j = 0; j < wndData->cbReceived; j++)
- if (!mir_tstrcmp(wndData->maReceived[j]->mcaUIN, caUIN))
+ if (!mir_wstrcmp(wndData->maReceived[j]->mcaUIN, caUIN))
return (MCONTACT)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(PALF_TEMPORARY, j), (LPARAM)wndData->mhDbEvent);
return NULL;
}
@@ -220,13 +220,13 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TReceivedItem* pItem = wndData->AddReceivedItem();
if (dbe.flags & DBEF_UTF)
- pItem->mcaNick = mir_utf8decodeT(pcBlob);
+ pItem->mcaNick = mir_utf8decodeW(pcBlob);
else
- pItem->mcaNick = mir_a2t(pcBlob);
+ pItem->mcaNick = mir_a2u(pcBlob);
pcBlob += strsize + 1;
// UIN
strsize = (int)strlennull(pcBlob);
- pItem->mcaUIN = mir_a2t(pcBlob);
+ pItem->mcaUIN = mir_a2u(pcBlob);
pcBlob += strsize + 1;
// add to listview
lvi.iItem = nItem;
@@ -315,7 +315,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara // found checked contact item, add it
wchar_t *caUIN = ListView_GetItemTextEx(hLV, i, 0);
for (int j = 0; j < wndData->cbReceived; j++) // determine item index in packet
- if (!mir_tstrcmp(wndData->maReceived[j]->mcaUIN, caUIN)) {
+ if (!mir_wstrcmp(wndData->maReceived[j]->mcaUIN, caUIN)) {
char *szProto =GetContactProto(wndData->mhContact);
hContact = (MCONTACT)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(0, j), (LPARAM)wndData->mhDbEvent);
if (hContact && caGroup) {
@@ -437,7 +437,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara fi.psz = wndData->haUin;
int iLPos = ListView_FindItem(hLV, -1, &fi);
if (iLPos == -1) iLPos = 0;
- if (mir_tstrcmp(psr->nick.w, L"") && psr->nick.w)
+ if (mir_wstrcmp(psr->nick.w, L"") && psr->nick.w)
ListView_SetItemText(hLV, iLPos, 1, psr->nick.w);
ListView_SetItemText(hLV, iLPos, 2, psr->firstName.w);
ListView_SetItemText(hLV, iLPos, 3, psr->lastName.w);
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index 7674ed4d57..5031b03ac9 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -411,8 +411,8 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara int i;
for (i = 0; i < ackData->nContacts; i++) {
// prepare data & count size
- maSend[i].mcaNick = mir_utf8encodeT(pcli->pfnGetContactDisplayName(ackData->aContacts[i], 0));
- maSend[i].mcaUIN = mir_utf8encodeT(ptrT(GetContactUID(ackData->aContacts[i])));
+ maSend[i].mcaNick = mir_utf8encodeW(pcli->pfnGetContactDisplayName(ackData->aContacts[i], 0));
+ maSend[i].mcaUIN = mir_utf8encodeW(ptrW(GetContactUID(ackData->aContacts[i])));
dbei.cbBlob += (DWORD)strlennull(maSend[i].mcaUIN) + (DWORD)strlennull((char*)maSend[i].mcaNick) + 2;
}
dbei.pBlob = (PBYTE)_alloca(dbei.cbBlob);
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp index f16a559fe2..0cb84a1642 100644 --- a/plugins/ContactsPlus/src/utils.cpp +++ b/plugins/ContactsPlus/src/utils.cpp @@ -69,17 +69,17 @@ wchar_t* GetContactUID(MCONTACT hContact) if (vrUid.type == DBVT_DWORD) {
wchar_t tmp[100];
_itow(vrUid.dVal, tmp, 10);
- return mir_tstrdup(tmp);
+ return mir_wstrdup(tmp);
}
if (vrUid.type == DBVT_ASCIIZ) {
- wchar_t *res = mir_a2t(vrUid.pszVal);
+ wchar_t *res = mir_a2u(vrUid.pszVal);
mir_free(vrUid.pszVal);
return res;
}
if (vrUid.type == DBVT_UTF8) {
- wchar_t *res = mir_utf8decodeT(vrUid.pszVal);
+ wchar_t *res = mir_utf8decodeW(vrUid.pszVal);
mir_free(vrUid.pszVal);
return res;
}
@@ -115,22 +115,22 @@ void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, MCONTACT hContact) void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, wchar_t *pszTitleStart)
{
wchar_t newtitle[512];
- mir_tstrncpy(newtitle, TranslateTS(pszTitleStart), _countof(newtitle));
+ mir_wstrncpy(newtitle, TranslateTS(pszTitleStart), _countof(newtitle));
if (hContact) {
char *szProto = GetContactProto(hContact);
if (szProto) {
- ptrT uid(GetContactUID(hContact));
+ ptrW uid(GetContactUID(hContact));
wchar_t *contactName = pcli->pfnGetContactDisplayName(hContact, 0);
wchar_t oldTitle[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_NAME, oldTitle, _countof(oldTitle));
- if (mir_tstrcmp(uid ? uid : contactName, oldTitle))
+ if (mir_wstrcmp(uid ? uid : contactName, oldTitle))
SetDlgItemText(hwndDlg, IDC_NAME, uid ? uid : contactName);
wchar_t *szStatus = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
- mir_sntprintf(newtitle, L"%s %s (%s)", TranslateTS(pszTitleStart), contactName, szStatus);
+ mir_snwprintf(newtitle, L"%s %s (%s)", TranslateTS(pszTitleStart), contactName, szStatus);
}
}
diff --git a/plugins/CountryFlags/src/ip2country.cpp b/plugins/CountryFlags/src/ip2country.cpp index 261f91aaa2..b3411d8ec9 100644 --- a/plugins/CountryFlags/src/ip2country.cpp +++ b/plugins/CountryFlags/src/ip2country.cpp @@ -207,27 +207,27 @@ static int EnumIpDataLines(const char *pszFileCSV,const char *pszFileOut) buf=strchr(pszCountry,'"');
*buf=pszTwo[2]='\0';
/* corrections */
- if (!mir_tstrcmpi(pszCountry,"ANTARCTICA")) continue;
- if (!mir_tstrcmpi(pszCountry,"TIMOR-LESTE")) continue;
- if (!mir_tstrcmpi(pszCountry,"PALESTINIAN TERRITORY, OCCUPIED"))
- mir_tstrcpy(pszCountry,"ISRAEL");
- else if (!mir_tstrcmpi(pszCountry,"UNITED STATES MINOR OUTLYING ISLANDS"))
- mir_tstrcpy(pszCountry,"UNITED STATES");
- else if (!mir_tstrcmpi(pszCountry,"SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS"))
- mir_tstrcpy(pszCountry,"UNITED KINGDOM");
- else if (!mir_tstrcmpi(pszTwo,"JE")) /* map error */
- mir_tstrcpy(pszCountry,"UNITED KINGDOM");
- else if (!mir_tstrcmpi(pszTwo,"AX")) /* Åland Island belongs to Finland */
- mir_tstrcpy(pszCountry,"FINLAND");
- else if (!mir_tstrcmpi(pszTwo,"ME"))
- mir_tstrcpy(pszCountry,"MONTENEGRO");
- else if (!mir_tstrcmpi(pszTwo,"RS") || !mir_tstrcmpi(pszTwo,"CS"))
- mir_tstrcpy(pszCountry,"SERBIA");
+ if (!mir_wstrcmpi(pszCountry,"ANTARCTICA")) continue;
+ if (!mir_wstrcmpi(pszCountry,"TIMOR-LESTE")) continue;
+ if (!mir_wstrcmpi(pszCountry,"PALESTINIAN TERRITORY, OCCUPIED"))
+ mir_wstrcpy(pszCountry,"ISRAEL");
+ else if (!mir_wstrcmpi(pszCountry,"UNITED STATES MINOR OUTLYING ISLANDS"))
+ mir_wstrcpy(pszCountry,"UNITED STATES");
+ else if (!mir_wstrcmpi(pszCountry,"SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS"))
+ mir_wstrcpy(pszCountry,"UNITED KINGDOM");
+ else if (!mir_wstrcmpi(pszTwo,"JE")) /* map error */
+ mir_wstrcpy(pszCountry,"UNITED KINGDOM");
+ else if (!mir_wstrcmpi(pszTwo,"AX")) /* Åland Island belongs to Finland */
+ mir_wstrcpy(pszCountry,"FINLAND");
+ else if (!mir_wstrcmpi(pszTwo,"ME"))
+ mir_wstrcpy(pszCountry,"MONTENEGRO");
+ else if (!mir_wstrcmpi(pszTwo,"RS") || !mir_wstrcmpi(pszTwo,"CS"))
+ mir_wstrcpy(pszCountry,"SERBIA");
/* convert */
for(i=0;i<nCountriesCount;i++) {
/* map different writings */
for(j=0;j<_countof(differentCountryNames);j++)
- if (!mir_tstrcmpi(countries[i].szName,differentCountryNames[j].szMir)) {
+ if (!mir_wstrcmpi(countries[i].szName,differentCountryNames[j].szMir)) {
buf=(char*)differentCountryNames[j].szCSV;
break;
}
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index 5c96a12456..eec8817037 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -68,7 +68,7 @@ INT_PTR StoreVersionInfoToFile(WPARAM, LPARAM lParam) CreateDirectoryTreeT(VersionInfoFolder);
wchar_t path[MAX_PATH];
- mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
+ mir_snwprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
HANDLE hDumpFile = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hDumpFile != INVALID_HANDLE_VALUE) {
@@ -103,7 +103,7 @@ INT_PTR UploadVersionInfo(WPARAM, LPARAM lParam) PrintVersionInfo(buffer);
VerTrnsfr *trn = (VerTrnsfr*)mir_alloc(sizeof(VerTrnsfr));
- trn->buf = mir_utf8encodeT(buffer.c_str());
+ trn->buf = mir_utf8encodeW(buffer.c_str());
trn->autot = lParam == 0xa1;
mir_forkthread(VersionInfoUploadThread, trn);
@@ -133,7 +133,7 @@ INT_PTR GetVersionInfo(WPARAM wParam, LPARAM lParam) CMString buffer;
PrintVersionInfo(buffer, (unsigned int)wParam);
char **retData = (char **)lParam;
- *retData = mir_utf8encodeT(buffer.c_str());
+ *retData = mir_utf8encodeW(buffer.c_str());
if (*retData)
result = 0; //success
}
@@ -156,10 +156,10 @@ INT_PTR OpenUrl(WPARAM wParam, LPARAM) INT_PTR CopyLinkToClipboard(WPARAM, LPARAM)
{
- ptrT tmp(db_get_wsa(NULL, PluginName, "Username"));
+ ptrW tmp(db_get_wsa(NULL, PluginName, "Username"));
if (tmp != NULL) {
wchar_t buffer[MAX_PATH];
- mir_sntprintf(buffer, L"http://vi.miranda-ng.org/detail/%s", tmp);
+ mir_snwprintf(buffer, L"http://vi.miranda-ng.org/detail/%s", tmp);
int bufLen = (sizeof(buffer) + 1) * sizeof(wchar_t);
HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, bufLen);
@@ -245,7 +245,7 @@ static int ModulesLoaded(WPARAM, LPARAM) crs_a2t(vertxt, temp);
if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) {
- replaceStrT(profpath, L"%miranda_userdata%");
+ replaceStrW(profpath, L"%miranda_userdata%");
// Removed because it isn't available on Load()
// hCrashLogFolder = FoldersRegisterCustomPathT(PluginName, LPGEN("Crash Reports"), CrashLogFolder);
@@ -368,7 +368,7 @@ extern "C" int __declspec(dllexport) Load(void) profname = Utils_ReplaceVarsT(L"%miranda_profilename%.dat");
profpath = Utils_ReplaceVarsT(L"%miranda_userdata%");
if (catchcrashes && !needrestart)
- mir_sntprintf(CrashLogFolder, TEXT("%s\\CrashLog"), profpath);
+ mir_snwprintf(CrashLogFolder, TEXT("%s\\CrashLog"), profpath);
wcsncpy_s(VersionInfoFolder, profpath, _TRUNCATE);
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index 3fa432aa47..7843451951 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -178,7 +178,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
- mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\*.dll"));
+ mir_snwprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\*.dll"));
WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFile(path, &FindFileData);
@@ -193,7 +193,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) do {
bool loaded = false;
- mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\%s"), FindFileData.cFileName);
+ mir_snwprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\%s"), FindFileData.cFileName);
HMODULE hModule = GetModuleHandle(path);
if (hModule == NULL && servicemode) {
hModule = LoadLibrary(path);
@@ -264,7 +264,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) else
lsttmppv->next = lst;
- if (mir_tstrcmpi(FindFileData.cFileName, TEXT("weather.dll")) == 0)
+ if (mir_wstrcmpi(FindFileData.cFileName, TEXT("weather.dll")) == 0)
flags |= VI_FLAG_WEATHER;
++count;
@@ -357,7 +357,7 @@ static void GetWeatherStrings(CMString& buffer, unsigned flags) LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
- mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\weather\\*.ini"));
+ mir_snwprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\weather\\*.ini"));
WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFile(path, &FindFileData);
@@ -366,7 +366,7 @@ static void GetWeatherStrings(CMString& buffer, unsigned flags) do {
if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue;
- mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\weather\\%s"), FindFileData.cFileName);
+ mir_snwprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\weather\\%s"), FindFileData.cFileName);
HANDLE hDumpFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -424,7 +424,7 @@ static void GetIconStrings(CMString& buffer) LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
- mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\Icons\\*.*"));
+ mir_snwprintf(fname, MAX_PATH - (fname - path), TEXT("\\Icons\\*.*"));
WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFile(path, &FindFileData);
@@ -480,7 +480,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) buffer.AppendFormat(TEXT("Build time: %s\r\n"), mirtime);
wchar_t profpn[MAX_PATH];
- mir_sntprintf(profpn, TEXT("%s\\%s"), profpathfull, profname);
+ mir_snwprintf(profpn, TEXT("%s\\%s"), profpathfull, profname);
DATABASELINK *db = FindDatabasePlugin(profpn);
diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp index 6fbace54c1..eef812a33a 100644 --- a/plugins/CrashDumper/src/exhndlr.cpp +++ b/plugins/CrashDumper/src/exhndlr.cpp @@ -55,13 +55,13 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify) __try {
if (dtsubfldr) {
- mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
+ mir_snwprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
CreateDirectory(path, NULL);
- mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
+ mir_snwprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
}
else
- mir_sntprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
+ mir_snwprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
hDumpFile = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -82,18 +82,18 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify) __try {
if (dtsubfldr) {
- mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
+ mir_snwprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
CreateDirectory(path, NULL);
- mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
+ mir_snwprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
}
else
- mir_sntprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
+ mir_snwprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
hDumpFile = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
- mir_sntprintf(path, TranslateT("Miranda crashed. Crash report stored in the folder:\n %s\n\n Would you like store it in the clipboard as well?"), CrashLogFolder);
+ mir_snwprintf(path, TranslateT("Miranda crashed. Crash report stored in the folder:\n %s\n\n Would you like store it in the clipboard as well?"), CrashLogFolder);
if (hDumpFile != INVALID_HANDLE_VALUE)
CreateCrashReport(hDumpFile, exc_ptr, notify ? path : NULL);
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp index 14e018aa2f..319740aaa7 100644 --- a/plugins/CrashDumper/src/ui.cpp +++ b/plugins/CrashDumper/src/ui.cpp @@ -69,7 +69,7 @@ INT_PTR CALLBACK DlgProcView(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara CHARFORMAT2 chf;
chf.cbSize = sizeof(chf);
SendDlgItemMessage(hwndDlg, IDC_VIEWVERSIONINFO, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&chf);
- mir_tstrcpy(chf.szFaceName, TEXT("Courier New"));
+ mir_wstrcpy(chf.szFaceName, TEXT("Courier New"));
SendDlgItemMessage(hwndDlg, IDC_VIEWVERSIONINFO, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&chf);
CMString buffer;
@@ -279,7 +279,7 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case 3:
wchar_t path[MAX_PATH];
- mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
+ mir_snwprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
ShellExecute(NULL, TEXT("open"), path, NULL, NULL, SW_SHOW);
break;
@@ -301,12 +301,12 @@ void ShowMessage(int type, const wchar_t* format, ...) va_list va;
va_start(va, format);
- int len = mir_vsntprintf(pi.lptzText, _countof(pi.lptzText) - 1, format, va);
+ int len = mir_vsnwprintf(pi.lptzText, _countof(pi.lptzText) - 1, format, va);
pi.lptzText[len] = 0;
va_end(va);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- mir_tstrcpy(pi.lptzContactName, TEXT(PluginName));
+ mir_wstrcpy(pi.lptzContactName, TEXT(PluginName));
pi.lchIcon = LoadIconEx(IDI_VI);
pi.PluginWindowProc = DlgProcPopup;
pi.PluginData = (void*)type;
diff --git a/plugins/CrashDumper/src/utils.cpp b/plugins/CrashDumper/src/utils.cpp index 356bf6a8a1..df32598f4a 100644 --- a/plugins/CrashDumper/src/utils.cpp +++ b/plugins/CrashDumper/src/utils.cpp @@ -52,14 +52,14 @@ void GetISO8061Time(SYSTEMTIME *stLocal, LPTSTR lpszString, DWORD dwSize) if (clsdates) {
GetDateFormat(LOCALE_INVARIANT, 0, stLocal, TEXT("d MMM yyyy"), lpszString, dwSize);
- int dlen = (int)mir_tstrlen(lpszString);
+ int dlen = (int)mir_wstrlen(lpszString);
GetTimeFormat(LOCALE_INVARIANT, 0, stLocal, TEXT(" H:mm:ss"), lpszString + dlen, dwSize - dlen);
}
else {
int offset = GetTZOffset();
// Build a string showing the date and time.
- mir_sntprintf(lpszString, dwSize, TEXT("%d-%02d-%02d %02d:%02d:%02d%+03d%02d"),
+ mir_snwprintf(lpszString, dwSize, TEXT("%d-%02d-%02d %02d:%02d:%02d%+03d%02d"),
stLocal->wYear, stLocal->wMonth, stLocal->wDay,
stLocal->wHour, stLocal->wMinute, stLocal->wSecond,
offset / 60, offset % 60);
@@ -129,13 +129,13 @@ void GetInternetExplorerVersion(CMString &buffer) if (ieVersion[0] == 0) {
if (iVer[0] == 0)
buffer.Append(TEXT("<not installed>"));
- else if (mir_tstrcmp(iVer, TEXT("100")) == 0)
+ else if (mir_wstrcmp(iVer, TEXT("100")) == 0)
buffer.Append(TEXT("1.0"));
- else if (mir_tstrcmp(iVer, TEXT("101")) == 0)
+ else if (mir_wstrcmp(iVer, TEXT("101")) == 0)
buffer.Append(TEXT("NT"));
- else if (mir_tstrcmp(iVer, TEXT("102")) == 0)
+ else if (mir_wstrcmp(iVer, TEXT("102")) == 0)
buffer.Append(TEXT("2.0"));
- else if (mir_tstrcmp(iVer, TEXT("103")) == 0)
+ else if (mir_wstrcmp(iVer, TEXT("103")) == 0)
buffer.Append(TEXT("3.0"));
}
else buffer.Append(ieVersion);
@@ -175,12 +175,12 @@ void GetProcessorString(CMString &buffer) if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Hardware\\Description\\System\\CentralProcessor\\0"), 0, KEY_QUERY_VALUE, &hKey)) {
size = _countof(cpuName);
if (RegQueryValueEx(hKey, TEXT("ProcessorNameString"), NULL, NULL, (LPBYTE)cpuName, &size) != ERROR_SUCCESS)
- mir_tstrcpy(cpuName, TEXT("Unknown"));
+ mir_wstrcpy(cpuName, TEXT("Unknown"));
size = _countof(cpuIdent);
if (RegQueryValueEx(hKey, TEXT("Identifier"), NULL, NULL, (LPBYTE)cpuIdent, &size) != ERROR_SUCCESS)
if (RegQueryValueEx(hKey, TEXT("VendorIdentifier"), NULL, NULL, (LPBYTE)cpuIdent, &size) != ERROR_SUCCESS)
- mir_tstrcpy(cpuIdent, TEXT("Unknown"));
+ mir_wstrcpy(cpuIdent, TEXT("Unknown"));
RegCloseKey(hKey);
}
diff --git a/plugins/CryptoPP/src/PGPw/sdk8.cpp b/plugins/CryptoPP/src/PGPw/sdk8.cpp index e91f714d6b..5dd4cb1ebe 100644 --- a/plugins/CryptoPP/src/PGPw/sdk8.cpp +++ b/plugins/CryptoPP/src/PGPw/sdk8.cpp @@ -163,7 +163,7 @@ LPSTR __cdecl _pgp_encrypt_keydb(LPCSTR szPlainMsg, PVOID pgpKeyID) PGPFindKeyByKeyID(pgpKeyDB, RemoteKeyID, &PublicKey);
PGPError err = PGPEncode(pgpContext,
- PGPOInputBuffer(pgpContext, szPlainMsg, mir_tstrlen(szPlainMsg)),
+ PGPOInputBuffer(pgpContext, szPlainMsg, mir_strlen(szPlainMsg)),
PGPOArmorOutput(pgpContext, TRUE),
PGPOAllocatedOutputBuffer(pgpContext, (LPVOID *)&szEncMsg, 16384, &dwEncMsgLen),
PGPOEncryptToKeyDBObj(pgpContext, PublicKey),
@@ -206,7 +206,7 @@ LPSTR __cdecl _pgp_decrypt_keydb(LPCSTR szEncMsg) }
PGPError err = PGPDecode(pgpContext,
- PGPOInputBuffer(pgpContext, szEncMsg, mir_tstrlen(szEncMsg)),
+ PGPOInputBuffer(pgpContext, szEncMsg, mir_strlen(szEncMsg)),
PGPOAllocatedOutputBuffer(pgpContext, (LPVOID *)&szPlainMsg, 16384, &dwPlainMsgLen),
PGPOKeyDBRef(pgpContext, pgpKeyDB),
PGPOPassphrase(pgpContext, pszPassphrase),
@@ -244,7 +244,7 @@ PGPError _pgp_import_key(PGPKeyDBRef *keyDB, LPCSTR pgpKey) keyDB,
PGPOInputBuffer( pgpContext,
pgpKey,
- mir_tstrlen(pgpKey) ),
+ mir_strlen(pgpKey) ),
PGPOLastOption(pgpContext ));
#endif
}
@@ -278,7 +278,7 @@ LPSTR __cdecl _pgp_encrypt_key(LPCSTR szPlainMsg, LPCSTR pgpKey) }
PGPError err = PGPEncode(pgpContext,
- PGPOInputBuffer(pgpContext, szPlainMsg, mir_tstrlen(szPlainMsg)),
+ PGPOInputBuffer(pgpContext, szPlainMsg, mir_strlen(szPlainMsg)),
PGPOArmorOutput(pgpContext, TRUE),
PGPOAllocatedOutputBuffer(pgpContext, (LPVOID *)&szEncMsg, 16384, &dwEncMsgLen),
PGPOEncryptToKeyDBObj(pgpContext, PublicKey),
@@ -332,7 +332,7 @@ LPSTR __cdecl _pgp_decrypt_key(LPCSTR szEncMsg, LPCSTR pgpKey) }
PGPError err = PGPDecode(pgpContext,
- PGPOInputBuffer(pgpContext, szEncMsg, mir_tstrlen(szEncMsg)),
+ PGPOInputBuffer(pgpContext, szEncMsg, mir_strlen(szEncMsg)),
PGPOAllocatedOutputBuffer(pgpContext, (LPVOID *)&szPlainMsg, 16384, &dwPlainMsgLen),
PGPOKeyDBRef(pgpContext, PrivateKeyDB),
PGPOPassphrase(pgpContext, pszPassphrase),
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp index 06cfcaf963..80dc43d777 100644 --- a/plugins/Db3x_mmap/src/database.cpp +++ b/plugins/Db3x_mmap/src/database.cpp @@ -87,7 +87,7 @@ void __cdecl dbpanic(void *) msg = TranslateT("Disk is full. Miranda will now shut down.");
wchar_t err[256];
- mir_sntprintf(err, msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
+ mir_snwprintf(err, msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
}
diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp index f831b627b8..5a11c25259 100644 --- a/plugins/Db3x_mmap/src/dbintf.cpp +++ b/plugins/Db3x_mmap/src/dbintf.cpp @@ -54,7 +54,7 @@ CDb3Mmap::CDb3Mmap(const wchar_t *tszFileName, int iMode) : m_lOfs(50, OfsCompare),
m_lResidentSettings(50, stringCompare2)
{
- m_tszProfileName = mir_tstrdup(tszFileName);
+ m_tszProfileName = mir_wstrdup(tszFileName);
InitDbInstance(this);
SYSTEM_INFO sinf;
diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index 36896352e4..5e6929572f 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -201,13 +201,13 @@ static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam case IDOK:
wchar_t buf2[100];
GetDlgItemText(hwndDlg, IDC_USERPASS1, buf2, _countof(buf2));
- if (mir_tstrlen(buf2) < 3) {
+ if (mir_wstrlen(buf2) < 3) {
SetDlgItemText(hwndDlg, IDC_HEADERBAR, TranslateT("Password is too short!"));
goto LBL_Error;
}
GetDlgItemText(hwndDlg, IDC_USERPASS2, buf, _countof(buf));
- if (mir_tstrcmp(buf2, buf)) {
+ if (mir_wstrcmp(buf2, buf)) {
SetDlgItemText(hwndDlg, IDC_HEADERBAR, TranslateT("Passwords do not match!"));
goto LBL_Error;
}
diff --git a/plugins/DbChecker/src/progress.cpp b/plugins/DbChecker/src/progress.cpp index e5dce00b3f..5c123b86e0 100644 --- a/plugins/DbChecker/src/progress.cpp +++ b/plugins/DbChecker/src/progress.cpp @@ -34,7 +34,7 @@ void AddToStatus(int flags, const wchar_t* fmt, ...) va_start(vararg, fmt);
wchar_t str[256];
- mir_vsntprintf(str, _countof(str), fmt, vararg);
+ mir_vsnwprintf(str, _countof(str), fmt, vararg);
va_end(vararg);
int i = SendMessage(hwndStatus, LB_ADDSTRING, 0, (LPARAM)str);
@@ -147,7 +147,7 @@ INT_PTR CALLBACK ProgressDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM break;
}
if (bold) hoFont = (HFONT)SelectObject(dis->hDC, hBoldFont);
- ExtTextOut(dis->hDC, dis->rcItem.left, dis->rcItem.top, ETO_CLIPPED | ETO_OPAQUE, &dis->rcItem, str, (UINT)mir_tstrlen(str), NULL);
+ ExtTextOut(dis->hDC, dis->rcItem.left, dis->rcItem.top, ETO_CLIPPED | ETO_OPAQUE, &dis->rcItem, str, (UINT)mir_wstrlen(str), NULL);
if (bold) SelectObject(dis->hDC, hoFont);
}
return TRUE;
diff --git a/plugins/DbChecker/src/selectdb.cpp b/plugins/DbChecker/src/selectdb.cpp index 72ac4e9824..0a704fe2ef 100644 --- a/plugins/DbChecker/src/selectdb.cpp +++ b/plugins/DbChecker/src/selectdb.cpp @@ -36,7 +36,7 @@ int OpenDatabase(HWND hdlg, INT iNextPage) if (opts.dbChecker == NULL) {
DATABASELINK* dblink = FindDatabasePlugin(opts.filename);
if (dblink == NULL) {
- mir_sntprintf(tszMsg,
+ mir_snwprintf(tszMsg,
TranslateT("Database Checker cannot find a suitable database plugin to open '%s'."),
opts.filename);
LBL_Error:
@@ -45,7 +45,7 @@ int OpenDatabase(HWND hdlg, INT iNextPage) }
if (dblink->CheckDB == NULL) {
- mir_sntprintf(tszMsg,
+ mir_snwprintf(tszMsg,
TranslateT("Database driver '%s' doesn't support checking."),
TranslateTS(dblink->szFullName));
goto LBL_Error;
@@ -77,15 +77,15 @@ void GetProfileDirectory(wchar_t* szMirandaDir, wchar_t* szPath, int cbPath) {
wchar_t szProfileDir[MAX_PATH], szExpandedProfileDir[MAX_PATH], szMirandaBootIni[MAX_PATH];
- mir_tstrcpy(szMirandaBootIni, szMirandaDir);
- mir_tstrcat(szMirandaBootIni, L"\\mirandaboot.ini");
+ mir_wstrcpy(szMirandaBootIni, szMirandaDir);
+ mir_wstrcat(szMirandaBootIni, L"\\mirandaboot.ini");
GetPrivateProfileString(L"Database", L"ProfileDir", L"./Profiles", szProfileDir, _countof(szProfileDir), szMirandaBootIni);
ExpandEnvironmentStrings(szProfileDir, szExpandedProfileDir, _countof(szExpandedProfileDir));
_wchdir(szMirandaDir);
if (!_wfullpath(szPath, szExpandedProfileDir, cbPath))
- mir_tstrncpy(szPath, szMirandaDir, cbPath);
- if (szPath[mir_tstrlen(szPath) - 1] == '\\')
- szPath[mir_tstrlen(szPath) - 1] = 0;
+ mir_wstrncpy(szPath, szMirandaDir, cbPath);
+ if (szPath[mir_wstrlen(szPath) - 1] == '\\')
+ szPath[mir_wstrlen(szPath) - 1] = 0;
}
static int AddDatabaseToList(HWND hwndList, const wchar_t* filename, wchar_t* dir)
@@ -95,7 +95,7 @@ static int AddDatabaseToList(HWND hwndList, const wchar_t* filename, wchar_t* di lvi.iSubItem = 0;
for (lvi.iItem = ListView_GetItemCount(hwndList) - 1; lvi.iItem >= 0; lvi.iItem--) {
ListView_GetItem(hwndList, &lvi);
- if (!mir_tstrcmpi((wchar_t*)lvi.lParam, filename))
+ if (!mir_wstrcmpi((wchar_t*)lvi.lParam, filename))
return lvi.iItem;
}
@@ -114,10 +114,10 @@ static int AddDatabaseToList(HWND hwndList, const wchar_t* filename, wchar_t* di pName++;
wchar_t szName[MAX_PATH];
- mir_sntprintf(szName, L"%s%s", dir, pName);
+ mir_snwprintf(szName, L"%s%s", dir, pName);
wchar_t *pDot = wcsrchr(szName, '.');
- if (pDot != NULL && !mir_tstrcmpi(pDot, L".dat"))
+ if (pDot != NULL && !mir_wstrcmpi(pDot, L".dat"))
*pDot = 0;
lvi.iItem = 0;
@@ -129,7 +129,7 @@ static int AddDatabaseToList(HWND hwndList, const wchar_t* filename, wchar_t* di int iNewItem = ListView_InsertItem(hwndList, &lvi);
wchar_t szSize[20];
- mir_sntprintf(szSize, L"%.2lf MB", totalSize / 1048576.0);
+ mir_snwprintf(szSize, L"%.2lf MB", totalSize / 1048576.0);
ListView_SetItemText(hwndList, iNewItem, 1, szSize);
return iNewItem;
}
@@ -140,16 +140,16 @@ void FindAdd(HWND hdlg, wchar_t *szProfileDir, wchar_t *szPrefix) WIN32_FIND_DATA fd;
wchar_t szSearchPath[MAX_PATH], szFilename[MAX_PATH];
- mir_tstrcpy(szSearchPath, szProfileDir);
- mir_tstrcat(szSearchPath, L"\\*.*");
+ mir_wstrcpy(szSearchPath, szProfileDir);
+ mir_wstrcat(szSearchPath, L"\\*.*");
hFind = FindFirstFile(szSearchPath, &fd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
- if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_tstrcmp(fd.cFileName, L".") || !mir_tstrcmp(fd.cFileName, L".."))
+ if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_wstrcmp(fd.cFileName, L".") || !mir_wstrcmp(fd.cFileName, L".."))
continue;
- mir_sntprintf(szFilename, L"%s\\%s\\%s.dat", szProfileDir, fd.cFileName, fd.cFileName);
+ mir_snwprintf(szFilename, L"%s\\%s\\%s.dat", szProfileDir, fd.cFileName, fd.cFileName);
if (_waccess(szFilename, 0) == 0)
AddDatabaseToList(GetDlgItem(hdlg, IDC_DBLIST), szFilename, szPrefix);
} while (FindNextFile(hFind, &fd));
@@ -159,8 +159,8 @@ void FindAdd(HWND hdlg, wchar_t *szProfileDir, wchar_t *szPrefix) wchar_t *addstring(wchar_t *str, wchar_t *add)
{
- mir_tstrcpy(str, add);
- return str + mir_tstrlen(add) + 1;
+ mir_wstrcpy(str, add);
+ return str + mir_wstrlen(add) + 1;
}
INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
@@ -203,12 +203,12 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM wchar_t szMirandaProfiles[MAX_PATH];
DWORD cbData = _countof(szMirandaPath);
- mir_tstrcpy(szMirandaProfiles, szMirandaPath);
- mir_tstrcat(szMirandaProfiles, L"\\Profiles");
+ mir_wstrcpy(szMirandaProfiles, szMirandaPath);
+ mir_wstrcat(szMirandaProfiles, L"\\Profiles");
GetProfileDirectory(szMirandaPath, szProfileDir, _countof(szProfileDir));
// search in profile dir (using ini file)
- if (mir_tstrcmpi(szProfileDir, szMirandaProfiles))
+ if (mir_wstrcmpi(szProfileDir, szMirandaProfiles))
FindAdd(hdlg, szProfileDir, L"[ini]\\");
FindAdd(hdlg, szMirandaProfiles, L"[prf]\\");
@@ -218,7 +218,7 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM // search in profile dir (using registry path + ini file)
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\miranda32.exe", 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueEx(hKey, L"Path", NULL, NULL, (PBYTE)szMirandaPath, &cbData) == ERROR_SUCCESS) {
- if (mir_tstrcmp(szProfileDir, szMirandaPath)) {
+ if (mir_wstrcmp(szProfileDir, szMirandaPath)) {
GetProfileDirectory(szMirandaPath, szProfileDir, _countof(szProfileDir));
FindAdd(hdlg, szProfileDir, L"[reg]\\");
}
@@ -265,7 +265,7 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM wchar_t *filter, *tmp, *tmp1, *tmp2;
tmp1 = TranslateT("Miranda Databases (*.dat)");
tmp2 = TranslateT("All Files");
- filter = tmp = (wchar_t*)_alloca((mir_tstrlen(tmp1) + mir_tstrlen(tmp2) + 11)*sizeof(wchar_t));
+ filter = tmp = (wchar_t*)_alloca((mir_wstrlen(tmp1) + mir_wstrlen(tmp2) + 11)*sizeof(wchar_t));
tmp = addstring(tmp, tmp1);
tmp = addstring(tmp, L"*.DAT");
tmp = addstring(tmp, tmp2);
diff --git a/plugins/DbChecker/src/welcome.cpp b/plugins/DbChecker/src/welcome.cpp index 326f7b5c14..321eba23a8 100644 --- a/plugins/DbChecker/src/welcome.cpp +++ b/plugins/DbChecker/src/welcome.cpp @@ -42,7 +42,7 @@ INT_PTR CALLBACK WelcomeDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM l SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
LOGFONT TitleLogFont = ncm.lfMessageFont;
TitleLogFont.lfWeight = FW_BOLD;
- mir_tstrcpy(TitleLogFont.lfFaceName, TEXT("Verdana Bold"));
+ mir_wstrcpy(TitleLogFont.lfFaceName, TEXT("Verdana Bold"));
HDC hdc = GetDC(NULL);
INT FontSize = 12;
diff --git a/plugins/DbChecker/src/worker.cpp b/plugins/DbChecker/src/worker.cpp index 92ab1cf497..ab97b54b33 100644 --- a/plugins/DbChecker/src/worker.cpp +++ b/plugins/DbChecker/src/worker.cpp @@ -42,21 +42,21 @@ static void Finalize(time_t& ts) if (opts.bBackup) {
wchar_t dbPath[MAX_PATH], dbFile[MAX_PATH];
- mir_tstrcpy(dbPath, opts.filename);
+ mir_wstrcpy(dbPath, opts.filename);
wchar_t* str2 = wcsrchr(dbPath, '\\');
if (str2 != NULL) {
- mir_tstrcpy(dbFile, str2 + 1);
+ mir_wstrcpy(dbFile, str2 + 1);
*str2 = 0;
}
else {
- mir_tstrcpy(dbFile, dbPath);
+ mir_wstrcpy(dbFile, dbPath);
dbPath[0] = 0;
}
for (int i = 1;; i++) {
if (i == 1)
- mir_sntprintf(opts.backupFilename, TranslateT("%s\\Backup of %s"), dbPath, dbFile);
+ mir_snwprintf(opts.backupFilename, TranslateT("%s\\Backup of %s"), dbPath, dbFile);
else
- mir_sntprintf(opts.backupFilename, TranslateT("%s\\Backup (%d) of %s"), dbPath, i, dbFile);
+ mir_snwprintf(opts.backupFilename, TranslateT("%s\\Backup (%d) of %s"), dbPath, i, dbFile);
if (_waccess(opts.backupFilename, 0) == -1) break;
}
@@ -79,16 +79,16 @@ void __cdecl WorkerThread(void *) AddToStatus(STATUS_MESSAGE, TranslateT("Database worker thread activated"));
- mir_tstrcpy(opts.workingFilename, opts.filename);
+ mir_wstrcpy(opts.workingFilename, opts.filename);
if (opts.bCheckOnly) {
- mir_tstrcpy(opts.outputFilename, TranslateT("<check only>"));
+ mir_wstrcpy(opts.outputFilename, TranslateT("<check only>"));
opts.hOutFile = INVALID_HANDLE_VALUE;
}
else {
- mir_tstrcpy(opts.outputFilename, opts.filename);
+ mir_wstrcpy(opts.outputFilename, opts.filename);
*wcsrchr(opts.outputFilename, '.') = 0;
- mir_tstrcat(opts.outputFilename, TranslateT(" (Output).dat"));
+ mir_wstrcat(opts.outputFilename, TranslateT(" (Output).dat"));
opts.hOutFile = CreateFile(opts.outputFilename, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (opts.hOutFile == INVALID_HANDLE_VALUE) {
AddToStatus(STATUS_FATAL, TranslateT("Can't create output file (%u)"), GetLastError());
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp index 042719fe53..faa42d29ea 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -29,7 +29,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar mac = (ModuleAndContact *)lParam;
wchar_t name[NAME_SIZE], msg[MSG_SIZE];
- mir_sntprintf(msg, TranslateT("Copy module \"%s\""), _A2T(mac->module));
+ mir_snwprintf(msg, TranslateT("Copy module \"%s\""), _A2T(mac->module));
SetWindowText(hwnd, msg);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp index 5bb46feefb..8ea862845e 100644 --- a/plugins/DbEditorPP/src/deletemodule.cpp +++ b/plugins/DbEditorPP/src/deletemodule.cpp @@ -10,7 +10,7 @@ int deleteModule(MCONTACT hContact, const char *module, int confirm) if (confirm && db_get_b(NULL, modname, "WarnOnDelete", 1)) {
wchar_t text[MSG_SIZE];
- mir_sntprintf(text, TranslateT("Are you sure you want to delete module \"%s\"?"), _A2T(module));
+ mir_snwprintf(text, TranslateT("Are you sure you want to delete module \"%s\"?"), _A2T(module));
if (dlg(text, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
return 0;
}
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index 40b0fd405a..f87b9af57a 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -3,7 +3,7 @@ wchar_t *GetFilter()
{
static wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s%c*.ini%c%s%c*.*%c", TranslateT("INI Files"), 0, 0, TranslateT("All Files"), 0, 0);
+ mir_snwprintf(filter, L"%s%c*.ini%c%s%c*.*%c", TranslateT("INI Files"), 0, 0, TranslateT("All Files"), 0, 0);
return filter;
}
@@ -13,7 +13,7 @@ int Openfile(wchar_t *outputFile, const char *module, int maxlen) if (module) {
int n = 0;
- mir_tstrncpy(filename, _A2T(module), _countof(filename));
+ mir_wstrncpy(filename, _A2T(module), _countof(filename));
while (filename[n]) {
switch (filename[n]) {
@@ -42,7 +42,7 @@ int Openfile(wchar_t *outputFile, const char *module, int maxlen) if (!GetSaveFileName(&ofn))
return 0;
- mir_tstrncpy(outputFile, filename, maxlen);
+ mir_wstrncpy(outputFile, filename, maxlen);
return 1;
}
@@ -356,7 +356,7 @@ void importSettings(MCONTACT hContact, char *utf8) // get the type
type = *(end + 1);
if (mir_strcmp(module, "CList") == 0 && mir_strcmp(setting, "Group") == 0) {
- ptrT GroupName(mir_utf8decodeT(end + 2));
+ ptrW GroupName(mir_utf8decodeW(end + 2));
if (!GroupName)
continue;
@@ -431,7 +431,7 @@ INT_PTR CALLBACK ImportDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara GetContactName((MCONTACT)lParam, NULL, name, _countof(name));
- mir_sntprintf(msg, TranslateT("Import to \"%s\""), name);
+ mir_snwprintf(msg, TranslateT("Import to \"%s\""), name);
SetWindowText(hwnd, msg);
break;
@@ -492,28 +492,28 @@ void ImportSettingsFromFileMenuItem(MCONTACT hContact, const char *FilePath) DWORD offset = 0;
- mir_tstrcpy(szFileNames, L"");
+ mir_wstrcpy(szFileNames, L"");
if (!FilePath)
offset = Openfile2Import(szFileNames, _countof(szFileNames));
else {
_A2T tmp(FilePath);
if (GetFileAttributes(tmp) != INVALID_FILE_ATTRIBUTES)
- mir_tstrncpy(szFileNames, tmp, _countof(szFileNames));
+ mir_wstrncpy(szFileNames, tmp, _countof(szFileNames));
}
int index = 0;
- if (mir_tstrcmp(szFileNames, L"")) {
- if ((DWORD)mir_tstrlen(szFileNames) < offset) {
+ if (mir_wstrcmp(szFileNames, L"")) {
+ if ((DWORD)mir_wstrlen(szFileNames) < offset) {
index += offset;
- mir_tstrncpy(szPath, szFileNames, offset);
- mir_tstrcat(szPath, L"\\");
+ mir_wstrncpy(szPath, szFileNames, offset);
+ mir_wstrcat(szPath, L"\\");
}
while (szFileNames[index]) {
- mir_tstrcpy(szFile, szPath);
- mir_tstrcat(szFile, &szFileNames[index]);
- index += (int)mir_tstrlen(&szFileNames[index]) + 1;
+ mir_wstrcpy(szFile, szPath);
+ mir_wstrcat(szFile, &szFileNames[index]);
+ index += (int)mir_wstrlen(&szFileNames[index]) + 1;
HANDLE hFile = CreateFile(szFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp index 3769825cd9..b97dd4ab0d 100644 --- a/plugins/DbEditorPP/src/findwindow.cpp +++ b/plugins/DbEditorPP/src/findwindow.cpp @@ -127,7 +127,7 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (IsDlgButtonChecked(hwnd, IDC_ENTIRELY))
fi->options |= F_ENTIRE;
- fi->replace = mir_tstrdup(replace);
+ fi->replace = mir_wstrdup(replace);
SetDlgItemText(hwnd, IDOK, TranslateT("Stop"));
EnableWindow(GetDlgItem(hwnd, IDC_SEARCH), 0);
@@ -138,7 +138,7 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP EnableWindow(GetDlgItem(hwnd, IDOK), 0);
}
- fi->search = mir_tstrdup(text);
+ fi->search = mir_wstrdup(text);
ListView_DeleteAllItems(fi->hwnd);
SetWindowLongPtr(GetDlgItem(hwnd, IDC_SEARCH), GWLP_USERDATA, 1);
@@ -459,15 +459,15 @@ void __cdecl FindSettings(LPVOID param) break;
case DBVT_WCHAR:
- if (!value) value = mir_u2t(dbv.pwszVal);
+ if (!value) value = mir_wstrdup(dbv.pwszVal);
case DBVT_UTF8:
- if (!value) value = mir_utf8decodeT(dbv.pszVal);
+ if (!value) value = mir_utf8decodeW(dbv.pszVal);
case DBVT_ASCIIZ:
- if (!value) value = mir_a2t(dbv.pszVal);
+ if (!value) value = mir_a2u(dbv.pszVal);
if (FindMatchT(value, fi->search, fi->options)) {
foundCount++;
- ptrT ptr;
+ ptrW ptr;
wchar_t *newValue = value;
int flag = F_SETVAL;
@@ -568,7 +568,7 @@ void __cdecl FindSettings(LPVOID param) }
wchar_t msg[MSG_SIZE];
- mir_sntprintf(msg, TranslateT("Finished. Items found: %d / replaced: %d / deleted: %d"), foundCount, replaceCount, deleteCount);
+ mir_snwprintf(msg, TranslateT("Finished. Items found: %d / replaced: %d / deleted: %d"), foundCount, replaceCount, deleteCount);
SendDlgItemMessage(hwndParent, IDC_SBAR, SB_SETTEXT, 0, (LPARAM)msg);
if (fi->replace) {
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 442237c4f6..20026bb8bc 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -421,7 +421,7 @@ int GetContactName(MCONTACT hContact, const char *proto, wchar_t *value, int max return 0;
if (!hContact) {
- mir_tstrncpy(value, TranslateT("Settings"), maxlen);
+ mir_wstrncpy(value, TranslateT("Settings"), maxlen);
return 1;
}
@@ -471,10 +471,10 @@ int GetContactName(MCONTACT hContact, const char *proto, wchar_t *value, int max if (szProto) {
GetValue(hContact, szProto, "FirstName", name, _countof(name));
- int len = (int)mir_tstrlen(name);
+ int len = (int)mir_wstrlen(name);
if (len + 2 < _countof(name)) {
if (len)
- mir_tstrncat(name, L" ", _countof(name));
+ mir_wstrncat(name, L" ", _countof(name));
len++;
GetValue(hContact, szProto, "LastName", &name[len], _countof(name) - len);
}
@@ -487,20 +487,20 @@ int GetContactName(MCONTACT hContact, const char *proto, wchar_t *value, int max }
if (!name[0])
- mir_tstrncpy(name, TranslateT("<UNKNOWN>"), _countof(name));
+ mir_wstrncpy(name, TranslateT("<UNKNOWN>"), _countof(name));
if (szProto && szProto[0]) {
if (g_Order)
- mir_sntprintf(value, maxlen, L"(%s) %s", _A2T(szProto), name);
+ mir_snwprintf(value, maxlen, L"(%s) %s", _A2T(szProto), name);
else
- mir_sntprintf(value, maxlen, L"%s (%s)", name, _A2T(szProto));
+ mir_snwprintf(value, maxlen, L"%s (%s)", name, _A2T(szProto));
}
- else mir_tstrncpy(value, name, maxlen);
+ else mir_wstrncpy(value, name, maxlen);
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (!Proto_IsAccountEnabled(pa)) {
- mir_tstrncat(value, L" ", maxlen);
- mir_tstrncat(value, TranslateT("[UNLOADED]"), maxlen);
+ mir_wstrncat(value, L" ", maxlen);
+ mir_wstrncat(value, TranslateT("[UNLOADED]"), maxlen);
}
return 1;
@@ -560,6 +560,6 @@ INT_PTR CALLBACK ColumnsCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam) ListView_GetItemText(params.hList, lParam1, params.column, text1, _countof(text1));
ListView_GetItemText(params.hList, lParam2, params.column, text2, _countof(text2));
- int res = mir_tstrcmpi(text1, text2);
+ int res = mir_wstrcmpi(text1, text2);
return (params.column == params.last) ? -res : res;
}
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index 7351297335..ba44c3fa20 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -130,7 +130,7 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR else if ((mtis->type == CONTACT) && hContact) {
if (db_get_b(NULL, "CList", "ConfirmDelete", 1)) {
wchar_t str[MSG_SIZE];
- mir_sntprintf(str, TranslateT("Are you sure you want to delete contact \"%s\"?"), text);
+ mir_snwprintf(str, TranslateT("Are you sure you want to delete contact \"%s\"?"), text);
if (dlg(str, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
break;
}
@@ -443,7 +443,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case MENU_FIX_RESIDENT:
if (dlg(TranslateT("Delete resident settings from database?"), MB_YESNO | MB_ICONEXCLAMATION) == IDYES) {
int cnt = fixResidentSettings();
- mir_sntprintf(text, TranslateT("%d items deleted."), cnt);
+ mir_snwprintf(text, TranslateT("%d items deleted."), cnt);
msg(text);
}
break;
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp index 00fce5eb74..2853c4a57c 100644 --- a/plugins/DbEditorPP/src/moduletree.cpp +++ b/plugins/DbEditorPP/src/moduletree.cpp @@ -106,7 +106,7 @@ void doItems(ModuleSettingLL* modlist, int count) HWND hwnd = GetParent(hwnd2Tree); //!!!
wchar_t percent[128], title[96];
- mir_sntprintf(title, TranslateT("Loading modules..."));
+ mir_snwprintf(title, TranslateT("Loading modules..."));
TVITEM item = { 0 };
item.mask = TVIF_STATE | TVIF_PARAM;
@@ -131,7 +131,7 @@ void doItems(ModuleSettingLL* modlist, int count) continue;
// Caption
- mir_sntprintf(percent, L"%s %d%%", title, (int)(100 * i / count));
+ mir_snwprintf(percent, L"%s %d%%", title, (int)(100 * i / count));
SetWindowText(hwnd, percent);
for (ModSetLinkLinkItem *module = modlist->first; module && hwnd2mainWindow; module = module->next) {
@@ -169,7 +169,7 @@ HTREEITEM findItemInTree(MCONTACT hContact, const char* module) if (lastItem != TVI_ROOT) {
/* these next 2 lines are not from code guru..... */
if (TreeView_GetItem(hwnd2Tree, &item) && item.lParam) {
- if ((hContact == ((ModuleTreeInfoStruct *)item.lParam)->hContact) && (!module || !module[0] || !mir_tstrcmp(szModule, text))) {
+ if ((hContact == ((ModuleTreeInfoStruct *)item.lParam)->hContact) && (!module || !module[0] || !mir_wstrcmp(szModule, text))) {
return item.hItem;
}
@@ -252,7 +252,7 @@ http://www.codeguru.com/Cpp/controls/treeview/treetraversal/comments.php/c683/?t /* these next lines are not from code guru..... */
if (item.lParam) {
ModuleTreeInfoStruct *mtis = (ModuleTreeInfoStruct *)item.lParam;
- if (hContact == mtis->hContact && !mir_tstrcmp(text, szModule)) {
+ if (hContact == mtis->hContact && !mir_wstrcmp(text, szModule)) {
mir_free(mtis);
TreeView_DeleteItem(hwnd2Tree, item.hItem);
lastItem = prelastItem;
@@ -719,7 +719,7 @@ void moduleListRightClick(HWND hwnd, WPARAM, LPARAM lParam) // hwnd here is to t case MENU_DELETE_CONTACT:
if (db_get_b(NULL, "CList", "ConfirmDelete", 1)) {
wchar_t str[MSG_SIZE];
- mir_sntprintf(str, TranslateT("Are you sure you want to delete contact \"%s\"?"), text);
+ mir_snwprintf(str, TranslateT("Are you sure you want to delete contact \"%s\"?"), text);
if (dlg(str, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
break;
}
diff --git a/plugins/DbEditorPP/src/renamemodule.cpp b/plugins/DbEditorPP/src/renamemodule.cpp index bb713adadd..1844907aba 100644 --- a/plugins/DbEditorPP/src/renamemodule.cpp +++ b/plugins/DbEditorPP/src/renamemodule.cpp @@ -33,7 +33,7 @@ INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara wchar_t msg[MSG_SIZE], name[NAME_SIZE];
GetContactName((MCONTACT)lParam, NULL, name, _countof(name));
- mir_sntprintf(msg, TranslateT("Add module to \"%s\""), name);
+ mir_snwprintf(msg, TranslateT("Add module to \"%s\""), name);
SetWindowText(hwnd, msg);
break;
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index 5b0f8371a9..501aa0e75e 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -50,7 +50,7 @@ int convertSetting(MCONTACT hContact, const char *module, const char *setting, i int res = 0;
DWORD val = 0;
wchar_t tmp[16];
- ptrT value;
+ ptrW value;
switch (dbv.type) {
@@ -58,22 +58,22 @@ int convertSetting(MCONTACT hContact, const char *module, const char *setting, i case DBVT_WORD:
case DBVT_DWORD:
val = getNumericValue(&dbv);
- value = mir_tstrdup(_ultow(val, tmp, 10));
+ value = mir_wstrdup(_ultow(val, tmp, 10));
break;
case DBVT_WCHAR:
if (!value)
- value = mir_u2t(dbv.pwszVal);
+ value = mir_wstrdup(dbv.pwszVal);
// fall through
case DBVT_UTF8:
if (!value)
- value = mir_utf8decodeT(dbv.pszVal);
+ value = mir_utf8decodeW(dbv.pszVal);
// fall through
case DBVT_ASCIIZ:
if (!value)
- value = mir_a2t(dbv.pszVal);
+ value = mir_a2u(dbv.pszVal);
- if (mir_tstrlen(value) < 11)
+ if (mir_wstrlen(value) < 11)
val = wcstoul(value, NULL, NULL);
}
@@ -82,7 +82,7 @@ int convertSetting(MCONTACT hContact, const char *module, const char *setting, i case DBVT_BYTE:
case DBVT_WORD:
case DBVT_DWORD:
- if (val != 0 || !mir_tstrcmp(value, L"0"))
+ if (val != 0 || !mir_wstrcmp(value, L"0"))
res = setNumericValue(hContact, module, setting, val, toType);
break;
@@ -133,7 +133,7 @@ void DeleteSettingsFromList(MCONTACT hContact, const char *module, const char *s if (db_get_b(NULL, modname, "WarnOnDelete", 1)) {
wchar_t text[MSG_SIZE];
- mir_sntprintf(text, TranslateT("Are you sure you want to delete setting(s): %d?"), count);
+ mir_snwprintf(text, TranslateT("Are you sure you want to delete setting(s): %d?"), count);
if (dlg(text, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
return;
}
@@ -216,7 +216,7 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident ListView_SetItemTextA(hwnd2List, index, 1, ptrA(StringFromBlob(dbv->pbVal, dbv->cpbVal)));
- mir_sntprintf(data, L"0x%04X (%u)", dbv->cpbVal, dbv->cpbVal);
+ mir_snwprintf(data, L"0x%04X (%u)", dbv->cpbVal, dbv->cpbVal);
ListView_SetItemText(hwnd2List, index, 3, data);
break;
@@ -224,7 +224,7 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident lvi.iImage = IMAGE_BYTE;
ListView_SetItem(hwnd2List, &lvi);
- mir_sntprintf(data, L"0x%02X (%u)", dbv->bVal, dbv->bVal);
+ mir_snwprintf(data, L"0x%02X (%u)", dbv->bVal, dbv->bVal);
ListView_SetItemText(hwnd2List, index, 1, data);
ListView_SetItemText(hwnd2List, index, 3, L"0x0001 (1)");
@@ -234,7 +234,7 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident lvi.iImage = IMAGE_WORD;
ListView_SetItem(hwnd2List, &lvi);
- mir_sntprintf(data, L"0x%04X (%u)", dbv->wVal, dbv->wVal);
+ mir_snwprintf(data, L"0x%04X (%u)", dbv->wVal, dbv->wVal);
ListView_SetItemText(hwnd2List, index, 1, data);
ListView_SetItemText(hwnd2List, index, 3, L"0x0002 (2)");
@@ -244,7 +244,7 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident lvi.iImage = IMAGE_DWORD;
ListView_SetItem(hwnd2List, &lvi);
- mir_sntprintf(data, L"0x%08X (%u)", dbv->dVal, dbv->dVal);
+ mir_snwprintf(data, L"0x%08X (%u)", dbv->dVal, dbv->dVal);
ListView_SetItemText(hwnd2List, index, 1, data);
ListView_SetItemText(hwnd2List, index, 3, L"0x0004 (4)");
@@ -257,7 +257,7 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident ListView_SetItemTextA(hwnd2List, index, 1, dbv->pszVal);
length = (int)mir_strlen(dbv->pszVal) + 1;
- mir_sntprintf(data, L"0x%04X (%u)", length, length);
+ mir_snwprintf(data, L"0x%04X (%u)", length, length);
ListView_SetItemText(hwnd2List, index, 3, data);
break;
@@ -268,7 +268,7 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident length = (int)mir_wstrlen(dbv->pwszVal) + 1;
ListView_SetItemText(hwnd2List, index, 1, dbv->pwszVal);
- mir_sntprintf(data, L"0x%04X (%u)", length, length);
+ mir_snwprintf(data, L"0x%04X (%u)", length, length);
ListView_SetItemText(hwnd2List, index, 3, data);
break;
@@ -278,10 +278,10 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident length = (int)mir_strlen(dbv->pszVal) + 1;
{
- ptrT tszText(mir_utf8decodeT(dbv->pszVal));
+ ptrW tszText(mir_utf8decodeW(dbv->pszVal));
ListView_SetItemText(hwnd2List, index, 1, tszText);
}
- mir_sntprintf(data, L"0x%04X (%u)", length, length);
+ mir_snwprintf(data, L"0x%04X (%u)", length, length);
ListView_SetItemText(hwnd2List, index, 3, data);
break;
@@ -306,7 +306,7 @@ void addListHandle(MCONTACT hContact) int index = ListView_InsertItem(hwnd2List, &lvi);
- mir_sntprintf(data, L"0x%08X (%ld)", hContact, hContact);
+ mir_snwprintf(data, L"0x%08X (%ld)", hContact, hContact);
ListView_SetItemText(hwnd2List, index, 1, data);
ListView_SetItemText(hwnd2List, index, 2, L"HANDLE");
@@ -570,7 +570,7 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd, UINT msg, WPARAM case '\"':
case '\'':
{
- size_t nlen = mir_tstrlen(value);
+ size_t nlen = mir_wstrlen(value);
int sh = 0;
if (nlen > 3) {
if (value[nlen - 1] == value[0]) {
@@ -642,25 +642,25 @@ void EditLabel(int item, int subitem) switch (dbv.type) {
case DBVT_ASCIIZ:
- str = mir_a2t(dbv.pszVal);
+ str = mir_a2u(dbv.pszVal);
break;
case DBVT_BYTE:
- mir_sntprintf(value, (g_Hex & HEX_BYTE) ? L"0x%02X" : L"%u", dbv.bVal);
+ mir_snwprintf(value, (g_Hex & HEX_BYTE) ? L"0x%02X" : L"%u", dbv.bVal);
break;
case DBVT_WORD:
- mir_sntprintf(value, (g_Hex & HEX_WORD) ? L"0x%04X" : L"%u", dbv.wVal);
+ mir_snwprintf(value, (g_Hex & HEX_WORD) ? L"0x%04X" : L"%u", dbv.wVal);
break;
case DBVT_DWORD:
- mir_sntprintf(value, (g_Hex & HEX_DWORD) ? L"0x%08X" : L"%u", dbv.dVal);
+ mir_snwprintf(value, (g_Hex & HEX_DWORD) ? L"0x%08X" : L"%u", dbv.dVal);
break;
case DBVT_WCHAR:
- str = mir_u2t(dbv.pwszVal);
+ str = mir_wstrdup(dbv.pwszVal);
break;
case DBVT_UTF8:
- str = mir_utf8decodeT(dbv.pszVal);
+ str = mir_utf8decodeW(dbv.pszVal);
break;
case DBVT_BLOB:
- str = mir_a2t(ptrA(StringFromBlob(dbv.pbVal, dbv.cpbVal)));
+ str = mir_a2u(ptrA(StringFromBlob(dbv.pbVal, dbv.cpbVal)));
break;
}
diff --git a/plugins/DbEditorPP/src/settingsdlg.cpp b/plugins/DbEditorPP/src/settingsdlg.cpp index ed13f64227..bddbc89b0d 100644 --- a/plugins/DbEditorPP/src/settingsdlg.cpp +++ b/plugins/DbEditorPP/src/settingsdlg.cpp @@ -131,7 +131,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l TranslateDialogDefault(hwnd);
{
wchar_t text[MSG_SIZE];
- mir_sntprintf(text, dbsetting->setting?TranslateT("Edit setting (%s)"):TranslateT("New setting (%s)"), DBVType(dbsetting->dbv.type));
+ mir_snwprintf(text, dbsetting->setting?TranslateT("Edit setting (%s)"):TranslateT("New setting (%s)"), DBVType(dbsetting->dbv.type));
SetWindowText(hwnd, text);
}
}
@@ -167,12 +167,12 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (LOWORD(wParam) == CHK_DECIMAL && IsDlgButtonChecked(hwnd, CHK_DECIMAL))
{
swscanf(setting, L"%X", &tmp);
- mir_sntprintf(text, L"%u", tmp);
+ mir_snwprintf(text, L"%u", tmp);
}
else
{
swscanf(setting, L"%u", &tmp);
- mir_sntprintf(text, L"%X", tmp);
+ mir_snwprintf(text, L"%X", tmp);
}
SetDlgItemText(hwnd, IDC_SETTINGVALUE, text);
mir_free(setting);
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index 6407bd5b35..e4a175d1ff 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -131,16 +131,16 @@ void addwatchtolist(HWND hwnd, struct DBsetting *lParam) break;
}
case DBVT_BYTE:
- mir_sntprintf(data, L"0x%02X (%s)", dbv->bVal, _ultow(dbv->bVal, tmp, 10));
+ mir_snwprintf(data, L"0x%02X (%s)", dbv->bVal, _ultow(dbv->bVal, tmp, 10));
ListView_SetItemText(hwnd, index, 3, data);
break;
case DBVT_WORD:
- mir_sntprintf(data, L"0x%04X (%s)", dbv->wVal, _ultow(dbv->wVal, tmp, 10));
+ mir_snwprintf(data, L"0x%04X (%s)", dbv->wVal, _ultow(dbv->wVal, tmp, 10));
ListView_SetItemText(hwnd, index, 3, data);
break;
case DBVT_DWORD:
- mir_sntprintf(data, L"0x%08X (%s)", dbv->dVal, _ultow(dbv->dVal, tmp, 10));
+ mir_snwprintf(data, L"0x%08X (%s)", dbv->dVal, _ultow(dbv->dVal, tmp, 10));
ListView_SetItemText(hwnd, index, 3, data);
break;
@@ -150,14 +150,14 @@ void addwatchtolist(HWND hwnd, struct DBsetting *lParam) case DBVT_WCHAR:
{
- ptrT str(mir_u2t(dbv->pwszVal));
+ ptrW str(mir_wstrdup(dbv->pwszVal));
ListView_SetItemText(hwnd, index, 3, str);
break;
}
case DBVT_UTF8:
{
- ptrT str(mir_utf8decodeT(dbv->pszVal));
+ ptrW str(mir_utf8decodeW(dbv->pszVal));
ListView_SetItemText(hwnd, index, 3, str);
break;
}
@@ -357,13 +357,13 @@ void popupWatchedVar(MCONTACT hContact, const char *module, const char *setting) // 2nd line
int type = GetValue(hContact, module, setting, value, _countof(value));
- mir_sntprintf(text, TranslateT("Database Setting Changed: \nModule: \"%s\", Setting: \"%s\"\nNew Value (%s): \"%s\""), _A2T(module), _A2T(setting), DBVType(type), value);
+ mir_snwprintf(text, TranslateT("Database Setting Changed: \nModule: \"%s\", Setting: \"%s\"\nNew Value (%s): \"%s\""), _A2T(module), _A2T(setting), DBVType(type), value);
POPUPDATAT ppd = { 0 };
ppd.lchContact = (MCONTACT)hContact;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGEDIT));
- mir_tstrncpy(ppd.lptzContactName, name, _countof(ppd.lptzContactName));
- mir_tstrncpy(ppd.lptzText, text, _countof(ppd.lptzText));
+ mir_wstrncpy(ppd.lptzContactName, name, _countof(ppd.lptzContactName));
+ mir_wstrncpy(ppd.lptzText, text, _countof(ppd.lptzText));
ppd.colorBack = colorBack;
ppd.colorText = colorText;
ppd.iSeconds = timeout ? timeout : -1;
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index 82d06ad4bb..ea18899542 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -32,7 +32,7 @@ void ShowPopup(wchar_t* ptszText, wchar_t* ptszHeader, wchar_t* ptszPath) wcsncpy_s(ppd.lptzText, ptszText, _TRUNCATE);
wcsncpy_s(ppd.lptzContactName, ptszHeader, _TRUNCATE);
if (ptszPath != NULL)
- ppd.PluginData = (void*)mir_tstrdup(ptszPath);
+ ppd.PluginData = (void*)mir_wstrdup(ptszPath);
ppd.PluginWindowProc = DlgProcPopup;
ppd.lchIcon = IcoLib_GetIcon(iconList[0].szName);
@@ -112,7 +112,7 @@ bool MakeZip(wchar_t *tszSource, wchar_t *tszDest, wchar_t *dbname, HWND progres HWND hProgBar = GetDlgItem(progress_dialog, IDC_PROGRESS);
ptrA szSourceName(mir_u2a(dbname));
- ptrT tszDestPath(DoubleSlash(tszDest));
+ ptrW tszDestPath(DoubleSlash(tszDest));
OBJLIST<ZipFile> lstFiles(15);
lstFiles.insert(new ZipFile((char*)_T2A(tszSource), (char*)szSourceName));
@@ -149,7 +149,7 @@ int RotateBackups(wchar_t *backupfolder, wchar_t *dbname) if (options.num_backups == 0)
return 0; /* Roration disabled. */
- mir_sntprintf(backupfolderTmp, L"%s\\%s*", backupfolder, dbname);
+ mir_snwprintf(backupfolderTmp, L"%s\\%s*", backupfolder, dbname);
hFind = FindFirstFile(backupfolderTmp, &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
return 0;
@@ -169,7 +169,7 @@ int RotateBackups(wchar_t *backupfolder, wchar_t *dbname) if (i > 0)
qsort(bf, i, sizeof(backupFile), Comp); /* Sort the list of found files by date in descending order. */
for (; i >= options.num_backups; i --) {
- mir_sntprintf(backupfolderTmp, L"%s\\%s", backupfolder, bf[(i - 1)].Name);
+ mir_snwprintf(backupfolderTmp, L"%s\\%s", backupfolder, bf[(i - 1)].Name);
DeleteFile(backupfolderTmp);
}
err_out:
@@ -205,12 +205,12 @@ int Backup(wchar_t *backup_filename) GetLocalTime(&st);
GetComputerName(buffer, &size);
- mir_sntprintf(dest_file, L"%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.%s", backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer, bZip ? L"zip" : L"dat");
+ mir_snwprintf(dest_file, L"%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.%s", backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer, bZip ? L"zip" : L"dat");
mir_free(backupfolder);
}
else {
wcsncpy_s(dest_file, backup_filename, _TRUNCATE);
- if (!mir_tstrcmp(wcsrchr(backup_filename, '.'), L".zip"))
+ if (!mir_wstrcmp(wcsrchr(backup_filename, '.'), L".zip"))
bZip = true;
}
if (!options.disable_popups)
@@ -221,7 +221,7 @@ int Backup(wchar_t *backup_filename) SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Copying database file..."));
- mir_sntprintf(source_file, L"%s\\%s", profilePath, dbname);
+ mir_snwprintf(source_file, L"%s\\%s", profilePath, dbname);
wchar_t *pathtmp = Utils_ReplaceVarsT(source_file);
BOOL res = 0;
if (bZip)
@@ -253,7 +253,7 @@ int Backup(wchar_t *backup_filename) }
if (!options.disable_popups) {
- size_t dest_file_len = mir_tstrlen(dest_file);
+ size_t dest_file_len = mir_wstrlen(dest_file);
wchar_t *puText;
if (dest_file_len > 50) {
@@ -262,12 +262,12 @@ int Backup(wchar_t *backup_filename) for (i = (dest_file_len - 1); dest_file[i] != '\\'; i--)
;
//wcsncpy_s(dest_file, backup_filename, _TRUNCATE);
- mir_tstrncpy(puText, dest_file, (i + 2));
- mir_tstrcat(puText, L"\n");
- mir_tstrcat(puText, (dest_file + i + 1));
+ mir_wstrncpy(puText, dest_file, (i + 2));
+ mir_wstrcat(puText, L"\n");
+ mir_wstrcat(puText, (dest_file + i + 1));
}
else
- puText = mir_tstrdup(dest_file);
+ puText = mir_wstrdup(dest_file);
// Now we need to know, which folder we made a backup. Let's break unnecessary variables :)
while (dest_file[--dest_file_len] != L'\\')
@@ -303,7 +303,7 @@ void BackupStart(wchar_t *backup_filename) return;
}
if (backup_filename != NULL)
- tm = mir_tstrdup(backup_filename);
+ tm = mir_wstrdup(backup_filename);
if (mir_forkthread(BackupThread, (void*)tm) == INVALID_HANDLE_VALUE) {
InterlockedExchange(&m_state, 0); /* Backup done. */
mir_free(tm);
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index 52cc10aa91..4efd79dec5 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -38,7 +38,7 @@ static INT_PTR DBSaveAs(WPARAM, LPARAM) OPENFILENAME ofn = { 0 };
CallService(MS_DB_GETPROFILENAMET, _countof(fname_buff), (LPARAM)fname_buff);
- mir_sntprintf(tszFilter, L"%s (*.dat)%c*.dat%c%s (*.zip)%c*.zip%c%s (*.*)%c*%c",
+ mir_snwprintf(tszFilter, L"%s (*.dat)%c*.dat%c%s (*.zip)%c*.zip%c%s (*.*)%c*%c",
TranslateT("Miranda NG databases"), 0, 0,
TranslateT("Compressed Miranda NG databases"), 0, 0,
TranslateT("All files"), 0, 0);
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index 046f777fd9..52ca03f8ad 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -45,15 +45,15 @@ int LoadOptions(void) if (!db_get_ts(0, "AutoBackups", "Folder", &dbv)) {
wchar_t *tmp = Utils_ReplaceVarsT(dbv.ptszVal);
- if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
+ if (mir_wstrlen(tmp) >= 2 && tmp[1] == ':')
wcsncpy_s(options.folder, dbv.ptszVal, _TRUNCATE);
else
- mir_sntprintf(options.folder, L"%s\\%s", profilePath, dbv.ptszVal);
+ mir_snwprintf(options.folder, L"%s\\%s", profilePath, dbv.ptszVal);
db_free(&dbv);
mir_free(tmp);
}
- else mir_sntprintf(options.folder, L"%s%s", DIR, SUB_DIR);
+ else mir_snwprintf(options.folder, L"%s%s", DIR, SUB_DIR);
}
options.num_backups = db_get_w(0, "AutoBackups", "NumBackups", 3);
@@ -77,9 +77,9 @@ int SaveOptions(void) db_set_w(0, "AutoBackups", "Period", (WORD)options.period);
db_set_b(0, "AutoBackups", "PeriodType", (BYTE)options.period_type);
- mir_sntprintf(prof_dir, L"%s\\", profilePath);
- size_t prof_len = mir_tstrlen(prof_dir);
- size_t opt_len = mir_tstrlen(options.folder);
+ mir_snwprintf(prof_dir, L"%s\\", profilePath);
+ size_t prof_len = mir_wstrlen(prof_dir);
+ size_t opt_len = mir_wstrlen(options.folder);
if (opt_len > prof_len && wcsncmp(options.folder, prof_dir, prof_len) == 0) {
db_set_ts(0, "AutoBackups", "Folder", (options.folder + prof_len));
@@ -88,9 +88,9 @@ int SaveOptions(void) db_set_ts(0, "AutoBackups", "Folder", options.folder);
wchar_t *tmp = Utils_ReplaceVarsT(options.folder);
- if (mir_tstrlen(tmp) < 2 || tmp[1] != ':') {
+ if (mir_wstrlen(tmp) < 2 || tmp[1] != ':') {
wcsncpy_s(prof_dir, options.folder, _TRUNCATE);
- mir_sntprintf(options.folder, L"%s\\%s", profilePath, prof_dir);
+ mir_snwprintf(options.folder, L"%s\\%s", profilePath, prof_dir);
}
mir_free(tmp);
db_set_w(0, "AutoBackups", "NumBackups", options.num_backups);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
else {
wchar_t tszTooltipText[4096];
- mir_sntprintf(tszTooltipText, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
+ mir_snwprintf(tszTooltipText, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"%miranda_path%", TranslateT("path to Miranda root folder"),
L"%miranda_profilesdir%", TranslateT("path to folder containing Miranda profiles"),
L"%miranda_profilename%", TranslateT("name of current Miranda profile (filename, without extension)"),
@@ -359,10 +359,10 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP BOOL folder_ok = TRUE;
wchar_t *tmp = Utils_ReplaceVarsT(folder_buff);
- if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
+ if (mir_wstrlen(tmp) >= 2 && tmp[1] == ':')
wcsncpy_s(backupfolder, tmp, _TRUNCATE);
else
- mir_sntprintf(backupfolder, L"%s\\%s", profilePath, tmp);
+ mir_snwprintf(backupfolder, L"%s\\%s", profilePath, tmp);
mir_free(tmp);
int err = CreateDirectoryTreeT(backupfolder);
diff --git a/plugins/Dbx_mdb/src/dbcrypt.cpp b/plugins/Dbx_mdb/src/dbcrypt.cpp index 0b5d3e6bf2..74b51d1084 100644 --- a/plugins/Dbx_mdb/src/dbcrypt.cpp +++ b/plugins/Dbx_mdb/src/dbcrypt.cpp @@ -100,7 +100,7 @@ int CDbxMdb::InitCrypt() {
if (-128 != dlg.DoModal())
return 4;
- m_crypto->setPassword(pass_ptrA(mir_utf8encodeT(param.newPass)));
+ m_crypto->setPassword(pass_ptrA(mir_utf8encodeW(param.newPass)));
if (m_crypto->setKey((const BYTE*)value.mv_data, value.mv_size))
{
m_bUsesPassword = true;
@@ -156,7 +156,7 @@ void CDbxMdb::SetPassword(LPCTSTR ptszPassword) else
{
m_bUsesPassword = true;
- m_crypto->setPassword(pass_ptrA(mir_utf8encodeT(ptszPassword)));
+ m_crypto->setPassword(pass_ptrA(mir_utf8encodeW(ptszPassword)));
}
UpdateMenuItem();
}
diff --git a/plugins/Dbx_mdb/src/dbintf.cpp b/plugins/Dbx_mdb/src/dbintf.cpp index 1bfc1ddc24..a47dd6b677 100644 --- a/plugins/Dbx_mdb/src/dbintf.cpp +++ b/plugins/Dbx_mdb/src/dbintf.cpp @@ -30,7 +30,7 @@ CDbxMdb::CDbxMdb(const TCHAR *tszFileName, int iMode) : m_lResidentSettings(50, strcmp),
m_maxContactId(1)
{
- m_tszProfileName = mir_tstrdup(tszFileName);
+ m_tszProfileName = mir_wstrdup(tszFileName);
InitDbInstance(this);
mdb_env_create(&m_pMdbEnv);
@@ -226,7 +226,7 @@ EXTERN_C void __cdecl dbpanic(void *) msg = TranslateT("Disk is full. Miranda will now shut down.");
TCHAR err[256];
- mir_sntprintf(err, _countof(err), msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
+ mir_snwprintf(err, msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
}
diff --git a/plugins/Dbx_mdb/src/ui.cpp b/plugins/Dbx_mdb/src/ui.cpp index 7f73b41cd6..9845552062 100644 --- a/plugins/Dbx_mdb/src/ui.cpp +++ b/plugins/Dbx_mdb/src/ui.cpp @@ -48,7 +48,7 @@ static bool CheckOldPassword(HWND hwndDlg, CDbxMdb *db) {
TCHAR buf[100];
GetDlgItemText(hwndDlg, IDC_OLDPASS, buf, _countof(buf));
- pass_ptrA oldPass(mir_utf8encodeT(buf));
+ pass_ptrA oldPass(mir_utf8encodeW(buf));
if (!db->m_crypto->checkPassword(oldPass))
{
SetDlgItemText(hwndDlg, IDC_HEADERBAR, TranslateT("Wrong old password entered!"));
diff --git a/plugins/Dropbox/src/dropbox.cpp b/plugins/Dropbox/src/dropbox.cpp index 4a6faac5b1..6ec01a5354 100644 --- a/plugins/Dropbox/src/dropbox.cpp +++ b/plugins/Dropbox/src/dropbox.cpp @@ -173,7 +173,7 @@ UINT CDropbox::RequestAccessTokenAsync(void *owner, void *param) JSONNode node = root.at("error_description");
if (node != JSONNULL) {
- ptrT error_description(mir_a2t_cp(node.as_string().c_str(), CP_UTF8));
+ ptrW error_description(mir_a2u_cp(node.as_string().c_str(), CP_UTF8));
Netlib_Logf(instance->hNetlibConnection, "%s: %s", MODULE, HttpStatusToText((HTTP_STATUS)response->resultCode));
if (hwndDlg)
SetDlgItemText(hwndDlg, IDC_AUTH_STATUS, error_description);
diff --git a/plugins/Dropbox/src/dropbox_options.cpp b/plugins/Dropbox/src/dropbox_options.cpp index f5ff7516fd..3bba4c0520 100644 --- a/plugins/Dropbox/src/dropbox_options.cpp +++ b/plugins/Dropbox/src/dropbox_options.cpp @@ -77,8 +77,8 @@ void CDropboxOptionsInterception::OnInitDialog() PROTOACCOUNT *acc = accounts[i];
if (strstr(acc->szProtoName, MODULE) || strstr(acc->szProtoName, "Meta"))
continue;
- int iItem = m_accounts.AddItem(mir_tstrdup(acc->tszAccountName), -1, (LPARAM)acc);
- m_accounts.SetItem(iItem, 1, mir_a2t(acc->szProtoName));
+ int iItem = m_accounts.AddItem(mir_wstrdup(acc->tszAccountName), -1, (LPARAM)acc);
+ m_accounts.SetItem(iItem, 1, mir_a2u(acc->szProtoName));
if (interceptedAccounts && strstr(interceptedAccounts, acc->szModuleName))
m_accounts.SetCheckState(iItem, TRUE);
}
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp index 6896398ced..9dd4100a68 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -192,7 +192,7 @@ INT_PTR CDropbox::UploadToDropbox(WPARAM wParam, LPARAM lParam) int res = UploadToDropbox(this, ftp);
if (res == ACKRESULT_SUCCESS && wParam) {
char **data = (char**)wParam;
- *data = mir_utf8encodeT(ftp->GetData());
+ *data = mir_utf8encodeW(ftp->GetData());
}
transfers.remove(ftp);
diff --git a/plugins/Dropbox/src/dropbox_transfers.cpp b/plugins/Dropbox/src/dropbox_transfers.cpp index 33d9ed8613..85f3d44592 100644 --- a/plugins/Dropbox/src/dropbox_transfers.cpp +++ b/plugins/Dropbox/src/dropbox_transfers.cpp @@ -102,7 +102,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg) PreparePath(folderName, path);
instance->CreateFolder(path);
instance->CreateDownloadUrl(path, url);
- ftp->AppendFormatData(L"%s\r\n", ptrT(mir_utf8decodeT(url)));
+ ftp->AppendFormatData(L"%s\r\n", ptrW(mir_utf8decodeW(url)));
}
ftp->FirstFile();
@@ -142,7 +142,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg) const wchar_t *serverFolder = ftp->GetServerFolder();
if (serverFolder) {
wchar_t serverPath[MAX_PATH] = { 0 };
- mir_sntprintf(serverPath, L"%s\\%s", serverFolder, fileName);
+ mir_snwprintf(serverPath, L"%s\\%s", serverFolder, fileName);
PreparePath(serverPath, path);
}
else
@@ -154,7 +154,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg) if (!wcschr(fileName, L'\\')) {
char url[MAX_PATH];
instance->CreateDownloadUrl(path, url);
- ftp->AppendFormatData(L"%s\r\n", ptrT(mir_utf8decodeT(url)));
+ ftp->AppendFormatData(L"%s\r\n", ptrW(mir_utf8decodeW(url)));
}
} while (ftp->NextFile());
}
diff --git a/plugins/Dropbox/src/dropbox_utils.cpp b/plugins/Dropbox/src/dropbox_utils.cpp index 28bf244984..b388117db5 100644 --- a/plugins/Dropbox/src/dropbox_utils.cpp +++ b/plugins/Dropbox/src/dropbox_utils.cpp @@ -98,26 +98,26 @@ MEVENT CDropbox::AddEventToDb(MCONTACT hContact, WORD type, DWORD flags, DWORD c void CDropbox::SendToContact(MCONTACT hContact, const wchar_t *data)
{
if (hContact == GetDefaultContact()) {
- char *message = mir_utf8encodeT(data);
+ char *message = mir_utf8encodeW(data);
AddEventToDb(hContact, EVENTTYPE_MESSAGE, DBEF_UTF, (DWORD)mir_strlen(message), (PBYTE)message);
return;
}
const char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == TRUE) {
- ptrT tszChatRoom(db_get_tsa(hContact, szProto, "ChatRoomID"));
+ ptrW tszChatRoom(db_get_tsa(hContact, szProto, "ChatRoomID"));
GCDEST gcd = { szProto, tszChatRoom, GC_EVENT_SENDMESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
gce.bIsMe = TRUE;
gce.dwFlags = GCEF_ADDTOLOG;
- gce.ptszText = mir_tstrdup(data);
+ gce.ptszText = mir_wstrdup(data);
gce.time = time(NULL);
CallServiceSync(MS_GC_EVENT, WINDOW_VISIBLE, (LPARAM)&gce);
mir_free((void*)gce.ptszText);
return;
}
- char *message = mir_utf8encodeT(data);
+ char *message = mir_utf8encodeW(data);
if (ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)message) != ACKRESULT_FAILED)
AddEventToDb(hContact, EVENTTYPE_MESSAGE, DBEF_UTF | DBEF_SENT, (DWORD)mir_strlen(message), (PBYTE)message);
}
@@ -142,7 +142,7 @@ void CDropbox::PasteToClipboard(const wchar_t *data) if (OpenClipboard(NULL)) {
EmptyClipboard();
- size_t size = sizeof(wchar_t) * (mir_tstrlen(data) + 1);
+ size_t size = sizeof(wchar_t) * (mir_wstrlen(data) + 1);
HGLOBAL hClipboardData = GlobalAlloc(NULL, size);
if (hClipboardData) {
wchar_t *pchData = (wchar_t*)GlobalLock(hClipboardData);
diff --git a/plugins/Dropbox/src/file_transfer.h b/plugins/Dropbox/src/file_transfer.h index 6feacbb445..f5ef1e56fd 100644 --- a/plugins/Dropbox/src/file_transfer.h +++ b/plugins/Dropbox/src/file_transfer.h @@ -91,7 +91,7 @@ public: {
relativePathStart = wcsrchr(path, '\\') - path + 1;
pfts.tszWorkingDir = (wchar_t*)mir_calloc(sizeof(wchar_t) * relativePathStart);
- mir_tstrncpy(pfts.tszWorkingDir, path, relativePathStart);
+ mir_wstrncpy(pfts.tszWorkingDir, path, relativePathStart);
if (PathIsDirectory(path))
folderName = wcsrchr(path, '\\') + 1;
}
@@ -117,7 +117,7 @@ public: void AddFile(const wchar_t *path)
{
pfts.ptszFiles = (wchar_t**)mir_realloc(pfts.ptszFiles, sizeof(wchar_t*) * (pfts.totalFiles + 2));
- pfts.ptszFiles[pfts.totalFiles++] = mir_tstrdup(path);
+ pfts.ptszFiles[pfts.totalFiles++] = mir_wstrdup(path);
pfts.ptszFiles[pfts.totalFiles] = NULL;
FILE *file = _wfopen(path, L"rb");
diff --git a/plugins/Exchange/src/MirandaExchange.cpp b/plugins/Exchange/src/MirandaExchange.cpp index 346ca7471b..a60992410f 100644 --- a/plugins/Exchange/src/MirandaExchange.cpp +++ b/plugins/Exchange/src/MirandaExchange.cpp @@ -116,17 +116,17 @@ CKeeper::CKeeper( LPTSTR szSender, LPTSTR szSubject, LPSTR szEntryID) m_nSizeEntryID = 0 ;
if (NULL != szSender) {
- m_nSizeSender = (UINT)mir_tstrlen(szSender)+1;
+ m_nSizeSender = (UINT)mir_wstrlen(szSender)+1;
m_szSender = new wchar_t[ m_nSizeSender ];
memset(m_szSender, 0, m_nSizeSender * sizeof(wchar_t));
- mir_tstrcpy(m_szSender, szSender);
+ mir_wstrcpy(m_szSender, szSender);
}
if (NULL != szSubject) {
- m_nSizeSubject = (UINT)mir_tstrlen(szSubject) +1;
+ m_nSizeSubject = (UINT)mir_wstrlen(szSubject) +1;
m_szSubject = new wchar_t[m_nSizeSubject];
memset(m_szSubject, 0, m_nSizeSubject * sizeof(wchar_t));
- mir_tstrcpy(m_szSubject, szSubject);
+ mir_wstrcpy(m_szSubject, szSubject);
}
if (NULL != szEntryID) {
@@ -392,32 +392,32 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass short nSizeOfTCHAR = sizeof( wchar_t );
if (m_szUsername == NULL && NULL != szUsername) {
- nSize = (UINT)mir_tstrlen(szUsername);
+ nSize = (UINT)mir_wstrlen(szUsername);
if (nSize > 0) {
nSize++;
m_szUsername = new wchar_t[nSize];
memset ( m_szUsername, 0, nSize * nSizeOfTCHAR );
- mir_tstrcpy( m_szUsername, szUsername );
+ mir_wstrcpy( m_szUsername, szUsername );
}
}
if (m_szPassword == NULL && NULL != szPassword) {
- nSize = (UINT)mir_tstrlen(szPassword);
+ nSize = (UINT)mir_wstrlen(szPassword);
if (nSize > 0) {
nSize++;
m_szPassword = new wchar_t[nSize];
memset(m_szPassword, 0, nSize * nSizeOfTCHAR);
- mir_tstrcpy(m_szPassword, szPassword);
+ mir_wstrcpy(m_szPassword, szPassword);
}
}
if (m_szExchangeServer == NULL && NULL != szExchangeServer) {
- nSize = (UINT)mir_tstrlen(szExchangeServer);
+ nSize = (UINT)mir_wstrlen(szExchangeServer);
if (nSize > 0) {
nSize++;
m_szExchangeServer = new wchar_t[nSize];
memset(m_szExchangeServer, 0, nSize * nSizeOfTCHAR);
- mir_tstrcpy(m_szExchangeServer, szExchangeServer);
+ mir_wstrcpy(m_szExchangeServer, szExchangeServer);
}
}
@@ -436,7 +436,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass _wstrtime(szPID);
wcsncpy(szPIDandName, m_szUsername, _countof(szPIDandName)-1);
- mir_tstrncat(szPIDandName, szPID, _countof(szPIDandName) - mir_tstrlen(szPIDandName));
+ mir_wstrncat(szPIDandName, szPID, _countof(szPIDandName) - mir_wstrlen(szPIDandName));
hr = CreateProfile(szPIDandName);
if ( HR_FAILED(hr)) {
@@ -446,7 +446,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass DWORD dwFlags = MAPI_EXPLICIT_PROFILE|MAPI_EXTENDED|MAPI_NEW_SESSION|MAPI_NO_MAIL ;
- hr = MAPILogonEx( 0, (LPTSTR)mir_t2a(szPIDandName), (LPTSTR)mir_t2a(m_szPassword), dwFlags, &m_lpMAPISession );
+ hr = MAPILogonEx( 0, (LPTSTR)mir_u2a(szPIDandName), (LPTSTR)mir_u2a(m_szPassword), dwFlags, &m_lpMAPISession );
if (FAILED(hr)) {
//Log( L"MAPI Logon failed: 0x%08X", hr );
@@ -461,7 +461,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass //Log("Admin profile interface creation failed: 0x%08X", hr);
}
else {
- hr = pProfAdmin->DeleteProfile( (LPTSTR)mir_t2a(szPIDandName), 0 );
+ hr = pProfAdmin->DeleteProfile( (LPTSTR)mir_u2a(szPIDandName), 0 );
if ( FAILED(hr) )
{
//Log( "Failed to delete the profile: 0x%08X", hr );
@@ -527,13 +527,13 @@ HRESULT CMirandaExchange::CreateProfile( LPTSTR szProfileName ) hr = MAPIAdminProfiles(ulFlags, &pProfAdmin);
if (FAILED(hr) || pProfAdmin == NULL)
return hr;
- hr = pProfAdmin->CreateProfile((LPTSTR)mir_t2a(szProfileName), NULL, NULL, ulFlags);
+ hr = pProfAdmin->CreateProfile((LPTSTR)mir_u2a(szProfileName), NULL, NULL, ulFlags);
if (FAILED(hr)) {
- pProfAdmin->DeleteProfile((LPTSTR)mir_t2a(szProfileName), ulFlags);
+ pProfAdmin->DeleteProfile((LPTSTR)mir_u2a(szProfileName), ulFlags);
return hr;
}
- hr = pProfAdmin->AdminServices( (LPTSTR)mir_t2a(szProfileName), NULL, NULL, ulFlags, &pMsgSvcAdmin);
+ hr = pProfAdmin->AdminServices( (LPTSTR)mir_u2a(szProfileName), NULL, NULL, ulFlags, &pMsgSvcAdmin);
if (FAILED(hr) || pMsgSvcAdmin == NULL)
return hr;
@@ -562,7 +562,7 @@ HRESULT CMirandaExchange::CreateProfile( LPTSTR szProfileName ) if (FAILED(hr))
return hr;
- nSize = mir_tstrlen(m_szUsername);
+ nSize = mir_wstrlen(m_szUsername);
szUniqName = (wchar_t*)mir_alloc(sizeof(wchar_t) * (nSize + 4));
if (szUniqName != NULL) {
memcpy(szUniqName, L"=", sizeof(wchar_t));
@@ -570,9 +570,9 @@ HRESULT CMirandaExchange::CreateProfile( LPTSTR szProfileName ) // Set values for PR_PROFILE_UNRESOLVED_NAME and PR_PROFILE_UNRESOLVED_SERVER
SPropValue spval[2];
spval[0].ulPropTag = PR_PROFILE_UNRESOLVED_NAME;
- spval[0].Value.lpszA = mir_t2a(szUniqName);
+ spval[0].Value.lpszA = mir_u2a(szUniqName);
spval[1].ulPropTag = PR_PROFILE_UNRESOLVED_SERVER;
- spval[1].Value.lpszA = mir_t2a(m_szExchangeServer);
+ spval[1].Value.lpszA = mir_u2a(m_szExchangeServer);
// Configure msg service
/*hr =*/ pMsgSvcAdmin->ConfigureMsgService(
@@ -867,8 +867,8 @@ HRESULT CMirandaExchange::OpenTheMessage( LPTSTR ) if ( NULL != szTheEnd )
{
- szRegValue[ mir_tstrlen(szRegValue) - mir_tstrlen(szTheEnd) +5 ] = '\0';
- mir_tstrcat( szRegValue, L" /recycle" );
+ szRegValue[ mir_wstrlen(szRegValue) - mir_wstrlen(szTheEnd) +5 ] = '\0';
+ mir_wstrcat( szRegValue, L" /recycle" );
STARTUPINFO si;
PROCESS_INFORMATION pi;
diff --git a/plugins/Exchange/src/dlg_handlers.cpp b/plugins/Exchange/src/dlg_handlers.cpp index 4032a748e6..93e5cde48f 100644 --- a/plugins/Exchange/src/dlg_handlers.cpp +++ b/plugins/Exchange/src/dlg_handlers.cpp @@ -242,7 +242,7 @@ INT_PTR CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam item.pszText = email.szSender;
ListView_InsertItem(hList, &item);
ListView_SetItemText(hList, i, 1, email.szSubject);
- ListView_SetItemText(hList, i, 2, mir_a2t(email.emailID));
+ ListView_SetItemText(hList, i, 2, mir_a2u(email.emailID));
}
SetFocus(hList);
}
diff --git a/plugins/Exchange/src/emails.cpp b/plugins/Exchange/src/emails.cpp index f38bc7335c..5f22aa6a29 100644 --- a/plugins/Exchange/src/emails.cpp +++ b/plugins/Exchange/src/emails.cpp @@ -68,7 +68,7 @@ int CExchangeServer::Connect(int bForceConnect) GetStringFromDatabase("Server", L"", server, _countof(server));
int port = db_get_dw(NULL, ModuleName, "Port", EXCHANGE_PORT);
- if (mir_tstrlen(server) > 0) //only connect if there's a server to connect to
+ if (mir_wstrlen(server) > 0) //only connect if there's a server to connect to
return DoConnect(user, password, server, port);
_popupUtil(TranslateT("Server is not configured..."));
@@ -155,7 +155,7 @@ int CExchangeServer::IsServerAvailable() wchar_t szServer[1024];
GetStringFromDatabase("Server", L"", szServer, sizeof(szServer));
sockaddr_in addrServer;
- InitSocketAddr(&addrServer, mir_t2a(szServer));
+ InitSocketAddr(&addrServer, mir_u2a(szServer));
int res = connect(sServer, (sockaddr *) &addrServer, sizeof(addrServer));
int bAvailable = 0;
if (!res) {
@@ -279,9 +279,9 @@ int CExchangeServer::Check(int bNoEmailsNotify) if (((count > 0) || ((bNoEmailsNotify) && (count >= 0))) && (count != -1)) {
wchar_t buffer[1024];
if (count != 1)
- mir_sntprintf(buffer, TranslateT("You have %d unread emails..."), count);
+ mir_snwprintf(buffer, TranslateT("You have %d unread emails..."), count);
else
- mir_sntprintf(buffer, TranslateT("You have one unread email..."));
+ mir_snwprintf(buffer, TranslateT("You have one unread email..."));
ShowMessage(buffer, count);
}
diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp index 9b5204a0cb..e65843eb88 100644 --- a/plugins/Exchange/src/utils.cpp +++ b/plugins/Exchange/src/utils.cpp @@ -115,7 +115,7 @@ int GetStringFromDatabase(char *szSettingName, wchar_t *szError, wchar_t *szResu dbv.type = DBVT_ASCIIZ;
if (db_get_ts(NULL, ModuleName, szSettingName, &dbv) == 0) {
res = 0;
- size_t tmp = mir_tstrlen(dbv.ptszVal);
+ size_t tmp = mir_wstrlen(dbv.ptszVal);
size_t len = (tmp < size - 1) ? tmp : size - 1;
wcsncpy(szResult, dbv.ptszVal, len);
szResult[len] = '\0';
@@ -123,7 +123,7 @@ int GetStringFromDatabase(char *szSettingName, wchar_t *szError, wchar_t *szResu }
else {
res = 1;
- size_t tmp = mir_tstrlen(szError);
+ size_t tmp = mir_wstrlen(szError);
size_t len = (tmp < size - 1) ? tmp : size - 1;
wcsncpy(szResult, szError, len);
szResult[len] = '\0';
diff --git a/plugins/ExternalAPI/m_variables.h b/plugins/ExternalAPI/m_variables.h index d80bb06e9b..daadc28c60 100644 --- a/plugins/ExternalAPI/m_variables.h +++ b/plugins/ExternalAPI/m_variables.h @@ -157,7 +157,7 @@ __inline static TCHAR *variables_parsedup(TCHAR *tszFormat, TCHAR *tszExtraText, if (tszParsed)
return tszParsed;
}
- return tszFormat ? mir_tstrdup(tszFormat) : tszFormat;
+ return tszFormat ? mir_wstrdup(tszFormat) : tszFormat;
}
__inline static TCHAR *variables_parsedup_ex(TCHAR *tszFormat, TCHAR *tszExtraText, MCONTACT hContact,
@@ -175,7 +175,7 @@ __inline static TCHAR *variables_parsedup_ex(TCHAR *tszFormat, TCHAR *tszExtraTe if (tszParsed)
return tszParsed;
}
- return tszFormat ? mir_tstrdup(tszFormat) : tszFormat;
+ return tszFormat ? mir_wstrdup(tszFormat) : tszFormat;
}
#endif
@@ -517,7 +517,7 @@ __inline static int variables_skin_helpbutton(HWND hwndDlg, UINT uIDButton) { hIcon = (HICON)CallService(MS_VARS_GETSKINITEM, 0, (LPARAM)VSI_HELPICON);
GetClassName(GetDlgItem(hwndDlg, uIDButton), tszClass, _countof(tszClass));
- if (!mir_tstrcmp(tszClass, L"Button")) {
+ if (!mir_wstrcmp(tszClass, L"Button")) {
if (hIcon != NULL) {
SetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE)|BS_ICON);
SendMessage(GetDlgItem(hwndDlg, uIDButton), BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon);
@@ -527,7 +527,7 @@ __inline static int variables_skin_helpbutton(HWND hwndDlg, UINT uIDButton) { SetDlgItemText(hwndDlg, uIDButton, L"V");
}
}
- else if (!mir_tstrcmp(tszClass, MIRANDABUTTONCLASS)) {
+ else if (!mir_wstrcmp(tszClass, MIRANDABUTTONCLASS)) {
if (hIcon != NULL) {
char *szTipInfo = NULL;
diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index 39192e6583..06c914070c 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -131,7 +131,7 @@ void UploadDialog::Tab::select() void UploadDialog::Tab::labelCompleted()
{
wchar_t buff[64], buff2[256];
- mir_sntprintf(buff2, L"* %s", Utils::getTextFragment(m_job->m_tszFileName, 20, buff));
+ mir_snwprintf(buff2, L"* %s", Utils::getTextFragment(m_job->m_tszFileName, 20, buff));
TCITEM tab = { 0 };
tab.mask = TCIF_TEXT;
@@ -293,11 +293,11 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar AppendMenu(hTimeMenu, MF_SEPARATOR, 0, 0);
if (i < 3)
- mir_sntprintf(buff, TranslateT("%d minutes"), times[i]);
+ mir_snwprintf(buff, TranslateT("%d minutes"), times[i]);
else if (i < 7)
- mir_sntprintf(buff, TranslateT("%d hours"), times[i] / 60);
+ mir_snwprintf(buff, TranslateT("%d hours"), times[i] / 60);
else
- mir_sntprintf(buff, TranslateT("%d days"), times[i] / 60 / 24);
+ mir_snwprintf(buff, TranslateT("%d days"), times[i] / 60 / 24);
UINT check = MF_UNCHECKED;
if (!bChecked && tab->m_iOptAutoDelete == times[i]) {
@@ -310,9 +310,9 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar if (opt.bAutoDelete) {
switch (opt.timeRange) {
- case Options::TR_MINUTES: mir_sntprintf(buff, TranslateT("%d minutes"), opt.iDeleteTime); break;
- case Options::TR_HOURS: mir_sntprintf(buff, TranslateT("%d hours"), opt.iDeleteTime); break;
- case Options::TR_DAYS: mir_sntprintf(buff, TranslateT("%d days"), opt.iDeleteTime); break;
+ case Options::TR_MINUTES: mir_snwprintf(buff, TranslateT("%d minutes"), opt.iDeleteTime); break;
+ case Options::TR_HOURS: mir_snwprintf(buff, TranslateT("%d hours"), opt.iDeleteTime); break;
+ case Options::TR_DAYS: mir_snwprintf(buff, TranslateT("%d days"), opt.iDeleteTime); break;
}
AppendMenu(hTimeMenu, MF_SEPARATOR, 0, 0);
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index c5e4d548b3..f2681e24c4 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -112,7 +112,7 @@ void InitMenuItems() for (int i = 0; i < ServerList::FTP_COUNT; i++) {
if (DB::getStringF(0, MODULE, "Name%d", i, stzName))
- mir_sntprintf(stzName, TranslateT("FTP Server %d"), i + 1);
+ mir_snwprintf(stzName, TranslateT("FTP Server %d"), i + 1);
mi.root = (opt.bUseSubmenu) ? hMenu : 0;
mi.hIcolibItem = iconList[i].hIcolib;
diff --git a/plugins/FTPFileYM/src/job_delete.cpp b/plugins/FTPFileYM/src/job_delete.cpp index 2449d1e91a..858bb9e58e 100644 --- a/plugins/FTPFileYM/src/job_delete.cpp +++ b/plugins/FTPFileYM/src/job_delete.cpp @@ -89,8 +89,8 @@ void DeleteJob::run() DBEntry::remove(m_entry->m_fileID);
}
else if (manDlg != NULL && m_treeItem) {
- wchar_t *error = mir_a2t(szError);
- mir_tstrcpy(m_treeItem->m_tszToolTip, error);
+ wchar_t *error = mir_a2u(szError);
+ mir_wstrcpy(m_treeItem->m_tszToolTip, error);
m_treeItem->setState(Manager::TreeItem::_ERROR());
FREE(error);
}
diff --git a/plugins/FTPFileYM/src/job_generic.cpp b/plugins/FTPFileYM/src/job_generic.cpp index 9d4adf6013..ddeb5ee282 100644 --- a/plugins/FTPFileYM/src/job_generic.cpp +++ b/plugins/FTPFileYM/src/job_generic.cpp @@ -41,8 +41,8 @@ GenericJob::GenericJob(GenericJob *job) : m_ftp(job->m_ftp),
m_tab(job->m_tab)
{
- mir_tstrcpy(m_tszFilePath, job->m_tszFilePath);
- mir_tstrcpy(m_tszFileName, job->m_tszFileName);
+ mir_wstrcpy(m_tszFilePath, job->m_tszFilePath);
+ mir_wstrcpy(m_tszFileName, job->m_tszFileName);
mir_strcpy(m_szSafeFileName, job->m_szSafeFileName);
}
@@ -55,7 +55,7 @@ GenericJob::~GenericJob() int GenericJob::openFileDialog()
{
wchar_t temp[MAX_PATH] = L"";
- mir_sntprintf(temp, L"%s\0*.*\0", TranslateT("All Files (*.*)"));
+ mir_snwprintf(temp, L"%s\0*.*\0", TranslateT("All Files (*.*)"));
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = 0;
@@ -87,14 +87,14 @@ void GenericJob::getFilesFromOpenDialog() {
wchar_t stzFile[MAX_PATH];
- size_t length = mir_tstrlen(m_tszFilePath);
+ size_t length = mir_wstrlen(m_tszFilePath);
if (m_tszFilePath[0] && m_tszFilePath[length + 1]) // multiple files
{
wchar_t *ptr = m_tszFilePath + length + 1;
while (ptr[0]) {
- mir_sntprintf(stzFile, L"%s\\%s", m_tszFilePath, ptr);
+ mir_snwprintf(stzFile, L"%s\\%s", m_tszFilePath, ptr);
addFile(stzFile);
- ptr += mir_tstrlen(ptr) + 1;
+ ptr += mir_wstrlen(ptr) + 1;
}
}
else {
@@ -116,7 +116,7 @@ int GenericJob::getFilesFromFolder(wchar_t *stzFolder) HANDLE hFind = FindFirstFile(L"*.*", &ffd);
while (hFind != INVALID_HANDLE_VALUE) {
if (!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- mir_sntprintf(stzFile, L"%s\\%s", stzFolder, ffd.cFileName);
+ mir_snwprintf(stzFile, L"%s\\%s", stzFolder, ffd.cFileName);
addFile(stzFile);
}
@@ -154,9 +154,9 @@ int GenericJob::getFiles(void **objects, int objCount, DWORD flags) if (m_mode == FTP_ZIPFOLDER) {
wchar_t *folder;
if (flags & FUPL_UNICODE)
- folder = mir_u2t((wchar_t *)objects[0]);
+ folder = mir_wstrdup((wchar_t *)objects[0]);
else
- folder = mir_a2t((char *)objects[0]);
+ folder = mir_a2u((char *)objects[0]);
int result = getFilesFromFolder(folder);
FREE(folder);
@@ -166,9 +166,9 @@ int GenericJob::getFiles(void **objects, int objCount, DWORD flags) for (int i = 0; i < objCount; i++) {
wchar_t *fileName;
if (flags & FUPL_UNICODE)
- fileName = mir_u2t((wchar_t *)objects[i]);
+ fileName = mir_wstrdup((wchar_t *)objects[i]);
else
- fileName = mir_a2t((char *)objects[i]);
+ fileName = mir_a2u((char *)objects[i]);
addFile(fileName);
FREE(fileName);
@@ -180,7 +180,7 @@ int GenericJob::getFiles(void **objects, int objCount, DWORD flags) void GenericJob::addFile(wchar_t *fileName)
{
- wchar_t *buff = mir_tstrdup(fileName);
+ wchar_t *buff = mir_wstrdup(fileName);
m_files.push_back(buff);
}
diff --git a/plugins/FTPFileYM/src/job_packer.cpp b/plugins/FTPFileYM/src/job_packer.cpp index 135b06e665..29ec91c4b8 100644 --- a/plugins/FTPFileYM/src/job_packer.cpp +++ b/plugins/FTPFileYM/src/job_packer.cpp @@ -39,27 +39,27 @@ void PackerJob::getZipFilePath() wchar_t *pch;
if (m_files.size() == 1) {
- mir_tstrcpy(stzFileName, Utils::getFileNameFromPath(m_files[0]));
+ mir_wstrcpy(stzFileName, Utils::getFileNameFromPath(m_files[0]));
pch = wcsrchr(stzFileName, '.');
if (pch) *pch = 0;
}
else {
- mir_tstrcpy(buff, m_files[0]);
+ mir_wstrcpy(buff, m_files[0]);
pch = wcsrchr(buff, '\\');
if (pch) {
*pch = 0;
pch = wcsrchr(buff, '\\');
- if (pch) mir_tstrcpy(stzFileName, pch + 1);
+ if (pch) mir_wstrcpy(stzFileName, pch + 1);
}
}
if (stzFileName[0] == '\0')
- mir_tstrcpy(stzFileName, L"archive");
+ mir_wstrcpy(stzFileName, L"archive");
GetTempPath(_countof(buff), buff);
- mir_sntprintf(m_tszFilePath, L"%s%s.zip", buff, stzFileName);
- mir_tstrcpy(m_tszFileName, Utils::getFileNameFromPath(m_tszFilePath));
+ mir_snwprintf(m_tszFilePath, L"%s%s.zip", buff, stzFileName);
+ mir_wstrcpy(m_tszFileName, Utils::getFileNameFromPath(m_tszFilePath));
if (opt.bSetZipName)
Utils::setFileNameDlg(m_tszFileName);
@@ -156,7 +156,7 @@ int PackerJob::createZipFile() getFileTime(m_files[i], &zi.tmz_date, &zi.dosDate);
- char *file = mir_t2a(Utils::getFileNameFromPath(m_files[i]));
+ char *file = mir_u2a(Utils::getFileNameFromPath(m_files[i]));
int err = zipOpenNewFileInZip(zf, file, &zi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, opt.iCompressionLevel);
FREE(file);
@@ -233,10 +233,10 @@ void PackerJob::updateStats() m_lastUpdateTick = dwNewTick;
double speed = ((double)m_uiReaded / 1024) / (time(NULL) - m_startTS);
- mir_sntprintf(m_tab->m_stzSpeed, TranslateT("%0.1f kB/s"), speed);
+ mir_snwprintf(m_tab->m_stzSpeed, TranslateT("%0.1f kB/s"), speed);
double perc = m_uiFileSize ? ((double)m_uiReaded / m_uiFileSize) * 100 : 0;
- mir_sntprintf(m_tab->m_stzComplet, TranslateT("%0.1f%% (%d kB/%d kB)"), perc, (int)m_uiReaded / 1024, (int)m_uiFileSize / 1024);
+ mir_snwprintf(m_tab->m_stzComplet, TranslateT("%0.1f%% (%d kB/%d kB)"), perc, (int)m_uiReaded / 1024, (int)m_uiFileSize / 1024);
wchar_t buff[256];
long s = (m_uiFileSize - m_uiReaded) / (long)(speed * 1024);
@@ -245,9 +245,9 @@ void PackerJob::updateStats() int m = (s - d * 60 * 60 * 24 - h * 60 * 60) / 60;
s = s - (d * 24 * 60 * 60) - (h * 60 * 60) - (m * 60);
- if (d > 0) mir_sntprintf(buff, L"%dd %02d:%02d:%02d", d, h, m, s);
- else mir_sntprintf(buff, L"%02d:%02d:%02d", h, m, s);
- mir_sntprintf(m_tab->m_stzRemain, TranslateT("%s (%d kB/%d kB)"), buff, (m_uiFileSize - m_uiReaded) / 1024, m_uiFileSize / 1024);
+ if (d > 0) mir_snwprintf(buff, L"%dd %02d:%02d:%02d", d, h, m, s);
+ else mir_snwprintf(buff, L"%02d:%02d:%02d", h, m, s);
+ mir_snwprintf(m_tab->m_stzRemain, TranslateT("%s (%d kB/%d kB)"), buff, (m_uiFileSize - m_uiReaded) / 1024, m_uiFileSize / 1024);
refreshTab(false);
}
@@ -313,6 +313,6 @@ void PackerJob::closeAllTabs() void PackerJob::createToolTip()
{
- mir_sntprintf(uDlg->m_tszToolTipText, TranslateT("Status: %s\r\nFile: %s\r\nServer: %S"),
+ mir_snwprintf(uDlg->m_tszToolTipText, TranslateT("Status: %s\r\nFile: %s\r\nServer: %S"),
getStatusString(), m_tszFileName, m_ftp->m_szServer);
}
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp index b6c1e9a20c..5bd60536f5 100644 --- a/plugins/FTPFileYM/src/job_upload.cpp +++ b/plugins/FTPFileYM/src/job_upload.cpp @@ -64,8 +64,8 @@ void UploadJob::addToUploadDlg() {
for (UINT i = 0; i < m_files.size(); i++) {
UploadJob *jobCopy = new UploadJob(this);
- mir_tstrcpy(jobCopy->m_tszFilePath, m_files[i]);
- mir_tstrcpy(jobCopy->m_tszFileName, Utils::getFileNameFromPath(jobCopy->m_tszFilePath));
+ mir_wstrcpy(jobCopy->m_tszFilePath, m_files[i]);
+ mir_wstrcpy(jobCopy->m_tszFileName, Utils::getFileNameFromPath(jobCopy->m_tszFilePath));
Utils::makeSafeString(jobCopy->m_tszFileName, jobCopy->m_szSafeFileName);
UploadDialog::Tab *newTab = new UploadDialog::Tab(jobCopy);
@@ -246,8 +246,8 @@ INT_PTR CALLBACK UploadJob::DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wPa TranslateDialogDefault(hwndDlg);
{
wchar_t buff[256];
- wchar_t *fileName = mir_a2t((char *)lParam);
- mir_sntprintf(buff, TranslateT("File exists - %s"), fileName);
+ wchar_t *fileName = mir_a2u((char *)lParam);
+ mir_snwprintf(buff, TranslateT("File exists - %s"), fileName);
SetWindowText(hwndDlg, buff);
FREE(fileName);
}
@@ -391,10 +391,10 @@ void UploadJob::updateStats() m_avgSpeed /= _countof(m_lastSpeed) + 1;
m_lastSpeed[0] = speed;
- mir_sntprintf(m_tab->m_stzSpeed, L"%0.1f kB/s", m_avgSpeed);
+ mir_snwprintf(m_tab->m_stzSpeed, L"%0.1f kB/s", m_avgSpeed);
double perc = m_uiFileSize ? ((double)m_uiTotalSent / m_uiFileSize) * 100 : 0;
- mir_sntprintf(m_tab->m_stzComplet, L"%0.1f%% (%d kB/%d kB)", perc, (int)m_uiTotalSent / 1024, (int)m_uiFileSize / 1024);
+ mir_snwprintf(m_tab->m_stzComplet, L"%0.1f%% (%d kB/%d kB)", perc, (int)m_uiTotalSent / 1024, (int)m_uiFileSize / 1024);
long s = (m_uiFileSize - m_uiTotalSent) / (long)(m_avgSpeed * 1024);
int d = (s / 60 / 60 / 24);
@@ -403,9 +403,9 @@ void UploadJob::updateStats() s = s - (d * 24 * 60 * 60) - (h * 60 * 60) - (m * 60);
wchar_t buff[256];
- if (d > 0) mir_sntprintf(buff, L"%dd %02d:%02d:%02d", d, h, m, s);
- else mir_sntprintf(buff, L"%02d:%02d:%02d", h, m, s);
- mir_sntprintf(m_tab->m_stzRemain, L"%s (%d kB/%d kB)", buff, (m_uiFileSize - m_uiTotalSent) / 1024, m_uiFileSize / 1024);
+ if (d > 0) mir_snwprintf(buff, L"%dd %02d:%02d:%02d", d, h, m, s);
+ else mir_snwprintf(buff, L"%02d:%02d:%02d", h, m, s);
+ mir_snwprintf(m_tab->m_stzRemain, L"%s (%d kB/%d kB)", buff, (m_uiFileSize - m_uiTotalSent) / 1024, m_uiFileSize / 1024);
refreshTab(false);
}
@@ -493,10 +493,10 @@ void UploadJob::closeAllTabs() void UploadJob::createToolTip()
{
- mir_sntprintf(uDlg->m_tszToolTipText, TranslateT("Status: %s\r\nFile: %s\r\nServer: %S"),
+ mir_snwprintf(uDlg->m_tszToolTipText, TranslateT("Status: %s\r\nFile: %s\r\nServer: %S"),
getStatusString(), m_tszFileName, m_ftp->m_szServer);
if (m_tab->m_stzSpeed[0] && m_tab->m_stzComplet[0] && m_tab->m_stzRemain[0])
- mir_sntprintf(uDlg->m_tszToolTipText, TranslateT("%s\r\nSpeed: %s\r\nCompleted: %s\r\nRemaining: %s"),
+ mir_snwprintf(uDlg->m_tszToolTipText, TranslateT("%s\r\nSpeed: %s\r\nCompleted: %s\r\nRemaining: %s"),
uDlg->m_tszToolTipText, m_tab->m_stzSpeed, m_tab->m_stzComplet, m_tab->m_stzRemain);
}
diff --git a/plugins/FTPFileYM/src/manager.cpp b/plugins/FTPFileYM/src/manager.cpp index d838e77884..84e648bcfd 100644 --- a/plugins/FTPFileYM/src/manager.cpp +++ b/plugins/FTPFileYM/src/manager.cpp @@ -121,7 +121,7 @@ void Manager::fillTree() DBEntry *entry = DBEntry::getFirst();
while (entry != NULL) {
if ((UINT)entry->m_iFtpNum < m_rootItems.size()) {
- tvi.item.pszText = mir_a2t(entry->m_szFileName);
+ tvi.item.pszText = mir_a2u(entry->m_szFileName);
tvi.hParent = m_rootItems[entry->m_iFtpNum]->m_handle;
HTREEITEM hItem = TreeView_InsertItem(m_hwndFileTree, &tvi);
AddLeaf(hItem, tvi.hParent, entry->m_fileID);
diff --git a/plugins/FTPFileYM/src/mir_db.cpp b/plugins/FTPFileYM/src/mir_db.cpp index e14e2caccc..dadc502028 100644 --- a/plugins/FTPFileYM/src/mir_db.cpp +++ b/plugins/FTPFileYM/src/mir_db.cpp @@ -98,7 +98,7 @@ int DB::getString(MCONTACT hContact, char *szModule, char *szSetting, wchar_t *b {
DBVARIANT dbv;
if (!db_get_ts(hContact, szModule, szSetting, &dbv)) {
- mir_tstrcpy(buff, dbv.ptszVal);
+ mir_wstrcpy(buff, dbv.ptszVal);
db_free(&dbv);
return 0;
}
diff --git a/plugins/FTPFileYM/src/serverlist.cpp b/plugins/FTPFileYM/src/serverlist.cpp index b5be374920..b4a854b3d1 100644 --- a/plugins/FTPFileYM/src/serverlist.cpp +++ b/plugins/FTPFileYM/src/serverlist.cpp @@ -64,7 +64,7 @@ void ServerList::saveToDb() const ServerList::FTP::FTP(int index)
{
if (DB::getStringF(0, MODULE, "Name%d", index, m_stzName))
- mir_sntprintf(m_stzName, TranslateT("FTP Server %d"), index + 1);
+ mir_snwprintf(m_stzName, TranslateT("FTP Server %d"), index + 1);
DB::getAStringF(0, MODULE, "Password%d", index, m_szPass);
DB::getAStringF(0, MODULE, "Server%d", index, m_szServer);
diff --git a/plugins/FTPFileYM/src/utils.cpp b/plugins/FTPFileYM/src/utils.cpp index d15a706055..eb2c8a2dc1 100644 --- a/plugins/FTPFileYM/src/utils.cpp +++ b/plugins/FTPFileYM/src/utils.cpp @@ -67,10 +67,10 @@ wchar_t* Utils::getFileNameFromPath(wchar_t *stzPath) wchar_t* Utils::getTextFragment(wchar_t *stzText, size_t length, wchar_t *buff)
{
- if (mir_tstrlen(stzText) > length) {
- mir_tstrcpy(buff, stzText);
+ if (mir_wstrlen(stzText) > length) {
+ mir_wstrcpy(buff, stzText);
buff[length - 1] = 0;
- mir_tstrcat(buff, L"...");
+ mir_wstrcat(buff, L"...");
return buff;
}
@@ -97,7 +97,7 @@ const char to_chars[] = "abvgdeezziiklmnoprstufhccwwqyqeuaABVGDEEZZIIKLMNOPRSTUF char* Utils::makeSafeString(wchar_t *input, char *output)
{
- char *buff = mir_t2a(input);
+ char *buff = mir_u2a(input);
size_t length = mir_strlen(buff);
for (UINT i = 0; i < length; i++) {
@@ -166,7 +166,7 @@ INT_PTR CALLBACK Utils::DlgProcSetFileName(HWND hwndDlg, UINT msg, WPARAM wParam if (GetDlgCtrlID((HWND)wParam) != IDC_NAME) {
SetFocus(GetDlgItem(hwndDlg, IDC_NAME));
- SendDlgItemMessage(hwndDlg, IDC_NAME, EM_SETSEL, 0, mir_tstrlen(fileName) - 4);
+ SendDlgItemMessage(hwndDlg, IDC_NAME, EM_SETSEL, 0, mir_wstrlen(fileName) - 4);
return FALSE;
}
@@ -200,13 +200,13 @@ bool Utils::setFileNameDlg(wchar_t *nameBuff) bool Utils::setFileNameDlgA(char *nameBuff)
{
wchar_t buff[64];
- wchar_t *tmp = mir_a2t(nameBuff);
- mir_tstrcpy(buff, tmp);
+ wchar_t *tmp = mir_a2u(nameBuff);
+ mir_wstrcpy(buff, tmp);
FREE(tmp);
bool res = setFileNameDlg(buff);
if (res) {
- char *p = mir_t2a(buff);
+ char *p = mir_u2a(buff);
mir_strcpy(nameBuff, p);
FREE(p);
}
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index fb837cdd09..632875cf57 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -116,9 +116,9 @@ float CContactCache::getWeight(int rate) static bool AppendInfo(wchar_t *buf, int size, MCONTACT hContact, int info)
{
- ptrT str(Contact_GetInfo(info, hContact));
+ ptrW str(Contact_GetInfo(info, hContact));
if (str != NULL) {
- mir_tstrncpy(buf, str, size);
+ mir_wstrncpy(buf, str, size);
return true;
}
@@ -140,7 +140,7 @@ void CContactCache::TContactInfo::LoadInfo() for (int i = 0; i < _countof(items); ++i)
if (AppendInfo(p, _countof(info) - (p - info), hContact, items[i]))
- p += mir_tstrlen(p) + 1;
+ p += mir_wstrlen(p) + 1;
*p = 0;
@@ -155,8 +155,8 @@ wchar_t *nb_stristr(wchar_t *str, wchar_t *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));
+ CharUpperBuff(str_up, (DWORD)mir_wstrlen(str_up));
+ CharUpperBuff(substr_up, (DWORD)mir_wstrlen(substr_up));
wchar_t *p = wcsstr(str_up, substr_up);
return p ? (str + (p - str_up)) : NULL;
@@ -177,7 +177,7 @@ bool CContactCache::filter(int rate, wchar_t *str) for (int iLayout = 0; iLayout < nKbdLayouts; ++iLayout) {
if (kbdLayoutActive == kbdLayouts[iLayout])
- mir_tstrcpy(buf, str);
+ mir_wstrcpy(buf, str);
else {
int i;
for (i = 0; str[i]; ++i) {
@@ -188,7 +188,7 @@ bool CContactCache::filter(int rate, wchar_t *str) buf[i] = 0;
}
- for (wchar_t *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_wstrlen(p) + 1)
if (nb_stristr(p, buf))
return true;
}
diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h index 91245327d7..3cbb4a8285 100644 --- a/plugins/FavContacts/src/favlist.h +++ b/plugins/FavContacts/src/favlist.h @@ -17,13 +17,13 @@ public: bManual(_bManual),
fRate(_fRate)
{
- name = mir_tstrdup(pcli->pfnGetContactDisplayName(hContact, 0));
+ name = mir_wstrdup(pcli->pfnGetContactDisplayName(hContact, 0));
if (g_Options.bUseGroups) {
if ((group = db_get_tsa(hContact, "CList", "Group")) == NULL)
- group = mir_tstrdup(TranslateT("<no group>"));
+ group = mir_wstrdup(TranslateT("<no group>"));
}
- else group = mir_tstrdup(TranslateT("Favorite Contacts"));
+ else group = mir_wstrdup(TranslateT("Favorite Contacts"));
status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE);
}
@@ -56,8 +56,8 @@ public: }
int res = 0;
- if (res = mir_tstrcmp(p1->group, p2->group)) return res;
- if (res = mir_tstrcmp(p1->name, p2->name)) return res;
+ if (res = mir_wstrcmp(p1->group, p2->group)) return res;
+ if (res = mir_wstrcmp(p1->name, p2->name)) return res;
return 0;
}
};
@@ -85,7 +85,7 @@ private: TContactInfo *info = new TContactInfo(hContact, bManual);
insert(info);
wchar_t *group = info->getGroup();
- if (prevGroup && mir_tstrcmp(prevGroup, group))
+ if (prevGroup && mir_wstrcmp(prevGroup, group))
++nGroups;
prevGroup = group;
return 1;
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp index 15c2f3189e..64568587c2 100644 --- a/plugins/FavContacts/src/menu.cpp +++ b/plugins/FavContacts/src/menu.cpp @@ -47,7 +47,7 @@ static BOOL sttMeasureItem_Group(LPMEASUREITEMSTRUCT lpmis, Options *options) SelectObject(hdc, g_Options.hfntName);
SIZE sz;
- GetTextExtentPoint32(hdc, name, (int)mir_tstrlen(name), &sz);
+ GetTextExtentPoint32(hdc, name, (int)mir_wstrlen(name), &sz);
lpmis->itemHeight = sz.cy + 8;
lpmis->itemWidth = sz.cx + 10;
SelectObject(hdc, hfntSave);
@@ -81,7 +81,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) if (!options->bSysColors)
SelectObject(hdc, g_Options.hfntSecond);
- GetTextExtentPoint32(hdc, title, (int)mir_tstrlen(title), &sz);
+ GetTextExtentPoint32(hdc, title, (int)mir_wstrlen(title), &sz);
textWidth = sz.cx;
lpmis->itemHeight += sz.cy + 3;
@@ -92,7 +92,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) 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);
+ GetTextExtentPoint32(hdc, name, (int)mir_wstrlen(name), &sz);
textWidth = max(textWidth, sz.cx);
SelectObject(hdc, hfntSave);
@@ -309,7 +309,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) DrawText(hdcTemp, name, -1, &lpdis->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_TOP | DT_LEFT);
SIZE sz;
- GetTextExtentPoint32(hdcTemp, name, (int)mir_tstrlen(name), &sz);
+ GetTextExtentPoint32(hdcTemp, name, (int)mir_wstrlen(name), &sz);
lpdis->rcItem.top += sz.cy + 3;
}
@@ -390,13 +390,13 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, RemoveMenu((HMENU)lParam, 1, MF_BYPOSITION);
if (LOWORD(wParam) == VK_BACK) {
- if (size_t l = mir_tstrlen(g_filter))
+ if (size_t l = mir_wstrlen(g_filter))
g_filter[l - 1] = 0;
}
else if (iswalnum(LOWORD(wParam))) {
- if (mir_tstrlen(g_filter) < _countof(g_filter) - 1) {
+ if (mir_wstrlen(g_filter) < _countof(g_filter) - 1) {
wchar_t s[] = { LOWORD(wParam), 0 };
- mir_tstrcat(g_filter, s);
+ mir_wstrcat(g_filter, s);
}
}
{
@@ -465,7 +465,7 @@ int ShowMenu(bool centered) mis.CtlID = 0;
mis.CtlType = ODT_MENU;
- if (!prevGroup || mir_tstrcmp(prevGroup, favList[i]->getGroup())) {
+ if (!prevGroup || mir_wstrcmp(prevGroup, favList[i]->getGroup())) {
if (prevGroup && g_Options.bUseColumns) {
szMenu.cx += szColumn.cx;
szMenu.cy = max(szMenu.cy, szColumn.cy);
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp index 556e0ebbaa..00a053b996 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, LPGENW("Favorite Contacts"));
- mir_tstrcpy(fontid.name, LPGENW("Contact name"));
+ mir_wstrcpy(fontid.group, LPGENW("Favorite Contacts"));
+ mir_wstrcpy(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, LPGENW("Second line"));
+ mir_wstrcpy(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, LPGENW("Selected contact name (color)"));
+ mir_wstrcpy(fontid.name, LPGENW("Selected contact name (color)"));
g_Options.clLine1Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
- mir_tstrcpy(fontid.name, LPGENW("Selected second line (color)"));
+ mir_wstrcpy(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, LPGENW("Favorite Contacts"));
- mir_tstrcpy(colourid.name, LPGENW("Background"));
+ mir_wstrcpy(colourid.group, LPGENW("Favorite Contacts"));
+ mir_wstrcpy(colourid.name, LPGENW("Background"));
g_Options.clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf);
- mir_tstrcpy(colourid.name, LPGENW("Selected background"));
+ mir_wstrcpy(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, LPGENW("Favorite Contacts"));
+ mir_wstrcpy(fontid.group, LPGENW("Favorite Contacts"));
mir_strcpy(fontid.dbSettingsGroup, "FavContacts");
- mir_tstrcpy(fontid.backgroundGroup, LPGENW("Favorite Contacts"));
+ mir_wstrcpy(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");
+ mir_wstrcpy(fontid.deffontsettings.szFace, L"MS Shell Dlg");
fontid.deffontsettings.style = 0;
- mir_tstrcpy(fontid.backgroundName, LPGENW("Background"));
+ mir_wstrcpy(fontid.backgroundName, LPGENW("Background"));
- mir_tstrcpy(fontid.name, LPGENW("Contact name"));
+ mir_wstrcpy(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, LPGENW("Second line"));
+ mir_wstrcpy(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, LPGENW("Selected background"));
+ mir_wstrcpy(fontid.backgroundName, LPGENW("Selected background"));
- mir_tstrcpy(fontid.name, LPGENW("Selected contact name (color)"));
+ mir_wstrcpy(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, LPGENW("Selected second line (color)"));
+ mir_wstrcpy(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, LPGENW("Favorite Contacts"));
+ mir_wstrcpy(colourid.group, LPGENW("Favorite Contacts"));
mir_strcpy(colourid.dbSettingsGroup, "FavContacts");
- mir_tstrcpy(colourid.name, LPGENW("Background"));
+ mir_wstrcpy(colourid.name, LPGENW("Background"));
mir_strcpy(colourid.setting, "BackColour");
colourid.defcolour = GetSysColor(COLOR_MENU);
ColourRegisterT(&colourid);
- mir_tstrcpy(colourid.name, LPGENW("Selected background"));
+ mir_wstrcpy(colourid.name, LPGENW("Selected background"));
mir_strcpy(colourid.setting, "SelectedColour");
colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
ColourRegisterT(&colourid);
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index ad2b494846..a9940f2437 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -101,13 +101,13 @@ void MakePopupMsg(HWND hDlg, MCONTACT hContact, char *msg) if (hDlg == hFocused || hDlg == GetParent(hFocused)) return;
//
- //The text for the second line. You could even make something like: char lpzText[128]; mir_tstrcpy(lpzText, "Hello world!"); It's your choice.
+ //The text for the second line. You could even make something like: char lpzText[128]; mir_wstrcpy(lpzText, "Hello world!"); It's your choice.
//
POPUPDATA ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SMALLICON));
- mir_tstrcpy(ppd.lpzContactName, (char *)pcli->pfnGetContactDisplayName(hContact, 0));
- mir_tstrcpy(ppd.lpzText, msg);
+ mir_strcpy(ppd.lpzContactName, (char*)pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_strcpy(ppd.lpzText, msg);
ppd.colorBack = GetSysColor(COLOR_INFOBK);
ppd.colorText = GetSysColor(COLOR_INFOTEXT);
ppd.PluginWindowProc = (WNDPROC)PopupDlgProc;
@@ -618,7 +618,7 @@ void FILEECHO::onSendTimer() char prefix[128];
mir_snprintf(prefix, "%X,%X,%X>", chunkIndx + 1, chunkPos[chunkIndx], chksum);
#ifdef DEBUG
- overhead += mir_tstrlen((char*)buffer);
+ overhead += mir_wstrlen((char*)buffer);
#endif
sendCmd(0, CMD_DATA, (char*)buffer, (char*)prefix);
chunkAck[chunkIndx] = CHUNK_SENT;
@@ -844,18 +844,17 @@ void FILEECHO::perform(char *str) int FILEECHO::sendCmd(int id, int cmd, char *szParam, char *szPrefix)
{
- char *buf;
- int retval;
- int buflen = (int)mir_tstrlen(szServicePrefix) + (int)mir_tstrlen(szParam) + 2;
+ int buflen = (int)mir_strlen(szServicePrefix) + (int)mir_strlen(szParam) + 2;
if (szPrefix != NULL)
- buflen += (int)mir_tstrlen(szPrefix);
+ buflen += (int)mir_strlen(szPrefix);
- buf = (char*)malloc(buflen);
+ char *buf = (char*)malloc(buflen);
if (szPrefix == NULL)
mir_snprintf(buf, buflen, "%s%c%s", szServicePrefix, cCmdList[cmd], szParam);
else
mir_snprintf(buf, buflen, "%s%c%s%s", szServicePrefix, cCmdList[cmd], szPrefix, szParam);
- retval = ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)buf);
+
+ int retval = ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)buf);
free(buf);
updateProgress();
return retval;
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index 4ca28bdac2..3d0f14b90c 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -57,7 +57,7 @@ void __fastcall Prepare(KN_FP_MASK* mask, bool bEnable) if (!mask->szMask || !bEnable) return; - size_t iMaskLen = mir_tstrlen(mask->szMask) + 1; + size_t iMaskLen = mir_wstrlen(mask->szMask) + 1; LPTSTR pszNewMask = (LPTSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, iMaskLen * sizeof(wchar_t)); wcscpy_s(pszNewMask, iMaskLen, mask->szMask); _wcsupr_s(pszNewMask, iMaskLen); @@ -147,7 +147,7 @@ static void SetSrmmIcon(MCONTACT hContact, LPTSTR ptszMirver) sid.flags = MBF_TCHAR; sid.tszTooltip = ptszMirver; - if (mir_tstrlen(ptszMirver)) + if (mir_wstrlen(ptszMirver)) sid.hIcon = (HICON)ServiceGetClientIconW((WPARAM)ptszMirver, TRUE); else sid.flags |= MBF_HIDDEN; @@ -326,7 +326,7 @@ void __fastcall GetIconsIndexesA(LPSTR szMirVer, short *base, short *overlay, sh return; } - LPTSTR tszMirVerUp = mir_a2t(szMirVer); + LPTSTR tszMirVerUp = mir_a2u(szMirVer); wcsupr(tszMirVerUp); MatchMasks(tszMirVerUp, base, overlay, overlay2, overlay3, overlay4); mir_free(tszMirVerUp); @@ -840,7 +840,7 @@ int OnExtraImageApply(WPARAM hContact, LPARAM) if (hContact == NULL) return 0; - ptrT tszMirver; + ptrW tszMirver; char *szProto = GetContactProto(hContact); if (szProto != NULL) tszMirver = db_get_tsa(hContact, szProto, "MirVer"); @@ -863,7 +863,7 @@ static int OnContactSettingChanged(WPARAM hContact, LPARAM lParam) if (cws && cws->szSetting && !strcmp(cws->szSetting, "MirVer")) { switch (cws->value.type) { case DBVT_UTF8: - ApplyFingerprintImage(hContact, ptrT(mir_utf8decodeT(cws->value.pszVal))); + ApplyFingerprintImage(hContact, ptrW(mir_utf8decodeW(cws->value.pszVal))); break; case DBVT_ASCIIZ: ApplyFingerprintImage(hContact, _A2T(cws->value.pszVal)); @@ -893,7 +893,7 @@ static int OnSrmmWindowEvent(WPARAM, LPARAM lParam) return 0; if (event->uType == MSG_WINDOW_EVT_OPEN) { - ptrT ptszMirVer; + ptrW ptszMirVer; char *szProto = GetContactProto(event->hContact); if (szProto != NULL) ptszMirVer = db_get_tsa(event->hContact, szProto, "MirVer"); diff --git a/plugins/FloatingContacts/src/bitmap_funcs.cpp b/plugins/FloatingContacts/src/bitmap_funcs.cpp index 4db3c8f07c..577bd7ecc7 100644 --- a/plugins/FloatingContacts/src/bitmap_funcs.cpp +++ b/plugins/FloatingContacts/src/bitmap_funcs.cpp @@ -699,7 +699,7 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h) // slightly modified and integrated to MyBitmap class
void MyBitmap::DrawText(wchar_t *str, int x, int y, int blur, int strength)
{
- SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
+ SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_wstrlen(str), &sz);
sz.cx += (blur + 2) * 2; sz.cy += (blur + 2) * 2;
x -= blur + 2; y -= blur + 2;
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index ac8d80cadc..dbd018a81a 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -570,7 +570,7 @@ static void CreateBackgroundBrush() }
if (db_get_b(NULL, MODULE, "BkUseBitmap", FLT_DEFAULT_BKGNDUSEBITMAP)) {
- ptrT tszBitmapName(db_get_tsa(NULL, MODULE, "BkBitmap"));
+ ptrW tszBitmapName(db_get_tsa(NULL, MODULE, "BkBitmap"));
if (tszBitmapName != NULL)
hBmpBackground = Bitmap_Load(tszBitmapName);
}
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index a5d901bdd6..e394581046 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -271,7 +271,7 @@ void ThumbInfo::ResizeThumb() // Get text and icon sizes
SIZEL sizeText;
- GetTextExtentPoint32(hdc, ptszName, (int)mir_tstrlen(ptszName), &sizeText);
+ GetTextExtentPoint32(hdc, ptszName, (int)mir_wstrlen(ptszName), &sizeText);
SelectObject(hdc, hOldFont);
@@ -624,7 +624,7 @@ void ThumbInfo::UpdateContent() hOldFont = (HFONT)SelectObject(hdcDraw, hFont[index]);
SIZE szText;
- GetTextExtentPoint32(hdcDraw, ptszName, (int)mir_tstrlen(ptszName), &szText);
+ GetTextExtentPoint32(hdcDraw, ptszName, (int)mir_wstrlen(ptszName), &szText);
SetTextColor(hdcDraw, bkColor);
// simple border
diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp index 82a1b38d04..cc22e06423 100644 --- a/plugins/Folders/src/dlg_handlers.cpp +++ b/plugins/Folders/src/dlg_handlers.cpp @@ -37,7 +37,7 @@ static void LoadRegisteredFolderSections(HWND hWnd) for (int i = 0; i < lstRegisteredFolders.getCount(); i++) {
CFolderItem &tmp = lstRegisteredFolders[i];
- wchar_t *translated = mir_a2t(tmp.GetSection());
+ wchar_t *translated = mir_a2u(tmp.GetSection());
if (!ContainsSection(hWnd, TranslateTS(translated))) {
int idx = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)TranslateTS(translated));
SendMessage(hwndList, LB_SETITEMDATA, idx, (LPARAM)tmp.GetSection());
@@ -105,7 +105,7 @@ static int ChangesNotSaved(HWND hWnd, PFolderItem item) wchar_t buffer[MAX_FOLDER_SIZE];
GetEditText(hWnd, buffer, MAX_FOLDER_SIZE);
- return mir_tstrcmp(item->GetFormat(), buffer) != 0;
+ return mir_wstrcmp(item->GetFormat(), buffer) != 0;
}
static void CheckForChanges(HWND hWnd, int bNeedConfirmation = 1)
@@ -123,7 +123,7 @@ static INT_PTR CALLBACK DlgProcVariables(HWND hWnd, UINT msg, WPARAM wParam, LPA switch (msg) {
case WM_INITDIALOG:
- mir_sntprintf(tszMessage, L"%s\r\n%s\r\n\r\n%s\t\t%s\r\n%%miranda_path%%\t\t%s\r\n%%profile_path%%\t\t%s\r\n\t\t\t%s\r\n%%current_profile%%\t\t%s\r\n\t\t\t%s\r\n\r\n\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n\r\n%s\r\n%s\r\n%s\r\n%%miranda_path%%\t\t\t%s\r\n%%profile_path%%\t\t\t%s\r\n%%current_profile%%\t\t\t%s\r\n%%temp%%\t\t\t\t%s\r\n%%profile_path%%\\%%current_profile%%\t%s\r\n%%miranda_path%%\\plugins\\config\t%s\r\n' %%miranda_path%%\\\\\\\\ '\t\t%s\r\n\r\n%s",
+ mir_snwprintf(tszMessage, L"%s\r\n%s\r\n\r\n%s\t\t%s\r\n%%miranda_path%%\t\t%s\r\n%%profile_path%%\t\t%s\r\n\t\t\t%s\r\n%%current_profile%%\t\t%s\r\n\t\t\t%s\r\n\r\n\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n\r\n%s\r\n%s\r\n%s\r\n%%miranda_path%%\t\t\t%s\r\n%%profile_path%%\t\t\t%s\r\n%%current_profile%%\t\t\t%s\r\n%%temp%%\t\t\t\t%s\r\n%%profile_path%%\\%%current_profile%%\t%s\r\n%%miranda_path%%\\plugins\\config\t%s\r\n' %%miranda_path%%\\\\\\\\ '\t\t%s\r\n\r\n%s",
TranslateT("Don't forget to click on Apply to save the changes. If you don't then the changes won't"),
TranslateT("be saved to the database, they will only be valid for this session."),
TranslateT("Variable string"),
diff --git a/plugins/Folders/src/folderItem.cpp b/plugins/Folders/src/folderItem.cpp index 9cc475593e..4a47eb5c7d 100644 --- a/plugins/Folders/src/folderItem.cpp +++ b/plugins/Folders/src/folderItem.cpp @@ -25,9 +25,9 @@ CFolderItem::CFolderItem(const char *sectionName, const char *name, const wchar_ m_szSection = mir_strdup(sectionName);
m_szName = mir_strdup(name);
if (userName)
- m_tszUserName = mir_tstrdup(userName);
+ m_tszUserName = mir_wstrdup(userName);
else
- m_tszUserName = mir_a2t(name);
+ m_tszUserName = mir_a2u(name);
m_tszFormat = NULL;
m_tszOldFormat = NULL;
GetDataFromDatabase(format);
@@ -47,7 +47,7 @@ void CFolderItem::SetFormat(const wchar_t *newFormat) {
mir_free(m_tszOldFormat);
m_tszOldFormat = m_tszFormat;
- m_tszFormat = mir_tstrdup(*newFormat ? newFormat : MIRANDA_PATHT);
+ m_tszFormat = mir_wstrdup(*newFormat ? newFormat : MIRANDA_PATHT);
}
int CFolderItem::IsEqual(const CFolderItem *other)
@@ -57,12 +57,12 @@ int CFolderItem::IsEqual(const CFolderItem *other) int CFolderItem::IsEqual(const char *section, const wchar_t *name)
{
- return !mir_tstrcmp(m_tszUserName, name) && !mir_strcmp(m_szSection, section);
+ return !mir_wstrcmp(m_tszUserName, name) && !mir_strcmp(m_szSection, section);
}
int CFolderItem::IsEqualTranslated(const char *trSection, const wchar_t *trName)
{
- return !mir_tstrcmp(TranslateTS(m_tszUserName), trName) && !mir_strcmp(Translate(m_szSection), trSection);
+ return !mir_wstrcmp(TranslateTS(m_tszUserName), trName) && !mir_strcmp(Translate(m_szSection), trSection);
}
int CFolderItem::operator ==(const CFolderItem *other)
@@ -100,7 +100,7 @@ int CFolderItem::FolderDeleteOldDirectory(int showFolder) if (!m_tszOldFormat)
return FOLDER_SUCCESS;
- if (!mir_tstrcmp(m_tszFormat, m_tszOldFormat)) //format wasn't changed
+ if (!mir_wstrcmp(m_tszFormat, m_tszOldFormat)) //format wasn't changed
return FOLDER_SUCCESS;
CMString buffer(ExpandPath(m_tszOldFormat));
@@ -117,7 +117,7 @@ void CFolderItem::GetDataFromDatabase(const wchar_t *szNotFound) strcpy_s(szSettingName, _countof(szSettingName), m_szSection);
strcat_s(szSettingName, _countof(szSettingName), m_szName);
- ptrT tszValue(db_get_tsa(NULL, ModuleName, szSettingName));
+ ptrW tszValue(db_get_tsa(NULL, ModuleName, szSettingName));
SetFormat(tszValue != NULL ? tszValue : szNotFound);
}
diff --git a/plugins/Folders/src/services.cpp b/plugins/Folders/src/services.cpp index de7669c4e9..c05f4ee007 100644 --- a/plugins/Folders/src/services.cpp +++ b/plugins/Folders/src/services.cpp @@ -87,7 +87,7 @@ int InitServices() pos = wcsrchr(szMirandaPath, '\\'); if (pos) *pos = 0;
wchar_t *szTemp = Utils_ReplaceVarsT(L"%miranda_userdata%");
- mir_sntprintf(szUserDataPath, szTemp);
+ mir_snwprintf(szUserDataPath, szTemp);
mir_free(szTemp);
CreateServiceFunction(MS_FOLDERS_GET_PATH, GetPathService);
diff --git a/plugins/Folders/src/utils.cpp b/plugins/Folders/src/utils.cpp index 2adc3b7035..f2fb0087af 100644 --- a/plugins/Folders/src/utils.cpp +++ b/plugins/Folders/src/utils.cpp @@ -25,7 +25,7 @@ CMString ExpandPath(const wchar_t *format) CMString res;
if (ServiceExists(MS_VARS_FORMATSTRING))
- res = VARST(ptrT(variables_parse((wchar_t*)format, NULL, NULL)));
+ res = VARST(ptrW(variables_parse((wchar_t*)format, NULL, NULL)));
else
res = VARST(format);
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 9cad408bbd..e0f87a2171 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -900,7 +900,7 @@ extern "C" __declspec(dllexport) int Load() MessageBox(NULL, "Failed to retrieve plugin path.", MSG_BOX_TITEL, MB_OK);
return 1;
}
- mir_tstrncat(szPluginPath, "\\HTTPServer\\", _countof(szPluginPath) - mir_tstrlen(szPluginPath));
+ mir_strncat(szPluginPath, "\\HTTPServer\\", _countof(szPluginPath) - mir_strlen(szPluginPath));
int err = CreateDirectoryTree(szPluginPath);
if ((err != 0) && (err != ERROR_ALREADY_EXISTS)) {
MessageBox(NULL, "Failed to create HTTPServer directory.", MSG_BOX_TITEL, MB_OK);
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp index 812a828b6b..f17efc864a 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp @@ -76,7 +76,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) SetClassLongPtr(hDlg, GCLP_HICON, (LONG_PTR)LoadIcon(hInst, MAKEINTRESOURCE(IDI_LINKLISTICON)));
WindowList_Add(hWindowList, hDlg, DlgParam->hContact);
- mir_sntprintf(title, L"%s [%s]", TranslateT("Linklist plugin"), pcli->pfnGetContactDisplayName(DlgParam->hContact, 0));
+ mir_snwprintf(title, L"%s [%s]", TranslateT("Linklist plugin"), pcli->pfnGetContactDisplayName(DlgParam->hContact, 0));
SetWindowText(hDlg, title);
GetFilterText(listMenu, filter, _countof(filter));
SetDlgItemText(hDlg, IDC_STATUS, filter);
@@ -170,7 +170,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) break;
EmptyClipboard();
- size_t dataLen = ((mir_tstrlen(link) + 1) * sizeof(wchar_t));
+ size_t dataLen = ((mir_wstrlen(link) + 1) * sizeof(wchar_t));
HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, dataLen);
memcpy((LPTSTR)GlobalLock(hData), link, dataLen);
GlobalUnlock(hData);
@@ -399,7 +399,7 @@ INT_PTR CALLBACK SearchDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara WriteLinkList(hListDlg, flags, DlgParam->listStart, buffer, 0);
mir_free(buffer);
}
- mir_sntprintf(filter, L"%s: %s", TXT_FILTER, TXT_SEARCHFILTER);
+ mir_snwprintf(filter, L"%s: %s", TXT_FILTER, TXT_SEARCHFILTER);
SetDlgItemText(hWndMain, IDC_STATUS, filter);
} break;
}
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index 7517494115..c267c1d03c 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -116,7 +116,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart) CharLower(wordsearch);
for (j = 0; j < _countof(hyperlinkPrefixes); j ++) {
- if (!wcsncmp(wordsearch, hyperlinkPrefixes[j], mir_tstrlen(hyperlinkPrefixes[j]))) {
+ if (!wcsncmp(wordsearch, hyperlinkPrefixes[j], mir_wstrlen(hyperlinkPrefixes[j]))) {
isLink = 1;
break;
}
@@ -305,7 +305,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc wcscpy_s(cf.szFaceName, L"Arial");
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
- mir_sntprintf(searchText, L"%s '%s': %d\n\n", TranslateT("Matches for searchtext"), searchString, listCount);
+ mir_snwprintf(searchText, L"%s '%s': %d\n\n", TranslateT("Matches for searchtext"), searchString, listCount);
SendDlgItemMessage(hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)searchText);
linePos += 2;
}
@@ -401,7 +401,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc {
LPCTSTR type;
- if ( mir_tstrcmp(actualElement->date, lastDate) != 0 )
+ if ( mir_wstrcmp(actualElement->date, lastDate) != 0 )
{
memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
@@ -454,7 +454,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc type = L"[UNK ]";
}
- mir_sntprintf(textLine, L"%s%s%s%s%s%s%s\n",
+ mir_snwprintf(textLine, L"%s%s%s%s%s%s%s\n",
options.showDirection ? (actualElement->direction==DIRECTION_IN?L"[in ]":L"[out]") : L"",
options.showDirection? L" " : L"",
options.showType ? type : L"",
@@ -660,17 +660,17 @@ void GetFilterText(HMENU listMenu, LPTSTR filter, size_t max_len) if ( GetMenuState(listMenu, IDM_DIR_IN, MF_BYCOMMAND) == MF_CHECKED )
{
//incoming URLs
- mir_sntprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_INCOMING, TXT_URLSONLY);
+ mir_snwprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_INCOMING, TXT_URLSONLY);
}
else if ( GetMenuState(listMenu, IDM_DIR_OUT, MF_BYCOMMAND) == MF_CHECKED )
{
//outgoing URLs
- mir_sntprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_OUTGOING, TXT_URLSONLY);
+ mir_snwprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_OUTGOING, TXT_URLSONLY);
}
else
{
// both directions (URL)
- mir_sntprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, "", TXT_URLSONLY);
+ mir_snwprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, "", TXT_URLSONLY);
}
}
else if ( GetMenuState(listMenu, IDM_TYPE_MAIL, MF_BYCOMMAND) == MF_CHECKED )
@@ -678,17 +678,17 @@ void GetFilterText(HMENU listMenu, LPTSTR filter, size_t max_len) if ( GetMenuState(listMenu, IDM_DIR_IN, MF_BYCOMMAND) == MF_CHECKED )
{
//incoming mail
- mir_sntprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_INCOMING, TXT_MAILSONLY);
+ mir_snwprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_INCOMING, TXT_MAILSONLY);
}
else if ( GetMenuState(listMenu, IDM_DIR_OUT, MF_BYCOMMAND) == MF_CHECKED )
{
//outgoing mail
- mir_sntprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_OUTGOING, TXT_MAILSONLY);
+ mir_snwprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_OUTGOING, TXT_MAILSONLY);
}
else
{
// both directions (mail)
- mir_sntprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, "", TXT_MAILSONLY);
+ mir_snwprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, "", TXT_MAILSONLY);
}
}
else
@@ -696,17 +696,17 @@ void GetFilterText(HMENU listMenu, LPTSTR filter, size_t max_len) if ( GetMenuState(listMenu, IDM_DIR_IN, MF_BYCOMMAND) == MF_CHECKED )
{
//incoming (both)
- mir_sntprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_INCOMING, "");
+ mir_snwprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_INCOMING, "");
}
else if ( GetMenuState(listMenu, IDM_DIR_OUT, MF_BYCOMMAND) == MF_CHECKED )
{
//outgoing (both)
- mir_sntprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_OUTGOING, "");
+ mir_snwprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_OUTGOING, "");
}
else
{
// no filter
- mir_sntprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_NOFILTER, "");
+ mir_snwprintf(filter, max_len, L"%s: %s %s", TXT_FILTER, TXT_NOFILTER, "");
}
}
}
@@ -795,7 +795,7 @@ void GetListInfo(BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, siz {
(*elementCount)++;
- tempLen = mir_tstrlen(actualElement->link);
+ tempLen = mir_wstrlen(actualElement->link);
if (*maxLen < tempLen)
*maxLen = tempLen;
}
@@ -1246,7 +1246,7 @@ BOOL SaveEditAsStream( HWND hDlg ) ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hDlg;
wchar_t temp[MAX_PATH];
- mir_sntprintf(temp, L"%s (*.rtf)%c*.rtf%c%s (*.*)%c*.*%c%c", TranslateT("RTF file"), 0, 0, TranslateT("All files"), 0, 0, 0);
+ mir_snwprintf(temp, L"%s (*.rtf)%c*.rtf%c%s (*.*)%c*.*%c%c", TranslateT("RTF file"), 0, 0, TranslateT("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.lpstrFile = szFilename;
ofn.nMaxFile = _countof(szFilename);
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index b01f1c2f32..9744a5b889 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -119,12 +119,12 @@ void LoadSettings(HWND hwndDlg) SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_RESETCONTENT, 0, 0);
for (i = 0; i < _countof(time_stamp_strings); i++) {
- ptrT ptszTimeStr(Langpack_PcharToTchar(time_stamp_strings[i]));
+ ptrW ptszTimeStr(Langpack_PcharToTchar(time_stamp_strings[i]));
SendDlgItemMessage(hwndDlg, IDC_SSOLDER, CB_ADDSTRING, 0, (LPARAM)ptszTimeStr);
}
for (i = 0; i < _countof(keep_strings); i++) {
- ptrT ptszTimeStr(Langpack_PcharToTchar(keep_strings[i]));
+ ptrW ptszTimeStr(Langpack_PcharToTchar(keep_strings[i]));
SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_ADDSTRING, 0, (LPARAM)ptszTimeStr);
}
diff --git a/plugins/IEHistory/src/utils.cpp b/plugins/IEHistory/src/utils.cpp index 090033c533..d3a656f1c6 100644 --- a/plugins/IEHistory/src/utils.cpp +++ b/plugins/IEHistory/src/utils.cpp @@ -80,7 +80,7 @@ returns the name of a contact wchar_t* GetContactName(MCONTACT contact) { - ptrT name(Contact_GetInfo(CNF_DISPLAY, contact)); + ptrW name(Contact_GetInfo(CNF_DISPLAY, contact)); return (name) ? wcsdup(name) : NULL; } diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index c43c1dc415..8dd3337a13 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -88,7 +88,7 @@ char* HTMLBuilder::encodeUTF8(MCONTACT hContact, const char *proto, const wchar_ CMStringW str;
encode(hContact, proto, wtext, str, 0, flags, isSent);
- return mir_utf8encodeT(str);
+ return mir_utf8encodeW(str);
}
char* HTMLBuilder::encodeUTF8(MCONTACT hContact, const char *proto, const char *text, int flags, bool isSent)
@@ -104,7 +104,7 @@ char* HTMLBuilder::encodeUTF8(MCONTACT hContact, const char *proto, const char * if (text == NULL)
return NULL;
- ptrW wtext(mir_a2t_cp(text, cp));
+ ptrW wtext(mir_a2u_cp(text, cp));
return encodeUTF8(hContact, proto, wtext, flags, isSent);
}
@@ -184,11 +184,11 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut) {
hContact = getRealContact(hContact);
- ptrT id(Contact_GetInfo(CNF_UNIQUEID, hContact));
- uinIn = mir_utf8encodeT(id ? id.get() : L"");
+ ptrW id(Contact_GetInfo(CNF_UNIQUEID, hContact));
+ uinIn = mir_utf8encodeW(id ? id.get() : L"");
id = Contact_GetInfo(CNF_UNIQUEID, NULL);
- uinOut = mir_utf8encodeT(id ? id.get() : L"");
+ uinOut = mir_utf8encodeW(id ? id.get() : L"");
}
wchar_t* HTMLBuilder::getContactName(MCONTACT hContact, const char *szProto)
@@ -203,9 +203,9 @@ wchar_t* HTMLBuilder::getContactName(MCONTACT hContact, const char *szProto) str = pcli->pfnGetContactDisplayName(hContact, 0);
if (str != NULL)
- return mir_tstrdup(str);
+ return mir_wstrdup(str);
- return mir_tstrdup(TranslateT("(Unknown Contact)"));
+ return mir_wstrdup(TranslateT("(Unknown Contact)"));
}
char* HTMLBuilder::getEncodedContactName(MCONTACT hContact, const char* szProto, const char* szSmileyProto)
@@ -302,13 +302,13 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) }
else if (dbei.eventType == EVENTTYPE_AUTHREQUEST) {
//blob is: uin(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
- eventData->ptszText = mir_tstrdup(TranslateT(" requested authorization"));
+ eventData->ptszText = mir_wstrdup(TranslateT(" requested authorization"));
eventData->ptszNick = DbGetEventStringT(&dbei, (char *)dbei.pBlob + 8);
eventData->iType = IEED_EVENT_SYSTEM;
}
else if (dbei.eventType == EVENTTYPE_ADDED) {
//blob is: uin(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
- eventData->ptszText = mir_tstrdup(TranslateT(" was added."));
+ eventData->ptszText = mir_wstrdup(TranslateT(" was added."));
eventData->ptszNick = DbGetEventStringT(&dbei, (char *)dbei.pBlob + 8);
eventData->iType = IEED_EVENT_SYSTEM;
}
diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp index adc87feb1b..8a4cddba29 100644 --- a/plugins/IEView/src/IEView.cpp +++ b/plugins/IEView/src/IEView.cpp @@ -168,7 +168,7 @@ void IEViewSink::PropertyChange(BSTR) {} void IEViewSink::BeforeNavigate2(IDispatch*, VARIANT* url, VARIANT*, VARIANT*, VARIANT*, VARIANT*, VARIANT_BOOL* cancel)
{
#ifndef GECKO
- if (mir_tstrcmp(url->bstrVal, L"about:blank"))
+ if (mir_wstrcmp(url->bstrVal, L"about:blank"))
{
Utils_OpenUrlT(url->bstrVal);
*cancel = VARIANT_TRUE;
@@ -989,7 +989,7 @@ void* IEView::getSelection(IEVIEWEVENT *event) if (event->cbSize >= IEVIEWEVENT_SIZE_V2)
cp = event->codepage;
- char *str = mir_t2a_cp(selectedText, cp);
+ char *str = mir_u2a_cp(selectedText, cp);
mir_free(selectedText);
selectedText = (BSTR)str;
}
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index f99da29479..5e055c1cac 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -386,7 +386,7 @@ static void RefreshProtoList(HWND hwndDlg, int mode, bool protoTemplates) else
CallProtoService(proto->getProtocolName(), PS_GETNAME, sizeof(protoName), (LPARAM)protoName);
- tvi.item.pszText = mir_a2t(protoName);
+ tvi.item.pszText = mir_a2u(protoName);
tvi.item.lParam = (LPARAM)proto;
tvi.item.iImage = i;
tvi.item.iSelectedImage = i;
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index c0712adff6..438fa6f6ef 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -53,11 +53,11 @@ char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto) }
}
if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
- if (mir_tstrlen(dbv.ptszVal) > 0) {
+ if (mir_wstrlen(dbv.ptszVal) > 0) {
//wchar_t *ext = wcsrchr(dbv.ptszVal, '.');
if (result == NULL) {
/* relative -> absolute */
- mir_tstrcpy(tmpPath, dbv.ptszVal);
+ mir_wstrcpy(tmpPath, dbv.ptszVal);
if (wcsncmp(tmpPath, L"http://", 7))
PathToAbsoluteT(dbv.ptszVal, tmpPath);
result = tmpPath;
@@ -65,7 +65,7 @@ char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto) }
db_free(&dbv);
}
- char* res = mir_utf8encodeT(result);
+ char* res = mir_utf8encodeW(result);
Utils::convertPath(res);
return res;
}
@@ -157,7 +157,7 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr wchar_t *szNoAvatarPathTmp = wcsrchr(szNoAvatarPath, '\\');
if (szNoAvatarPathTmp != NULL)
*szNoAvatarPathTmp = 0;
- mir_tstrcat(szNoAvatarPath, L"\\noavatar.png");
+ mir_wstrcat(szNoAvatarPath, L"\\noavatar.png");
if (_waccess(szNoAvatarPath, 0) == -1)
mir_snprintf(tempStr, "%snoavatar.jpg", tempBase);
else
@@ -178,7 +178,7 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr db_free(&dbv);
}
- ptrT tszNick(Contact_GetInfo(CNF_NICK, event->hContact, szProto));
+ ptrW tszNick(Contact_GetInfo(CNF_NICK, event->hContact, szProto));
if (tszNick != NULL)
szNickIn = encodeUTF8(event->hContact, szRealProto, tszNick, ENF_NAMESMILEYS, true);
@@ -326,7 +326,7 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, wchar_t *szNoAvatarPathTmp = wcsrchr(szNoAvatarPath, '\\');
if (szNoAvatarPathTmp != NULL)
*szNoAvatarPathTmp = 0;
- mir_tstrcat(szNoAvatarPath, L"\\noavatar.png");
+ mir_wstrcat(szNoAvatarPath, L"\\noavatar.png");
if (_waccess(szNoAvatarPath, 0) == -1)
mir_snprintf(tempStr, "%snoavatar.jpg", tempBase);
else
@@ -352,7 +352,7 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, }
}
- ptrT tszNick(Contact_GetInfo(CNF_NICK, event->hContact, szProto));
+ ptrW tszNick(Contact_GetInfo(CNF_NICK, event->hContact, szProto));
if (tszNick != NULL)
szNickIn = encodeUTF8(event->hContact, szRealProto, tszNick, ENF_NAMESMILEYS, true);
diff --git a/plugins/IEView/src/TextToken.cpp b/plugins/IEView/src/TextToken.cpp index ab3441f5b6..1b77f1efb4 100644 --- a/plugins/IEView/src/TextToken.cpp +++ b/plugins/IEView/src/TextToken.cpp @@ -28,7 +28,7 @@ TextToken::TextToken(int _type, const char *_text, int _len) end = false;
type = _type;
text = mir_strndup(_text, _len);
- wtext = mir_a2t(text);
+ wtext = mir_a2u(text);
link = NULL;
wlink = NULL;
}
@@ -39,8 +39,8 @@ TextToken::TextToken(int _type, const wchar_t *_wtext, int _len) tag = 0;
end = false;
type = _type;
- wtext = mir_tstrndup(_wtext, _len);
- text = mir_t2a(wtext);
+ wtext = mir_wstrndup(_wtext, _len);
+ text = mir_u2a(wtext);
link = NULL;
wlink = NULL;
}
@@ -58,7 +58,7 @@ void TextToken::setLink(const char *_link) replaceStr(link, _link);
mir_free(wlink);
- this->wlink = mir_a2t(_link);
+ this->wlink = mir_a2u(_link);
}
void TextToken::setLink(const wchar_t *_link)
@@ -169,7 +169,7 @@ TextToken* TextToken::tokenizeBBCodes(const wchar_t *text, int l) newTokenType = BBCODE;
newTokenSize = k - i;
if (bbTagArg[j]) {
- wchar_t *urlLink = mir_tstrndup(text + tagArgStart, tagArgEnd - tagArgStart);
+ wchar_t *urlLink = mir_wstrndup(text + tagArgStart, tagArgEnd - tagArgStart);
bbToken->setLink(urlLink);
mir_free(urlLink);
}
diff --git a/plugins/IEView/src/ieview_main.cpp b/plugins/IEView/src/ieview_main.cpp index ecf69d2561..87997933dd 100644 --- a/plugins/IEView/src/ieview_main.cpp +++ b/plugins/IEView/src/ieview_main.cpp @@ -63,7 +63,7 @@ extern "C" int __declspec(dllexport) Load(void) wchar_t *workingDir = new wchar_t[wdsize];
GetCurrentDirectory(wdsize, workingDir);
Utils::convertPath(workingDir);
- workingDirUtf8 = mir_utf8encodeT(workingDir);
+ workingDirUtf8 = mir_utf8encodeW(workingDir);
delete[] workingDir;
mir_getLP(&pluginInfoEx);
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index c19816d33c..2db83b8a7c 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -29,14 +29,14 @@ struct AccountMap AccountMap(const char *_src, int _origIdx, const wchar_t *_srcName) :
szSrcAcc(mir_strdup(_src)),
iSrcIndex(_origIdx),
- tszSrcName(mir_tstrdup(_srcName)),
+ tszSrcName(mir_wstrdup(_srcName)),
pa(NULL)
{}
~AccountMap() {}
ptrA szSrcAcc, szBaseProto;
- ptrT tszSrcName;
+ ptrW tszSrcName;
int iSrcIndex;
PROTOACCOUNT *pa;
};
@@ -77,7 +77,7 @@ void AddMessage(const wchar_t* fmt, ...) va_list args;
wchar_t msgBuf[4096];
va_start(args, fmt);
- mir_vsntprintf(msgBuf, _countof(msgBuf), TranslateTS(fmt), args);
+ mir_vsnwprintf(msgBuf, _countof(msgBuf), TranslateTS(fmt), args);
SendMessage(hdlgProgress, PROGM_ADDMESSAGE, 0, (LPARAM)msgBuf);
}
@@ -144,7 +144,7 @@ static MCONTACT HContactFromID(char *pszProtoName, char *pszSetting, wchar_t *pw char *szProto = GetContactProto(hContact);
if (!mir_strcmp(szProto, pszProtoName)) {
ptrW id(db_get_tsa(hContact, pszProtoName, pszSetting));
- if (!mir_tstrcmp(pwszID, id))
+ if (!mir_wstrcmp(pwszID, id))
return hContact;
}
}
@@ -259,7 +259,7 @@ static LRESULT CALLBACK ListWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM int idx = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName);
SendMessage(hwndCombo, CB_SETITEMDATA, idx, (LPARAM)accs[i]);
- if (!mir_tstrcmpi(accs[i]->tszAccountName, tszText))
+ if (!mir_wstrcmpi(accs[i]->tszAccountName, tszText))
iSel = idx;
}
@@ -390,7 +390,7 @@ static PROTOACCOUNT* FindMyAccount(const char *szProto, const char *szBaseProto, if (pa->bOldProto || pa->bIsVirtual || pa->bDynDisabled)
return pa;
- if (ptszName && !mir_tstrcmp(pa->tszAccountName, ptszName))
+ if (ptszName && !mir_wstrcmp(pa->tszAccountName, ptszName))
return pa;
char *pszUniqueSetting = (char*)CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
@@ -430,7 +430,7 @@ bool ImportAccounts(OBJLIST<char> &arSkippedModules) continue;
itoa(800 + i, szSetting, 10);
- ptrT tszName(myGetWs(NULL, "Protocols", szSetting));
+ ptrW tszName(myGetWs(NULL, "Protocols", szSetting));
AccountMap *pNew = new AccountMap(szProto, i, tszName);
arAccountMap.insert(pNew);
@@ -498,7 +498,7 @@ bool ImportAccounts(OBJLIST<char> &arSkippedModules) p.pa->bIsEnabled = iVal != 0;
if (p.tszSrcName == NULL) {
- p.pa->tszAccountName = mir_a2t(p.pa->szModuleName);
+ p.pa->tszAccountName = mir_a2u(p.pa->szModuleName);
itoa(800 + p.pa->iOrder, szSetting, 10);
db_set_ts(NULL, "Protocols", szSetting, p.pa->tszAccountName);
}
@@ -663,7 +663,7 @@ void ImportMeta(DBCachedContact *ccSrc) return;
}
- ptrT tszGroup(myGetWs(ccSrc->contactID, "CList", "Group")), tszNick(myGetWs(ccSrc->contactID, "CList", "MyHandle"));
+ ptrW tszGroup(myGetWs(ccSrc->contactID, "CList", "Group")), tszNick(myGetWs(ccSrc->contactID, "CList", "MyHandle"));
if (tszNick == NULL)
tszNick = myGetWs(ccSrc->contactID, ccSrc->szProto, "Nick");
@@ -795,7 +795,7 @@ static MCONTACT ImportContact(MCONTACT hSrc) return NULL;
}
- ptrT tszGroup(myGetWs(hSrc, "CList", "Group")), tszNick(myGetWs(hSrc, "CList", "MyHandle"));
+ ptrW tszGroup(myGetWs(hSrc, "CList", "Group")), tszNick(myGetWs(hSrc, "CList", "MyHandle"));
if (tszNick == NULL)
tszNick = myGetWs(hSrc, cc->szProto, "Nick");
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp index dc4c5c86f8..bed803d016 100644 --- a/plugins/Import/src/miranda.cpp +++ b/plugins/Import/src/miranda.cpp @@ -33,7 +33,7 @@ static void SearchForLists(HWND hwndDlg, const wchar_t *mirandaPath, const wchar {
// find in Miranda profile subfolders
wchar_t searchspec[MAX_PATH];
- mir_sntprintf(searchspec, L"%s\\*.*", mirandaPath);
+ mir_snwprintf(searchspec, L"%s\\*.*", mirandaPath);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(searchspec, &fd);
@@ -42,20 +42,20 @@ static void SearchForLists(HWND hwndDlg, const wchar_t *mirandaPath, const wchar do {
// find all subfolders except "." and ".."
- if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_tstrcmp(fd.cFileName, L".") || !mir_tstrcmp(fd.cFileName, L".."))
+ if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_wstrcmp(fd.cFileName, L".") || !mir_wstrcmp(fd.cFileName, L".."))
continue;
// skip the current profile too
- if (mirandaProf != NULL && !mir_tstrcmpi(mirandaProf, fd.cFileName))
+ if (mirandaProf != NULL && !mir_wstrcmpi(mirandaProf, fd.cFileName))
continue;
wchar_t buf[MAX_PATH], profile[MAX_PATH];
- mir_sntprintf(buf, L"%s\\%s\\%s.dat", mirandaPath, fd.cFileName, fd.cFileName);
+ mir_snwprintf(buf, L"%s\\%s\\%s.dat", mirandaPath, fd.cFileName, fd.cFileName);
if (_waccess(buf, 0) == 0) {
- mir_sntprintf(profile, L"%s.dat", fd.cFileName);
+ mir_snwprintf(profile, L"%s.dat", fd.cFileName);
int i = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)profile);
- SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETITEMDATA, i, (LPARAM)mir_tstrdup(buf));
+ SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETITEMDATA, i, (LPARAM)mir_wstrdup(buf));
}
}
while (FindNextFile(hFind, &fd));
@@ -78,7 +78,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR SearchForLists(hwndDlg, pfd2, pfn);
SearchForLists(hwndDlg, pfd1, NULL);
- if (mir_tstrcmpi(pfd, pfd2))
+ if (mir_wstrcmpi(pfd, pfd2))
SearchForLists(hwndDlg, pfd, NULL);
}
SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCURSEL, 0, 0);
@@ -100,7 +100,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR MessageBox(hwndDlg, TranslateT("The given file does not exist. Please check that you have entered the name correctly."), TranslateT("Miranda Import"), MB_OK);
break;
}
- mir_tstrcpy(importFile, filename);
+ mir_wstrcpy(importFile, filename);
PostMessage(GetParent(hwndDlg), WIZM_GOTOPAGE, IDD_OPTIONS, (LPARAM)MirandaOptionsPageProc);
break;
@@ -119,11 +119,11 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR break;
case IDC_OTHER:
- ptrT pfd(Utils_ReplaceVarsT(L"%miranda_profilesdir%"));
+ ptrW pfd(Utils_ReplaceVarsT(L"%miranda_profilesdir%"));
wchar_t str[MAX_PATH], text[256];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
- mir_sntprintf(text, L"%s (*.dat, *.bak)%c*.dat;*.bak%c%s (*.*)%c*.*%c%c", TranslateT("Miranda NG database"), 0, 0, TranslateT("All Files"), 0, 0, 0);
+ mir_snwprintf(text, L"%s (*.dat, *.bak)%c*.dat;*.bak%c%s (*.*)%c*.*%c%c", TranslateT("Miranda NG database"), 0, 0, TranslateT("All Files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
diff --git a/plugins/KeyboardNotify/src/flash.cpp b/plugins/KeyboardNotify/src/flash.cpp index bbbcc84da4..6f56a9552d 100644 --- a/plugins/KeyboardNotify/src/flash.cpp +++ b/plugins/KeyboardNotify/src/flash.cpp @@ -88,7 +88,7 @@ void setFlashingSequence(void) FLASHING_SEQUENCE *getCustomSeq(void)
{
- ptrT tszSeq( db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", wCustomTheme)));
+ ptrW tszSeq( db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", wCustomTheme)));
static FLASHING_SEQUENCE Custom = {0};
Custom = str2FS((tszSeq != 0) ? tszSeq : L"");
diff --git a/plugins/KeyboardNotify/src/keyboard.cpp b/plugins/KeyboardNotify/src/keyboard.cpp index 5fd5116dc5..eaa613c661 100644 --- a/plugins/KeyboardNotify/src/keyboard.cpp +++ b/plugins/KeyboardNotify/src/keyboard.cpp @@ -40,11 +40,11 @@ BOOL OpenKeyboardDevice() wchar_t aux1[MAX_PATH+1], aux2[MAX_PATH+1];
do {
- mir_sntprintf(aux1, L"Kbd%d", i);
- mir_sntprintf(aux2, L"\\Device\\KeyboardClass%d", i);
+ mir_snwprintf(aux1, L"Kbd%d", i);
+ mir_snwprintf(aux2, L"\\Device\\KeyboardClass%d", i);
DefineDosDevice(DDD_RAW_TARGET_PATH, aux1, aux2);
- mir_sntprintf(aux1, L"\\\\.\\Kbd%d", i);
+ mir_snwprintf(aux1, L"\\\\.\\Kbd%d", i);
hKbdDev[i] = CreateFile(aux1, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
} while (hKbdDev[i] != INVALID_HANDLE_VALUE && ++i < MAX_KBDHANDLES);
@@ -80,7 +80,7 @@ void CloseKeyboardDevice() if (hKbdDev[i] != INVALID_HANDLE_VALUE)
CloseHandle(hKbdDev[i]);
- mir_sntprintf(aux, L"Kbd%d", i);
+ mir_snwprintf(aux, L"Kbd%d", i);
DefineDosDevice(DDD_REMOVE_DEFINITION, aux, NULL);
} while (hKbdDev[i] != INVALID_HANDLE_VALUE && ++i < MAX_KBDHANDLES);
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 3cafb2523b..2ccf62e6f1 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -829,12 +829,12 @@ void createEventPrefix(wchar_t *prefixName, size_t maxLen) while (str = wcschr(profileName, '\\'))
*str = '/';
- if ((len = mir_tstrlen(profileName)) <= maxLen)
+ if ((len = mir_wstrlen(profileName)) <= maxLen)
wcsncpy_s(prefixName, maxLen, profileName, _TRUNCATE);
else {
str = profileName + len - maxLen / 2;
wcsncpy_s(prefixName, (maxLen / 2), profileName, _TRUNCATE);
- mir_tstrcat(prefixName, str);
+ mir_wstrcat(prefixName, str);
}
}
@@ -914,9 +914,9 @@ static int ModulesLoaded(WPARAM, LPARAM) // Create some synchronisation objects
createEventPrefix(eventPrefix, MAX_PATH - 11);
- mir_sntprintf(eventName, L"%s/FlashEvent", eventPrefix);
+ mir_snwprintf(eventName, L"%s/FlashEvent", eventPrefix);
hFlashEvent = CreateEvent(NULL, FALSE, FALSE, eventName);
- mir_sntprintf(eventName, L"%s/ExitEvent", eventPrefix);
+ mir_snwprintf(eventName, L"%s/ExitEvent", eventPrefix);
hExitEvent = CreateEvent(NULL, FALSE, FALSE, eventName);
hThread = mir_forkthread(FlashThreadFunction, 0);
diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index 5f5f0bd92d..1fdc35eae0 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -46,14 +46,14 @@ static void writeThemeToCombo(const wchar_t *theme, const wchar_t *custom, BOOL int item = SendDlgItemMessage(hwndTheme, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); if (item == CB_ERR) { item = SendDlgItemMessage(hwndTheme, IDC_THEME, CB_ADDSTRING, 0, (LPARAM)theme); - wchar_t *str = mir_tstrdup(custom); + wchar_t *str = mir_wstrdup(custom); SendDlgItemMessage(hwndTheme, IDC_THEME, CB_SETITEMDATA, (WPARAM)item, (LPARAM)str); } else if (overrideExisting) { wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndTheme, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) - mir_tstrcpy(str, custom); + mir_wstrcpy(str, custom); } } @@ -97,12 +97,12 @@ void importThemes(const wchar_t *filename, BOOL overrideExisting) for (str = buffer; *str && isspace(*str); str++); //ltrim if (!*str || *str == ';') //empty line or comment continue; - for (i = mir_tstrlen(str) - 1; isspace(str[i]); str[i--] = '\0'); //rtrim + for (i = mir_wstrlen(str) - 1; isspace(str[i]); str[i--] = '\0'); //rtrim switch (status) { case 0: if (i > 1 && str[0] == '[' && str[i] == ']') { status = 1; - mir_tstrcpy(theme, str + 1); + mir_wstrcpy(theme, str + 1); theme[i - 1] = '\0'; } break; @@ -127,7 +127,7 @@ static void createProcessListAux(void) if (!ProcessList.szFileName[i]) ProcessListAux.szFileName[i] = NULL; else { - ProcessListAux.szFileName[i] = mir_tstrdup(ProcessList.szFileName[i]); + ProcessListAux.szFileName[i] = mir_wstrdup(ProcessList.szFileName[i]); } } @@ -264,7 +264,7 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, wchar_t szFileNameAux[MAX_PATH + 1]; SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_GETLBTEXT, (WPARAM)i, (LPARAM)szFileNameAux); - ProcessListAux.szFileName[i] = mir_tstrdup(szFileNameAux); + ProcessListAux.szFileName[i] = mir_wstrdup(szFileNameAux); } // fallthrough @@ -1162,15 +1162,15 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hwndDlg; ofn.hInstance = NULL; - mir_tstrcpy(filter, TranslateT("Keyboard Notify Theme")); + mir_wstrcpy(filter, TranslateT("Keyboard Notify Theme")); mir_wstrcat(filter, L" (*.knt)"); - pfilter = filter + mir_tstrlen(filter) + 1; - mir_tstrcpy(pfilter, L"*.knt"); - pfilter = pfilter + mir_tstrlen(pfilter) + 1; - mir_tstrcpy(pfilter, TranslateT("All Files")); - pfilter = pfilter + mir_tstrlen(pfilter) + 1; - mir_tstrcpy(pfilter, L"*.*"); - pfilter = pfilter + mir_tstrlen(pfilter) + 1; + pfilter = filter + mir_wstrlen(filter) + 1; + mir_wstrcpy(pfilter, L"*.knt"); + pfilter = pfilter + mir_wstrlen(pfilter) + 1; + mir_wstrcpy(pfilter, TranslateT("All Files")); + pfilter = pfilter + mir_wstrlen(pfilter) + 1; + mir_wstrcpy(pfilter, L"*.*"); + pfilter = pfilter + mir_wstrlen(pfilter) + 1; *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.lpstrFile = path; @@ -1190,15 +1190,15 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hwndDlg; ofn.hInstance = NULL; - mir_tstrcpy(filter, TranslateT("Keyboard Notify Theme")); + mir_wstrcpy(filter, TranslateT("Keyboard Notify Theme")); mir_wstrcat(filter, L" (*.knt)"); - pfilter = filter + mir_tstrlen(filter) + 1; - mir_tstrcpy(pfilter, L"*.knt"); - pfilter = pfilter + mir_tstrlen(pfilter) + 1; - mir_tstrcpy(pfilter, TranslateT("All Files")); - pfilter = pfilter + mir_tstrlen(pfilter) + 1; - mir_tstrcpy(pfilter, L"*.*"); - pfilter = pfilter + mir_tstrlen(pfilter) + 1; + pfilter = filter + mir_wstrlen(filter) + 1; + mir_wstrcpy(pfilter, L"*.knt"); + pfilter = pfilter + mir_wstrlen(pfilter) + 1; + mir_wstrcpy(pfilter, TranslateT("All Files")); + pfilter = pfilter + mir_wstrlen(pfilter) + 1; + mir_wstrcpy(pfilter, L"*.*"); + pfilter = pfilter + mir_wstrlen(pfilter) + 1; *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.lpstrFile = path; @@ -1227,7 +1227,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: if (szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", wCustomTheme))) { - mir_tstrcpy(theme, szTheme); + mir_wstrcpy(theme, szTheme); mir_free(szTheme); } else diff --git a/plugins/KeyboardNotify/src/utils.cpp b/plugins/KeyboardNotify/src/utils.cpp index b7d59819b8..f7d8bc4ab8 100644 --- a/plugins/KeyboardNotify/src/utils.cpp +++ b/plugins/KeyboardNotify/src/utils.cpp @@ -38,7 +38,7 @@ wchar_t *getAbsoluteProfileName(wchar_t *absoluteProfileName, size_t maxLen) profilePath[0] = profileName[0] = '\0';
CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath);
CallService(MS_DB_GETPROFILENAMET, MAX_PATH, (LPARAM)profileName);
- mir_sntprintf(absoluteProfileName, maxLen, L"%s\\%s", profilePath, profileName);
+ mir_snwprintf(absoluteProfileName, maxLen, L"%s\\%s", profilePath, profileName);
return absoluteProfileName;
}
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 6292695560..8f7dfe7465 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -170,7 +170,7 @@ struct compareFunc : std::binary_function<const ProtocolInfo, const ProtocolInfo {
bool operator()(const ProtocolInfo &one, const ProtocolInfo &two) const
{
- return mir_tstrcmp(one.account, two.account) < 0;
+ return mir_wstrcmp(one.account, two.account) < 0;
}
};
@@ -186,7 +186,7 @@ void RebuildMenu() Menu_RemoveItem(info->hMenu);
wchar_t text[512];
- mir_sntprintf(text, TranslateT("Send to %s"), info->account);
+ mir_snwprintf(text, TranslateT("Send to %s"), info->account);
CMenuItem mi;
mi.position = 100000 + i;
@@ -216,7 +216,7 @@ void RegisterProtocol(char *proto, wchar_t *account) strncpy(proto_items[id].proto, proto, _countof(proto_items[id].proto));
proto_items[id].proto[_countof(proto_items[id].proto) - 1] = 0;
- mir_tstrncpy(proto_items[id].account, account, _countof(proto_items[id].account));
+ mir_wstrncpy(proto_items[id].account, account, _countof(proto_items[id].account));
proto_items[id].hMenu = NULL;
proto_items[id].old_xstatus = 0;
@@ -234,10 +234,10 @@ int AccListChanged(WPARAM wParam, LPARAM lParam) ProtocolInfo *info = GetProtoInfo(proto->szModuleName);
if (info != NULL) {
if (wParam == PRAC_UPGRADED || wParam == PRAC_CHANGED) {
- mir_tstrncpy(info->account, proto->tszAccountName, _countof(info->account));
+ mir_wstrncpy(info->account, proto->tszAccountName, _countof(info->account));
wchar_t text[512];
- mir_sntprintf(text, TranslateT("Send to %s"), info->account);
+ mir_snwprintf(text, TranslateT("Send to %s"), info->account);
Menu_ModifyItem(info->hMenu, text);
}
else if (wParam == PRAC_REMOVED || (wParam == PRAC_CHECKED && !proto->bIsEnabled)) {
@@ -644,7 +644,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) if (lti == NULL)
CallProtoService(proto, PS_SETAWAYMSG, status, 0);
else {
- ptrT fr(GetParsedFormat(lti));
+ ptrW fr(GetParsedFormat(lti));
CallProtoService(proto, PS_SETAWAYMSG, status, fr);
}
}
@@ -713,7 +713,7 @@ INT_PTR GetTextFormat(WPARAM, LPARAM) if (!loaded)
return NULL;
- return (INT_PTR)mir_tstrdup(opts.templ);
+ return (INT_PTR)mir_wstrdup(opts.templ);
}
wchar_t *GetParsedFormat(LISTENINGTOINFO *lti)
@@ -764,7 +764,7 @@ void SetListeningInfos(LISTENINGTOINFO *lti) if (lti) {
fr = GetParsedFormat(lti);
- if (fr) info = mir_t2a(fr);
+ if (fr) info = mir_u2a(fr);
}
NotifyEventHooks(hListeningInfoChangedEvent, (WPARAM)info, 0);
@@ -910,7 +910,7 @@ wchar_t* VariablesParseInfo(ARGUMENTSINFO *ai) LISTENINGTOINFO *lti = GetListeningInfo();
if (lti == NULL) {
ai->flags = AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
wchar_t *fr[] = {
@@ -938,17 +938,17 @@ wchar_t* VariablesParseInfo(ARGUMENTSINFO *ai) if (lti == NULL) \
{ \
ai->flags = AIF_FALSE; \
- return mir_tstrdup(L""); \
+ return mir_wstrdup(L""); \
} \
else if (IsEmpty(lti->__field__)) \
{ \
ai->flags = AIF_FALSE; \
- return mir_tstrdup(opts.unknown); \
+ return mir_wstrdup(opts.unknown); \
} \
else \
{ \
ai->flags = AIF_DONTPARSE; \
- wchar_t *ret = mir_tstrdup(lti->__field__); \
+ wchar_t *ret = mir_wstrdup(lti->__field__); \
return ret; \
}
diff --git a/plugins/ListeningTo/src/music.cpp b/plugins/ListeningTo/src/music.cpp index 2cc709e025..3ded9a24d2 100644 --- a/plugins/ListeningTo/src/music.cpp +++ b/plugins/ListeningTo/src/music.cpp @@ -68,15 +68,15 @@ void CopyListeningInfo(LISTENINGTOINFO *dest, const LISTENINGTOINFO * const src) dest->cbSize = src->cbSize;
dest->dwFlags = src->dwFlags;
- dest->ptszArtist = mir_tstrdup(src->ptszArtist);
- dest->ptszAlbum = mir_tstrdup(src->ptszAlbum);
- dest->ptszTitle = mir_tstrdup(src->ptszTitle);
- dest->ptszTrack = mir_tstrdup(src->ptszTrack);
- dest->ptszYear = mir_tstrdup(src->ptszYear);
- dest->ptszGenre = mir_tstrdup(src->ptszGenre);
- dest->ptszLength = mir_tstrdup(src->ptszLength);
- dest->ptszPlayer = mir_tstrdup(src->ptszPlayer);
- dest->ptszType = mir_tstrdup(src->ptszType);
+ dest->ptszArtist = mir_wstrdup(src->ptszArtist);
+ dest->ptszAlbum = mir_wstrdup(src->ptszAlbum);
+ dest->ptszTitle = mir_wstrdup(src->ptszTitle);
+ dest->ptszTrack = mir_wstrdup(src->ptszTrack);
+ dest->ptszYear = mir_wstrdup(src->ptszYear);
+ dest->ptszGenre = mir_wstrdup(src->ptszGenre);
+ dest->ptszLength = mir_wstrdup(src->ptszLength);
+ dest->ptszPlayer = mir_wstrdup(src->ptszPlayer);
+ dest->ptszType = mir_wstrdup(src->ptszType);
}
BOOL Equals(const LISTENINGTOINFO *lti1, const LISTENINGTOINFO *lti2)
@@ -84,15 +84,15 @@ BOOL Equals(const LISTENINGTOINFO *lti1, const LISTENINGTOINFO *lti2) if (lti1->cbSize != lti2->cbSize)
return FALSE;
- return mir_tstrcmpi(lti1->ptszArtist, lti2->ptszArtist) == 0
- && mir_tstrcmpi(lti1->ptszAlbum, lti2->ptszAlbum) == 0
- && mir_tstrcmpi(lti1->ptszTitle, lti2->ptszTitle) == 0
- && mir_tstrcmpi(lti1->ptszTrack, lti2->ptszTrack) == 0
- && mir_tstrcmpi(lti1->ptszYear, lti2->ptszYear) == 0
- && mir_tstrcmpi(lti1->ptszGenre, lti2->ptszGenre) == 0
- && mir_tstrcmpi(lti1->ptszLength, lti2->ptszLength) == 0
- && mir_tstrcmpi(lti1->ptszPlayer, lti2->ptszPlayer) == 0
- && mir_tstrcmpi(lti1->ptszType, lti2->ptszType) == 0;
+ return mir_wstrcmpi(lti1->ptszArtist, lti2->ptszArtist) == 0
+ && mir_wstrcmpi(lti1->ptszAlbum, lti2->ptszAlbum) == 0
+ && mir_wstrcmpi(lti1->ptszTitle, lti2->ptszTitle) == 0
+ && mir_wstrcmpi(lti1->ptszTrack, lti2->ptszTrack) == 0
+ && mir_wstrcmpi(lti1->ptszYear, lti2->ptszYear) == 0
+ && mir_wstrcmpi(lti1->ptszGenre, lti2->ptszGenre) == 0
+ && mir_wstrcmpi(lti1->ptszLength, lti2->ptszLength) == 0
+ && mir_wstrcmpi(lti1->ptszPlayer, lti2->ptszPlayer) == 0
+ && mir_wstrcmpi(lti1->ptszType, lti2->ptszType) == 0;
}
diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp index 121a5e5869..26667de180 100644 --- a/plugins/ListeningTo/src/options.cpp +++ b/plugins/ListeningTo/src/options.cpp @@ -131,11 +131,11 @@ BOOL IsTypeEnabled(LISTENINGTOINFO *lti) return TRUE;
if (lti->dwFlags & LTI_UNICODE) {
- if (mir_tstrcmpi(lti->ptszType, LPGENW("Music")) == 0)
+ if (mir_wstrcmpi(lti->ptszType, LPGENW("Music")) == 0)
return opts.enable_music;
- if (mir_tstrcmpi(lti->ptszType, LPGENW("Radio")) == 0)
+ if (mir_wstrcmpi(lti->ptszType, LPGENW("Radio")) == 0)
return opts.enable_radio;
- if (mir_tstrcmpi(lti->ptszType, LPGENW("Video")) == 0)
+ if (mir_wstrcmpi(lti->ptszType, LPGENW("Video")) == 0)
return opts.enable_video;
return opts.enable_others;
}
diff --git a/plugins/ListeningTo/src/players/generic.cpp b/plugins/ListeningTo/src/players/generic.cpp index 551d0d2a5e..e6a7a77c7b 100644 --- a/plugins/ListeningTo/src/players/generic.cpp +++ b/plugins/ListeningTo/src/players/generic.cpp @@ -32,11 +32,11 @@ void m_log(const wchar_t *function, const wchar_t *fmt, ...) return;
}
- mir_writeLogT(hLog, L"%s: ", function);
+ mir_writeLogW(hLog, L"%s: ", function);
va_list args;
va_start(args, fmt);
- mir_writeLogVT(hLog, fmt, args);
+ mir_writeLogVW(hLog, fmt, args);
}
static LRESULT CALLBACK ReceiverWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
@@ -163,9 +163,9 @@ void GenericPlayer::ProcessReceived() li->ptszGenre = U2T(parts[8]);
if (player == this)
- li->ptszPlayer = mir_u2t(parts[1]);
+ li->ptszPlayer = mir_wstrdup(parts[1]);
else
- li->ptszPlayer = mir_tstrdup(player->name);
+ li->ptszPlayer = mir_wstrdup(player->name);
if (parts[9] != NULL) {
long length = _wtoi(parts[9]);
@@ -177,9 +177,9 @@ void GenericPlayer::ProcessReceived() int h = (length / 60) / 60;
if (h > 0)
- mir_sntprintf(li->ptszLength, 9, L"%d:%02d:%02d", h, m, s);
+ mir_snwprintf(li->ptszLength, 9, L"%d:%02d:%02d", h, m, s);
else
- mir_sntprintf(li->ptszLength, 9, L"%d:%02d", m, s);
+ mir_snwprintf(li->ptszLength, 9, L"%d:%02d", m, s);
}
}
}
diff --git a/plugins/ListeningTo/src/players/itunes.cpp b/plugins/ListeningTo/src/players/itunes.cpp index fa6f2478e6..167779db76 100644 --- a/plugins/ListeningTo/src/players/itunes.cpp +++ b/plugins/ListeningTo/src/players/itunes.cpp @@ -125,12 +125,12 @@ BOOL ITunes::FillCache() int h = (lret / 60) / 60;
if (h > 0)
- mir_sntprintf(listening_info.ptszLength, 9, L"%d:%02d:%02d", h, m, s);
+ mir_snwprintf(listening_info.ptszLength, 9, L"%d:%02d:%02d", h, m, s);
else
- mir_sntprintf(listening_info.ptszLength, 9, L"%d:%02d", m, s);
+ mir_snwprintf(listening_info.ptszLength, 9, L"%d:%02d", m, s);
}
- listening_info.ptszType = mir_tstrdup(L"Music");
+ listening_info.ptszType = mir_wstrdup(L"Music");
if (listening_info.ptszTitle == NULL) {
// Get from filename
@@ -140,14 +140,14 @@ BOOL ITunes::FillCache() else
p = filename;
- listening_info.ptszTitle = mir_u2t(p);
+ listening_info.ptszTitle = mir_wstrdup(p);
wchar_t *pt = wcsrchr(listening_info.ptszTitle, '.');
if (pt != NULL)
*p = '\0';
}
- listening_info.ptszPlayer = mir_tstrdup(name);
+ listening_info.ptszPlayer = mir_wstrdup(name);
listening_info.cbSize = sizeof(listening_info);
listening_info.dwFlags = LTI_TCHAR;
diff --git a/plugins/ListeningTo/src/players/mradio.cpp b/plugins/ListeningTo/src/players/mradio.cpp index 5654325be2..60a88ec252 100644 --- a/plugins/ListeningTo/src/players/mradio.cpp +++ b/plugins/ListeningTo/src/players/mradio.cpp @@ -43,9 +43,9 @@ int MRadio::GetData() if (!db_get_s(hContact, "mRadio", "Nick", &dbv)) {
listening_info.cbSize = sizeof(listening_info);
listening_info.dwFlags = LTI_TCHAR;
- listening_info.ptszArtist = mir_tstrdup(L"Radio");
- listening_info.ptszType = mir_tstrdup(L"Radio");
- listening_info.ptszTitle = mir_a2t(dbv.pszVal);
+ listening_info.ptszArtist = mir_wstrdup(L"Radio");
+ listening_info.ptszType = mir_wstrdup(L"Radio");
+ listening_info.ptszTitle = mir_a2u(dbv.pszVal);
db_free(&dbv);
return 1;
diff --git a/plugins/ListeningTo/src/players/watrack.cpp b/plugins/ListeningTo/src/players/watrack.cpp index d76b79571b..895c555b91 100644 --- a/plugins/ListeningTo/src/players/watrack.cpp +++ b/plugins/ListeningTo/src/players/watrack.cpp @@ -102,15 +102,15 @@ void WATrack::GetData() int h = (si->total / 60) / 60;
if (h > 0)
- mir_sntprintf(listening_info.ptszLength, 9, L"%d:%02d:%02d", h, m, s);
+ mir_snwprintf(listening_info.ptszLength, 9, L"%d:%02d:%02d", h, m, s);
else
- mir_sntprintf(listening_info.ptszLength, 9, L"%d:%02d", m, s);
+ mir_snwprintf(listening_info.ptszLength, 9, L"%d:%02d", m, s);
}
if (si->width > 0)
- listening_info.ptszType = mir_tstrdup(L"Video");
+ listening_info.ptszType = mir_wstrdup(L"Video");
else
- listening_info.ptszType = mir_tstrdup(L"Music");
+ listening_info.ptszType = mir_wstrdup(L"Music");
listening_info.ptszPlayer = DUPD(si->player, name);
diff --git a/plugins/ListeningTo/src/players/wmp.cpp b/plugins/ListeningTo/src/players/wmp.cpp index c3131e8718..f7d2ab6df2 100644 --- a/plugins/ListeningTo/src/players/wmp.cpp +++ b/plugins/ListeningTo/src/players/wmp.cpp @@ -100,7 +100,7 @@ void WindowsMediaPlayer::ProcessReceived() listening_info.ptszArtist = U2T(parts[5]);
listening_info.ptszAlbum = U2T(parts[6]);
- listening_info.ptszPlayer = mir_tstrdup(name);
+ listening_info.ptszPlayer = mir_wstrdup(name);
}
// Put back the '\\'s
diff --git a/plugins/ListeningTo/src/stdafx.h b/plugins/ListeningTo/src/stdafx.h index 535d581660..9bf16d8c66 100644 --- a/plugins/ListeningTo/src/stdafx.h +++ b/plugins/ListeningTo/src/stdafx.h @@ -107,10 +107,10 @@ static bool IsEmpty(const WCHAR *str) return str == NULL || str[0] == 0;
}
-#define DUP(_X_) ( IsEmpty(_X_) ? NULL : mir_tstrdup(_X_))
-#define DUPD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_tstrdup(_DEF_) : mir_tstrdup(_X_))
-#define U2T(_X_) ( IsEmpty(_X_) ? NULL : mir_u2t(_X_))
-#define U2TD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_u2t(_DEF_) : mir_u2t(_X_))
+#define DUP(_X_) ( IsEmpty(_X_) ? NULL : mir_wstrdup(_X_))
+#define DUPD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_wstrdup(_DEF_) : mir_wstrdup(_X_))
+#define U2T(_X_) ( IsEmpty(_X_) ? NULL : mir_wstrdup(_X_))
+#define U2TD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_wstrdup(_DEF_) : mir_wstrdup(_X_))
#endif // __COMMONS_H__
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 96aa582cf6..02a83da50d 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -446,7 +446,7 @@ void showMsg(wchar_t* sender,wchar_t* text, DWORD id, char *strUID) //99% of the times you'll just copy this line.
//1% of the times you may wish to change the contact's name. I don't know why you should, but you can.
//char * lpzText;
- //The text for the second line. You could even make something like: char lpzText[128]; mir_tstrcpy(lpzText, "Hello world!"); It's your choice.
+ //The text for the second line. You could even make something like: char lpzText[128]; mir_wstrcpy(lpzText, "Hello world!"); It's your choice.
POPUPATT * mpd = (POPUPATT*)malloc(sizeof(POPUPATT));
memset(&ppd, 0, sizeof(ppd)); //This is always a good thing to do.
@@ -478,7 +478,7 @@ void showMsg(wchar_t* sender,wchar_t* text, DWORD id, char *strUID) //what to do with error msg
void ErMsgW(WCHAR* msg)
{
- wchar_t* msgT = mir_u2t(msg);
+ wchar_t* msgT = mir_wstrdup(msg);
ErMsgT(msgT);
mir_free(msgT);
}
@@ -775,11 +775,11 @@ void checkthread(void*) if (attSize) {
WCHAR field_attachments_UNICODE[MAX_FIELD];
- mir_sntprintf(field_attachments_UNICODE, TranslateT("Attachments: %d bytes"), attSize);
- mir_sntprintf(msgSubject, L"%S\n%s\n%s", field_date, field_subject_UNICODE, field_attachments_UNICODE);
+ mir_snwprintf(field_attachments_UNICODE, TranslateT("Attachments: %d bytes"), attSize);
+ mir_snwprintf(msgSubject, L"%S\n%s\n%s", field_date, field_subject_UNICODE, field_attachments_UNICODE);
}
else {
- mir_sntprintf(msgSubject, L"%S\n%s", field_date, field_subject_UNICODE);
+ mir_snwprintf(msgSubject, L"%S\n%s", field_date, field_subject_UNICODE);
}
//check if this is not filtered msg
@@ -1574,7 +1574,7 @@ void checkEnvPath(wchar_t *path) wchar_t *cur = _wgetenv(L"PATH");
wcslwr(cur);
wchar_t *found = wcsstr(cur, path);
- size_t len = mir_tstrlen(path);
+ size_t len = mir_wstrlen(path);
if (found != NULL && (found[len] == ';' || found[len] == 0 || (found[len] == '\\' && (found[len + 1] == ';' || found[len + 1] == 0))))
return;
@@ -1600,7 +1600,7 @@ static int modulesloaded(WPARAM, LPARAM) GetLotusPath(path, sizeof(path));
checkEnvPath(path);
wcscat_s(path, _countof(path), L"nnotes.dll");
- assert(mir_tstrlen(path) > 0);
+ assert(mir_wstrlen(path) > 0);
log_p(L"Loading dll: %s", path);
diff --git a/plugins/LotusNotify/src/debug.cpp b/plugins/LotusNotify/src/debug.cpp index 37f5f26948..965538e7f4 100644 --- a/plugins/LotusNotify/src/debug.cpp +++ b/plugins/LotusNotify/src/debug.cpp @@ -34,7 +34,7 @@ void log_p(const wchar_t* szText, ...){ va_start(args, szText);
int len = _vscwprintf(szText, args ) + 1; // _vscprintf doesn't count terminating '\0' //!!!!!!!!!!!!!!!!
wchar_t* buffer = new wchar_t[len * sizeof(wchar_t)];
- mir_vsntprintf(buffer, len, szText, args);
+ mir_vsnwprintf(buffer, len, szText, args);
va_end(args);
log(buffer);
delete[] buffer;
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index ed5005e30d..a71bac9998 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -209,9 +209,9 @@ void ShowPopup(char* szText, wchar_t* tszText, MCONTACT hContact) wchar_t* text = 0;
if (tszText)
- text = mir_tstrdup(tszText);
+ text = mir_wstrdup(tszText);
else if (szText)
- text = mir_a2t(szText);
+ text = mir_a2u(szText);
if (!text) return;
ppd.lchIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
@@ -236,16 +236,16 @@ void CopyToClipboard(HWND, LPSTR pszMsg, LPTSTR ptszMsg) {
LPTSTR buf = 0;
if (ptszMsg)
- buf = mir_tstrdup(ptszMsg);
+ buf = mir_wstrdup(ptszMsg);
else if (pszMsg)
- buf = mir_a2t(pszMsg);
+ buf = mir_a2u(pszMsg);
if (buf == 0)
return;
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(buf) + 1)*sizeof(wchar_t));
+ HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_wstrlen(buf) + 1)*sizeof(wchar_t));
LPTSTR lptstrCopy = (LPTSTR)GlobalLock(hglbCopy);
- mir_tstrcpy(lptstrCopy, buf);
+ mir_wstrcpy(lptstrCopy, buf);
mir_free(buf);
GlobalUnlock(hglbCopy);
@@ -331,8 +331,8 @@ BOOL MirVerExists(MCONTACT hContact) if (!szProto)
return 0;
- ptrT msg(db_get_tsa(hContact, szProto, "MirVer"));
- return mir_tstrlen(msg) != 0;
+ ptrW msg(db_get_tsa(hContact, szProto, "MirVer"));
+ return mir_wstrlen(msg) != 0;
}
void getIP(MCONTACT hContact, LPSTR szProto, LPSTR szIP)
@@ -507,7 +507,7 @@ void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID) szID[MAX_IDLEN + 1] = 0;
}
- mir_sntprintf(buffer, L"%s [%S]", TranslateT("Copy ID"), szID);
+ mir_snwprintf(buffer, L"%s [%S]", TranslateT("Copy ID"), szID);
Menu_ModifyItem(hmenuCopyID, buffer, hIconCID);
}
else Menu_ModifyItem(hmenuCopyID, LPGENW("Copy ID"), hIconCID);
@@ -628,11 +628,11 @@ INT_PTR onCopyStatusMsg(WPARAM wparam, LPARAM lparam) if (msg) {
if (wcslen(msg)) {
if (flags & VF_SMNAME) {
- mir_tstrncat(buffer, TranslateTS(statusMsg[i].fullName), (_countof(buffer) - wcslen(buffer) - 1));
- mir_tstrncat(buffer, L": ", (_countof(buffer) - wcslen(buffer) - 1));
+ mir_wstrncat(buffer, TranslateTS(statusMsg[i].fullName), (_countof(buffer) - wcslen(buffer) - 1));
+ mir_wstrncat(buffer, L": ", (_countof(buffer) - wcslen(buffer) - 1));
}
- mir_tstrncat(buffer, msg, (_countof(buffer) - wcslen(buffer) - 1));
- mir_tstrncat(buffer, L"\r\n", (_countof(buffer) - wcslen(buffer) - 1));
+ mir_wstrncat(buffer, msg, (_countof(buffer) - wcslen(buffer) - 1));
+ mir_wstrncat(buffer, L"\r\n", (_countof(buffer) - wcslen(buffer) - 1));
}
mir_free(msg);
}
diff --git a/plugins/MenuItemEx/src/options.cpp b/plugins/MenuItemEx/src/options.cpp index 75e33c58a5..2f94374064 100644 --- a/plugins/MenuItemEx/src/options.cpp +++ b/plugins/MenuItemEx/src/options.cpp @@ -48,7 +48,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) for (i = 0; i < 4; i++)
{
GetDlgItemText(hdlg, checkboxes[i].idc, buffer, (_countof(buffer) - 3));
- mir_tstrcat(buffer, L" *");
+ mir_wstrcat(buffer, L" *");
SetDlgItemText(hdlg, checkboxes[i].idc, buffer);
}
}
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index b37be018a8..a29245cff6 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -200,12 +200,12 @@ void MirandaUtils::sendMessage(ActionThreadArgStruct* args, MFENUM_SEND_MESSAGE_ wchar_t* buffer = new wchar_t[1024 * sizeof(wchar_t)];
if (contactNameW != NULL && tszAccountName != NULL)
if (args->mirfoxDataPtr->getAddAccountToContactNameCheckbox()){
- mir_sntprintf(buffer, 1024, TranslateT("Message sent to %s"), contactNameW);
+ mir_snwprintf(buffer, 1024, TranslateT("Message sent to %s"), contactNameW);
} else {
- mir_sntprintf(buffer, 1024, TranslateT("Message sent to %s (%s)"), contactNameW, tszAccountName);
+ mir_snwprintf(buffer, 1024, TranslateT("Message sent to %s (%s)"), contactNameW, tszAccountName);
}
else
- mir_sntprintf(buffer, 1024, TranslateT("Message sent"));
+ mir_snwprintf(buffer, 1024, TranslateT("Message sent"));
if(ServiceExists(MS_POPUP_ADDPOPUPCLASS))
ShowClassPopupT("MirFox_Notify", L"MirFox", buffer);
@@ -229,23 +229,23 @@ void MirandaUtils::sendMessage(ActionThreadArgStruct* args, MFENUM_SEND_MESSAGE_ logger->log_p(L"SMTC: ERROR - Cannot send message - result = [%d] ", myMfAck->result);
if (myMfAck->errorDesc != NULL){
if (contactNameW != NULL && tszAccountName != NULL){
- mir_sntprintf(buffer, 1024, TranslateT("Cannot send message to %s (%s) - %S"), contactNameW, tszAccountName, myMfAck->errorDesc);
+ mir_snwprintf(buffer, 1024, TranslateT("Cannot send message to %s (%s) - %S"), contactNameW, tszAccountName, myMfAck->errorDesc);
} else {
- mir_sntprintf(buffer, 1024, TranslateT("Cannot send message - %S"), myMfAck->errorDesc);
+ mir_snwprintf(buffer, 1024, TranslateT("Cannot send message - %S"), myMfAck->errorDesc);
}
} else {
if (contactNameW != NULL && tszAccountName != NULL){
- mir_sntprintf(buffer, 1024, TranslateT("Cannot send message to %s (%s)"), contactNameW, tszAccountName);
+ mir_snwprintf(buffer, 1024, TranslateT("Cannot send message to %s (%s)"), contactNameW, tszAccountName);
} else {
- mir_sntprintf(buffer, 1024, TranslateT("Cannot send message"));
+ mir_snwprintf(buffer, 1024, TranslateT("Cannot send message"));
}
}
} else {
logger->log(L"SMTC: ERROR - Cannot send message 2");
if (contactNameW != NULL && tszAccountName != NULL){
- mir_sntprintf(buffer, 1024, TranslateT("Cannot send message to %s (%s)"), contactNameW, tszAccountName);
+ mir_snwprintf(buffer, 1024, TranslateT("Cannot send message to %s (%s)"), contactNameW, tszAccountName);
} else {
- mir_sntprintf(buffer, 1024, TranslateT("Cannot send message"));
+ mir_snwprintf(buffer, 1024, TranslateT("Cannot send message"));
}
}
@@ -342,7 +342,7 @@ int MirandaUtils::on_hook_OpenMW(WPARAM wParam, LPARAM lParam) OnHookOpenMvStruct* param = (OnHookOpenMvStruct*)wParam;
if (param->msgBuffer != NULL){
- wchar_t *msgBuffer = mir_tstrdup(param->msgBuffer->c_str());
+ wchar_t *msgBuffer = mir_wstrdup(param->msgBuffer->c_str());
CallServiceSync(MS_MSG_SENDMESSAGET, (WPARAM)param->targetHandle, (LPARAM)msgBuffer);
mir_free(msgBuffer);
@@ -400,10 +400,10 @@ void MirandaUtils::setStatusOnAccount(ActionThreadArgStruct* args) if(result == 0){
if (tszAccountName != NULL){
logger->log_p(L"SSOA: Status message set on [%s]", tszAccountName);
- mir_sntprintf(buffer, 1024, TranslateT("Status message set on %s"), tszAccountName);
+ mir_snwprintf(buffer, 1024, TranslateT("Status message set on %s"), tszAccountName);
} else {
logger->log(L"SSOA: Status message set");
- mir_sntprintf(buffer, 1024, TranslateT("Status message set"));
+ mir_snwprintf(buffer, 1024, TranslateT("Status message set"));
}
if(ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
@@ -414,10 +414,10 @@ void MirandaUtils::setStatusOnAccount(ActionThreadArgStruct* args) } else {
if (tszAccountName != NULL){
logger->log_p(L"SSOA: ERROR - Cannot set status message 2 on [%s] - result = [%d] ", tszAccountName, result);
- mir_sntprintf(buffer, 1024, TranslateT("Cannot set status message on %s"), tszAccountName);
+ mir_snwprintf(buffer, 1024, TranslateT("Cannot set status message on %s"), tszAccountName);
} else {
logger->log_p(L"SSOA: ERROR - Cannot set status message 2 - result = [%d] ", result);
- mir_sntprintf(buffer, 1024, TranslateT("Cannot set status message"));
+ mir_snwprintf(buffer, 1024, TranslateT("Cannot set status message"));
}
if(ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
diff --git a/plugins/MirFox/src/MirfoxMiranda.cpp b/plugins/MirFox/src/MirfoxMiranda.cpp index da140c8d17..c19a436e84 100644 --- a/plugins/MirFox/src/MirfoxMiranda.cpp +++ b/plugins/MirFox/src/MirfoxMiranda.cpp @@ -270,7 +270,7 @@ void CMirfoxMiranda::initializeSharedMemoryData(MirfoxData& mirfoxData, SharedMe } else {
mirfoxData.processCsmId = result.processCsmId;
wchar_t prefix[7];
- mir_sntprintf(prefix, L"MNG%d", result.processCsmId);
+ mir_snwprintf(prefix, L"MNG%d", result.processCsmId);
logger->set6CharsPrefix(prefix);
}
diff --git a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp index 8bb7ec0d8b..40c80555bf 100644 --- a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp +++ b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp @@ -23,9 +23,9 @@ static int lua_MessageBox(lua_State *L) static int lua_ShellExecute(lua_State *L)
{
- ptrT command(mir_utf8decodeT(lua_tostring(L, 1)));
- ptrT file(mir_utf8decodeT(lua_tostring(L, 2)));
- ptrT args(mir_utf8decodeT(lua_tostring(L, 3)));
+ ptrW command(mir_utf8decodeW(lua_tostring(L, 1)));
+ ptrW file(mir_utf8decodeW(lua_tostring(L, 2)));
+ ptrW args(mir_utf8decodeW(lua_tostring(L, 3)));
int flags = lua_tointeger(L, 4);
::ShellExecute(NULL, command, file, args, NULL, flags);
@@ -62,8 +62,8 @@ static int lua_FindIterator(lua_State *L) }
}
- if (!mir_tstrcmpi(ffd.cFileName, L".") ||
- !mir_tstrcmpi(ffd.cFileName, L"..") ||
+ if (!mir_wstrcmpi(ffd.cFileName, L".") ||
+ !mir_wstrcmpi(ffd.cFileName, L"..") ||
(ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT))
{
lua_pushlightuserdata(L, hFind);
@@ -98,7 +98,7 @@ static int lua_FindIterator(lua_State *L) static int lua_Find(lua_State *L)
{
- wchar_t *path = mir_utf8decodeT(luaL_checkstring(L, 1));
+ wchar_t *path = mir_utf8decodeW(luaL_checkstring(L, 1));
lua_pushlightuserdata(L, NULL);
lua_pushlightuserdata(L, path);
@@ -121,9 +121,9 @@ static int lua_GetKeyState(lua_State *L) static int lua_GetIniValue(lua_State *L)
{
- ptrT path(mir_utf8decodeT(luaL_checkstring(L, 1)));
- ptrT section(mir_utf8decodeT(luaL_checkstring(L, 2)));
- ptrT key(mir_utf8decodeT(luaL_checkstring(L, 3)));
+ ptrW path(mir_utf8decodeW(luaL_checkstring(L, 1)));
+ ptrW section(mir_utf8decodeW(luaL_checkstring(L, 2)));
+ ptrW key(mir_utf8decodeW(luaL_checkstring(L, 3)));
if (lua_isinteger(L, 4))
{
@@ -135,7 +135,7 @@ static int lua_GetIniValue(lua_State *L) return 1;
}
- ptrT default(mir_utf8decodeT(lua_tostring(L, 4)));
+ ptrW default(mir_utf8decodeW(lua_tostring(L, 4)));
wchar_t value[MAX_PATH] = { 0 };
if (!::GetPrivateProfileString(section, key, default, value, _countof(value), path))
@@ -143,7 +143,7 @@ static int lua_GetIniValue(lua_State *L) lua_pushvalue(L, 4);
}
- ptrA res(mir_utf8encodeT(value));
+ ptrA res(mir_utf8encodeW(value));
lua_pushstring(L, res);
return 1;
@@ -151,10 +151,10 @@ static int lua_GetIniValue(lua_State *L) static int lua_SetIniValue(lua_State *L)
{
- ptrT path(mir_utf8decodeT(luaL_checkstring(L, 1)));
- ptrT section(mir_utf8decodeT(luaL_checkstring(L, 2)));
- ptrT key(mir_utf8decodeT(luaL_checkstring(L, 3)));
- ptrT value(mir_utf8decodeT(lua_tostring(L, 4)));
+ ptrW path(mir_utf8decodeW(luaL_checkstring(L, 1)));
+ ptrW section(mir_utf8decodeW(luaL_checkstring(L, 2)));
+ ptrW key(mir_utf8decodeW(luaL_checkstring(L, 3)));
+ ptrW value(mir_utf8decodeW(lua_tostring(L, 4)));
bool res = ::WritePrivateProfileString(section, key, value, path) != 0;
lua_pushboolean(L, res);
@@ -164,9 +164,9 @@ static int lua_SetIniValue(lua_State *L) static int lua_DeleteIniValue(lua_State *L)
{
- ptrT path(mir_utf8decodeT(luaL_checkstring(L, 1)));
- ptrT section(mir_utf8decodeT(luaL_checkstring(L, 2)));
- ptrT key(mir_utf8decodeT(luaL_checkstring(L, 3)));
+ ptrW path(mir_utf8decodeW(luaL_checkstring(L, 1)));
+ ptrW section(mir_utf8decodeW(luaL_checkstring(L, 2)));
+ ptrW key(mir_utf8decodeW(luaL_checkstring(L, 3)));
bool res = ::WritePrivateProfileString(section, key, NULL, path) != 0;
lua_pushboolean(L, res);
@@ -179,8 +179,8 @@ static int lua_DeleteIniValue(lua_State *L) static int lua_GetRegValue(lua_State *L)
{
HKEY hRootKey = (HKEY)luaL_checkinteger(L, 1);
- ptrT path(mir_utf8decodeT(luaL_checkstring(L, 2)));
- ptrT valueName(mir_utf8decodeT(luaL_checkstring(L, 3)));
+ ptrW path(mir_utf8decodeW(luaL_checkstring(L, 2)));
+ ptrW valueName(mir_utf8decodeW(luaL_checkstring(L, 3)));
HKEY hKey = 0;
LSTATUS res = ::RegOpenKeyEx(hRootKey, path, NULL, KEY_READ, &hKey);
@@ -240,8 +240,8 @@ static int lua_GetRegValue(lua_State *L) static int lua_SetRegValue(lua_State *L)
{
HKEY hRootKey = (HKEY)luaL_checkinteger(L, 1);
- ptrT path(mir_utf8decodeT(luaL_checkstring(L, 2)));
- ptrT valueName(mir_utf8decodeT(luaL_checkstring(L, 3)));
+ ptrW path(mir_utf8decodeW(luaL_checkstring(L, 2)));
+ ptrW valueName(mir_utf8decodeW(luaL_checkstring(L, 3)));
HKEY hKey = 0;
LSTATUS res = ::RegOpenKeyEx(hRootKey, path, NULL, KEY_WRITE, &hKey);
@@ -275,7 +275,7 @@ static int lua_SetRegValue(lua_State *L) case LUA_TSTRING:
type = REG_SZ;
length = mir_strlen(lua_tostring(L, 4)) * sizeof(wchar_t);
- value = (BYTE*)mir_utf8decodeT(lua_tostring(L, 4));
+ value = (BYTE*)mir_utf8decodeW(lua_tostring(L, 4));
break;
default:
@@ -296,8 +296,8 @@ static int lua_SetRegValue(lua_State *L) static int lua_DeleteRegValue(lua_State *L)
{
HKEY hRootKey = (HKEY)luaL_checkinteger(L, 1);
- ptrT path(mir_utf8decodeT(luaL_checkstring(L, 2)));
- ptrT valueName(mir_utf8decodeT(luaL_checkstring(L, 3)));
+ ptrW path(mir_utf8decodeW(luaL_checkstring(L, 2)));
+ ptrW valueName(mir_utf8decodeW(luaL_checkstring(L, 3)));
HKEY hKey = 0;
LSTATUS res = ::RegOpenKeyEx(hRootKey, path, NULL, KEY_WRITE, &hKey);
diff --git a/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp b/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp index de2fbdc021..f8f7ce7b7f 100644 --- a/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp +++ b/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp @@ -22,7 +22,7 @@ static BBButton* MakeBBButton(lua_State *L) bbb->bbbFlags &= ~BBBF_ANSITOOLTIP;
lua_getfield(L, -1, "Tooltip");
- bbb->ptszTooltip = mir_utf8decodeT(lua_tostring(L, -1));
+ bbb->ptszTooltip = mir_utf8decodeW(lua_tostring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Icon");
@@ -140,7 +140,7 @@ extern "C" LUAMOD_API int luaopen_m_msg_buttonsbar(lua_State *L) lua_register(L, MT_CUSTOMBUTTONCLICKDATA, bcd_new);
luaL_newmetatable(L, MT_CUSTOMBUTTONCLICKDATA);
- lua_pushcfunction(L, bcd__index); + lua_pushcfunction(L, bcd__index);
lua_setfield(L, -2, "__index");
lua_pop(L, 1);
diff --git a/plugins/MirLua/Modules/m_popup/src/main.cpp b/plugins/MirLua/Modules/m_popup/src/main.cpp index 288f03c1ca..c169ba72e6 100644 --- a/plugins/MirLua/Modules/m_popup/src/main.cpp +++ b/plugins/MirLua/Modules/m_popup/src/main.cpp @@ -5,11 +5,11 @@ static POPUPDATAT* MakePopupData(lua_State *L) POPUPDATAT *ppd = (POPUPDATAT*)mir_calloc(sizeof(POPUPDATAT));
lua_getfield(L, -1, "ContactName");
- mir_tstrcpy(ppd->lptzContactName, ptrT(mir_utf8decodeT(lua_tostring(L, -1))));
+ mir_wstrcpy(ppd->lptzContactName, ptrW(mir_utf8decodeW(lua_tostring(L, -1))));
lua_pop(L, 1);
lua_getfield(L, -1, "Text");
- mir_tstrcpy(ppd->lptzText, ptrT(mir_utf8decodeT(luaL_checkstring(L, -1))));
+ mir_wstrcpy(ppd->lptzText, ptrW(mir_utf8decodeW(luaL_checkstring(L, -1))));
lua_pop(L, 1);
lua_getfield(L, -1, "hContact");
@@ -60,11 +60,11 @@ static POPUPDATA2* MakePopupData2(lua_State *L) ppd->flags |= PU2_TCHAR;
lua_getfield(L, -1, "Title");
- ppd->lptzTitle = mir_utf8decodeT(lua_tostring(L, -1));
+ ppd->lptzTitle = mir_utf8decodeW(lua_tostring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Text");
- ppd->lptzText = mir_utf8decodeT(luaL_checkstring(L, -1));
+ ppd->lptzText = mir_utf8decodeW(luaL_checkstring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "hContact");
diff --git a/plugins/MirLua/Modules/m_variables/src/main.cpp b/plugins/MirLua/Modules/m_variables/src/main.cpp index 308325e202..a9c5204f96 100644 --- a/plugins/MirLua/Modules/m_variables/src/main.cpp +++ b/plugins/MirLua/Modules/m_variables/src/main.cpp @@ -8,7 +8,7 @@ static int lua_Parse(lua_State *L) return 1;
}
- ptrT format(mir_utf8decodeT(luaL_checkstring(L, 1)));
+ ptrW format(mir_utf8decodeW(luaL_checkstring(L, 1)));
MCONTACT hContact = lua_tointeger(L, 2);
wchar_t *res = variables_parse_ex(format, NULL, hContact, NULL, 0);
diff --git a/plugins/MirLua/src/m_clist.cpp b/plugins/MirLua/src/m_clist.cpp index 70ac7ebfe3..59a5415b32 100644 --- a/plugins/MirLua/src/m_clist.cpp +++ b/plugins/MirLua/src/m_clist.cpp @@ -6,7 +6,7 @@ static int clist_AddMainMenuRoot(lua_State *L) int position = lua_tointeger(L, 2);
HANDLE hIcon = (HANDLE)lua_touserdata(L, 3);
- HGENMENU res = Menu_CreateRoot(MO_MAIN, ptrT(Utf8DecodeT(name)), position, hIcon);
+ HGENMENU res = Menu_CreateRoot(MO_MAIN, ptrW(Utf8DecodeT(name)), position, hIcon);
lua_pushlightuserdata(L, res);
return 1;
@@ -29,7 +29,7 @@ static int clist_AddContactMenuRoot(lua_State *L) int position = lua_tointeger(L, 2);
HANDLE hIcon = (HANDLE)lua_touserdata(L, 3);
- HGENMENU res = Menu_CreateRoot(MO_MAIN, ptrT(Utf8DecodeT(name)), position, hIcon);
+ HGENMENU res = Menu_CreateRoot(MO_MAIN, ptrW(Utf8DecodeT(name)), position, hIcon);
lua_pushlightuserdata(L, res);
return 1;
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 27d4cc7714..07f3c9329e 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -278,7 +278,7 @@ static int core_Translate(lua_State *L) {
char *what = (char*)luaL_checkstring(L, 1);
- ptrT value(mir_utf8decodeT(what));
+ ptrW value(mir_utf8decodeW(what));
lua_pushstring(L, T2Utf(TranslateW_LP(value, hLangpack)));
return 1;
@@ -288,7 +288,7 @@ static int core_Parse(lua_State *L) {
char *what = (char*)luaL_checkstring(L, 1);
- ptrT value(mir_utf8decodeT(what));
+ ptrW value(mir_utf8decodeW(what));
lua_pushstring(L, T2Utf(VARST(value)));
return 1;
@@ -299,7 +299,7 @@ static int core_GetFullPath(lua_State *L) wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
- lua_pushstring(L, ptrA(mir_utf8encodeT(path)));
+ lua_pushstring(L, ptrA(mir_utf8encodeW(path)));
return 1;
}
diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp index fab5f86d57..5f5ea774d0 100644 --- a/plugins/MirLua/src/m_database.cpp +++ b/plugins/MirLua/src/m_database.cpp @@ -103,9 +103,9 @@ static int db_GetContactInfo(lua_State *L) }
}
- ptrT value(Contact_GetInfo(type, hContact));
+ ptrW value(Contact_GetInfo(type, hContact));
if (value)
- lua_pushstring(L, ptrA(mir_utf8encodeT(value)));
+ lua_pushstring(L, ptrA(mir_utf8encodeW(value)));
else
{
lua_pushnil(L);
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp index 78ed5343d6..e5b33d58a7 100644 --- a/plugins/MirLua/src/m_genmenu.cpp +++ b/plugins/MirLua/src/m_genmenu.cpp @@ -18,7 +18,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) lua_pop(L, 1);
lua_getfield(L, -1, "Name");
- mi.name.w = mir_utf8decodeT(luaL_checkstring(L, -1));
+ mi.name.w = mir_utf8decodeW(luaL_checkstring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Position");
@@ -47,7 +47,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) int position = lua_tointeger(L, 3);
HANDLE hIcon = (HANDLE)lua_touserdata(L, 4);
- HGENMENU res = Menu_CreateRoot(hMenuObject, ptrT(Utf8DecodeT(name)), position, hIcon);
+ HGENMENU res = Menu_CreateRoot(hMenuObject, ptrW(Utf8DecodeT(name)), position, hIcon);
lua_pushlightuserdata(L, res);
return 1;
@@ -78,7 +78,7 @@ static int genmenu_ModifyMenuItem(lua_State *L) {
luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
HGENMENU hMenuItem = (HGENMENU)lua_touserdata(L, 1);
- ptrT name(mir_utf8decodeT(lua_tostring(L, 2)));
+ ptrW name(mir_utf8decodeW(lua_tostring(L, 2)));
HANDLE hIcolibItem = luaL_opt(L, lua_touserdata, 3, INVALID_HANDLE_VALUE);
int flags = luaL_optinteger(L, 4, -1);
diff --git a/plugins/MirLua/src/m_hotkeys.cpp b/plugins/MirLua/src/m_hotkeys.cpp index 4023904fe4..c99ef4290b 100644 --- a/plugins/MirLua/src/m_hotkeys.cpp +++ b/plugins/MirLua/src/m_hotkeys.cpp @@ -16,11 +16,11 @@ void MakeHotkey(lua_State *L, HOTKEYDESC &hk) lua_pop(L, 1);
lua_getfield(L, -1, "Description");
- hk.ptszDescription = mir_utf8decodeT(lua_tostring(L, -1));
+ hk.ptszDescription = mir_utf8decodeW(lua_tostring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Section");
- hk.ptszSection = mir_utf8decodeT(luaL_optstring(L, -1, MODULE));
+ hk.ptszSection = mir_utf8decodeW(luaL_optstring(L, -1, MODULE));
lua_pop(L, 1);
lua_getfield(L, -1, "Hotkey");
diff --git a/plugins/MirLua/src/m_icolib.cpp b/plugins/MirLua/src/m_icolib.cpp index 8827cc749c..018931ffb7 100644 --- a/plugins/MirLua/src/m_icolib.cpp +++ b/plugins/MirLua/src/m_icolib.cpp @@ -3,9 +3,9 @@ static int icolib_AddIcon(lua_State *L)
{
const char *name = luaL_checkstring(L, 1);
- ptrT description(mir_utf8decodeT(luaL_checkstring(L, 2)));
- ptrT section(mir_utf8decodeT(luaL_optstring(L, 3, MODULE)));
- ptrT filePath(mir_utf8decodeT(lua_tostring(L, 4)));
+ ptrW description(mir_utf8decodeW(luaL_checkstring(L, 2)));
+ ptrW section(mir_utf8decodeW(luaL_optstring(L, 3, MODULE)));
+ ptrW filePath(mir_utf8decodeW(lua_tostring(L, 4)));
if (filePath == NULL)
{
diff --git a/plugins/MirLua/src/m_message.cpp b/plugins/MirLua/src/m_message.cpp index b907807929..0a56c791e3 100644 --- a/plugins/MirLua/src/m_message.cpp +++ b/plugins/MirLua/src/m_message.cpp @@ -3,7 +3,7 @@ static int message_Paste(lua_State *L)
{
MCONTACT hContact = luaL_checkinteger(L, 1);
- ptrT text(mir_utf8decodeT(luaL_checkstring(L, 2)));
+ ptrW text(mir_utf8decodeW(luaL_checkstring(L, 2)));
MessageWindowInputData mwid = { sizeof(MessageWindowInputData) };
mwid.hContact = hContact;
@@ -34,12 +34,12 @@ static int message_Send(lua_State *L) const char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == TRUE)
{
- ptrT tszChatRoom(db_get_tsa(hContact, szProto, "ChatRoomID"));
+ ptrW tszChatRoom(db_get_tsa(hContact, szProto, "ChatRoomID"));
GCDEST gcd = { szProto, tszChatRoom, GC_EVENT_SENDMESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
gce.bIsMe = TRUE;
gce.dwFlags = GCEF_ADDTOLOG;
- gce.ptszText = mir_utf8decodeT(message);
+ gce.ptszText = mir_utf8decodeW(message);
gce.time = time(NULL);
res = CallServiceSync(MS_GC_EVENT, WINDOW_VISIBLE, (LPARAM)&gce);
diff --git a/plugins/MirLua/src/m_options.cpp b/plugins/MirLua/src/m_options.cpp index d67106d247..6bb25cbe26 100644 --- a/plugins/MirLua/src/m_options.cpp +++ b/plugins/MirLua/src/m_options.cpp @@ -54,15 +54,15 @@ void MakeOptionDialogPage(lua_State *L, OPTIONSDIALOGPAGE &odp) odp.flags |= ODPF_TCHAR;
lua_getfield(L, -1, "Group");
- odp.pwszGroup = mir_utf8decodeT(lua_tostring(L, -1));
+ odp.pwszGroup = mir_utf8decodeW(lua_tostring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Title");
- odp.pwszTitle = mir_utf8decodeT(luaL_checkstring(L, -1));
+ odp.pwszTitle = mir_utf8decodeW(luaL_checkstring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Tab");
- odp.pwszTab = mir_utf8decodeT(lua_tostring(L, -1));
+ odp.pwszTab = mir_utf8decodeW(lua_tostring(L, -1));
lua_pop(L, 1);
int onInitDialogRef = LUA_NOREF;
diff --git a/plugins/MirLua/src/m_sounds.cpp b/plugins/MirLua/src/m_sounds.cpp index cd31adfe76..0291515ee7 100644 --- a/plugins/MirLua/src/m_sounds.cpp +++ b/plugins/MirLua/src/m_sounds.cpp @@ -3,9 +3,9 @@ static int sounds_AddSound(lua_State *L)
{
ptrA name(mir_utf8decodeA(luaL_checkstring(L, 1)));
- ptrT description(mir_utf8decodeT(luaL_checkstring(L, 2)));
- ptrT section(mir_utf8decodeT(luaL_optstring(L, 3, MODULE)));
- ptrT filePath(mir_utf8decodeT(lua_tostring(L, 4)));
+ ptrW description(mir_utf8decodeW(luaL_checkstring(L, 2)));
+ ptrW section(mir_utf8decodeW(luaL_optstring(L, 3, MODULE)));
+ ptrW filePath(mir_utf8decodeW(lua_tostring(L, 4)));
SKINSOUNDDESCEX ssd = { sizeof(SKINSOUNDDESCEX) };
ssd.pszName = name;
@@ -34,7 +34,7 @@ static int sounds_PlaySound(lua_State *L) static int sounds_PlayFile(lua_State *L)
{
- ptrT filePath(mir_utf8decodeT(luaL_checkstring(L, 1)));
+ ptrW filePath(mir_utf8decodeW(luaL_checkstring(L, 1)));
INT_PTR res = SkinPlaySoundFile(filePath);
lua_pushboolean(L, res == 0);
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index 5386f364d1..b6c62101a6 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -28,11 +28,11 @@ void CMLua::SetPaths() lua_getglobal(L, "package");
FoldersGetCustomPathT(g_hCLibsFolder, path, _countof(path), VARST(MIRLUA_PATHT));
- lua_pushfstring(L, "%s\\?.dll", ptrA(mir_utf8encodeT(path)));
+ lua_pushfstring(L, "%s\\?.dll", ptrA(mir_utf8encodeW(path)));
lua_setfield(L, -2, "cpath");
FoldersGetCustomPathT(g_hScriptsFolder, path, _countof(path), VARST(MIRLUA_PATHT));
- lua_pushfstring(L, "%s\\?.lua", ptrA(mir_utf8encodeT(path)));
+ lua_pushfstring(L, "%s\\?.lua", ptrA(mir_utf8encodeW(path)));
lua_setfield(L, -2, "path");
lua_pop(L, 1);
diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp index cc902165d6..524cd427bb 100644 --- a/plugins/MirLua/src/mlua_options.cpp +++ b/plugins/MirLua/src/mlua_options.cpp @@ -62,7 +62,7 @@ void CMLuaOptions::OnInitDialog() wchar_t scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100];
FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT));
PathToRelativeT(scriptDir, relativeScriptDir, NULL);
- mir_sntprintf(header, L"%s (%s)", TranslateT("Common scripts"), relativeScriptDir);
+ mir_snwprintf(header, L"%s (%s)", TranslateT("Common scripts"), relativeScriptDir);
m_scripts.AddColumn(0, L"Script", 380);
m_scripts.AddColumn(1, NULL, 32 - GetSystemMetrics(SM_CXVSCROLL));
diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp index b84c3d978e..f4cfef8c7c 100644 --- a/plugins/MirLua/src/mlua_script.cpp +++ b/plugins/MirLua/src/mlua_script.cpp @@ -5,17 +5,17 @@ CMLuaScript::CMLuaScript(lua_State *L, const wchar_t *path)
: L(L), status(None), unloadRef(LUA_NOREF)
{
- mir_tstrcpy(filePath, path);
+ mir_wstrcpy(filePath, path);
fileName = wcsrchr(filePath, '\\') + 1;
wchar_t *dot = wcsrchr(fileName, '.');
- size_t length = mir_tstrlen(fileName) - mir_tstrlen(dot) + 1;
+ size_t length = mir_wstrlen(fileName) - mir_wstrlen(dot) + 1;
- ptrT name((wchar_t*)mir_calloc(sizeof(wchar_t) * (length + 1)));
- mir_tstrncpy(name, fileName, length);
+ ptrW name((wchar_t*)mir_calloc(sizeof(wchar_t) * (length + 1)));
+ mir_wstrncpy(name, fileName, length);
- moduleName = mir_utf8encodeT(name);
+ moduleName = mir_utf8encodeW(name);
MUUID muidLast = MIID_LAST;
id = GetPluginLangId(muidLast, 0);
diff --git a/plugins/MirLua/src/mlua_script_loader.cpp b/plugins/MirLua/src/mlua_script_loader.cpp index a8efa32320..3a3d88fbc7 100644 --- a/plugins/MirLua/src/mlua_script_loader.cpp +++ b/plugins/MirLua/src/mlua_script_loader.cpp @@ -7,7 +7,7 @@ CMLuaScriptLoader::CMLuaScriptLoader(lua_State *L) : L(L) void CMLuaScriptLoader::LoadScript(const wchar_t *scriptDir, const wchar_t *file)
{
wchar_t fullPath[MAX_PATH], path[MAX_PATH];
- mir_sntprintf(fullPath, L"%s\\%s", scriptDir, file);
+ mir_snwprintf(fullPath, L"%s\\%s", scriptDir, file);
PathToRelativeT(fullPath, path);
CMLuaScript *script = new CMLuaScript(L, path);
@@ -31,7 +31,7 @@ void CMLuaScriptLoader::LoadScripts() Log(L"Loading scripts from %s", scriptDir);
wchar_t searchMask[MAX_PATH];
- mir_sntprintf(searchMask, L"%s\\%s", scriptDir, L"*.lua");
+ mir_snwprintf(searchMask, L"%s\\%s", scriptDir, L"*.lua");
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(searchMask, &fd);
diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp index cc3ab94d61..98d0d5edef 100644 --- a/plugins/MirOTR/src/dialogs.cpp +++ b/plugins/MirOTR/src/dialogs.cpp @@ -40,11 +40,11 @@ static INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam, smp_for_contact[context->app_data].responder = data->responder; mir_free(data); - wchar_t title[512], *proto = mir_a2t(GetContactProto(hContact)); + wchar_t title[512], *proto = mir_a2u(GetContactProto(hContact)); const wchar_t *name = contact_get_nameT(hContact); - mir_sntprintf(title, TranslateW(LANG_SMP_PROGRESS_TITLE), name, proto); + mir_snwprintf(title, TranslateW(LANG_SMP_PROGRESS_TITLE), name, proto); SetWindowText(hwndDlg, title); - mir_sntprintf(title, TranslateW(LANG_SMP_PROGRESS_DESC), name, proto); + mir_snwprintf(title, TranslateW(LANG_SMP_PROGRESS_DESC), name, proto); mir_free(proto); SetDlgItemText(hwndDlg, IDC_STC_SMP_HEADPRO, title); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context); @@ -183,15 +183,15 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam smp_for_contact[context->app_data].oldlevel = data->oldlevel; smp_for_contact[context->app_data].responder = data->responder; - wchar_t buff[512], *proto = mir_a2t(GetContactProto(hContact)); - mir_sntprintf(buff, TranslateW(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); + wchar_t buff[512], *proto = mir_a2u(GetContactProto(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); mir_free(proto); SetWindowText(hwndDlg, buff); SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, buff); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context); if (data->question) { - mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -211,7 +211,7 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam mir_free(data->question); } else { - mir_sntprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -303,7 +303,7 @@ void SMPInitResponseDialog(ConnContext *context, const wchar_t *question) { data->context = context; data->oldlevel = TRUST_NOT_PRIVATE; data->responder = true; - data->question = (question) ? mir_tstrdup(question) : NULL; + data->question = (question) ? mir_wstrdup(question) : NULL; CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SMP_INPUT), 0, DlgSMPResponseProc, (LPARAM) data); } */ @@ -326,8 +326,8 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam } MCONTACT hContact = (UINT_PTR)context->app_data; - wchar_t title[512], *proto = mir_a2t(GetContactProto(hContact)); - mir_sntprintf(title, TranslateW(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); + wchar_t title[512], *proto = mir_a2u(GetContactProto(hContact)); + mir_snwprintf(title, TranslateW(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); mir_free(proto); SetWindowText(hwndDlg, title); SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, title); @@ -380,9 +380,9 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam } wchar_t buff[1024]; if (!fp->trust || fp->trust[0] == '\0') - mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -418,7 +418,7 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, szMsg, _countof(szMsg)); if (wcsncmp(szMsg, TranslateW(LANG_SMPTYPE_QUESTION), _countof(szMsg)) == 0) { if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) { - mir_sntprintf(szMsg, TranslateW(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); + mir_snwprintf(szMsg, TranslateW(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); ShowError(szMsg); } else { @@ -441,7 +441,7 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam } else if (wcsncmp(szMsg, TranslateW(LANG_SMPTYPE_PASSWORD), _countof(szMsg)) == 0) { if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) { - mir_sntprintf(szMsg, TranslateW(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); + mir_snwprintf(szMsg, TranslateW(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); ShowError(szMsg); } else { @@ -489,9 +489,9 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, buff, 255); if (wcsncmp(buff, TranslateW(LANG_SMPTYPE_QUESTION), 255) == 0) { if (trusted) - mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -510,9 +510,9 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam } else if (wcsncmp(buff, TranslateW(LANG_SMPTYPE_PASSWORD), 255) == 0) { if (trusted) - mir_sntprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -531,9 +531,9 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam } else if (wcsncmp(buff, TranslateW(LANG_SMPTYPE_FINGERPRINT), 255) == 0) { if (trusted) - mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -608,7 +608,7 @@ void SMPDialogReply(ConnContext *context, const char* question) data->context = context; data->oldlevel = TRUST_NOT_PRIVATE; data->responder = true; - data->question = (question) ? mir_utf8decodeT(question) : NULL; + data->question = (question) ? mir_utf8decodeW(question) : NULL; CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SMP_INPUT), 0, DlgSMPResponseProc, (LPARAM)data); /* ShowError(L"SMP requires user password (NOT IMPL YET)"); @@ -671,9 +671,9 @@ static INT_PTR CALLBACK DlgBoxProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM w } wchar_t buff[512]; if (!fp->trust || fp->trust[0] == '\0') - mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -735,7 +735,7 @@ static unsigned int CALLBACK verify_context_thread(void *param) lib_cs_lock(); otrl_context_set_trust(context->active_fingerprint, "verified"); otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename)); - mir_sntprintf(msg, TranslateW(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact)); + mir_snwprintf(msg, TranslateW(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact)); ShowMessage(hContact, msg); SetEncryptionStatus(hContact, otr_context_get_trust(context)); break; @@ -744,7 +744,7 @@ static unsigned int CALLBACK verify_context_thread(void *param) lib_cs_lock(); otrl_context_set_trust(context->active_fingerprint, NULL); otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename)); - mir_sntprintf(msg, TranslateW(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); + mir_snwprintf(msg, TranslateW(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); ShowMessage(hContact, msg); SetEncryptionStatus(hContact, otr_context_get_trust(context)); break; diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp index 23e7ecf35c..2629202ed3 100644 --- a/plugins/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/src/mirotrmenu.cpp @@ -68,12 +68,12 @@ INT_PTR MirOTRMenuCheckService(WPARAM wParam, LPARAM) switch (level) { case TRUST_PRIVATE: - mir_sntprintf(text, L"%s [v%i]", TranslateW(LANG_STATUS_PRIVATE), context->protocol_version); + mir_snwprintf(text, L"%s [v%i]", TranslateW(LANG_STATUS_PRIVATE), context->protocol_version); Menu_ModifyItem(hStatusInfoItem, text, IcoLib_GetIconHandle(ICON_PRIVATE)); break; case TRUST_UNVERIFIED: - mir_sntprintf(text, L"%s [v%i]", TranslateW(LANG_STATUS_UNVERIFIED), context->protocol_version); + mir_snwprintf(text, L"%s [v%i]", TranslateW(LANG_STATUS_UNVERIFIED), context->protocol_version); Menu_ModifyItem(hStatusInfoItem, text, IcoLib_GetIconHandle(ICON_UNVERIFIED)); break; diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index a3a4d04ec0..861dec4677 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -21,9 +21,9 @@ void SetFilenames(const wchar_t *path) return; CreateDirectoryTreeT(path); - mir_sntprintf(g_private_key_filename, L"%s\\" _A2W(PRIVATE_KEY_FILENAME), path); - mir_sntprintf(g_fingerprint_store_filename, L"%s\\" _A2W(FINGERPRINT_STORE_FILENAME), path); - mir_sntprintf(g_instag_filename, L"%s\\" _A2W(INSTAG_FILENAME), path); + mir_snwprintf(g_private_key_filename, L"%s\\" _A2W(PRIVATE_KEY_FILENAME), path); + mir_snwprintf(g_fingerprint_store_filename, L"%s\\" _A2W(FINGERPRINT_STORE_FILENAME), path); + mir_snwprintf(g_instag_filename, L"%s\\" _A2W(INSTAG_FILENAME), path); } int FoldersChanged(WPARAM, LPARAM) @@ -161,7 +161,7 @@ static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, CheckDlgButton(hwndDlg, IDC_CHK_ENDOFFLINE, options.end_offline ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHK_ENDCLOSE, options.end_window_close ? BST_CHECKED : BST_UNCHECKED); - prefix = mir_utf8decodeT(options.prefix); + prefix = mir_utf8decodeW(options.prefix); SetDlgItemText(hwndDlg, IDC_ED_PREFIX, prefix); mir_free(prefix); bInit = true; @@ -238,10 +238,10 @@ static unsigned int CALLBACK regen_key_thread(void* param) PROTOREGENKEYOPTIONS *opts = (PROTOREGENKEYOPTIONS *)param; wchar_t buff[512]; - mir_sntprintf(buff, TranslateW(LANG_OTR_ASK_NEWKEY), opts->proto); + mir_snwprintf(buff, TranslateW(LANG_OTR_ASK_NEWKEY), opts->proto); EnableWindow(opts->refresh, FALSE); if (IDYES == MessageBox(opts->refresh, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION|MB_YESNO)) { - char* proto = mir_t2a(opts->proto); + char* proto = mir_u2a(opts->proto); otr_gui_create_privkey(0, proto, proto); mir_free(proto); SendMessage(opts->refresh, WMU_REFRESHPROTOLIST, 0, 0); @@ -332,7 +332,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP char fprint[45]; if (otrl_privkey_fingerprint(otr_user_state, fprint, pppDesc[i]->szModuleName, pppDesc[i]->szModuleName)) { - wchar_t *temp = mir_a2t(fprint); + wchar_t *temp = mir_a2u(fprint); ListView_SetItemText(lv, ilvItem, 2, temp); mir_free(temp); } @@ -360,7 +360,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP wchar_t buff_proto[128]; ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, buff_proto, _countof(buff_proto)); wchar_t buff[512]; - mir_sntprintf(buff, TranslateW(LANG_OTR_ASK_REMOVEKEY), buff_proto); + mir_snwprintf(buff, TranslateW(LANG_OTR_ASK_REMOVEKEY), buff_proto); if (IDYES == MessageBox(hwndDlg, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION | MB_YESNO)) { char *proto = GetProtoName(lv, sel); if (proto == NULL) @@ -745,7 +745,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w wchar_t buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, fp->fingerprint); PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); - mir_sntprintf(buff, TranslateW(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName); + mir_snwprintf(buff, TranslateW(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName); ShowError(buff); } else { @@ -775,7 +775,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w wchar_t buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, it->first->fingerprint); PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); - mir_sntprintf(buff, TranslateW(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName); + mir_snwprintf(buff, TranslateW(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName); ShowError(buff); } else otrl_context_forget_fingerprint(it->first, 1); diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp index da2af8a178..c521025ef2 100644 --- a/plugins/MirOTR/src/otr.cpp +++ b/plugins/MirOTR/src/otr.cpp @@ -57,8 +57,8 @@ INT_PTR CALLBACK GenKeyDlgBoxProc(HWND hWndDlg, UINT msg, WPARAM, LPARAM lParam) TranslateDialogDefault(hWndDlg); SetClassLongPtr(hWndDlg, GCLP_HICON, (LONG_PTR)IcoLib_GetIcon(ICON_OTR, 1)); wchar_t buff[256]; - wchar_t *proto = mir_a2t((char*)lParam); - mir_sntprintf(buff, TranslateW(LANG_GENERATE_KEY), proto); + wchar_t *proto = mir_a2u((char*)lParam); + mir_snwprintf(buff, TranslateW(LANG_GENERATE_KEY), proto); mir_free(proto); SetDlgItemText(hWndDlg, IDC_GENERATE, buff); GenKeyData *data = (GenKeyData *)mir_calloc(sizeof(GenKeyData)); @@ -177,20 +177,20 @@ extern "C" { SetEncryptionStatus(hContact, trusted); wchar_t buff[512]; if (trusted == TRUST_PRIVATE) { - mir_sntprintf(buff, TranslateW(LANG_SESSION_START_OTR), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_START_OTR), contact_get_nameT(hContact)); } else if (trusted == TRUST_UNVERIFIED) { if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context); - mir_sntprintf(buff, TranslateW(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT(hContact)); } else { // should never happen - mir_sntprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); } if (context->protocol_version < MIROTR_PROTO_LATEST){ - size_t remaining = mir_tstrlen(buff); + size_t remaining = mir_wstrlen(buff); wchar_t *offset = buff + remaining; remaining = _countof(buff) - remaining; - mir_sntprintf(offset, remaining, TranslateT("\nusing older protocol version %i"), context->protocol_version); + mir_snwprintf(offset, remaining, TranslateT("\nusing older protocol version %i"), context->protocol_version); } ShowMessage(hContact, buff); @@ -201,7 +201,7 @@ extern "C" { MCONTACT hContact = (UINT_PTR)opdata; DEBUGOUTA("OTR_GUI_GONE_INSECURE\n"); wchar_t buff[512]; - mir_sntprintf(buff, TranslateW(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(hContact)); //MessageBox(0, buff, Translate("OTR Information"), MB_OK); if (!Miranda_Terminated()) { ShowMessage(hContact, buff); @@ -221,27 +221,27 @@ extern "C" { wchar_t buff[1024]; if (!is_reply) { if (trusted == TRUST_PRIVATE) { - mir_sntprintf(buff, TranslateW(LANG_SESSION_CONTINUE_OTR), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_CONTINUE_OTR), contact_get_nameT(hContact)); } else if (trusted == TRUST_UNVERIFIED) { if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context); - mir_sntprintf(buff, TranslateW(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); } else { // should never happen - mir_sntprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); } // opdata is hContact ShowMessage(hContact, buff); } else { if (trusted == TRUST_PRIVATE) { - mir_sntprintf(buff, TranslateW(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT(hContact)); } else if (trusted == TRUST_UNVERIFIED) { - mir_sntprintf(buff, TranslateW(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); } else { // should never happen - mir_sntprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); } } @@ -328,11 +328,11 @@ extern "C" { break; case OTRL_MSGEVENT_ENCRYPTION_REQUIRED: msgfunc = ShowMessageInline; - mir_tstrncpy(msg, TranslateT("Attempting to start a private conversation..."), _countof(msg)); + mir_wstrncpy(msg, TranslateT("Attempting to start a private conversation..."), _countof(msg)); break; case OTRL_MSGEVENT_ENCRYPTION_ERROR: msgfunc = ShowMessageInline; - mir_tstrncpy(msg, TranslateT("An error occurred when encrypting your message.\nThe message was not sent"), _countof(msg)); + mir_wstrncpy(msg, TranslateT("An error occurred when encrypting your message.\nThe message was not sent"), _countof(msg)); break; case OTRL_MSGEVENT_CONNECTION_ENDED: msgfunc = ShowMessageInline; @@ -346,14 +346,14 @@ extern "C" { mir_snwprintf(msg, _countof(msg), TranslateT("Error setting up private conversation: %s"), TranslateT("Malformed message received")); break; default:{ - wchar_t* tmp = mir_utf8decodeT(gcry_strerror(err)); + wchar_t* tmp = mir_utf8decodeW(gcry_strerror(err)); mir_snwprintf(msg, _countof(msg), TranslateT("Error setting up private conversation: %s"), tmp); mir_free(tmp); } } break; case OTRL_MSGEVENT_MSG_REFLECTED: // title = TranslateT("OTR Error"); - mir_tstrncpy(msg, TranslateT("We are receiving our own OTR messages.\nYou are either trying to talk to yourself, or someone is reflecting your messages back at you"), _countof(msg)); + mir_wstrncpy(msg, TranslateT("We are receiving our own OTR messages.\nYou are either trying to talk to yourself, or someone is reflecting your messages back at you"), _countof(msg)); break; case OTRL_MSGEVENT_MSG_RESENT: // title = TranslateT("Message resent"); @@ -373,14 +373,14 @@ extern "C" { break; case OTRL_MSGEVENT_RCVDMSG_GENERAL_ERR:{ // title = TranslateT("OTR Error"); - wchar_t* tmp = mir_utf8decodeT(message); - mir_tstrncpy(msg, tmp, _countof(msg)); + wchar_t* tmp = mir_utf8decodeW(message); + mir_wstrncpy(msg, tmp, _countof(msg)); mir_free(tmp); break; } case OTRL_MSGEVENT_RCVDMSG_UNENCRYPTED:{ // title = TranslateT("Received unencrypted message"); msgfunc = ShowMessageInline; - wchar_t* tmp = mir_utf8decodeT(message); + wchar_t* tmp = mir_utf8decodeW(message); mir_snwprintf(msg, _countof(msg), TranslateT("The following message received from '%s' was NOT encrypted:\n\n%s"), contact, tmp); mir_free(tmp); ProtoChainSend(hContact, PSS_MESSAGE, PREF_BYPASS_OTR, (LPARAM)message); @@ -391,7 +391,7 @@ extern "C" { break; default: // title = TranslateT("OTR Error"); - mir_tstrncpy(msg, TranslateT("unknown OTR message received, please report that to Miranda NG developers"), _countof(msg)); + mir_wstrncpy(msg, TranslateT("unknown OTR message received, please report that to Miranda NG developers"), _countof(msg)); } if (msg[0]) msgfunc(hContact, msg); diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp index 8bd87e7dd0..c86d81ef4f 100644 --- a/plugins/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/src/svcs_menu.cpp @@ -31,7 +31,7 @@ int StartOTR(MCONTACT hContact) { LCID langid = Langpack_GetDefaultLocale(); if(langid != 0x0409/*US*/ && langid != 0x1009/*CA*/ && langid != 0x0809/*GB*/){ // non english const wchar_t* translated=TranslateTS(MIROTR_PROTO_HELLO_MSG); - if(mir_tstrcmp(MIROTR_PROTO_HELLO_MSG,translated)){ + if(mir_wstrcmp(MIROTR_PROTO_HELLO_MSG,translated)){ *msgoff++ = '\n'; for(const wchar_t* c=nick; *c && msgoff<msgend; *msgoff++=*c++); for(const wchar_t* c=translated; *c && msgoff<msgend; *msgoff++=*c++); @@ -57,12 +57,12 @@ INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM) hContact = hSub; if ( options.bHaveSecureIM && CallService("SecureIM/IsContactSecured", hContact, 0) != 0 ) { - mir_sntprintf(buff, TranslateW(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact)); ShowError(buff); return 0; } - mir_sntprintf(buff, TranslateW(LANG_SESSION_REQUEST_OTR), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_REQUEST_OTR), contact_get_nameT(hContact)); ShowMessage(hContact, buff); return StartOTR(hContact); @@ -77,12 +77,12 @@ INT_PTR SVC_RefreshOTR(WPARAM hContact, LPARAM) hContact = hSub; if ( options.bHaveSecureIM && CallService("SecureIM/IsContactSecured", hContact, 0) != 0 ) { - mir_sntprintf(buff, 512, TranslateW(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact)); + mir_snwprintf(buff, 512, TranslateW(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact)); ShowError(buff); return 0; } - mir_sntprintf(buff, TranslateW(LANG_SESSION_TRY_CONTINUE_OTR), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_TRY_CONTINUE_OTR), contact_get_nameT(hContact)); ShowMessage(hContact, buff); int res = StartOTR(hContact); @@ -116,7 +116,7 @@ INT_PTR SVC_StopOTR(WPARAM hContact, LPARAM) SetEncryptionStatus(hContact, TRUST_NOT_PRIVATE); wchar_t buff[512]; - mir_sntprintf(buff, TranslateW(LANG_SESSION_TERMINATED_OTR), contact_get_nameT(hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_TERMINATED_OTR), contact_get_nameT(hContact)); ShowMessage(hContact, buff); return 0; } diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp index 375484f775..74934fbfd1 100644 --- a/plugins/MirOTR/src/svcs_proto.cpp +++ b/plugins/MirOTR/src/svcs_proto.cpp @@ -111,7 +111,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam) if (tlv && !Miranda_Terminated()) { /* Notify the user that the other side disconnected. */ wchar_t buff[256]; - mir_sntprintf(buff, TranslateW(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact)); + mir_snwprintf(buff, TranslateW(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact)); SetEncryptionStatus(ccs->hContact, otr_context_get_trust(context)); // required since libotr 4!? ShowMessage(ccs->hContact, buff); } diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index e4fbc217ec..5b10c37451 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -93,11 +93,11 @@ void otrl_privkey_hash_to_humanT(wchar_t human[45], const unsigned char hash[20] char* contact_get_id(MCONTACT hContact, bool bNameOnError) { - ptrT pszUniqueID(Contact_GetInfo(CNF_UNIQUEID, hContact)); + ptrW pszUniqueID(Contact_GetInfo(CNF_UNIQUEID, hContact)); if (!pszUniqueID && bNameOnError) - pszUniqueID = mir_tstrdup(pcli->pfnGetContactDisplayName(hContact, 0)); + pszUniqueID = mir_wstrdup(pcli->pfnGetContactDisplayName(hContact, 0)); - return mir_t2a(pszUniqueID); + return mir_u2a(pszUniqueID); } __inline const wchar_t* contact_get_nameT(MCONTACT hContact) { @@ -107,7 +107,7 @@ __inline const wchar_t* contact_get_nameT(MCONTACT hContact) { wchar_t* ProtoGetNickname(const char* proto) { wchar_t *p = Contact_GetInfo(CNF_NICK, NULL, proto); - return (p != NULL) ? p : mir_tstrdup(L""); + return (p != NULL) ? p : mir_wstrdup(L""); } void ShowPopup(const wchar_t* line1, const wchar_t* line2, int timeout, const MCONTACT hContact) { @@ -115,12 +115,12 @@ void ShowPopup(const wchar_t* line1, const wchar_t* line2, int timeout, const MC if ( !options.bHavePopups) { wchar_t title[256]; - mir_sntprintf(title, L"%s Message", _A2W(MODULENAME)); + mir_snwprintf(title, L"%s Message", _A2W(MODULENAME)); if(line1 && line2) { - int size = int(mir_tstrlen(line1) + mir_tstrlen(line2) + 3); + int size = int(mir_wstrlen(line1) + mir_wstrlen(line2) + 3); wchar_t *message = new wchar_t[size]; // newline and null terminator - mir_sntprintf(message, size, L"%s\r\n%s", line1, line2); + mir_snwprintf(message, size, L"%s\r\n%s", line1, line2); MessageBox( NULL, message, title, MB_OK | MB_ICONINFORMATION ); delete[] message; } else if(line1) { @@ -165,15 +165,15 @@ void ShowWarning(wchar_t *msg) { if(disp == ED_POP && !options.bHavePopups) disp = ED_BAL; if(disp == ED_BAL && !ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) disp = ED_MB; - mir_sntprintf(buffer, L"%s Warning", _A2W(MODULENAME)); + mir_snwprintf(buffer, L"%s Warning", _A2W(MODULENAME)); switch(disp) { case ED_POP: { - int size = int(mir_tstrlen(msg) + 515); + int size = int(mir_wstrlen(msg) + 515); wchar_t *message = new wchar_t[size]; // newline and null terminator - mir_sntprintf(message, size, L"%s\r\n%s", buffer, msg); + mir_snwprintf(message, size, L"%s\r\n%s", buffer, msg); PUShowMessageT(message, SM_WARNING); delete[] message; } @@ -211,16 +211,16 @@ void ShowError(wchar_t *msg) { if(disp == ED_POP && !options.bHavePopups) disp = ED_BAL; if(disp == ED_BAL && !ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) disp = ED_MB; - mir_sntprintf(buffer, L"%s Error", _A2W(MODULENAME)); + mir_snwprintf(buffer, L"%s Error", _A2W(MODULENAME)); wchar_t *message; switch(disp) { case ED_POP: { - int size = int(mir_tstrlen(msg) + 515); + int size = int(mir_wstrlen(msg) + 515); message = new wchar_t[size]; // newline and null terminator - mir_sntprintf(message, size, L"%s\r\n%s", buffer, msg); + mir_snwprintf(message, size, L"%s\r\n%s", buffer, msg); PUShowMessageT(message, SM_WARNING); delete[] message; } @@ -249,27 +249,27 @@ void ShowError(wchar_t *msg) { void ShowPopupUtf(const char* line1, const char* line2, int timeout, const MCONTACT hContact) { - wchar_t* l1 = (line1) ? mir_utf8decodeT(line1) : NULL; - wchar_t* l2 = (line2) ? mir_utf8decodeT(line2) : NULL; + wchar_t* l1 = (line1) ? mir_utf8decodeW(line1) : NULL; + wchar_t* l2 = (line2) ? mir_utf8decodeW(line2) : NULL; ShowPopup(l1, l2, timeout, hContact); if (l1) mir_free(l1); if (l2) mir_free(l2); } void ShowWarningUtf(char* msg) { - wchar_t* m = (msg) ? mir_utf8decodeT(msg) : NULL; + wchar_t* m = (msg) ? mir_utf8decodeW(msg) : NULL; ShowWarning(m); if (m) mir_free(m); } void ShowErrorUtf(char* msg) { - wchar_t* m = (msg) ? mir_utf8decodeT(msg) : NULL; + wchar_t* m = (msg) ? mir_utf8decodeW(msg) : NULL; ShowError(m); if (m) mir_free(m); } void ShowMessageInline(const MCONTACT hContact, const wchar_t *msg) { wchar_t buff[1024]; - mir_sntprintf(buff, L"%s%s", _A2W(LANG_INLINE_PREFIX), msg); + mir_snwprintf(buff, L"%s%s", _A2W(LANG_INLINE_PREFIX), msg); T2Utf utf(buff); PROTORECVEVENT pre = {0}; @@ -321,13 +321,13 @@ const wchar_t *policy_to_string(OtrlPolicy policy) { } OtrlPolicy policy_from_string(const wchar_t *polstring) { - if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_NEVER)) == 0) + if (mir_wstrcmp(polstring, TranslateW(LANG_POLICY_NEVER)) == 0) return OTRL_POLICY_NEVER; - else if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_OPP)) == 0) + else if (mir_wstrcmp(polstring, TranslateW(LANG_POLICY_OPP)) == 0) return OTRL_POLICY_OPPORTUNISTIC; - else if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_MANUAL)) == 0) + else if (mir_wstrcmp(polstring, TranslateW(LANG_POLICY_MANUAL)) == 0) return OTRL_POLICY_MANUAL_MOD; - else if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_ALWAYS)) == 0) + else if (mir_wstrcmp(polstring, TranslateW(LANG_POLICY_ALWAYS)) == 0) return OTRL_POLICY_ALWAYS; else return CONTACT_DEFAULT_POLICY; diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index b914945698..436881080f 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -1127,7 +1127,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) // fetch the network name if (gcd->iType == GC_EVENT_CHANGESESSIONAME) { - if (gcd->ptszID && !mir_tstrcmpi(gcd->ptszID, L"Network log")) { + if (gcd->ptszID && !mir_wstrcmpi(gcd->ptszID, L"Network log")) { pIRCCon->strNetwork = toTstring(gce->ptszText); TRACE(L"\t Found network identifier: %s\n", pIRCCon->strNetwork.c_str()); return 0; @@ -1149,7 +1149,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) if (pos != tstring::npos) strChannel = strChannel.substr(0, pos - 1); else { - if (mir_tstrcmpi(gcd->ptszID, L"Network log")) + if (mir_wstrcmpi(gcd->ptszID, L"Network log")) TRACE(L"\t WARNING: ignoring unknown event!\n"); return 0; } diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index 46cd677105..5903b8f2ca 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -338,9 +338,9 @@ void CConfig::LoadFontSettings(int iFont) mir_snprintf(szSetting, "Font%dName", iFont);
DBVARIANT dbv;
if (db_get_ts(NULL, "MirandaG15", szSetting, &dbv))
- mir_tstrcpy(m_logfont[iFont].lfFaceName, L"Small Fonts");
+ mir_wstrcpy(m_logfont[iFont].lfFaceName, L"Small Fonts");
else {
- mir_tstrcpy(m_logfont[iFont].lfFaceName, dbv.ptszVal);
+ mir_wstrcpy(m_logfont[iFont].lfFaceName, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index 69a7e1e972..d8bd87325d 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -502,7 +502,7 @@ bool CContactList::CompareEntries(CListEntry<CContactListEntry*,CContactListGrou else if(pLeftEntry->iStatus != pRightEntry->iStatus)
return (aiStatusPriority[pLeftEntry->iStatus - ID_STATUS_OFFLINE] > aiStatusPriority[pRightEntry->iStatus - ID_STATUS_OFFLINE]);
else
- return mir_tstrcmpi(pLeftEntry->strName.c_str(),pRightEntry->strName.c_str())<0;
+ return mir_wstrcmpi(pLeftEntry->strName.c_str(),pRightEntry->strName.c_str())<0;
}
else if(pLeft->GetType() == ITEM && pRight->GetType() == CONTAINER)
return false;
@@ -520,7 +520,7 @@ bool CContactList::CompareEntries(CListEntry<CContactListEntry*,CContactListGrou else if (pGroup1->iEvents && pGroup2->iEvents)
return (pGroup1->iEvents > pGroup2->iEvents);
else
- return mir_tstrcmpi(pGroup1->strName.c_str(),pGroup2->strName.c_str())<0;
+ return mir_wstrcmpi(pGroup1->strName.c_str(),pGroup2->strName.c_str())<0;
}
return false;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp index 7d874a7a33..f7bed6776c 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp @@ -302,7 +302,7 @@ void CLCDGfx::DrawText(int nX, int nY, LPCTSTR sText) dtp.cbSize = sizeof(DRAWTEXTPARAMS);
RECT rBounds = {nX,nY,GetClipWidth(),GetClipHeight()};
- DrawTextEx(m_hDC, (LPTSTR)sText, (int)mir_tstrlen(sText), &rBounds, (DT_LEFT | DT_NOPREFIX), &dtp);
+ DrawTextEx(m_hDC, (LPTSTR)sText, (int)mir_wstrlen(sText), &rBounds, (DT_LEFT | DT_NOPREFIX), &dtp);
// restores
SetMapMode(m_hDC, nOldMapMode);
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp index b18452a7d8..b170f9d704 100644 --- a/plugins/MobileState/src/main.cpp +++ b/plugins/MobileState/src/main.cpp @@ -54,7 +54,7 @@ bool hasMobileClient(MCONTACT hContact, LPARAM) {
char *proto = GetContactProto(hContact);
- ptrT client(db_get_tsa(hContact, proto, "MirVer"));
+ ptrW client(db_get_tsa(hContact, proto, "MirVer"));
if (client) {
// Make client lower-case
wcslwr(client);
diff --git a/plugins/ModernOpt/src/modernopt.cpp b/plugins/ModernOpt/src/modernopt.cpp index 8ef64ff744..9f7716d456 100644 --- a/plugins/ModernOpt/src/modernopt.cpp +++ b/plugins/ModernOpt/src/modernopt.cpp @@ -121,7 +121,7 @@ static int ModernOptionsObject_Comparator(const ModernOptionsObject *ptr1, const if (obj1->optObject.lptzSubsection && obj2->optObject.lptzSubsection)
{
- int c = mir_tstrcmp(obj1->optObject.lptzSubsection, obj2->optObject.lptzSubsection);
+ int c = mir_wstrcmp(obj1->optObject.lptzSubsection, obj2->optObject.lptzSubsection);
if (c) return c;
}
@@ -376,7 +376,7 @@ static int lstrcmp_null(wchar_t *p1, wchar_t *p2) if (!p1 && !p2) return 0;
if (!p1) return -1;
if (!p2) return 1;
- return mir_tstrcmp(p1, p2);
+ return mir_wstrcmp(p1, p2);
}
static void ModernOptUI_ShowPage(HWND hwndDlg, struct ModernOptionsData *dat, int iPage)
@@ -540,14 +540,14 @@ static INT_PTR svcModernOpt_AddObject(WPARAM wParam, LPARAM lParam) case MODERNOPT_TYPE_SUBSECTIONPAGE:
objCopy->optObject.lptzSubsection = (objCopy->optObject.dwFlags & MODEROPT_FLG_UNICODE) ?
- mir_u2t(obj->lpwzSubsection) :
- mir_a2t(obj->lpzSubsection);
+ mir_wstrdup(obj->lpwzSubsection) :
+ mir_a2u(obj->lpzSubsection);
break;
case MODERNOPT_TYPE_IGNOREOBJECT:
objCopy->optObject.lptzSubsection = (objCopy->optObject.dwFlags & MODEROPT_FLG_UNICODE) ?
- mir_u2t(obj->lpwzSubsection) :
- mir_a2t(obj->lpzSubsection);
+ mir_wstrdup(obj->lpwzSubsection) :
+ mir_a2u(obj->lpzSubsection);
objCopy->optObject.lpzIgnoreModule = mir_strdup(obj->lpzIgnoreModule);
objCopy->optObject.lpzIgnoreSetting = mir_strdup(obj->lpzIgnoreSetting);
objCopy->optObject.dwIgnoreBit = obj->dwIgnoreBit;
@@ -559,8 +559,8 @@ static INT_PTR svcModernOpt_AddObject(WPARAM wParam, LPARAM lParam) objCopy->optObject.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT_SKINS);
objCopy->optObject.pfnDlgProc = ModernOptSelector_DlgProc;
objCopy->optObject.lptzSubsection = (objCopy->optObject.dwFlags & MODEROPT_FLG_UNICODE) ?
- mir_u2t(obj->lpwzSubsection) :
- mir_a2t(obj->lpzSubsection);
+ mir_wstrdup(obj->lpwzSubsection) :
+ mir_a2u(obj->lpzSubsection);
objCopy->optObject.lpzThemeExtension = mir_strdup(obj->lpzThemeExtension);
objCopy->optObject.lpzThemeModuleName = mir_strdup(obj->lpzThemeModuleName);
break;
diff --git a/plugins/ModernOpt/src/mopt_selector.cpp b/plugins/ModernOpt/src/mopt_selector.cpp index 5e97984584..24c7ebb47c 100644 --- a/plugins/ModernOpt/src/mopt_selector.cpp +++ b/plugins/ModernOpt/src/mopt_selector.cpp @@ -81,7 +81,7 @@ struct TSkinListItem TSkinListItem(wchar_t *fn)
{
- title = mir_tstrdup(fn);
+ title = mir_wstrdup(fn);
if (wchar_t *p = wcsrchr(title, '.'))
*p = 0;
@@ -91,9 +91,9 @@ struct TSkinListItem path = (wchar_t *)mir_alloc(MAX_PATH * sizeof(wchar_t));
PathToRelativeT(curPath, path);
- size_t length = mir_tstrlen(curPath) + mir_tstrlen(fn) + 2;
+ size_t length = mir_wstrlen(curPath) + mir_wstrlen(fn) + 2;
filename = (wchar_t *)mir_alloc(length * sizeof(wchar_t));
- mir_sntprintf(filename, length, L"%s\\%s", curPath, fn);
+ mir_snwprintf(filename, length, L"%s\\%s", curPath, fn);
}
~TSkinListItem()
@@ -123,8 +123,8 @@ struct TSelectorData static bool CheckExt(wchar_t *fn, wchar_t *ext, int n)
{
- size_t l = mir_tstrlen(fn);
- return (l > n) && !mir_tstrcmp(fn + l - n, ext);
+ size_t l = mir_wstrlen(fn);
+ return (l > n) && !mir_wstrcmp(fn + l - n, ext);
}
static void BuildSkinList(HWND hwndList, wchar_t *szExt, int nExtLength = -1, bool start = true)
@@ -135,7 +135,7 @@ static void BuildSkinList(HWND hwndList, wchar_t *szExt, int nExtLength = -1, bo if (wchar_t *p = wcsrchr(mirPath, '\\')) *p = 0;
SetCurrentDirectory(mirPath);
SendMessage(hwndList, LB_RESETCONTENT, 0, 0);
- nExtLength = (int)mir_tstrlen(szExt);
+ nExtLength = (int)mir_wstrlen(szExt);
SendMessage(hwndList, WM_SETREDRAW, FALSE, 0);
}
@@ -143,7 +143,7 @@ static void BuildSkinList(HWND hwndList, wchar_t *szExt, int nExtLength = -1, bo HANDLE h = FindFirstFile(L"*.*", &ffd);
if (h != INVALID_HANDLE_VALUE) {
do {
- if (!mir_tstrcmp(ffd.cFileName, L"") || !mir_tstrcmp(ffd.cFileName, L".") || !mir_tstrcmp(ffd.cFileName, L".."))
+ if (!mir_wstrcmp(ffd.cFileName, L"") || !mir_wstrcmp(ffd.cFileName, L".") || !mir_wstrcmp(ffd.cFileName, L".."))
continue;
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
@@ -300,7 +300,7 @@ INT_PTR CALLBACK ModernOptSelector_DlgProc(HWND hwndDlg, UINT msg, WPARAM wPara int cxIcon = GetSystemMetrics(SM_CXSMICON);
int cyIcon = GetSystemMetrics(SM_CYSMICON);
- if (sd->active && !mir_tstrcmp(sd->active, dat->filename)) {
+ if (sd->active && !mir_wstrcmp(sd->active, dat->filename)) {
DrawIconEx(lps->hDC, lps->rcItem.left, (lps->rcItem.top + lps->rcItem.bottom - cyIcon) / 2,
Skin_LoadIcon(SKINICON_OTHER_EMPTYBLOB),
cxIcon, cyIcon, 0, NULL, DI_NORMAL);
diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp index 56f1d5b2cc..01f6807f53 100644 --- a/plugins/MsgPopup/src/main.cpp +++ b/plugins/MsgPopup/src/main.cpp @@ -87,8 +87,8 @@ void popupMessage(LPCTSTR lpText, LPCTSTR lpCaption, UINT uType) ppd.iSeconds = options.Timeout[indx];
ppd.lchIcon = (HICON)LoadImage(NULL, MAKEINTRESOURCE(iIcon), IMAGE_ICON, SM_CXSMICON, SM_CYSMICON, LR_SHARED);
- mir_tstrcpy(ppd.lptzContactName, lpCaption);
- mir_tstrcpy(ppd.lptzText, lpText);
+ mir_wstrcpy(ppd.lptzContactName, lpCaption);
+ mir_wstrcpy(ppd.lptzText, lpText);
PUAddPopupT(&ppd);
if (options.Sound)
MessageBeep(uType);
@@ -135,7 +135,7 @@ void HookOnImport(HMODULE hModule, char *lpszImpModName, PVOID lpOrigFunc, PVOID wchar_t buf[200];
g_HookError = TRUE;
- mir_sntprintf(buf, TranslateT("VirtualProtect failed. Code %d\nTry to call the author"), GetLastError());
+ mir_snwprintf(buf, TranslateT("VirtualProtect failed. Code %d\nTry to call the author"), GetLastError());
prevMessageBox(0, buf, TranslateT("Error"), MB_OK);
}
}
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index ecc4f8305c..f8b48d7ece 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -258,7 +258,7 @@ int CLStreamRTFInfo::nLoadFileStream(LPBYTE pbBuff, LONG cb) }
dwCurrent += nWriteHeader((char*)pbBuff, cb);
- tstring sMyNick = ptrT(GetMyOwnNick(hContact));
+ tstring sMyNick = ptrW(GetMyOwnNick(hContact));
nNickLen = WideCharToMultiByte(bUtf8File ? CP_UTF8 : CP_ACP, 0, sMyNick.c_str(), (int)sMyNick.length(), szMyNick, sizeof(szMyNick), NULL, NULL);
}
@@ -621,9 +621,9 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) wchar_t szTmp[1500];
if (nDBCount == -1)
- mir_sntprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nContact handle is invalid"), pclDlg->sPath.c_str());
+ mir_snwprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nContact handle is invalid"), pclDlg->sPath.c_str());
else
- mir_sntprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events"), pclDlg->sPath.c_str(), nDBCount);
+ mir_snwprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events"), pclDlg->sPath.c_str(), nDBCount);
SETTEXTEX stText = { 0 };
stText.codepage = 1200;
@@ -670,7 +670,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) CloseHandle(hFile);
wchar_t szTmp[100];
- mir_sntprintf(szTmp, L"File open time %d\n", GetTickCount() - dwStart);
+ mir_snwprintf(szTmp, L"File open time %d\n", GetTickCount() - dwStart);
OutputDebugString(szTmp);
GETTEXTLENGTHEX sData = { 0 };
@@ -682,7 +682,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) if (!bScrollToBottom)
SendMessage(hRichEdit, EM_SETSCROLLPOS, 0, (LPARAM)&ptOldPos);
- mir_sntprintf(szTmp, TranslateT("With scroll to bottom %d\n"), GetTickCount() - dwStart);
+ mir_snwprintf(szTmp, TranslateT("With scroll to bottom %d\n"), GetTickCount() - dwStart);
OutputDebugString(szTmp);
return true;
}
@@ -828,7 +828,7 @@ LRESULT CALLBACK EditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa }
}
ft.chrg.cpMin = LONG(res);
- ft.chrg.cpMax = LONG(res + mir_tstrlen(fr->lpstrFindWhat));
+ ft.chrg.cpMax = LONG(res + mir_wstrlen(fr->lpstrFindWhat));
SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&ft.chrg);
return 0;
}
@@ -908,7 +908,7 @@ void SetRichEditFont(HWND hRichEdit, bool bUseSyntaxHL) ncf.dwMask = CFM_BOLD | CFM_FACE | CFM_ITALIC | CFM_SIZE | CFM_UNDERLINE;
ncf.dwEffects = db_get_dw(NULL, MODULE, szFileViewDB "TEffects", 0);
ncf.yHeight = db_get_dw(NULL, MODULE, szFileViewDB "THeight", 165);
- mir_tstrcpy(ncf.szFaceName, _DBGetString(NULL, MODULE, szFileViewDB "TFace", L"Courier New").c_str());
+ mir_wstrcpy(ncf.szFaceName, _DBGetString(NULL, MODULE, szFileViewDB "TFace", L"Courier New").c_str());
if (!bUseSyntaxHL) {
ncf.dwMask |= CFM_COLOR;
@@ -988,7 +988,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, if (n != sPath.npos)
sPath.erase(0, n + 1);
- if (mir_sntprintf(szTitle, szFormat, pszNick, sPath.c_str(), (pclDlg->bUtf8File ? L"UTF8" : L"ANSI")) > 0)
+ if (mir_snwprintf(szTitle, szFormat, pszNick, sPath.c_str(), (pclDlg->bUtf8File ? L"UTF8" : L"ANSI")) > 0)
SetWindowText(hwndDlg, szTitle);
}
@@ -1036,7 +1036,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, lf.lfStrikeOut = (dwEffects & CFE_STRIKEOUT) != 0;
lf.lfItalic = (dwEffects & CFE_ITALIC) != 0;
- mir_tstrcpy(lf.lfFaceName, _DBGetString(NULL, MODULE, szFileViewDB "TFace", L"Courier New").c_str());
+ mir_wstrcpy(lf.lfFaceName, _DBGetString(NULL, MODULE, szFileViewDB "TFace", L"Courier New").c_str());
CHOOSEFONT cf = { 0 };
cf.lStructSize = sizeof(cf);
cf.hwndOwner = hwndDlg;
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index bbcd2d8513..0b3faed0f8 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -92,7 +92,7 @@ public: int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
if (lParamSort == 1)
- return mir_tstrcmpi(pcli->pfnGetContactDisplayName(lParam1, 0), pcli->pfnGetContactDisplayName(lParam2, 0));
+ return mir_wstrcmpi(pcli->pfnGetContactDisplayName(lParam1, 0), pcli->pfnGetContactDisplayName(lParam2, 0));
if (lParamSort == 2)
return _DBGetString((MCONTACT)lParam1, "Protocol", "p", L"").compare(_DBGetString((MCONTACT)lParam2, "Protocol", "p", L""));
@@ -322,7 +322,7 @@ BOOL bApplyChanges(HWND hwndDlg) int nTmp = GetDlgItemInt(hwndDlg, IDC_MAX_CLOUMN_WIDTH, &bTrans, TRUE);
if (!bTrans || nTmp < 5) {
- mir_sntprintf(szTemp, TranslateT("Max line width must be at least %d"), 5);
+ mir_snwprintf(szTemp, TranslateT("Max line width must be at least %d"), 5);
MessageBox(hwndDlg, szTemp, MSG_BOX_TITEL, MB_OK);
bRet = false;
}
@@ -365,7 +365,7 @@ BOOL bApplyChanges(HWND hwndDlg) if (ListView_GetItem(hMapUser, &sItem)) {
MCONTACT hUser = (MCONTACT)sItem.lParam;
- if (mir_tstrlen(szTemp) > 0)
+ if (mir_wstrlen(szTemp) > 0)
db_set_ts(hUser, MODULE, "FileName", szTemp);
else
db_unset(hUser, MODULE, "FileName");
@@ -461,7 +461,7 @@ void AutoFindeFileNames(HWND hwndDlg) sItem.pszText = szSubCur;
sItem.cchTextMax = _countof(szSubCur);
if (ListView_GetItem(hMapUser, &sItem)) {
- size_t nLen = mir_tstrlen(szSubCur);
+ size_t nLen = mir_wstrlen(szSubCur);
if (wcsnicmp(szSubCur, szSearch, nLen) == 0) {
if (nLen < (size_t)nShortestMatch) {
nShortestMatch = (int)nLen;
@@ -523,7 +523,7 @@ void OpenHelp(HWND hwndDlg) {
wchar_t szPath[MAX_PATH];
if (GetModuleFileName(hInstance, szPath, _countof(szPath))) {
- size_t nLen = mir_tstrlen(szPath);
+ size_t nLen = mir_wstrlen(szPath);
if (nLen > 3) {
szPath[nLen - 1] = 't';
szPath[nLen - 2] = 'x';
@@ -643,7 +643,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar DWORD dwUIN = db_get_dw(hContact, pa->szModuleName, "UIN", 0);
wchar_t szTmp[50];
- mir_sntprintf(szTmp, L"%d", dwUIN);
+ mir_snwprintf(szTmp, L"%d", dwUIN);
sItem.iSubItem = 3;
sItem.pszText = szTmp;
ListView_SetItem(hMapUser, &sItem);
@@ -793,7 +793,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar GetDlgItemText(hwndDlg, IDC_FILE_VIEWER, szFile, _countof(szFile));
wchar_t buf[MAX_PATH];
- mir_sntprintf(buf, L"%s (*.exe;*.com;*.bat;*.cmd)%c*.exe;*.com;*.bat;*.cmd%c%s (*.*)%c*.*%c%c", TranslateT("Executable files"), 0, 0, TranslateT("All files"), 0, 0, 0);
+ mir_snwprintf(buf, L"%s (*.exe;*.com;*.bat;*.cmd)%c*.exe;*.com;*.bat;*.cmd%c%s (*.*)%c*.*%c%c", TranslateT("Executable files"), 0, 0, TranslateT("All files"), 0, 0, 0);
{
OPENFILENAME ofn = {}; // common dialog box structure
ofn.lStructSize = sizeof(OPENFILENAME);
@@ -843,7 +843,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar LPITEMIDLIST psItemIDList = SHBrowseForFolder(&sBrowseInfo);
if (psItemIDList) {
SHGetPathFromIDList(psItemIDList, lpDestDir);
- size_t n = mir_tstrlen(lpDestDir);
+ size_t n = mir_wstrlen(lpDestDir);
if (n > 0 && lpDestDir[n] != '\\') {
lpDestDir[n] = '\\';
lpDestDir[n + 1] = 0;
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index c485229adc..686b006ffb 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -198,7 +198,7 @@ void DisplayLastError(const wchar_t *pszError) DWORD error = GetLastError();
wchar_t szTemp[50];
- mir_sntprintf(szTemp, L"\r\nErrorCode: %d\r\n", error);
+ mir_snwprintf(szTemp, L"\r\nErrorCode: %d\r\n", error);
sError += szTemp;
sError += sGetErrorString(error);
MessageBox(NULL, sError.c_str(), MSG_BOX_TITEL, MB_OK);
@@ -274,7 +274,7 @@ void ReplaceAll(tstring &sSrc, const wchar_t *pszReplace, const tstring &sNew) {
string::size_type nCur = 0;
while ((nCur = sSrc.find(pszReplace, nCur)) != sSrc.npos) {
- sSrc.replace(nCur, mir_tstrlen(pszReplace), sNew);
+ sSrc.replace(nCur, mir_wstrlen(pszReplace), sNew);
nCur += sNew.size();
}
}
@@ -368,13 +368,13 @@ static bool bWriteTextToFile(HANDLE hFile, const wchar_t *pszSrc, bool bUtf8File {
if (nLen != -1) {
wchar_t *tmp = (wchar_t*)alloca(sizeof(wchar_t)*(nLen + 1));
- mir_tstrncpy(tmp, pszSrc, nLen + 1);
+ mir_wstrncpy(tmp, pszSrc, nLen + 1);
pszSrc = tmp;
}
if (!bUtf8File) {
// We need to downgrade text to ansi
- ptrA pszAstr(mir_t2a(pszSrc));
+ ptrA pszAstr(mir_u2a(pszSrc));
return bWriteToFile(hFile, pszAstr, -1);
}
@@ -464,7 +464,7 @@ bool bWriteHexToFile(HANDLE hFile, void * pData, int nSize) bool bReadMirandaDirAndPath()
{
wchar_t szDBPath[MAX_PATH], tmp[MAX_PATH];
- mir_tstrcpy(szDBPath, pszDbPathError);
+ mir_wstrcpy(szDBPath, pszDbPathError);
PathToAbsoluteT(L"miranda32.exe", tmp);
sMirandaPath = tmp;
sMirandaPath.erase(sMirandaPath.find_last_of(L"\\"));
@@ -562,7 +562,7 @@ tstring GetFilePathFromUser(MCONTACT hContact) if (enRenameAction != eDAAutomatic) {
tstring sRemoteUser = pcli->pfnGetContactDisplayName(hContact, 0);
- mir_sntprintf(szTemp,
+ mir_snwprintf(szTemp,
TranslateT("File name for the user \"%s\" has changed!\n\nfrom:\t%s\nto:\t%s\n\nDo you wish to rename file?"),
sRemoteUser.c_str(),
sPrevFileName.c_str(),
@@ -580,7 +580,7 @@ tstring GetFilePathFromUser(MCONTACT hContact) bCreatePathToFile(sFilePath);
while (!MoveFile(sPrevFileName.c_str(), sFilePath.c_str())) {
- mir_sntprintf(szTemp,
+ mir_snwprintf(szTemp,
TranslateT("Failed to rename file\n\nfrom:\t%s\nto:\t%s\n\nFailed with error: %s"),
sPrevFileName.c_str(),
sFilePath.c_str(),
@@ -679,7 +679,7 @@ void ReplaceDefines(MCONTACT hContact, tstring & sTarget) tstring sReplaceUin;
if (dwUIN) {
wchar_t sTmp[20];
- mir_sntprintf(sTmp, L"%d", dwUIN);
+ mir_snwprintf(sTmp, L"%d", dwUIN);
sReplaceUin = sTmp;
}
else sReplaceUin = FileNickFromHandle(hContact);
@@ -761,11 +761,11 @@ void ReplaceTimeVariables(tstring &sRet) GetLocalTime(&stTime);
wchar_t sTmp[20];
- mir_sntprintf(sTmp, L"%d", stTime.wYear);
+ mir_snwprintf(sTmp, L"%d", stTime.wYear);
ReplaceAll(sRet, L"%year%", sTmp);
- mir_sntprintf(sTmp, L"%.2d", stTime.wMonth);
+ mir_snwprintf(sTmp, L"%.2d", stTime.wMonth);
ReplaceAll(sRet, L"%month%", sTmp);
- mir_sntprintf(sTmp, L"%.2d", stTime.wDay);
+ mir_snwprintf(sTmp, L"%.2d", stTime.wDay);
ReplaceAll(sRet, L"%day%", sTmp);
}
}
@@ -821,7 +821,7 @@ void DisplayErrorDialog(const wchar_t *pszError, tstring& sFilePath, DBEVENTINFO if (MessageBox(NULL, sError.c_str(), MSG_BOX_TITEL, MB_YESNO) == IDYES) {
OPENFILENAME ofn; // common dialog box structure
wchar_t szFile[260]; // buffer for file name
- mir_tstrcpy(szFile, L"DebugInfo.txt");
+ mir_wstrcpy(szFile, L"DebugInfo.txt");
// Initialize OPENFILENAME
memset(&ofn, 0, sizeof(OPENFILENAME));
@@ -908,7 +908,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) nFirstColumnWidth = 4;
}
else {
- sLocalUser = ptrT(GetMyOwnNick(hContact));
+ sLocalUser = ptrW(GetMyOwnNick(hContact));
sRemoteUser = pcli->pfnGetContactDisplayName(hContact, 0);
nFirstColumnWidth = max(sRemoteUser.size(), clFileTo1ColWidth[sFilePath]);
nFirstColumnWidth = max(sLocalUser.size(), nFirstColumnWidth);
@@ -973,11 +973,11 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) for (int nCur = 0; nCur < 9; nCur++)
ReplaceAll(output, pszReplaceList[nCur], _DBGetString(hContact, sProto.c_str(), pszReplaceListA[nCur], L""));
- ptrT id(Contact_GetInfo(CNF_UNIQUEID, hContact, sProto.c_str()));
+ ptrW id(Contact_GetInfo(CNF_UNIQUEID, hContact, sProto.c_str()));
if (id != NULL)
ReplaceAll(output, L"%UIN%", id);
- mir_sntprintf(szTemp, L"%d", db_get_w(hContact, sProto.c_str(), "Age", 0));
+ mir_snwprintf(szTemp, L"%d", db_get_w(hContact, sProto.c_str(), "Age", 0));
ReplaceAll(output, L"%Age%", szTemp);
szTemp[0] = (wchar_t)db_get_b(hContact, sProto.c_str(), "Gender", 0);
@@ -993,11 +993,11 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) }
// Get time stamp
- int nIndent = mir_sntprintf(szTemp, L"%-*s", nFirstColumnWidth, dbei.flags & DBEF_SENT ? sLocalUser.c_str() : sRemoteUser.c_str());
+ int nIndent = mir_snwprintf(szTemp, L"%-*s", nFirstColumnWidth, dbei.flags & DBEF_SENT ? sLocalUser.c_str() : sRemoteUser.c_str());
TimeZone_ToStringT(dbei.timestamp, sTimeFormat.c_str(), &szTemp[nIndent], _countof(szTemp) - nIndent - 2);
- nIndent = (int)mir_tstrlen(szTemp);
+ nIndent = (int)mir_wstrlen(szTemp);
szTemp[nIndent++] = ' ';
// Write first part of line with name and timestamp
@@ -1075,7 +1075,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) LPGENW("Reason :") };
if (dbei.cbBlob < 8 || dbei.cbBlob > 5000) {
- int n = mir_sntprintf(szTemp, TranslateT("Invalid Database event received. Type %d, size %d"), dbei.eventType, dbei.cbBlob);
+ int n = mir_snwprintf(szTemp, TranslateT("Invalid Database event received. Type %d, size %d"), dbei.eventType, dbei.cbBlob);
if (!bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n))
DisplayErrorDialog(LPGENW("Failed to write Invalid Database event the file :\n"), sFilePath, &dbei);
break;
@@ -1103,7 +1103,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) bWriteNewLine(hFile, nIndent) &&
bWriteTextToFile(hFile, LPGENW("UIN :"), bWriteUTF8Format)) {
DWORD uin = *((PDWORD)(dbei.pBlob));
- int n = mir_sntprintf(szTemp, L"%d", uin);
+ int n = mir_snwprintf(szTemp, L"%d", uin);
if (bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n)) {
char *pszEnd = (char *)(dbei.pBlob + dbei.cbSize);
for (int i = 0; i < nStringCount && pszCurBlobPos < pszEnd; i++) {
@@ -1178,14 +1178,14 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) break;
default:
- int n = mir_sntprintf(szTemp, TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
+ int n = mir_snwprintf(szTemp, TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
if (!bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n))
DisplayErrorDialog(LPGENW("Failed to write Unknown event to the file :\n"), sFilePath, &dbei);
break;
}
}
else {
- int n = mir_sntprintf(szTemp, TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
+ int n = mir_snwprintf(szTemp, TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n);
}
@@ -1380,13 +1380,13 @@ int nContactDeleted(WPARAM wparam, LPARAM /*lparam*/) CloseHandle(hPrevFile);
wchar_t szTemp[500];
- mir_sntprintf(szTemp, L"%s\r\n%s",
+ mir_snwprintf(szTemp, L"%s\r\n%s",
TranslateT("User has been deleted. Do you want to delete the file?"), sFilePath.c_str());
if (enDeleteAction == eDAAutomatic ||
MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_YESNO) == IDYES) {
if (!DeleteFile(sFilePath.c_str())) {
- mir_sntprintf(szTemp,
+ mir_snwprintf(szTemp,
L"%s\r\n%s",
TranslateT("Failed to delete the file"),
sFilePath.c_str());
@@ -1434,5 +1434,5 @@ void SaveSettings() wchar_t* GetMyOwnNick(MCONTACT hContact)
{
wchar_t *p = Contact_GetInfo(CNF_DISPLAY, NULL, GetContactProto(hContact));
- return (p != NULL) ? p : mir_tstrdup(TranslateT("No_Nick"));
+ return (p != NULL) ? p : mir_wstrdup(TranslateT("No_Nick"));
}
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index c9b2a1b0ea..681c2d4f61 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -55,7 +55,7 @@ void DeInitProtocolData() Protocol::Protocol(const char *aName, const wchar_t *descr)
{
mir_strncpy(name, aName, _countof(name));
- mir_tstrncpy(description, descr, _countof(description));
+ mir_wstrncpy(description, descr, _countof(description));
data_changed = true;
@@ -86,9 +86,9 @@ Protocol::~Protocol() void Protocol::lcopystr(wchar_t *dest, wchar_t *src, size_t maxlen)
{
- if (mir_tstrcmp(dest, src) != 0) {
+ if (mir_wstrcmp(dest, src) != 0) {
data_changed = true;
- mir_tstrncpy(dest, src, (DWORD)maxlen);
+ mir_wstrncpy(dest, src, (DWORD)maxlen);
}
}
@@ -134,7 +134,7 @@ int Protocol::GetStatus() else {
wchar_t *p = (tszXStatusName[0] != 0) ? TranslateTS(tszXStatusName) : TranslateT("<no status name>");
if (tszXStatusMessage[0])
- mir_sntprintf(status_name, L"%s: %s", p, tszXStatusMessage);
+ mir_snwprintf(status_name, L"%s: %s", p, tszXStatusMessage);
else
lcopystr(status_name, p, _countof(status_name));
}
@@ -214,11 +214,11 @@ void Protocol::GetStatusMsg(int aStatus, wchar_t *msg, size_t msg_size) if (!CanGetStatusMsg())
lcopystr(msg, L"", msg_size);
else if (aStatus == status && ProtoServiceExists(name, PS_GETMYAWAYMSG)) {
- ptrT tmp((wchar_t *)CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_TCHAR));
+ ptrW tmp((wchar_t *)CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_TCHAR));
lcopystr(msg, tmp == NULL ? L"" : tmp, msg_size);
}
else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSGT)) {
- ptrT tmp((wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)aStatus, (LPARAM)name));
+ ptrW tmp((wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)aStatus, (LPARAM)name));
lcopystr(msg, tmp == NULL ? L"" : tmp, msg_size);
}
}
@@ -286,7 +286,7 @@ int Protocol::GetNickMaxLength() wchar_t* Protocol::GetNick()
{
- ptrT nick(Contact_GetInfo(CNF_DISPLAY, NULL, name));
+ ptrW nick(Contact_GetInfo(CNF_DISPLAY, NULL, name));
lcopystr(nickname, (nick != NULL) ? nick : L"", _countof(nickname));
return nickname;
}
@@ -458,7 +458,7 @@ void ProtocolArray::SetNicks(const wchar_t *nick) if (nick == NULL || nick[0] == '\0')
return;
- mir_tstrncpy(default_nick, nick, _countof(default_nick));
+ mir_wstrncpy(default_nick, nick, _countof(default_nick));
db_set_ts(0, MODULE_NAME, SETTING_DEFAULT_NICK, nick);
@@ -493,18 +493,18 @@ void ProtocolArray::SetStatusMsgs(int status, const wchar_t *message) void ProtocolArray::GetDefaultNick()
{
- ptrT tszNick(db_get_tsa(0, MODULE_NAME, SETTING_DEFAULT_NICK));
+ ptrW tszNick(db_get_tsa(0, MODULE_NAME, SETTING_DEFAULT_NICK));
if (tszNick)
- mir_tstrncpy(default_nick, tszNick, _countof(default_nick));
+ mir_wstrncpy(default_nick, tszNick, _countof(default_nick));
else
default_nick[0] = '\0';
}
void ProtocolArray::GetDefaultAvatar()
{
- ptrT tszFile(db_get_tsa(0, "ContactPhoto", "File"));
+ ptrW tszFile(db_get_tsa(0, "ContactPhoto", "File"));
if (tszFile)
- mir_tstrncpy(default_avatar_file, tszFile, _countof(default_avatar_file));
+ mir_wstrncpy(default_avatar_file, tszFile, _countof(default_avatar_file));
else
default_avatar_file[0] = '\0';
}
@@ -523,7 +523,7 @@ wchar_t *ProtocolArray::GetDefaultStatusMsg(int status) wchar_t *tmp = (wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)status, 0);
if (tmp != NULL) {
- mir_tstrncpy(default_status_message, tmp, _countof(default_status_message));
+ mir_wstrncpy(default_status_message, tmp, _countof(default_status_message));
mir_free(tmp);
}
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 2778f655b9..b392bbc185 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -234,11 +234,11 @@ int CreateFrame() memset(&font_id[i], 0, sizeof(font_id[i]));
font_id[i].cbSize = sizeof(FontIDT);
- mir_tstrncpy(font_id[i].group, LPGENW("My details"), _countof(font_id[i].group));
- mir_tstrncpy(font_id[i].name, font_names[i], _countof(font_id[i].name));
+ mir_wstrncpy(font_id[i].group, LPGENW("My details"), _countof(font_id[i].group));
+ mir_wstrncpy(font_id[i].name, font_names[i], _countof(font_id[i].name));
mir_strncpy(font_id[i].dbSettingsGroup, MODULE_NAME, _countof(font_id[i].dbSettingsGroup));
- mir_tstrncpy(font_id[i].backgroundName, LPGENW("Background"), _countof(font_id[i].backgroundName));
- mir_tstrncpy(font_id[i].backgroundGroup, LPGENW("My details"), _countof(font_id[i].backgroundGroup));
+ mir_wstrncpy(font_id[i].backgroundName, LPGENW("Background"), _countof(font_id[i].backgroundName));
+ mir_wstrncpy(font_id[i].backgroundGroup, LPGENW("My details"), _countof(font_id[i].backgroundGroup));
mir_strncpy(font_id[i].prefix, font_settings[i], _countof(font_id[i].prefix));
@@ -246,7 +246,7 @@ int CreateFrame() font_id[i].deffontsettings.size = -MulDiv(font_sizes[i], GetDeviceCaps(hdc, LOGPIXELSY), 72);
font_id[i].deffontsettings.style = font_styles[i];
font_id[i].deffontsettings.charset = DEFAULT_CHARSET;
- mir_tstrncpy(font_id[i].deffontsettings.szFace, L"Tahoma", _countof(font_id[i].deffontsettings.szFace));
+ mir_wstrncpy(font_id[i].deffontsettings.szFace, L"Tahoma", _countof(font_id[i].deffontsettings.szFace));
font_id[i].order = i;
font_id[i].flags = FIDF_DEFAULTVALID;
FontRegisterT(&font_id[i]);
@@ -493,7 +493,7 @@ RECT GetRect(HDC hdc, RECT rc, const wchar_t *text, const wchar_t *def_text, Pro RECT r_tmp = rc;
// Only first line
- wchar_t *tmp2 = mir_tstrdup(tmp);
+ wchar_t *tmp2 = mir_wstrdup(tmp);
wchar_t *pos = wcschr(tmp2, '\r');
if (pos != NULL)
pos[0] = '\0';
@@ -502,7 +502,7 @@ RECT GetRect(HDC hdc, RECT rc, const wchar_t *text, const wchar_t *def_text, Pro pos[0] = '\0';
if (smileys)
- DRAW_TEXT(hdc, tmp2, (int)mir_tstrlen(tmp2), &r_tmp, uFormat | DT_CALCRECT, proto->name);
+ DRAW_TEXT(hdc, tmp2, (int)mir_wstrlen(tmp2), &r_tmp, uFormat | DT_CALCRECT, proto->name);
else
DrawText(hdc, tmp2, -1, &r_tmp, uFormat | DT_CALCRECT);
@@ -1030,7 +1030,7 @@ void DrawTextWithRect(HDC hdc, const wchar_t *text, const wchar_t *def_text, REC tmp = text;
// Only first line
- wchar_t *tmp2 = mir_tstrdup(tmp);
+ wchar_t *tmp2 = mir_wstrdup(tmp);
wchar_t *pos = wcsrchr(tmp2, '\r');
if (pos != NULL)
pos[0] = '\0';
@@ -1073,7 +1073,7 @@ void DrawTextWithRect(HDC hdc, const wchar_t *text, const wchar_t *def_text, REC }
}
- DRAW_TEXT(hdc, tmp2, (int)mir_tstrlen(tmp2), &r, uFormat, proto->name);
+ DRAW_TEXT(hdc, tmp2, (int)mir_wstrlen(tmp2), &r, uFormat, proto->name);
if (mouse_over)
DrawText(hdc, L" ...", 4, &rc_tmp, uFormat);
@@ -1267,7 +1267,7 @@ void Draw(HWND hwnd, HDC hdc_orig) SelectObject(hdc, hFont[FONT_STATUS]);
SetTextColor(hdc, font_colour[FONT_STATUS]);
- DRAW_TEXT(hdc, proto->status_name, (int)mir_tstrlen(proto->status_name), &rc, uFormat, proto->name);
+ DRAW_TEXT(hdc, proto->status_name, (int)mir_wstrlen(proto->status_name), &rc, uFormat, proto->name);
SelectClipRgn(hdc, NULL);
DeleteObject(rgn);
@@ -1421,7 +1421,7 @@ void ShowProtocolStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto mii.dwTypeData = (wchar_t *)malloc(sizeof(wchar_t) * mii.cch);
GetMenuItemInfo(menu, i, TRUE, &mii);
- if (mir_tstrcmp(mii.dwTypeData, proto->description) == 0)
+ if (mir_wstrcmp(mii.dwTypeData, proto->description) == 0)
submenu = GetSubMenu(menu, i);
free(mii.dwTypeData);
@@ -1478,7 +1478,7 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P // Add this proto to menu
wchar_t tmp[128];
- mir_sntprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
+ mir_snwprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1486,7 +1486,7 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P mii.fType = MFT_STRING;
mii.fState = proto->ListeningToEnabled() ? MFS_CHECKED : 0;
mii.dwTypeData = tmp;
- mii.cch = (int)mir_tstrlen(tmp);
+ mii.cch = (int)mir_wstrlen(tmp);
mii.wID = 1;
if (!proto->CanSetListeningTo())
@@ -1665,7 +1665,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = protocols->Get(i)->description;
- mii.cch = (int)mir_tstrlen(protocols->Get(i)->description);
+ mii.cch = (int)mir_wstrlen(protocols->Get(i)->description);
mii.wID = i + 1;
if (i == data->protocol_number) {
@@ -1716,14 +1716,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // Add this proto to menu
wchar_t tmp[128];
- mir_sntprintf(tmp, TranslateT("Set my avatar for %s..."), proto->description);
+ mir_snwprintf(tmp, TranslateT("Set my avatar for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = tmp;
- mii.cch = (int)mir_tstrlen(tmp);
+ mii.cch = (int)mir_wstrlen(tmp);
mii.wID = 1;
if (!proto->CanSetAvatar()) {
@@ -1756,14 +1756,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // Add this proto to menu
wchar_t tmp[128];
- mir_sntprintf(tmp, TranslateT("Set my nickname for %s..."), proto->description);
+ mir_snwprintf(tmp, TranslateT("Set my nickname for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = tmp;
- mii.cch = (int)mir_tstrlen(tmp);
+ mii.cch = (int)mir_wstrlen(tmp);
mii.wID = 1;
if (!proto->CanSetNick()) {
@@ -1804,14 +1804,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (protocols->CanSetStatusMsgPerProtocol()) {
// Add this proto to menu
- mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), proto->description);
+ mir_snwprintf(tmp, TranslateT("Set my status message for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = tmp;
- mii.cch = (int)mir_tstrlen(tmp);
+ mii.cch = (int)mir_wstrlen(tmp);
mii.wID = 1;
if (!proto->CanSetStatusMsg()) {
@@ -1823,14 +1823,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar }
// Add this to menu
- mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
+ mir_snwprintf(tmp, TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = tmp;
- mii.cch = (int)mir_tstrlen(tmp);
+ mii.cch = (int)mir_wstrlen(tmp);
mii.wID = 2;
if (proto->status == ID_STATUS_OFFLINE) {
@@ -1886,7 +1886,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // Add this proto to menu
wchar_t tmp[128];
- mir_sntprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
+ mir_snwprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1894,7 +1894,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar mii.fType = MFT_STRING;
mii.fState = proto->ListeningToEnabled() ? MFS_CHECKED : 0;
mii.dwTypeData = tmp;
- mii.cch = (int)mir_tstrlen(tmp);
+ mii.cch = (int)mir_wstrlen(tmp);
mii.wID = 5;
if (!proto->CanSetListeningTo())
mii.fState |= MFS_DISABLED;
@@ -1902,14 +1902,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii);
// Add this to menu
- mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
+ mir_snwprintf(tmp, TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = tmp;
- mii.cch = (int)mir_tstrlen(tmp);
+ mii.cch = (int)mir_wstrlen(tmp);
mii.wID = 4;
if (proto->status == ID_STATUS_OFFLINE) {
@@ -1921,14 +1921,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (protocols->CanSetStatusMsgPerProtocol()) {
// Add this proto to menu
- mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), proto->description);
+ mir_snwprintf(tmp, TranslateT("Set my status message for %s..."), proto->description);
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = tmp;
- mii.cch = (int)mir_tstrlen(tmp);
+ mii.cch = (int)mir_wstrlen(tmp);
mii.wID = 3;
if (!proto->CanSetStatusMsg()) {
@@ -1939,14 +1939,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii);
}
- mir_sntprintf(tmp, TranslateT("Set my nickname for %s..."), proto->description);
+ mir_snwprintf(tmp, TranslateT("Set my nickname for %s..."), proto->description);
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = tmp;
- mii.cch = (int)mir_tstrlen(tmp);
+ mii.cch = (int)mir_wstrlen(tmp);
mii.wID = 2;
if (!proto->CanSetNick()) {
@@ -1956,14 +1956,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii);
- mir_sntprintf(tmp, TranslateT("Set my avatar for %s..."), proto->description);
+ mir_snwprintf(tmp, TranslateT("Set my avatar for %s..."), proto->description);
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = tmp;
- mii.cch = (int)mir_tstrlen(tmp);
+ mii.cch = (int)mir_wstrlen(tmp);
mii.wID = 1;
if (!proto->CanSetAvatar()) {
diff --git a/plugins/MyDetails/src/services.cpp b/plugins/MyDetails/src/services.cpp index 30be916a0f..aa474bb453 100644 --- a/plugins/MyDetails/src/services.cpp +++ b/plugins/MyDetails/src/services.cpp @@ -52,15 +52,15 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam bool foundDefNick = true;
for (int i = 1; foundDefNick && i < protocols->GetSize(); i++) {
- if (mir_tstrcmpi(protocols->Get(i)->nickname, nick) != 0) {
+ if (mir_wstrcmpi(protocols->Get(i)->nickname, nick) != 0) {
foundDefNick = false;
break;
}
}
if (foundDefNick)
- if (mir_tstrcmpi(protocols->default_nick, nick) != 0)
- mir_tstrcpy(protocols->default_nick, nick);
+ if (mir_wstrcmpi(protocols->default_nick, nick) != 0)
+ mir_wstrcpy(protocols->default_nick, nick);
}
SetDlgItemText(hwndDlg, IDC_NICKNAME, protocols->default_nick);
@@ -70,7 +70,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam Protocol *proto = protocols->Get(proto_num);
wchar_t tmp[128];
- mir_sntprintf(tmp, TranslateT("Set my nickname for %s"), proto->description);
+ mir_snwprintf(tmp, TranslateT("Set my nickname for %s"), proto->description);
SetWindowText(hwndDlg, tmp);
@@ -188,13 +188,13 @@ INT_PTR PluginCommand_GetMyNickname(WPARAM wParam, LPARAM lParam) char *proto = (char *)wParam;
if (proto == NULL) {
- mir_tstrncpy(ret, protocols->default_nick, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE);
+ mir_wstrncpy(ret, protocols->default_nick, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE);
return 0;
}
else {
Protocol *protocol = protocols->Get(proto);
if (protocol != NULL) {
- mir_tstrncpy(ret, protocol->nickname, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE);
+ mir_wstrncpy(ret, protocol->nickname, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE);
return 0;
}
@@ -263,7 +263,7 @@ INT_PTR PluginCommand_GetMyAvatar(WPARAM wParam, LPARAM lParam) return -1;
if (proto == NULL) {
- mir_tstrncpy(ret, protocols->default_avatar_file, MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE);
+ mir_wstrncpy(ret, protocols->default_avatar_file, MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE);
return 0;
}
@@ -274,8 +274,8 @@ INT_PTR PluginCommand_GetMyAvatar(WPARAM wParam, LPARAM lParam) protocols->Get(i)->GetAvatar();
- if (mir_tstrlen(protocols->Get(i)->avatar_file))
- mir_tstrncpy(ret, protocols->Get(i)->avatar_file, MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE);
+ if (mir_wstrlen(protocols->Get(i)->avatar_file))
+ mir_wstrncpy(ret, protocols->Get(i)->avatar_file, MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE);
else
ret[0] = '\0';
@@ -333,7 +333,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w }
wchar_t title[256];
- mir_sntprintf(title, TranslateT("Set my status message for %s"), proto->description);
+ mir_snwprintf(title, TranslateT("Set my status message for %s"), proto->description);
SetWindowText(hwndDlg, title);
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, proto->GetStatusMsg());
@@ -342,7 +342,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w Window_SetProtoIcon_IcoLib(hwndDlg, NULL, data->status);
wchar_t title[256];
- mir_sntprintf(title, TranslateT("Set my status message for %s"), pcli->pfnGetStatusModeDescription(data->status, 0));
+ mir_snwprintf(title, TranslateT("Set my status message for %s"), pcli->pfnGetStatusModeDescription(data->status, 0));
SetWindowText(hwndDlg, title);
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg(data->status));
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 7a86594b43..e80fa4c2c7 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -325,11 +325,11 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM) // the protocol supports status message sending for current status, or autoreplying
if ((Flag1 & PF1_MODEMSGSEND && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iMode)) ||
((Flag1 & PF1_IM) == PF1_IM && (i < 0 || !g_AutoreplyOptPage.GetDBValueCopy(StatusModeList[i].DisableReplyCtlID))))
- mir_sntprintf(szSetStr, TranslateT("Set %s message for the contact"), pcli->pfnGetStatusModeDescription(iMode, 0), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szSetStr, TranslateT("Set %s message for the contact"), pcli->pfnGetStatusModeDescription(iMode, 0), pcli->pfnGetContactDisplayName(hContact, 0));
// the protocol supports status message reading for contact's status
if (Flag1 & PF1_MODEMSGRECV && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iContactMode)) {
- mir_sntprintf(szReadStr, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iContactMode, 0));
+ mir_snwprintf(szReadStr, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iContactMode, 0));
hReadMsgIcon = Skin_LoadProtoIcon(szProto, iContactMode);
}
}
@@ -488,18 +488,18 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) ARGUMENTSINFO *ai = (ARGUMENTSINFO*)lParam;
ai->flags = AIF_DONTPARSE;
TCString Result;
- if (!mir_tstrcmp(ai->targv[0], VAR_AWAYSINCE_TIME)) {
+ if (!mir_wstrcmp(ai->targv[0], VAR_AWAYSINCE_TIME)) {
GetTimeFormat(LOCALE_USER_DEFAULT, 0, g_ProtoStates[VarParseData.szProto].m_awaySince, (ai->argc > 1 && *ai->targv[1]) ? ai->targv[1] : L"H:mm", Result.GetBuffer(256), 256);
Result.ReleaseBuffer();
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_AWAYSINCE_DATE)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_AWAYSINCE_DATE)) {
GetDateFormat(LOCALE_USER_DEFAULT, 0, g_ProtoStates[VarParseData.szProto].m_awaySince, (ai->argc > 1 && *ai->targv[1]) ? ai->targv[1] : NULL, Result.GetBuffer(256), 256);
Result.ReleaseBuffer();
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_STATDESC)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_STATDESC)) {
Result = (VarParseData.Flags & VPF_XSTATUS) ? STR_XSTATUSDESC : pcli->pfnGetStatusModeDescription(g_ProtoStates[VarParseData.szProto].m_status, 0);
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_MYNICK)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_MYNICK)) {
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_MYNICKPERPROTO) && VarParseData.szProto)
Result = db_get_s(NULL, VarParseData.szProto, "Nick", (wchar_t*)NULL);
@@ -509,15 +509,15 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) if (Result == NULL)
Result = TranslateT("Stranger");
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_REQUESTCOUNT)) {
- mir_sntprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MOD_NAME, DB_REQUESTCOUNT, 0));
+ else if (!mir_wstrcmp(ai->targv[0], VAR_REQUESTCOUNT)) {
+ mir_snwprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MOD_NAME, DB_REQUESTCOUNT, 0));
Result.ReleaseBuffer();
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_MESSAGENUM)) {
- mir_sntprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MOD_NAME, DB_MESSAGECOUNT, 0));
+ else if (!mir_wstrcmp(ai->targv[0], VAR_MESSAGENUM)) {
+ mir_snwprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MOD_NAME, DB_MESSAGECOUNT, 0));
Result.ReleaseBuffer();
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_TIMEPASSED)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_TIMEPASSED)) {
ULARGE_INTEGER ul_AwaySince, ul_Now;
SYSTEMTIME st;
GetLocalTime(&st);
@@ -527,14 +527,14 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) ul_Now.QuadPart /= 10000000; // now it's in seconds
Result.GetBuffer(256);
if (ul_Now.LowPart >= 7200) // more than 2 hours
- mir_sntprintf(Result, 256, TranslateT("%d hours"), ul_Now.LowPart / 3600);
+ mir_snwprintf(Result, 256, TranslateT("%d hours"), ul_Now.LowPart / 3600);
else if (ul_Now.LowPart >= 120) // more than 2 minutes
- mir_sntprintf(Result, 256, TranslateT("%d minutes"), ul_Now.LowPart / 60);
+ mir_snwprintf(Result, 256, TranslateT("%d minutes"), ul_Now.LowPart / 60);
else
- mir_sntprintf(Result, 256, TranslateT("%d seconds"), ul_Now.LowPart);
+ mir_snwprintf(Result, 256, TranslateT("%d seconds"), ul_Now.LowPart);
Result.ReleaseBuffer();
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_PREDEFINEDMESSAGE)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_PREDEFINEDMESSAGE)) {
ai->flags = 0; // reset AIF_DONTPARSE flag
if (ai->argc != 2)
return NULL;
@@ -544,7 +544,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) TreeCtrl->DBToMem(CString(MOD_NAME));
for (int i = 0; i < TreeCtrl->m_value.GetSize(); i++) {
- if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP) && !mir_tstrcmpi(TreeCtrl->m_value[i].Title, ai->targv[1])) {
+ if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP) && !mir_wstrcmpi(TreeCtrl->m_value[i].Title, ai->targv[1])) {
Result = TreeCtrl->m_value[i].User_Str1;
break;
}
@@ -552,7 +552,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) if (Result == NULL) // if we didn't find a message with specified title
return NULL; // return it now, as later we change NULL to ""
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_PROTOCOL)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_PROTOCOL)) {
if (VarParseData.szProto) {
CString AnsiResult;
CallProtoService(VarParseData.szProto, PS_GETNAME, 256, (LPARAM)AnsiResult.GetBuffer(256));
@@ -566,7 +566,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) if (!szResult)
return NULL;
- mir_tstrcpy(szResult, (Result != NULL) ? Result : L"");
+ mir_wstrcpy(szResult, (Result != NULL) ? Result : L"");
return (INT_PTR)szResult;
}
diff --git a/plugins/NewAwaySysMod/src/CString.cpp b/plugins/NewAwaySysMod/src/CString.cpp index 58a8826ed9..83c9717ee5 100644 --- a/plugins/NewAwaySysMod/src/CString.cpp +++ b/plugins/NewAwaySysMod/src/CString.cpp @@ -279,7 +279,7 @@ CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{
- ptrT p( db_get_tsa(hContact, szModule, szSetting));
+ ptrW p( db_get_tsa(hContact, szModule, szSetting));
return TCString(p == NULL ? szDefaultValue : p);
}
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index dbee9f8da2..a571f7f2b1 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -149,7 +149,7 @@ int GetRecentGroupID(int iMode) return g_Messages_RecentRootID;
for (int Order = 0; Order < TreeCtrl->m_value.GetSize(); Order++) // find a group named accordingly to the current status
- if (TreeCtrl->m_value[Order].ParentID == g_Messages_RecentRootID && TreeCtrl->m_value[Order].Flags & TIF_GROUP && !mir_tstrcmpi(TreeCtrl->m_value[Order].Title, iMode ? pcli->pfnGetStatusModeDescription(iMode, 0) : MSGTREE_RECENT_OTHERGROUP))
+ if (TreeCtrl->m_value[Order].ParentID == g_Messages_RecentRootID && TreeCtrl->m_value[Order].Flags & TIF_GROUP && !mir_wstrcmpi(TreeCtrl->m_value[Order].Title, iMode ? pcli->pfnGetStatusModeDescription(iMode, 0) : MSGTREE_RECENT_OTHERGROUP))
return TreeCtrl->m_value[Order].ID;
return -1;
diff --git a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp index 913edfe261..4ec48644bb 100644 --- a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp +++ b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp @@ -96,7 +96,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l SIZE size;
wchar_t *szText = (wchar_t*)_alloca(Len * sizeof(wchar_t));
GetWindowText(hWnd, szText, Len);
- GetTextExtentPoint32(hdc, szText, (int)mir_tstrlen(szText), &size);
+ GetTextExtentPoint32(hdc, szText, (int)mir_wstrlen(szText), &size);
rcText.right = size.cx;
rcText.bottom = size.cy;
}
@@ -290,7 +290,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l GetThemeTextExtent(hTheme, hdcMem, BP_GROUPBOX, IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED, szTextT, -1, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE, 0, &rcText);
else {
SIZE size;
- GetTextExtentPoint32(hdcMem, szTextT, (int)mir_tstrlen(szTextT), &size);
+ GetTextExtentPoint32(hdcMem, szTextT, (int)mir_wstrlen(szTextT), &size);
rcText.right = size.cx;
rcText.bottom = size.cy;
}
diff --git a/plugins/NewAwaySysMod/src/Notification.cpp b/plugins/NewAwaySysMod/src/Notification.cpp index 3aaee466f0..e52cdeff3d 100644 --- a/plugins/NewAwaySysMod/src/Notification.cpp +++ b/plugins/NewAwaySysMod/src/Notification.cpp @@ -26,8 +26,8 @@ void ShowMsg(wchar_t *FirstLine, wchar_t *SecondLine, bool IsErrorMsg, int Timeo if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
POPUPDATAT ppd = { 0 };
ppd.lchIcon = LoadIcon(NULL, IsErrorMsg ? IDI_EXCLAMATION : IDI_INFORMATION);
- mir_tstrncpy(ppd.lptzContactName, FirstLine, MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lptzText, SecondLine, MAX_SECONDLINE);
+ mir_wstrncpy(ppd.lptzContactName, FirstLine, MAX_CONTACTNAME);
+ mir_wstrncpy(ppd.lptzText, SecondLine, MAX_SECONDLINE);
ppd.colorBack = IsErrorMsg ? 0x0202E3 : 0xE8F1FD;
ppd.colorText = IsErrorMsg ? 0xE8F1FD : 0x000000;
ppd.iSeconds = Timeout;
@@ -69,7 +69,7 @@ void ShowLog(TCString &LogFilePath) INT_PTR Result = (INT_PTR)ShellExecute(NULL, L"open", LogFilePath, NULL, NULL, SW_SHOW);
if (Result <= 32) {
wchar_t szError[64];
- mir_sntprintf(szError, TranslateT("Error #%d"), Result);
+ mir_snwprintf(szError, TranslateT("Error #%d"), Result);
ShowMsg(szError, TranslateT("Can't open log file ") + LogFilePath, true);
}
}
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp index bc8398e62e..13cf39c03b 100644 --- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp @@ -67,10 +67,10 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam char *szProto = GetContactProto(awayData->hContact);
wchar_t *status = pcli->pfnGetStatusModeDescription(db_get_w(awayData->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, format, status, contactName);
+ mir_snwprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
GetDlgItemText(hwndDlg, IDC_READAWAYMSG_RETRIEVE, format, _countof(format));
- mir_sntprintf(str, format, status);
+ mir_snwprintf(str, format, status);
SetDlgItemText(hwndDlg, IDC_READAWAYMSG_RETRIEVE, str);
}
return true;
diff --git a/plugins/NewAwaySysMod/src/Services.cpp b/plugins/NewAwaySysMod/src/Services.cpp index f961e23d84..36ecd5a7ab 100644 --- a/plugins/NewAwaySysMod/src/Services.cpp +++ b/plugins/NewAwaySysMod/src/Services.cpp @@ -53,7 +53,7 @@ __inline void PSSetStatus(char *szProto, WORD Status, int bNoClistSetStatusMode INT_PTR GetStatusMsgW(WPARAM wParam, LPARAM)
{
LogMessage("MS_AWAYMSG_GETSTATUSMSGW called. status=%d", wParam);
- WCHAR *szMsg = mir_t2u(GetDynamicStatMsg(INVALID_CONTACT_ID, NULL, 0, wParam));
+ WCHAR *szMsg = mir_wstrdup(GetDynamicStatMsg(INVALID_CONTACT_ID, NULL, 0, wParam));
LogMessage("returned szMsgW:\n%S", szMsg ? szMsg : L"NULL");
return (INT_PTR)szMsg;
}
@@ -90,7 +90,7 @@ int GetState(WPARAM wParam, LPARAM lParam, int Widechar) TCString Msg(pi->status ? CProtoSettings(pi->szProto, pi->status).GetMsgFormat(GMF_LASTORDEFAULT) : CProtoSettings(pi->szProto).GetMsgFormat(((Flags & PIF_NOTTEMPORARY) ? 0 : GMF_TEMPORARY) | GMF_PERSONAL));
if (Msg != NULL) {
if (Widechar)
- pi->tszMsg = mir_tstrdup(Msg);
+ pi->tszMsg = mir_wstrdup(Msg);
else
pi->szMsg = mir_strdup(_T2A(Msg));
}
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index 9d0346a124..e2ec9e24a0 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -80,7 +80,7 @@ static LRESULT CALLBACK MsgEditSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, int nLen = GetWindowTextLength(hWnd);
wchar_t *text = (wchar_t*)_alloca((nLen + 1) * sizeof(wchar_t));
GetWindowText(hWnd, text, nLen + 1);
- memmove(text + start, text + end, sizeof(wchar_t)* (mir_tstrlen(text) + 1 - end));
+ memmove(text + start, text + end, sizeof(wchar_t)* (mir_wstrlen(text) + 1 - end));
SetWindowText(hWnd, text);
SendMessage(hWnd, EM_SETSEL, start, start);
@@ -368,7 +368,7 @@ void ApplySelContactsMessage(SetAwayMsgData* dat, CCList *CList, PTREEITEMARRAY HWND hwndDlg = g_SetAwayMsgPage.GetWnd();
GetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, Message.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
Message.ReleaseBuffer();
- if (!mir_tstrlen(Message))
+ if (!mir_wstrlen(Message))
Message = NULL; // delete personal message if it's empty
if (CList) {
@@ -843,7 +843,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA return true;
}
wchar_t BtnTitle[64];
- mir_sntprintf(BtnTitle, TranslateT("Closing in %d"), Countdown);
+ mir_snwprintf(BtnTitle, TranslateT("Closing in %d"), Countdown);
SetDlgItemText(hwndDlg, IDC_OK, BtnTitle);
Countdown--;
}
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 41b792d5c6..0e4cc47692 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -180,22 +180,22 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) if (dbei->pBlob) {
if (dbei->flags & DBEF_UTF) {
// utf-8 in blob
- comment1 = mir_utf8decodeT((char*)dbei->pBlob);
+ comment1 = mir_utf8decodeW((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
+ else if (dbei->cbBlob == (mir_wstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
+ comment1 = mir_wstrdup((wchar_t*)dbei->pBlob);
}
- else comment1 = mir_a2t((char *)dbei->pBlob);
+ else comment1 = mir_a2u((char *)dbei->pBlob);
}
commentFix = POPUP_COMMENT_MESSAGE;
break;
case EVENTTYPE_URL:
// url
- if (dbei->pBlob) comment2 = mir_a2t((char *)dbei->pBlob);
+ if (dbei->pBlob) comment2 = mir_a2u((char *)dbei->pBlob);
// comment
- if (dbei->pBlob) comment1 = mir_a2t((char *)dbei->pBlob + mir_strlen((char *)dbei->pBlob) + 1);
+ if (dbei->pBlob) comment1 = mir_a2u((char *)dbei->pBlob + mir_strlen((char *)dbei->pBlob) + 1);
commentFix = POPUP_COMMENT_URL;
break;
@@ -203,10 +203,10 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) if (dbei->pBlob) {
char *p = (char*)dbei->pBlob + sizeof(DWORD);
// filenames
- comment2 = (dbei->flags & DBEF_UTF) ? mir_utf8decodeT(p) : mir_a2t(p);
+ comment2 = (dbei->flags & DBEF_UTF) ? mir_utf8decodeW(p) : mir_a2u(p);
p += mir_strlen(p) + 1;
// description
- comment1 = (dbei->flags & DBEF_UTF) ? mir_utf8decodeT(p) : mir_a2t(p);
+ comment1 = (dbei->flags & DBEF_UTF) ? mir_utf8decodeW(p) : mir_a2u(p);
}
commentFix = POPUP_COMMENT_FILE;
break;
@@ -231,8 +231,8 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) if (pcBlob >= pcEnd)
break;
}
- mir_sntprintf(szBuf, TranslateT("Received %d contacts."), nContacts);
- comment1 = mir_tstrdup(szBuf);
+ mir_snwprintf(szBuf, TranslateT("Received %d contacts."), nContacts);
+ comment1 = mir_wstrdup(szBuf);
}
commentFix = POPUP_COMMENT_CONTACTS;
break;
@@ -257,24 +257,24 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) mir_snprintf(szUin, "%d", *((DWORD*)dbei->pBlob));
if (mir_strlen(pszNick) > 0) {
if (dbei->flags & DBEF_UTF)
- szNick = mir_utf8decodeT(pszNick);
+ szNick = mir_utf8decodeW(pszNick);
else
- szNick = mir_a2t(pszNick);
+ szNick = mir_a2u(pszNick);
}
else if (mir_strlen(pszEmail) > 0) {
if (dbei->flags & DBEF_UTF)
- szNick = mir_utf8decodeT(pszEmail);
+ szNick = mir_utf8decodeW(pszEmail);
else
- szNick = mir_a2t(pszEmail);
+ szNick = mir_a2u(pszEmail);
}
else if (*((DWORD*)dbei->pBlob) > 0)
- szNick = mir_a2t(szUin);
+ szNick = mir_a2u(szUin);
if (szNick) {
- mir_tstrcpy(szBuf, szNick);
- mir_tstrcat(szBuf, TranslateT(" added you to the contact list"));
+ mir_wstrcpy(szBuf, szNick);
+ mir_wstrcat(szBuf, TranslateT(" added you to the contact list"));
mir_free(szNick);
- comment1 = mir_tstrdup(szBuf);
+ comment1 = mir_wstrdup(szBuf);
}
}
commentFix = POPUP_COMMENT_ADDED;
@@ -293,24 +293,24 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) mir_snprintf(szUin, "%d", *((DWORD*)dbei->pBlob));
if (mir_strlen(pszNick) > 0) {
if (dbei->flags & DBEF_UTF)
- szNick = mir_utf8decodeT(pszNick);
+ szNick = mir_utf8decodeW(pszNick);
else
- szNick = mir_a2t(pszNick);
+ szNick = mir_a2u(pszNick);
}
else if (mir_strlen(pszEmail) > 0) {
if (dbei->flags & DBEF_UTF)
- szNick = mir_utf8decodeT(pszEmail);
+ szNick = mir_utf8decodeW(pszEmail);
else
- szNick = mir_a2t(pszEmail);
+ szNick = mir_a2u(pszEmail);
}
else if (*((DWORD*)dbei->pBlob) > 0)
- szNick = mir_a2t(szUin);
+ szNick = mir_a2u(szUin);
if (szNick) {
- mir_tstrcpy(szBuf, szNick);
- mir_tstrcat(szBuf, TranslateT(" requested authorization"));
+ mir_wstrcpy(szBuf, szNick);
+ mir_wstrcat(szBuf, TranslateT(" requested authorization"));
mir_free(szNick);
- comment1 = mir_tstrdup(szBuf);
+ comment1 = mir_wstrdup(szBuf);
}
}
commentFix = POPUP_COMMENT_AUTH;
@@ -321,7 +321,7 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) //ASCIIZ from name
//ASCIIZ from e-mail
case ICQEVENTTYPE_WEBPAGER:
- if (dbei->pBlob) comment1 = mir_a2t((const char *)dbei->pBlob);
+ if (dbei->pBlob) comment1 = mir_a2u((const char *)dbei->pBlob);
commentFix = POPUP_COMMENT_WEBPAGER;
break;
@@ -330,7 +330,7 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) //ASCIIZ from name
//ASCIIZ from e-mail
case ICQEVENTTYPE_EMAILEXPRESS:
- if (dbei->pBlob) comment1 = mir_a2t((const char *)dbei->pBlob);
+ if (dbei->pBlob) comment1 = mir_a2u((const char *)dbei->pBlob);
commentFix = POPUP_COMMENT_EMAILEXP;
break;
@@ -340,13 +340,13 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) if (dbei->pBlob) {
if (dbei->flags & DBEF_UTF) {
// utf-8 in blob
- comment1 = mir_utf8decodeT((char*)dbei->pBlob);
+ comment1 = mir_utf8decodeW((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
+ else if (dbei->cbBlob == (mir_wstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
+ comment1 = mir_wstrdup((wchar_t*)dbei->pBlob);
}
- else comment1 = mir_a2t((char *)dbei->pBlob);
+ else comment1 = mir_a2u((char *)dbei->pBlob);
}
commentFix = POPUP_COMMENT_SMS;
break;
@@ -357,13 +357,13 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) if (dbei->pBlob) {
if (dbei->flags & DBEF_UTF) {
// utf-8 in blob
- comment1 = mir_utf8decodeT((char*)dbei->pBlob);
+ comment1 = mir_utf8decodeW((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
+ else if (dbei->cbBlob == (mir_wstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
+ comment1 = mir_wstrdup((wchar_t*)dbei->pBlob);
}
- else comment1 = mir_a2t((char *)dbei->pBlob);
+ else comment1 = mir_a2u((char *)dbei->pBlob);
}
commentFix = POPUP_COMMENT_SMSCONFIRMATION;
break;
@@ -377,7 +377,7 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) wchar_t *pet = (wchar_t*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&svc);
if (pet) {
// we've got event text, move to our memory space
- comment1 = mir_tstrdup(pet);
+ comment1 = mir_wstrdup(pet);
mir_free(pet);
}
commentFix = pei->descr;
@@ -387,17 +387,17 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) else commentFix = POPUP_COMMENT_OTHER;
}
- if ( mir_tstrlen(comment1) > 0) {
+ if ( mir_wstrlen(comment1) > 0) {
mir_free(comment2);
return comment1;
}
- if ( mir_tstrlen(comment2) > 0) {
+ if ( mir_wstrlen(comment2) > 0) {
mir_free(comment1);
return comment2;
}
mir_free(comment1);
mir_free(comment2);
- return TranslateTS( mir_a2t(commentFix));
+ return TranslateTS( mir_a2u(commentFix));
}
int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, UINT eventType)
@@ -495,7 +495,7 @@ int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, U }
else { // get the needed event data
wcsncpy(pudw.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- wcsncpy(pudw.lptzText, ptrT(GetEventPreview(&dbe)), MAX_SECONDLINE);
+ wcsncpy(pudw.lptzText, ptrW(GetEventPreview(&dbe)), MAX_SECONDLINE);
}
PopupCount++;
@@ -540,12 +540,12 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) wchar_t lpzText[MAX_SECONDLINE*2] = L"\0\0";
if (pdata->pluginOptions->bShowHeaders)
- mir_sntprintf(lpzText, TranslateT("[b]Number of new message(s): %d[/b]\n"), pdata->countEvent);
+ mir_snwprintf(lpzText, TranslateT("[b]Number of new message(s): %d[/b]\n"), pdata->countEvent);
int doReverse = pdata->pluginOptions->bShowON;
if ((pdata->firstShowEventData != pdata->firstEventData && doReverse) || (pdata->firstShowEventData != pdata->lastEventData && !doReverse))
- mir_sntprintf(lpzText, L"%s...\n", lpzText);
+ mir_snwprintf(lpzText, L"%s...\n", lpzText);
//take the active event as starting one
EVENT_DATA_EX *eventData = pdata->firstShowEventData;
@@ -575,15 +575,15 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) if (pdata->pluginOptions->bShowDate)
wcsncpy(formatTime, L"%Y.%m.%d", _countof(formatTime));
else if (pdata->pluginOptions->bShowTime)
- mir_tstrncat(formatTime, L" %H:%M", _countof(formatTime) - mir_tstrlen(formatTime));
+ mir_wstrncat(formatTime, L" %H:%M", _countof(formatTime) - mir_wstrlen(formatTime));
time_t localTime = dbe.timestamp;
wcsftime(timestamp, _countof(timestamp), formatTime, localtime(&localTime));
- mir_sntprintf(lpzText, L"%s[b][i]%s[/i][/b]\n", lpzText, timestamp);
+ mir_snwprintf(lpzText, L"%s[b][i]%s[/i][/b]\n", lpzText, timestamp);
}
// prepare event preview
wchar_t* szEventPreview = GetEventPreview(&dbe);
- mir_sntprintf(lpzText, L"%s%s", lpzText, szEventPreview);
+ mir_snwprintf(lpzText, L"%s%s", lpzText, szEventPreview);
mir_free(szEventPreview);
if (dbe.pBlob)
@@ -595,11 +595,11 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) else if ((iEvent >= pdata->pluginOptions->iNumberMsg && pdata->pluginOptions->iNumberMsg) || !eventData->prev)
break;
- mir_sntprintf(lpzText, L"%s\n", lpzText);
+ mir_snwprintf(lpzText, L"%s\n", lpzText);
}
if ((doReverse && eventData->next) || (!doReverse && eventData->prev))
- mir_sntprintf(lpzText, L"%s\n...", lpzText);
+ mir_snwprintf(lpzText, L"%s\n...", lpzText);
PUChangeTextT(pdata->hWnd, lpzText);
return 0;
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index ee0aae304d..eeceb22253 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -33,7 +33,7 @@ void PreviewSound(HWND hList) int hlpStatus = lvi.lParam;
ListView_GetItemText(hList, lvi.iItem, 1, buff, _countof(buff));
- if (!mir_tstrcmp(buff, TranslateTS(DEFAULT_SOUND))) {
+ if (!mir_wstrcmp(buff, TranslateTS(DEFAULT_SOUND))) {
if (hlpStatus < ID_STATUS_MIN)
SkinPlaySound(StatusListEx[hlpStatus].lpzSkinSoundName);
else
@@ -64,7 +64,7 @@ wchar_t *SelectSound(HWND hwndDlg, wchar_t *buff, size_t bufflen) HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
ListView_GetItemText(hList, ListView_GetNextItem(hList, -1, LVNI_SELECTED), 1, buff, (DWORD)bufflen);
- if (!mir_tstrcmp(buff, TranslateTS(DEFAULT_SOUND)))
+ if (!mir_wstrcmp(buff, TranslateTS(DEFAULT_SOUND)))
buff = NULL;
ofn.lStructSize = sizeof(ofn);
@@ -72,9 +72,9 @@ wchar_t *SelectSound(HWND hwndDlg, wchar_t *buff, size_t bufflen) ofn.hInstance = hInst;
wchar_t filter[MAX_PATH];
if (GetModuleHandle(L"bass_interface.dll"))
- mir_sntprintf(filter, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*.*)%c*%c", TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0);
+ mir_snwprintf(filter, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*.*)%c*%c", TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0);
else
- mir_sntprintf(filter, L"%s (*.wav)%c*.wav%c%s (*.*)%c*%c", TranslateT("Wave files"), 0, 0, TranslateT("All files"), 0, 0);
+ mir_snwprintf(filter, L"%s (*.wav)%c*.wav%c%s (*.*)%c*%c", TranslateT("Wave files"), 0, 0, TranslateT("All files"), 0, 0);
ofn.lpstrFilter = filter;
ofn.lpstrFile = buff;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_EXPLORER | OFN_NOCHANGEDIR;
@@ -150,10 +150,10 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvi.iItem = ListView_InsertItem(hList, &lvi);
if (!db_get_ts(hContact, MODULE, StatusList[Index(i)].lpzSkinSoundName, &dbv)) {
- mir_tstrcpy(buff, dbv.ptszVal);
+ mir_wstrcpy(buff, dbv.ptszVal);
db_free(&dbv);
}
- else mir_tstrcpy(buff, TranslateTS(DEFAULT_SOUND));
+ else mir_wstrcpy(buff, TranslateTS(DEFAULT_SOUND));
ListView_SetItemText(hList, lvi.iItem, 1, buff);
}
@@ -236,7 +236,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ListView_GetItem(hList, &lvi);
ListView_GetItemText(hList, lvi.iItem, 1, buff, _countof(buff));
- if (!mir_tstrcmp(buff, TranslateTS(DEFAULT_SOUND))) {
+ if (!mir_wstrcmp(buff, TranslateTS(DEFAULT_SOUND))) {
if (lvi.lParam < ID_STATUS_MIN)
db_unset(hContact, MODULE, StatusListEx[lvi.lParam].lpzSkinSoundName);
else
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index db07011b5c..bf7ef10106 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -114,10 +114,10 @@ static int CompareStatusMsg(STATUSMSGINFO *smi, DBCONTACTWRITESETTING *cws_new, switch (cws_new->value.type) {
case DBVT_ASCIIZ:
- smi->newstatusmsg = (CheckStr(cws_new->value.pszVal, 0, 1) ? NULL : mir_a2t_cp(cws_new->value.pszVal, CP_ACP));
+ smi->newstatusmsg = (CheckStr(cws_new->value.pszVal, 0, 1) ? NULL : mir_a2u_cp(cws_new->value.pszVal, CP_ACP));
break;
case DBVT_UTF8:
- smi->newstatusmsg = (CheckStr(cws_new->value.pszVal, 0, 1) ? NULL : mir_a2t_cp(cws_new->value.pszVal, CP_UTF8));
+ smi->newstatusmsg = (CheckStr(cws_new->value.pszVal, 0, 1) ? NULL : mir_a2u_cp(cws_new->value.pszVal, CP_UTF8));
break;
case DBVT_WCHAR:
smi->newstatusmsg = (CheckStrW(cws_new->value.pwszVal, 0, 1) ? NULL : mir_wstrdup(cws_new->value.pwszVal));
@@ -131,10 +131,10 @@ static int CompareStatusMsg(STATUSMSGINFO *smi, DBCONTACTWRITESETTING *cws_new, if (!db_get_s(smi->hContact, "UserOnline", szSetting, &dbv_old, 0)) {
switch (dbv_old.type) {
case DBVT_ASCIIZ:
- smi->oldstatusmsg = (CheckStr(dbv_old.pszVal, 0, 1) ? NULL : mir_a2t_cp(dbv_old.pszVal, CP_ACP));
+ smi->oldstatusmsg = (CheckStr(dbv_old.pszVal, 0, 1) ? NULL : mir_a2u_cp(dbv_old.pszVal, CP_ACP));
break;
case DBVT_UTF8:
- smi->oldstatusmsg = (CheckStr(dbv_old.pszVal, 0, 1) ? NULL : mir_a2t_cp(dbv_old.pszVal, CP_UTF8));
+ smi->oldstatusmsg = (CheckStr(dbv_old.pszVal, 0, 1) ? NULL : mir_a2u_cp(dbv_old.pszVal, CP_UTF8));
break;
case DBVT_WCHAR:
smi->oldstatusmsg = (CheckStrW(dbv_old.pwszVal, 0, 1) ? NULL : mir_wstrdup(dbv_old.pwszVal));
@@ -188,21 +188,21 @@ wchar_t* GetStr(STATUSMSGINFO *n, const wchar_t *tmplt) return NULL;
CMString res;
- size_t len = mir_tstrlen(tmplt);
+ size_t len = mir_wstrlen(tmplt);
for (size_t i = 0; i < len; i++) {
if (tmplt[i] == '%') {
i++;
switch (tmplt[i]) {
case 'n':
- if (n->compare == COMPARE_DEL || mir_tstrcmp(n->newstatusmsg, TranslateT("<no status message>")) == 0)
+ if (n->compare == COMPARE_DEL || mir_wstrcmp(n->newstatusmsg, TranslateT("<no status message>")) == 0)
res.Append(TranslateT("<no status message>"));
else
AddCR(res, n->newstatusmsg);
break;
case 'o':
- if (n->oldstatusmsg == NULL || n->oldstatusmsg[0] == '\0' || mir_tstrcmp(n->oldstatusmsg, TranslateT("<no status message>")) == 0)
+ if (n->oldstatusmsg == NULL || n->oldstatusmsg[0] == '\0' || mir_wstrcmp(n->oldstatusmsg, TranslateT("<no status message>")) == 0)
res.Append(TranslateT("<no status message>"));
else
AddCR(res, n->oldstatusmsg);
@@ -252,7 +252,7 @@ wchar_t* GetStr(STATUSMSGINFO *n, const wchar_t *tmplt) res.Append(L"...");
}
- return mir_tstrndup(res, res.GetLength());
+ return mir_wstrndup(res, res.GetLength());
}
bool SkipHiddenContact(MCONTACT hContact)
@@ -262,7 +262,7 @@ bool SkipHiddenContact(MCONTACT hContact) void LogSMsgToDB(STATUSMSGINFO *smi, const wchar_t *tmplt)
{
- ptrT str(GetStr(smi, tmplt));
+ ptrW str(GetStr(smi, tmplt));
T2Utf blob(str);
DBEVENTINFO dbei = { 0 };
@@ -304,8 +304,8 @@ void GetStatusText(MCONTACT hContact, WORD newStatus, WORD oldStatus, wchar_t *s if (opt.ShowPreviousStatus) {
wchar_t buff[MAX_STATUSTEXT];
- mir_sntprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText);
- mir_tstrcat(mir_tstrcat(stzStatusText, L" "), buff);
+ mir_snwprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText);
+ mir_wstrcat(mir_wstrcat(stzStatusText, L" "), buff);
}
}
@@ -441,7 +441,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) if (opt.BlinkIcon && !opt.TempDisabled) {
HICON hIcon = opt.BlinkIcon_Status ? Skin_LoadProtoIcon(szProto, newStatus) : Skin_LoadIcon(SKINICON_OTHER_USERONLINE);
wchar_t str[256];
- mir_sntprintf(str, TranslateT("%s is now %s"), pcli->pfnGetContactDisplayName(hContact, 0), StatusList[Index(newStatus)].lpzStandardText);
+ mir_snwprintf(str, TranslateT("%s is now %s"), pcli->pfnGetContactDisplayName(hContact, 0), StatusList[Index(newStatus)].lpzStandardText);
BlinkIcon(hContact, hIcon, str);
}
@@ -457,7 +457,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, L"HH':'mm", stzTime, _countof(stzTime));
GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, L"dd/MM/yyyy", stzDate, _countof(stzDate));
- mir_sntprintf(stzText, TranslateT("%s, %s. %s changed status to %s (was %s)\r\n"),
+ mir_snwprintf(stzText, TranslateT("%s, %s. %s changed status to %s (was %s)\r\n"),
stzDate, stzTime, pcli->pfnGetContactDisplayName(hContact, 0), StatusList[Index(newStatus)].lpzStandardText,
StatusList[Index(oldStatus)].lpzStandardText);
LogToFile(stzText);
@@ -537,8 +537,8 @@ int ProcessExtraStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) if (strstr(cws->szSetting, "title")) {
smi.compare = CompareStatusMsg(&smi, cws, szSetting);
if (smi.compare == COMPARE_SAME) {
- replaceStrT(smi.newstatusmsg, 0);
- replaceStrT(smi.oldstatusmsg, 0);
+ replaceStrW(smi.newstatusmsg, 0);
+ replaceStrW(smi.oldstatusmsg, 0);
}
if (cws->value.type == DBVT_DELETED)
@@ -554,8 +554,8 @@ int ProcessExtraStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) mir_snprintf(dbSetting, "%s%s", szSetting, "Msg");
smi.compare = CompareStatusMsg(&smi, cws, dbSetting);
if (smi.compare == COMPARE_SAME) {
- replaceStrT(smi.newstatusmsg, 0);
- replaceStrT(smi.oldstatusmsg, 0);
+ replaceStrW(smi.newstatusmsg, 0);
+ replaceStrW(smi.oldstatusmsg, 0);
}
if (cws->value.type == DBVT_DELETED)
@@ -576,8 +576,8 @@ int ProcessExtraStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) if (mir_strcmp(cws->szSetting, "XStatusName") == 0) {
smi.compare = CompareStatusMsg(&smi, cws, "LastXStatusName");
if (smi.compare == COMPARE_SAME) {
- replaceStrT(smi.newstatusmsg, 0);
- replaceStrT(smi.oldstatusmsg, 0);
+ replaceStrW(smi.newstatusmsg, 0);
+ replaceStrW(smi.oldstatusmsg, 0);
}
if (cws->value.type == DBVT_DELETED)
@@ -591,8 +591,8 @@ int ProcessExtraStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) else if (!mir_strcmp(cws->szSetting, "XStatusMsg")) {
smi.compare = CompareStatusMsg(&smi, cws, "LastXStatusMsg");
if (smi.compare == COMPARE_SAME) {
- replaceStrT(smi.newstatusmsg, 0);
- replaceStrT(smi.oldstatusmsg, 0);
+ replaceStrW(smi.newstatusmsg, 0);
+ replaceStrW(smi.oldstatusmsg, 0);
}
if (cws->value.type == DBVT_DELETED)
@@ -629,11 +629,11 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) //don't show popup when mradio connecting and disconnecting
if (_stricmp(szProto, "mRadio") == 0 && !cws->value.type == DBVT_DELETED) {
wchar_t buf[MAX_PATH];
- mir_sntprintf(buf, L" (%s)", TranslateT("connecting"));
+ mir_snwprintf(buf, L" (%s)", TranslateT("connecting"));
T2Utf pszUtf(buf);
- mir_sntprintf(buf, L" (%s)", TranslateT("aborting"));
+ mir_snwprintf(buf, L" (%s)", TranslateT("aborting"));
T2Utf pszUtf2(buf);
- mir_sntprintf(buf, L" (%s)", TranslateT("playing"));
+ mir_snwprintf(buf, L" (%s)", TranslateT("playing"));
T2Utf pszUtf3(buf);
if (_stricmp(cws->value.pszVal, pszUtf) == 0 || _stricmp(cws->value.pszVal, pszUtf2) == 0 || _stricmp(cws->value.pszVal, pszUtf3) == 0)
goto skip_notify;
@@ -681,13 +681,13 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) if (bEnablePopup && db_get_b(hContact, MODULE, "EnablePopups", 1) && !opt.TempDisabled) {
// cut message if needed
wchar_t *copyText = NULL;
- if (opt.PSMsgTruncate && (opt.PSMsgLen > 0) && smi.newstatusmsg && (mir_tstrlen(smi.newstatusmsg) > opt.PSMsgLen)) {
+ if (opt.PSMsgTruncate && (opt.PSMsgLen > 0) && smi.newstatusmsg && (mir_wstrlen(smi.newstatusmsg) > opt.PSMsgLen)) {
wchar_t buff[MAX_TEXT_LEN + 3];
- copyText = mir_tstrdup(smi.newstatusmsg);
+ copyText = mir_wstrdup(smi.newstatusmsg);
wcsncpy(buff, smi.newstatusmsg, opt.PSMsgLen);
buff[opt.PSMsgLen] = 0;
- mir_tstrcat(buff, L"...");
- replaceStrT(smi.newstatusmsg, buff);
+ mir_wstrcat(buff, L"...");
+ replaceStrW(smi.newstatusmsg, buff);
}
wchar_t *str;
@@ -731,7 +731,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) if (opt.BlinkIcon && opt.BlinkIcon_ForMsgs && !opt.TempDisabled) {
HICON hIcon = opt.BlinkIcon_Status ? Skin_LoadProtoIcon(szProto, db_get_w(hContact, szProto, "Status", ID_STATUS_ONLINE)) : Skin_LoadIcon(SKINICON_OTHER_USERONLINE);
wchar_t str[256];
- mir_sntprintf(str, TranslateT("%s changed status message to %s"), pcli->pfnGetContactDisplayName(hContact, 0), smi.newstatusmsg);
+ mir_snwprintf(str, TranslateT("%s changed status message to %s"), pcli->pfnGetContactDisplayName(hContact, 0), smi.newstatusmsg);
BlinkIcon(hContact, hIcon, str);
}
@@ -758,15 +758,15 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) else
str = GetStr(&smi, templates.LogSMsgChanged);
- mir_sntprintf(stzText, L"%s, %s. %s %s\r\n", stzDate, stzTime, pcli->pfnGetContactDisplayName(hContact, 0), str);
+ mir_snwprintf(stzText, L"%s, %s. %s %s\r\n", stzDate, stzTime, pcli->pfnGetContactDisplayName(hContact, 0), str);
LogToFile(stzText);
mir_free(str);
}
skip_notify:
- replaceStrT(smi.newstatusmsg, 0);
- replaceStrT(smi.oldstatusmsg, 0);
+ replaceStrW(smi.newstatusmsg, 0);
+ replaceStrW(smi.oldstatusmsg, 0);
return 1;
}
@@ -850,121 +850,121 @@ void InitStatusList() int index = 0;
//Online
index = Index(ID_STATUS_ONLINE);
- mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) is back online!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) is back online!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) is back online!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Online"), MAX_STANDARDTEXT);
+ mir_wstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) is back online!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) is back online!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) is back online!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzStandardText, TranslateT("Online"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOnline", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Online"), MAX_SKINSOUNDDESC);
- mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"global.wav", MAX_PATH);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Online"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundFile, L"global.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40072bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40072tx", COLOR_TX_DEFAULT);
//Offline
index = Index(ID_STATUS_OFFLINE);
- mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) went offline! :("), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) went offline! :("), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) went offline! :("), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Offline"), MAX_STANDARDTEXT);
+ mir_wstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) went offline! :("), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) went offline! :("), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) went offline! :("), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzStandardText, TranslateT("Offline"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOffline", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Offline"), MAX_SKINSOUNDDESC);
- mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"offline.wav", MAX_PATH);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Offline"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundFile, L"offline.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40071bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40071tx", COLOR_TX_DEFAULT);
//Invisible
index = Index(ID_STATUS_INVISIBLE);
- mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) hides in shadows..."), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) hides in shadows..."), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) hides in shadows..."), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Invisible"), MAX_STANDARDTEXT);
+ mir_wstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) hides in shadows..."), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) hides in shadows..."), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) hides in shadows..."), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzStandardText, TranslateT("Invisible"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserInvisible", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Invisible"), MAX_SKINSOUNDDESC);
- mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"invisible.wav", MAX_PATH);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Invisible"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundFile, L"invisible.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40078bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40078tx", COLOR_TX_DEFAULT);
//Free for chat
index = Index(ID_STATUS_FREECHAT);
- mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) feels talkative!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) feels talkative!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) feels talkative!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Free for chat"), MAX_STANDARDTEXT);
+ mir_wstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) feels talkative!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) feels talkative!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) feels talkative!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzStandardText, TranslateT("Free for chat"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserFreeForChat", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Free for chat"), MAX_SKINSOUNDDESC);
- mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"free4chat.wav", MAX_PATH);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Free for chat"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundFile, L"free4chat.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40077bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40077tx", COLOR_TX_DEFAULT);
//Away
index = Index(ID_STATUS_AWAY);
- mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) went away"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) went away"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) went away"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Away"), MAX_STANDARDTEXT);
+ mir_wstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) went away"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) went away"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) went away"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzStandardText, TranslateT("Away"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserAway", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Away"), MAX_SKINSOUNDDESC);
- mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"away.wav", MAX_PATH);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Away"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundFile, L"away.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40073bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40073tx", COLOR_TX_DEFAULT);
//NA
index = Index(ID_STATUS_NA);
- mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) isn't there anymore!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) isn't there anymore!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) isn't there anymore!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Not available"), MAX_STANDARDTEXT);
+ mir_wstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) isn't there anymore!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) isn't there anymore!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) isn't there anymore!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzStandardText, TranslateT("Not available"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserNA", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Not available"), MAX_SKINSOUNDDESC);
- mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"na.wav", MAX_PATH);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Not available"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundFile, L"na.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40075bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40075tx", COLOR_TX_DEFAULT);
//Occupied
index = Index(ID_STATUS_OCCUPIED);
- mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) has something else to do"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) has something else to do"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) has something else to do"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Occupied"), MAX_STANDARDTEXT);
+ mir_wstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) has something else to do"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) has something else to do"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) has something else to do"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzStandardText, TranslateT("Occupied"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOccupied", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Occupied"), MAX_SKINSOUNDDESC);
- mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"occupied.wav", MAX_PATH);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Occupied"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundFile, L"occupied.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40076bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40076tx", COLOR_TX_DEFAULT);
//Do not disturb
index = Index(ID_STATUS_DND);
- mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) doesn't want to be disturbed!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) doesn't want to be disturbed!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) doesn't want to be disturbed!"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Do not disturb"), MAX_STANDARDTEXT);
+ mir_wstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) doesn't want to be disturbed!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) doesn't want to be disturbed!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) doesn't want to be disturbed!"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzStandardText, TranslateT("Do not disturb"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserDND", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Do not disturb"), MAX_SKINSOUNDDESC);
- mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"dnd.wav", MAX_PATH);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Do not disturb"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundFile, L"dnd.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40074bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40074tx", COLOR_TX_DEFAULT);
//Out to lunch
index = Index(ID_STATUS_OUTTOLUNCH);
- mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) is eating something"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) is eating something"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) is eating something"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Out to lunch"), MAX_STANDARDTEXT);
+ mir_wstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) is eating something"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) is eating something"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) is eating something"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzStandardText, TranslateT("Out to lunch"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOutToLunch", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Out to lunch"), MAX_SKINSOUNDDESC);
- mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"lunch.wav", MAX_PATH);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Out to lunch"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundFile, L"lunch.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40080bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40080tx", COLOR_TX_DEFAULT);
//On the phone
index = Index(ID_STATUS_ONTHEPHONE);
- mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) had to answer the phone"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) had to answer the phone"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) had to answer the phone"), MAX_STATUSTEXT);
- mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("On the phone"), MAX_STANDARDTEXT);
+ mir_wstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) had to answer the phone"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) had to answer the phone"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) had to answer the phone"), MAX_STATUSTEXT);
+ mir_wstrncpy(StatusList[index].lpzStandardText, TranslateT("On the phone"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOnThePhone", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: On the phone"), MAX_SKINSOUNDDESC);
- mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"phone.wav", MAX_PATH);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: On the phone"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusList[index].lpzSkinSoundFile, L"phone.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40079bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40079tx", COLOR_TX_DEFAULT);
@@ -981,37 +981,37 @@ void InitStatusList() //From offline
index = ID_STATUS_FROMOFFLINE;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, "UserFromOffline", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("User: from offline (has priority!)"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("User: from offline (has priority!)"), MAX_SKINSOUNDDESC);
//Status message removed
index = ID_STATUS_SMSGREMOVED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, "StatusMsgRemoved", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Status message removed"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Status message removed"), MAX_SKINSOUNDDESC);
//Status message changed
index = ID_STATUS_SMSGCHANGED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, "StatusMsgChanged", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Status message changed"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Status message changed"), MAX_SKINSOUNDDESC);
//Extra status removed
index = ID_STATUS_XREMOVED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_REMOVED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status removed"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status removed"), MAX_SKINSOUNDDESC);
//Extra status message changed
index = ID_STATUS_XMSGCHANGED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_MSGCHANGED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status message changed"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status message changed"), MAX_SKINSOUNDDESC);
//Extra status changed
index = ID_STATUS_XCHANGED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_CHANGED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status changed"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status changed"), MAX_SKINSOUNDDESC);
//Extra status message removed
index = ID_STATUS_XMSGREMOVED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_MSGREMOVED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status message removed"), MAX_SKINSOUNDDESC);
+ mir_wstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status message removed"), MAX_SKINSOUNDDESC);
}
void CALLBACK ConnectionTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD)
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 61ca3ad9a7..2e602a4586 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -256,7 +256,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ofn.nMaxFile = MAX_PATH;
ofn.hwndOwner = hwndDlg;
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*.*)%c*.*%c%s (*.log)%c*.log%c%s (*.txt)%c*.txt%c", TranslateT("All Files"), 0, 0, TranslateT("Log"), 0, 0, TranslateT("Text"), 0, 0);
+ mir_snwprintf(filter, L"%s (*.*)%c*.*%c%s (*.log)%c*.log%c%s (*.txt)%c*.txt%c", TranslateT("All Files"), 0, 0, TranslateT("Log"), 0, 0, TranslateT("Text"), 0, 0);
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 2;
ofn.lpstrInitialDir = buff;
@@ -391,16 +391,16 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (opt.ShowPreviousStatus) {
wchar_t buff[MAX_STATUSTEXT];
- mir_sntprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText);
- mir_tstrcat(str, L" ");
- mir_tstrcat(str, buff);
+ mir_snwprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText);
+ mir_wstrcat(str, L" ");
+ mir_wstrcat(str, buff);
}
}
if (opt.ReadAwayMsg) {
if (str[0])
- mir_tstrcat(str, L"\n");
- mir_tstrcat(str, TranslateT("This is status message"));
+ mir_wstrcat(str, L"\n");
+ mir_wstrcat(str, TranslateT("This is status message"));
}
ShowChangePopup(NULL, Skin_LoadProtoIcon(NULL, i), i, str);
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index a6346e67d9..2f7e702036 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -30,7 +30,7 @@ void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const wchar // add group name to popup title
if (opt.ShowGroup) {
- ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup)
buf.AppendFormat(L" (%s)", tszGroup);
}
@@ -77,7 +77,7 @@ static int AwayMsgHook(WPARAM, LPARAM lParam, LPARAM pObj) return 0;
MCONTACT hContact = PUGetContact(pdp->hWnd);
- ptrT pstzLast(db_get_tsa(hContact, MODULE, "LastPopupText"));
+ ptrW pstzLast(db_get_tsa(hContact, MODULE, "LastPopupText"));
wchar_t *tszStatus = (wchar_t *)ack->lParam;
if (tszStatus == NULL || *tszStatus == 0)
@@ -85,7 +85,7 @@ static int AwayMsgHook(WPARAM, LPARAM lParam, LPARAM pObj) wchar_t stzText[1024];
if (pstzLast)
- mir_sntprintf(stzText, L"%s\n%s", pstzLast, tszStatus);
+ mir_snwprintf(stzText, L"%s\n%s", pstzLast, tszStatus);
else
wcsncpy(stzText, tszStatus, _countof(stzText));
SendMessage(pdp->hWnd, WM_SETREDRAW, FALSE, 0);
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 5640113053..ec650d1775 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -80,13 +80,13 @@ wchar_t* GetStatusTypeAsString(int type, wchar_t *buff) {
switch (type) {
case TYPE_JABBER_MOOD:
- mir_tstrcpy(buff, TranslateT("Mood")); return buff;
+ mir_wstrcpy(buff, TranslateT("Mood")); return buff;
case TYPE_JABBER_ACTIVITY:
- mir_tstrcpy(buff, TranslateT("Activity")); return buff;
+ mir_wstrcpy(buff, TranslateT("Activity")); return buff;
case TYPE_ICQ_XSTATUS:
- mir_tstrcpy(buff, TranslateT("xStatus")); return buff;
+ mir_wstrcpy(buff, TranslateT("xStatus")); return buff;
default:
- mir_tstrcpy(buff, TranslateT("<unknown>")); return buff;
+ mir_wstrcpy(buff, TranslateT("<unknown>")); return buff;
}
}
@@ -95,7 +95,7 @@ CMString ReplaceVars(XSTATUSCHANGE *xsc, const wchar_t *tmplt) if (xsc == NULL || tmplt == NULL || tmplt[0] == '\0')
return CMString();
- size_t len = mir_tstrlen(tmplt);
+ size_t len = mir_wstrlen(tmplt);
CMString res;
for (size_t i = 0; i < len; i++) {
@@ -189,13 +189,13 @@ void ShowXStatusPopup(XSTATUSCHANGE *xsc) // cut message if needed
wchar_t *copyText = NULL;
- if (opt.PXMsgTruncate && (opt.PXMsgLen > 0) && xsc->stzText && (mir_tstrlen(xsc->stzText) > opt.PXMsgLen)) {
+ if (opt.PXMsgTruncate && (opt.PXMsgLen > 0) && xsc->stzText && (mir_wstrlen(xsc->stzText) > opt.PXMsgLen)) {
wchar_t buff[MAX_TEXT_LEN + 3];
- copyText = mir_tstrdup(xsc->stzText);
+ copyText = mir_wstrdup(xsc->stzText);
wcsncpy(buff, xsc->stzText, opt.PXMsgLen);
buff[opt.PXMsgLen] = 0;
- mir_tstrcat(buff, L"...");
- replaceStrT(xsc->stzText, buff);
+ mir_wstrcat(buff, L"...");
+ replaceStrW(xsc->stzText, buff);
}
wchar_t *Template = L"";
@@ -226,7 +226,7 @@ void BlinkXStatusIcon(XSTATUSCHANGE *xsc) HICON hIcon = NULL;
wchar_t str[256] = { 0 };
wchar_t stzType[32];
- mir_sntprintf(str, TranslateT("%s changed %s"), pcli->pfnGetContactDisplayName(xsc->hContact, 0), GetStatusTypeAsString(xsc->type, stzType));
+ mir_snwprintf(str, TranslateT("%s changed %s"), pcli->pfnGetContactDisplayName(xsc->hContact, 0), GetStatusTypeAsString(xsc->type, stzType));
if (opt.BlinkIcon_Status) {
DBVARIANT dbv;
@@ -337,7 +337,7 @@ void LogChangeToFile(XSTATUSCHANGE *xsc) Template = templates.LogXMsgRemoved; break;
}
- mir_sntprintf(stzText, L"%s, %s. %s %s\r\n", stzDate, stzTime,
+ mir_snwprintf(stzText, L"%s, %s. %s %s\r\n", stzDate, stzTime,
pcli->pfnGetContactDisplayName(xsc->hContact, 0), ReplaceVars(xsc, Template).GetString());
LogToFile(stzText);
@@ -464,7 +464,7 @@ wchar_t* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, void LogXstatusChange(MCONTACT hContact, char *szProto, int xstatusType, wchar_t *stzTitle, wchar_t *stzText)
{
- XSTATUSCHANGE *xsc = NewXSC(hContact, szProto, xstatusType, NOTIFY_OPENING_ML, stzTitle[0] ? mir_tstrdup(stzTitle) : NULL, stzText[0] ? mir_tstrdup(stzText) : NULL);
+ XSTATUSCHANGE *xsc = NewXSC(hContact, szProto, xstatusType, NOTIFY_OPENING_ML, stzTitle[0] ? mir_wstrdup(stzTitle) : NULL, stzText[0] ? mir_wstrdup(stzText) : NULL);
LogChangeToDB(xsc);
FreeXSC(xsc);
diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp index ef52cbe196..5b2b319fa4 100755 --- a/plugins/New_GPG/src/gpg_wrapper.cpp +++ b/plugins/New_GPG/src/gpg_wrapper.cpp @@ -49,7 +49,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae env.push_back(L"LANG=C"); argv.push_back(bin_path); wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); - if(mir_tstrlen(home_dir)) //this check are required for first run gpg binary validation + if(mir_wstrlen(home_dir)) //this check are required for first run gpg binary validation { argv.push_back(L"--homedir"); argv.push_back(home_dir); diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index d3e7d1679b..bc7c4764ac 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -280,7 +280,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (wcschr(name, '(')) { wstring str = name; wstring::size_type p = str.find(L"(") - 1; - mir_tstrcpy(name, str.substr(0, p).c_str()); + mir_wstrcpy(name, str.substr(0, p).c_str()); } } string out; @@ -333,7 +333,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, GetDlgItemText(hwndDlg, IDC_KEY_PASSWORD, passwd, _countof(passwd)); if (passwd[0]) { string dbsetting = "szKey_"; - char *keyid = mir_t2a(fp); + char *keyid = mir_u2a(fp); dbsetting += keyid; mir_free(keyid); dbsetting += "_Password"; @@ -452,7 +452,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, while ((p = tmp.find(" ", p)) != string::npos) tmp.erase(p, 1); - str = mir_a2t(tmp.c_str()); + str = mir_a2u(tmp.c_str()); } cmd.clear(); out.clear(); @@ -661,7 +661,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, char *szKey = (char*)GlobalLock(hMem); if (!szKey) { wchar_t msg[64]; - mir_sntprintf(msg, TranslateT("Failed to lock memory with error %d"), GetLastError()); + mir_snwprintf(msg, TranslateT("Failed to lock memory with error %d"), GetLastError()); MessageBox(0, msg, TranslateT("Error"), MB_OK); GlobalFree(hMem); } @@ -672,7 +672,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (!SetClipboardData(CF_OEMTEXT, hMem)) { GlobalFree(hMem); wchar_t msg[64]; - mir_sntprintf(msg, TranslateT("Failed write to clipboard with error %d"), GetLastError()); + mir_snwprintf(msg, TranslateT("Failed write to clipboard with error %d"), GetLastError()); MessageBox(0, msg, TranslateT("Error"), MB_OK); } CloseClipboard(); @@ -687,7 +687,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, //TODO: handle error break; } - char *path = mir_t2a(p); + char *path = mir_u2a(p); delete[] p; std::ofstream file; file.open(path, std::ios::trunc | std::ios::out); @@ -794,16 +794,16 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, PathToAbsolute("\\", mir_path); SetCurrentDirectoryA(mir_path); - ptrT tmp(mir_a2t(mir_path)); + ptrW tmp(mir_a2u(mir_path)); wstring gpg_path(tmp); gpg_path += L"\\GnuPG\\gpg.exe"; wstring gpg_lang_path(tmp); gpg_lang_path += L"\\GnuPG\\gnupg.nls\\en@quot.mo"; if (boost::filesystem::exists(gpg_path)) { gpg_exists = true; - mir_tstrcpy(path, L"GnuPG\\gpg.exe"); + mir_wstrcpy(path, L"GnuPG\\gpg.exe"); } - else mir_tstrcpy(path, gpg_path.c_str()); + else mir_wstrcpy(path, gpg_path.c_str()); if (boost::filesystem::exists(gpg_lang_path)) lang_exists = true; @@ -813,7 +813,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, DWORD len = MAX_PATH; bool bad_version = false; { - ptrT tmp; + ptrW tmp; if (!gpg_exists) { tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", (SHGetValue(HKEY_CURRENT_USER, L"Software\\GNU\\GnuPG", L"gpgProgram", 0, path, &len) == ERROR_SUCCESS) ? path : L""); if (tmp[0]) @@ -854,7 +854,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } } { - ptrT tmp(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")); + ptrW tmp(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")); if (!tmp[0]) { mir_free(tmp); char *mir_path = (char*)mir_alloc(sizeof(char) * MAX_PATH); @@ -890,13 +890,13 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe"); SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp); char mir_path[MAX_PATH]; - char *atmp = mir_t2a(tmp); + char *atmp = mir_u2a(tmp); mir_free(tmp); PathToAbsolute("\\", mir_path); char* p_path = NULL; if (StriStr(atmp, mir_path)) { p_path = atmp + mir_strlen(mir_path); - tmp = mir_a2t(p_path); + tmp = mir_a2u(p_path); SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp); } } @@ -907,13 +907,13 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp); char mir_path[MAX_PATH]; - char *atmp = mir_t2a(tmp); + char *atmp = mir_u2a(tmp); mir_free(tmp); PathToAbsolute("\\", mir_path); char* p_path = NULL; if (StriStr(atmp, mir_path)) { p_path = atmp + mir_strlen(mir_path); - tmp = mir_a2t(p_path); + tmp = mir_a2u(p_path); SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp); } } @@ -967,8 +967,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, _countof(tmp)); - while (tmp[mir_tstrlen(tmp) - 1] == '\\') - tmp[mir_tstrlen(tmp) - 1] = '\0'; + while (tmp[mir_wstrlen(tmp) - 1] == '\\') + tmp[mir_wstrlen(tmp) - 1] = '\0'; if (!tmp[0]) { MessageBox(0, TranslateT("Please set keyring's home directory"), TranslateT("Warning"), MB_OK); break; @@ -1038,8 +1038,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, _countof(tmp)); - while (tmp[mir_tstrlen(tmp) - 1] == '\\') - tmp[mir_tstrlen(tmp) - 1] = '\0'; + while (tmp[mir_wstrlen(tmp) - 1] == '\\') + tmp[mir_wstrlen(tmp) - 1] = '\0'; if (!tmp[0]) { MessageBox(0, TranslateT("Please set keyring's home directory"), TranslateT("Warning"), MB_OK); break; @@ -1196,7 +1196,7 @@ static INT_PTR CALLBACK DlgProcNewKeyDialog(HWND hwndDlg, UINT msg, WPARAM wPara SetDlgItemText(hwndDlg, ID_IMPORT, tmp[0] ? TranslateT("Replace") : TranslateT("Accept")); mir_free(tmp); tmp = new wchar_t[256]; - mir_sntprintf(tmp, 255 * sizeof(wchar_t), TranslateT("Received key from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_snwprintf(tmp, 255 * sizeof(wchar_t), TranslateT("Received key from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); SetDlgItemText(hwndDlg, IDC_KEY_FROM, tmp); delete[] tmp; } @@ -1269,7 +1269,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara { //data sanity checks wchar_t *tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 5); GetDlgItemText(hwndDlg, IDC_KEY_TYPE, tmp, 5); - if (mir_tstrlen(tmp) < 3) { + if (mir_wstrlen(tmp) < 3) { mir_free(tmp); tmp = NULL; MessageBox(0, TranslateT("You must set encryption algorithm first"), TranslateT("Error"), MB_OK); break; @@ -1286,7 +1286,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara } tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 12); GetDlgItemText(hwndDlg, IDC_KEY_EXPIRE_DATE, tmp, 11); - if (mir_tstrlen(tmp) != 10 && tmp[0] != '0') { + if (mir_wstrlen(tmp) != 10 && tmp[0] != '0') { MessageBox(0, TranslateT("Invalid date"), TranslateT("Error"), MB_OK); mir_free(tmp); break; @@ -1294,7 +1294,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara mir_free(tmp); tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 128); GetDlgItemText(hwndDlg, IDC_KEY_REAL_NAME, tmp, 127); - if (mir_tstrlen(tmp) < 5) { + if (mir_wstrlen(tmp) < 5) { MessageBox(0, TranslateT("Name must contain at least 5 characters"), TranslateT("Error"), MB_OK); mir_free(tmp); break; @@ -1307,7 +1307,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara mir_free(tmp); tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 128); GetDlgItemText(hwndDlg, IDC_KEY_EMAIL, tmp, 128); - if ((mir_tstrlen(tmp)) < 5 || (!wcschr(tmp, '@')) || (!wcschr(tmp, '.'))) { + if ((mir_wstrlen(tmp)) < 5 || (!wcschr(tmp, '@')) || (!wcschr(tmp, '.'))) { MessageBox(0, TranslateT("Invalid Email"), TranslateT("Error"), MB_OK); mir_free(tmp); break; @@ -1316,7 +1316,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara } { //generating key file wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); - char *tmp2;// = mir_t2a(tmp); + char *tmp2;// = mir_u2a(tmp); path = tmp; mir_free(tmp); // mir_free(tmp2); @@ -1329,7 +1329,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara f << "Key-Type: "; tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 5); GetDlgItemText(hwndDlg, IDC_KEY_TYPE, tmp, 5); - tmp2 = mir_t2a(tmp); + tmp2 = mir_u2a(tmp); mir_free(tmp); char *subkeytype = (char*)mir_alloc(6); if (strstr(tmp2, "RSA")) @@ -1714,7 +1714,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg, UINT msg, WPARAM wP if (p2 != std::string::npos) { p2 += mir_strlen("-----END PGP PUBLIC KEY BLOCK-----"); out = out.substr(p1, p2 - p1); - wchar_t *tmp = mir_a2t(out.c_str()); + wchar_t *tmp = mir_a2u(out.c_str()); SetWindowText(hPubKeyEdit, tmp); mir_free(tmp); } @@ -1910,10 +1910,10 @@ void InitCheck() if (!home_dir_access || !temp_access || !gpg_valid) { wchar_t buf[4096]; wcsncpy(buf, gpg_valid ? TranslateT("GPG binary is set and valid (this is good).\n") : TranslateT("GPG binary unset or invalid (plugin will not work).\n"), _countof(buf)); - mir_tstrncat(buf, home_dir_access ? TranslateT("Home dir write access granted (this is good).\n") : TranslateT("Home dir has no write access (plugin most probably will not work).\n"), _countof(buf) - mir_tstrlen(buf)); - mir_tstrncat(buf, temp_access ? TranslateT("Temp dir write access granted (this is good).\n") : TranslateT("Temp dir has no write access (plugin should work, but may have some problems, file transfers will not work)."), _countof(buf) - mir_tstrlen(buf)); + mir_wstrncat(buf, home_dir_access ? TranslateT("Home dir write access granted (this is good).\n") : TranslateT("Home dir has no write access (plugin most probably will not work).\n"), _countof(buf) - mir_wstrlen(buf)); + mir_wstrncat(buf, temp_access ? TranslateT("Temp dir write access granted (this is good).\n") : TranslateT("Temp dir has no write access (plugin should work, but may have some problems, file transfers will not work)."), _countof(buf) - mir_wstrlen(buf)); if (!gpg_valid) - mir_tstrncat(buf, TranslateT("\nGPG will be disabled until you solve these problems"), _countof(buf) - mir_tstrlen(buf)); + mir_wstrncat(buf, TranslateT("\nGPG will be disabled until you solve these problems"), _countof(buf) - mir_wstrlen(buf)); MessageBox(0, buf, TranslateT("GPG plugin problems"), MB_OK); } if (!gpg_valid) @@ -2137,12 +2137,12 @@ void ImportKey() std::vector<wstring> cmd; wchar_t tmp2[MAX_PATH] = { 0 }; { - wcsncpy(tmp2, ptrT(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")), MAX_PATH - 1); - mir_tstrncat(tmp2, L"\\", _countof(tmp2) - mir_tstrlen(tmp2)); - mir_tstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_tstrlen(tmp2)); + wcsncpy(tmp2, ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")), MAX_PATH - 1); + mir_wstrncat(tmp2, L"\\", _countof(tmp2) - mir_wstrlen(tmp2)); + mir_wstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_wstrlen(tmp2)); boost::filesystem::remove(tmp2); - ptrT ptmp; + ptrW ptmp; if (db_mc_isMeta(hContact)) ptmp = UniGetContactSettingUtf(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", L""); else diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index 7ea7e6f1eb..89e77e782c 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -68,9 +68,9 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR else if (bDebugLog) debuglog << std::string(time_str() + ": info: received encrypted message from: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); boost::algorithm::erase_all(str, "\r"); - s2 += mir_tstrlen(L"-----END PGP MESSAGE-----"); + s2 += mir_wstrlen(L"-----END PGP MESSAGE-----"); - ptrT ptszHomePath(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")); + ptrW ptszHomePath(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")); wstring encfile = toUTF16(get_random(10)); wstring decfile = toUTF16(get_random(10)); { @@ -100,7 +100,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR } f.open(path.c_str(), std::ios::out); } - char *tmp = mir_t2a(str.substr(s1, s2 - s1).c_str()); + char *tmp = mir_u2a(str.substr(s1, s2 - s1).c_str()); f << tmp; mir_free(tmp); f.close(); @@ -418,7 +418,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) { if (bDebugLog) debuglog << std::string(time_str() + ": info(autoexchange): found pubkey block:" + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); - s2 += mir_tstrlen(L"-----END PGP PUBLIC KEY BLOCK-----"); + s2 += mir_wstrlen(L"-----END PGP PUBLIC KEY BLOCK-----"); db_set_ts(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1, s2 - s1).c_str()); { //gpg execute block std::vector<wstring> cmd; @@ -426,15 +426,15 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) string output; DWORD exitcode; { - ptrT ptmp(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")); - mir_tstrcpy(tmp2, ptmp); + ptrW ptmp(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")); + mir_wstrcpy(tmp2, ptmp); mir_free(ptmp); - mir_tstrcat(tmp2, L"\\"); - wchar_t *tmp3 = mir_a2t(get_random(5).c_str()); - mir_tstrcat(tmp2, tmp3); - mir_tstrcat(tmp2, L".asc"); + mir_wstrcat(tmp2, L"\\"); + wchar_t *tmp3 = mir_a2u(get_random(5).c_str()); + mir_wstrcat(tmp2, tmp3); + mir_wstrcat(tmp2, L".asc"); mir_free(tmp3); - //mir_tstrcat(tmp2, L"temporary_exported.asc"); + //mir_wstrcat(tmp2, L"temporary_exported.asc"); if(!bDebugLog) { boost::system::error_code e; @@ -565,9 +565,9 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) str.erase(s1, 1); void ShowNewKeyDialog(); if (((s2 = str.find(L"-----END PGP PUBLIC KEY BLOCK-----")) != wstring::npos) && ((s1 = str.find(L"-----BEGIN PGP PUBLIC KEY BLOCK-----")) != wstring::npos)) - s2 += mir_tstrlen(L"-----END PGP PUBLIC KEY BLOCK-----"); + s2 += mir_wstrlen(L"-----END PGP PUBLIC KEY BLOCK-----"); else if (((s2 = str.find(L"-----BEGIN PGP PRIVATE KEY BLOCK-----")) != wstring::npos) && ((s1 = str.find(L"-----END PGP PRIVATE KEY BLOCK-----")) != wstring::npos)) - s2 += mir_tstrlen(L"-----END PGP PRIVATE KEY BLOCK-----"); + s2 += mir_wstrlen(L"-----END PGP PRIVATE KEY BLOCK-----"); new_key.append(str.substr(s1, s2 - s1)); //new_key_hcnt_mutex.lock(); new_key_hcnt = ccs->hContact; @@ -688,7 +688,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) cmd.push_back(L"--batch"); cmd.push_back(L"--yes"); cmd.push_back(L"-eatr"); - tmp2 = mir_a2t(tmp); + tmp2 = mir_a2u(tmp); mir_free(tmp); } cmd.push_back(tmp2); @@ -1040,8 +1040,8 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam } if (password) mir_free(password); - password = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_tstrlen(tmp) + 1)); - mir_tstrcpy(password, tmp); + password = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_wstrlen(tmp) + 1)); + mir_wstrcpy(password, tmp); } mir_free(inkeyid); DestroyWindow(hwndDlg); diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 68595f9ce9..5a7592f833 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -128,14 +128,14 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L iRow = ListView_InsertItem(hwndList, &item);
ListView_SetItemText(hwndList, iRow, 0, name);
- wchar_t *tmp = mir_a2t(GetContactProto(hContact));
+ wchar_t *tmp = mir_a2u(GetContactProto(hContact));
ListView_SetItemText(hwndList, iRow, 4, tmp);
mir_free(tmp);
char *tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", "");
- tmp = mir_a2t(tmp2);
+ tmp = mir_a2u(tmp2);
mir_free(tmp2);
- ListView_SetItemText(hwndList, iRow, 1, (mir_tstrlen(tmp) > 1) ? tmp : L"not set");
+ ListView_SetItemText(hwndList, iRow, 1, (mir_wstrlen(tmp) > 1) ? tmp : L"not set");
mir_free(tmp);
tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainName", "");
@@ -144,7 +144,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L else
tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainName", L"");
mir_free(tmp2);
- ListView_SetItemText(hwndList, iRow, 2, (mir_tstrlen(tmp) > 1) ? tmp : L"not set");
+ ListView_SetItemText(hwndList, iRow, 2, (mir_wstrlen(tmp) > 1) ? tmp : L"not set");
mir_free(tmp);
tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainEmail", "");
@@ -153,7 +153,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L else
tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainEmail", L"");
mir_free(tmp2);
- ListView_SetItemText(hwndList, iRow, 3, (mir_tstrlen(tmp) > 1) ? tmp : L"not set");
+ ListView_SetItemText(hwndList, iRow, 3, (mir_wstrlen(tmp) > 1) ? tmp : L"not set");
mir_free(tmp);
if (db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0))
@@ -169,7 +169,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L }
}
wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szLogFilePath", L"");
- SetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, (mir_tstrlen(tmp) > 1) ? tmp : L"c:\\GPGdebug.log");
+ SetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, (mir_wstrlen(tmp) > 1) ? tmp : L"c:\\GPGdebug.log");
mir_free(tmp);
CheckStateLoadDB(hwndDlg, IDC_DEBUG_LOG, "bDebugLog", 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_JABBER_API), bIsMiranda09);
@@ -230,7 +230,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L cmd.push_back(L"--batch");
cmd.push_back(L"--yes");
cmd.push_back(L"--delete-key");
- ptmp = mir_a2t(tmp);
+ ptmp = mir_a2u(tmp);
cmd.push_back(ptmp);
mir_free(ptmp);
gpg_execution_params params(cmd);
@@ -306,7 +306,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L {
wchar_t *tmp = GetFilePath(TranslateT("Export public key"), L"*", TranslateT(".asc pubkey file"), true);
if (tmp) {
- wstring str(ptrT(UniGetContactSettingUtf(user_data[item_num + 1], szGPGModuleName, "GPGPubKey", L"")));
+ wstring str(ptrW(UniGetContactSettingUtf(user_data[item_num + 1], szGPGModuleName, "GPGPubKey", L"")));
wstring::size_type s = 0;
while ((s = str.find(L"\r", s)) != wstring::npos)
str.erase(s, 1);
@@ -333,7 +333,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L szKey = (char*)GlobalLock(hMem);
if (!szKey) {
wchar_t msg[64];
- mir_sntprintf(msg, TranslateT("Failed to lock memory with error %d"), GetLastError());
+ mir_snwprintf(msg, TranslateT("Failed to lock memory with error %d"), GetLastError());
MessageBox(0, msg, TranslateT("Error"), MB_OK);
GlobalFree(hMem);
}
@@ -346,7 +346,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L if (!SetClipboardData(CF_OEMTEXT, hMem)) {
GlobalFree(hMem);
wchar_t msg[64];
- mir_sntprintf(msg, TranslateT("Failed write to clipboard with error %d"), GetLastError());
+ mir_snwprintf(msg, TranslateT("Failed write to clipboard with error %d"), GetLastError());
MessageBox(0, msg, TranslateT("Error"), MB_OK);
}
CloseClipboard();
@@ -354,13 +354,13 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L }
else {
wchar_t msg[64];
- mir_sntprintf(msg, TranslateT("Failed to open clipboard with error %d"), GetLastError());
+ mir_snwprintf(msg, TranslateT("Failed to open clipboard with error %d"), GetLastError());
MessageBox(0, msg, TranslateT("Error"), MB_OK);
}
break;
case IDC_LOG_FILE_SET:
- SetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, ptrT(GetFilePath(TranslateT("Set log file"), L"*", TranslateT("LOG files"), 1)));
+ SetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, ptrW(GetFilePath(TranslateT("Set log file"), L"*", TranslateT("LOG files"), 1)));
break;
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -415,8 +415,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetDlgItemText(hwndDlg, IDC_BIN_PATH, ptrT(UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe")));
- SetDlgItemText(hwndDlg, IDC_HOME_DIR, ptrT(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"gpg")));
+ SetDlgItemText(hwndDlg, IDC_BIN_PATH, ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe")));
+ SetDlgItemText(hwndDlg, IDC_HOME_DIR, ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"gpg")));
return TRUE;
case WM_COMMAND:
@@ -464,13 +464,13 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, }
}
char mir_path[MAX_PATH];
- char *atmp = mir_t2a(tmp);
+ char *atmp = mir_u2a(tmp);
mir_free(tmp);
PathToAbsolute("\\", mir_path);
char* p_path = NULL;
if (StriStr(atmp, mir_path)) {
p_path = atmp + mir_strlen(mir_path);
- tmp = mir_a2t(p_path);
+ tmp = mir_a2u(p_path);
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
}
}
@@ -481,13 +481,13 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp);
char mir_path[MAX_PATH];
- char *atmp = mir_t2a(tmp);
+ char *atmp = mir_u2a(tmp);
mir_free(tmp);
PathToAbsolute("\\", mir_path);
char* p_path = NULL;
if (StriStr(atmp, mir_path)) {
p_path = atmp + mir_strlen(mir_path);
- tmp = mir_a2t(p_path);
+ tmp = mir_a2u(p_path);
SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp);
}
mir_free(atmp);
@@ -507,8 +507,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, _countof(tmp));
- while (tmp[mir_tstrlen(tmp) - 1] == '\\')
- tmp[mir_tstrlen(tmp) - 1] = '\0';
+ while (tmp[mir_wstrlen(tmp) - 1] == '\\')
+ tmp[mir_wstrlen(tmp) - 1] = '\0';
db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp);
return TRUE;
}
@@ -569,23 +569,23 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, GetDlgItemText(hwndDlg, IDC_IN_OPEN_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szInOpenTag", tmp);
mir_free(inopentag);
- inopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_tstrlen(tmp) + 1));
- mir_tstrcpy(inopentag, tmp);
+ inopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_wstrlen(tmp) + 1));
+ mir_wstrcpy(inopentag, tmp);
GetDlgItemText(hwndDlg, IDC_IN_CLOSE_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szInCloseTag", tmp);
mir_free(inclosetag);
- inclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_tstrlen(tmp) + 1));
- mir_tstrcpy(inclosetag, tmp);
+ inclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_wstrlen(tmp) + 1));
+ mir_wstrcpy(inclosetag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_OPEN_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szOutOpenTag", tmp);
mir_free(outopentag);
- outopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_tstrlen(tmp) + 1));
- mir_tstrcpy(outopentag, tmp);
+ outopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_wstrlen(tmp) + 1));
+ mir_wstrcpy(outopentag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_CLOSE_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szOutCloseTag", tmp);
mir_free(outclosetag);
- outclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_tstrlen(tmp) + 1));
- mir_tstrcpy(outclosetag, tmp);
+ outclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_wstrlen(tmp) + 1));
+ mir_wstrcpy(outclosetag, tmp);
}
return TRUE;
}
@@ -713,7 +713,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa if ((out.find("-----BEGIN PGP PUBLIC KEY BLOCK-----") != string::npos) && (out.find("-----END PGP PUBLIC KEY BLOCK-----") != string::npos)) {
boost::algorithm::replace_all(out, "\n", "\r\n");
- wchar_t *tmp3 = mir_a2t(out.c_str());
+ wchar_t *tmp3 = mir_a2u(out.c_str());
str.clear();
str.append(tmp3);
mir_free(tmp3);
@@ -758,22 +758,22 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa }
ws1 = 0;
if (((ws2 = key_buf.find(L"-----END PGP PUBLIC KEY BLOCK-----")) != wstring::npos) && ((ws1 = key_buf.find(L"-----BEGIN PGP PUBLIC KEY BLOCK-----")) != wstring::npos)) {
- begin = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----BEGIN PGP PUBLIC KEY BLOCK-----") + 1));
- mir_tstrcpy(begin, L"-----BEGIN PGP PUBLIC KEY BLOCK-----");
- end = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----END PGP PUBLIC KEY BLOCK-----") + 1));
- mir_tstrcpy(end, L"-----END PGP PUBLIC KEY BLOCK-----");
+ begin = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_wstrlen(L"-----BEGIN PGP PUBLIC KEY BLOCK-----") + 1));
+ mir_wstrcpy(begin, L"-----BEGIN PGP PUBLIC KEY BLOCK-----");
+ end = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_wstrlen(L"-----END PGP PUBLIC KEY BLOCK-----") + 1));
+ mir_wstrcpy(end, L"-----END PGP PUBLIC KEY BLOCK-----");
}
else if (((ws2 = key_buf.find(L"-----END PGP PRIVATE KEY BLOCK-----")) != wstring::npos) && ((ws1 = key_buf.find(L"-----BEGIN PGP PRIVATE KEY BLOCK-----")) != wstring::npos)) {
- begin = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----BEGIN PGP PRIVATE KEY BLOCK-----") + 1));
- mir_tstrcpy(begin, L"-----BEGIN PGP PRIVATE KEY BLOCK-----");
- end = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----END PGP PRIVATE KEY BLOCK-----") + 1));
- mir_tstrcpy(end, L"-----END PGP PRIVATE KEY BLOCK-----");
+ begin = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_wstrlen(L"-----BEGIN PGP PRIVATE KEY BLOCK-----") + 1));
+ mir_wstrcpy(begin, L"-----BEGIN PGP PRIVATE KEY BLOCK-----");
+ end = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_wstrlen(L"-----END PGP PRIVATE KEY BLOCK-----") + 1));
+ mir_wstrcpy(end, L"-----END PGP PRIVATE KEY BLOCK-----");
}
else {
MessageBox(0, TranslateT("This is not public or private key"), L"INFO", MB_OK);
break;
}
- ws2 += mir_tstrlen(end);
+ ws2 += mir_wstrlen(end);
bool allsubcontacts = false;
{
if (db_mc_isMeta(hContact)) {
@@ -791,7 +791,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa else db_set_ts(hContact, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
}
tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * (key_buf.length() + 1));
- mir_tstrcpy(tmp, key_buf.substr(ws1, ws2 - ws1).c_str());
+ mir_wstrcpy(tmp, key_buf.substr(ws1, ws2 - ws1).c_str());
{ //gpg execute block
std::vector<wstring> cmd;
wchar_t tmp2[MAX_PATH] = { 0 };
@@ -803,8 +803,8 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
wcsncpy(tmp2, ptmp, MAX_PATH - 1);
mir_free(ptmp);
- mir_tstrncat(tmp2, L"\\", _countof(tmp2) - mir_tstrlen(tmp2));
- mir_tstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_tstrlen(tmp2));
+ mir_wstrncat(tmp2, L"\\", _countof(tmp2) - mir_wstrlen(tmp2));
+ mir_wstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_wstrlen(tmp2));
boost::filesystem::remove(tmp2);
wfstream f(tmp2, std::ios::out);
ptmp = UniGetContactSettingUtf(hcnt, szGPGModuleName, "GPGPubKey", L"");
@@ -1105,7 +1105,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa MessageBox(0, TranslateT("There is no public or private key."), TranslateT("Info"), MB_OK);
break;
}
- ws2 += mir_tstrlen(L"-----END PGP PUBLIC KEY BLOCK-----");
+ ws2 += mir_wstrlen(L"-----END PGP PUBLIC KEY BLOCK-----");
SetDlgItemText(hwndDlg, IDC_PUBLIC_KEY_EDIT, key_buf.substr(ws1, ws2 - ws1).c_str());
key_buf.clear();
}
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 1a169bbcb3..a0359340a9 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -29,11 +29,11 @@ wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModu DBVARIANT dbv = { DBVT_DELETED }; wchar_t* szRes = NULL; if (db_get_ts(hContact, szModule, szSetting, &dbv)) - return mir_tstrdup(szDef); + return mir_wstrdup(szDef); else if (dbv.pszVal) - szRes = mir_tstrdup(dbv.ptszVal); + szRes = mir_wstrdup(dbv.ptszVal); else - szRes = mir_tstrdup(szDef); + szRes = mir_wstrdup(szDef); db_free(&dbv); return szRes; @@ -62,15 +62,15 @@ void GetFilePath(wchar_t *WindowTittle, char *szSetting, wchar_t *szExt, wchar_t ofn.Flags = OFN_EXPLORER; ofn.lpstrTitle = TranslateW(WindowTittle); wcsncpy(filter, TranslateW(szExtDesc), _countof(filter) - 1); - pfilter = filter + mir_tstrlen(filter) + 1; - mir_tstrcpy(pfilter, szExt); - pfilter[mir_tstrlen(pfilter) + 1] = '\0'; - pfilter[mir_tstrlen(pfilter) + 2] = '\0'; + pfilter = filter + mir_wstrlen(filter) + 1; + mir_wstrcpy(pfilter, szExt); + pfilter[mir_wstrlen(pfilter) + 1] = '\0'; + pfilter[mir_wstrlen(pfilter) + 2] = '\0'; ofn.lpstrFilter = filter; tmp = UniGetContactSettingUtf(0, szGPGModuleName, szSetting, L""); wcsncpy(str, tmp, _countof(str) - 1); mir_free(tmp); - if (mir_tstrlen(str) < 2) + if (mir_wstrlen(str) < 2) str[0] = '\0'; ofn.lpstrFile = str; ofn.nMaxFile = _MAX_PATH; @@ -88,14 +88,14 @@ wchar_t *GetFilePath(wchar_t *WindowTittle, wchar_t *szExt, wchar_t *szExtDesc, ofn.lStructSize = CDSIZEOF_STRUCT(OPENFILENAME, lpTemplateName); ofn.Flags = OFN_EXPLORER; ofn.lpstrTitle = TranslateW(WindowTittle); - mir_tstrcpy(filter, TranslateW(szExtDesc)); - pfilter = filter + mir_tstrlen(filter) + 1; - mir_tstrcpy(pfilter, szExt); - pfilter[mir_tstrlen(pfilter) + 1] = '\0'; - pfilter[mir_tstrlen(pfilter) + 2] = '\0'; + mir_wstrcpy(filter, TranslateW(szExtDesc)); + pfilter = filter + mir_wstrlen(filter) + 1; + mir_wstrcpy(pfilter, szExt); + pfilter[mir_wstrlen(pfilter) + 1] = '\0'; + pfilter[mir_wstrlen(pfilter) + 2] = '\0'; ofn.lpstrFilter = filter; - mir_tstrcpy(str, L""); - if (mir_tstrlen(str) < 2) + mir_wstrcpy(str, L""); + if (mir_wstrlen(str) < 2) str[0] = '\0'; ofn.lpstrFile = str; ofn.nMaxFile = _MAX_PATH; @@ -238,7 +238,7 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM) keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); } wchar_t buf[128] = { 0 }; - mir_sntprintf(buf, L"%s: %s", TranslateT("Send public key"), toUTF16(keyid).c_str()); + mir_snwprintf(buf, L"%s: %s", TranslateT("Send public key"), toUTF16(keyid).c_str()); mir_free(keyid); Menu_ModifyItem(hSendKey, buf); } @@ -285,7 +285,7 @@ int onProtoAck(WPARAM, LPARAM l) } else { if (f->szCurrentFile && f->szCurrentFile[0]) - filename = mir_utf8decodeT(f->szCurrentFile); + filename = mir_utf8decodeW(f->szCurrentFile); if (!filename) return 0; } @@ -309,7 +309,7 @@ int onProtoAck(WPARAM, LPARAM l) cmd.push_back(L"-o"); wstring file = filename; wstring::size_type p1 = file.rfind(L".gpg"); - file.erase(p1, mir_tstrlen(L".gpg")); + file.erase(p1, mir_wstrlen(L".gpg")); if (boost::filesystem::exists(file)) { if (MessageBox(0, TranslateT("Target file exists, do you want to replace it?"), TranslateT("Warning"), MB_YESNO) == IDNO) return 0; @@ -325,15 +325,15 @@ int onProtoAck(WPARAM, LPARAM l) dbsetting += keyid; dbsetting += "_Password"; pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), L""); - if (mir_tstrlen(pass) > 0 && bDebugLog) + if (mir_wstrlen(pass) > 0 && bDebugLog) debuglog << std::string(time_str() + ": info: found password in database for key ID: " + keyid + ", trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(ack->hContact, 0)) + " with password"); } else { pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); - if (mir_tstrlen(pass) > 0 && bDebugLog) + if (mir_wstrlen(pass) > 0 && bDebugLog) debuglog << std::string(time_str() + ": info: found password for all keys in database, trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(ack->hContact, 0)) + " with password"); } - if (mir_tstrlen(pass) > 0) { + if (mir_wstrlen(pass) > 0) { cmd.push_back(L"--passphrase"); cmd.push_back(pass); } @@ -432,14 +432,14 @@ std::wstring encrypt_file(MCONTACT hContact, wchar_t *filename) cmd.push_back(L"--tes"); cmd.push_back(L"-r"); char *keyid = UniGetContactSettingUtf(hcnt, szGPGModuleName, "KeyID", ""); - wchar_t *szKeyid = mir_a2t(keyid); + wchar_t *szKeyid = mir_a2u(keyid); wchar_t *name = wcsrchr(filename, '\\'); if (!name) name = filename; else name++; - wchar_t *file_out = new wchar_t[mir_tstrlen(name) + mir_tstrlen(L".gpg") + 1]; - mir_sntprintf(file_out, mir_tstrlen(name) + mir_tstrlen(L".gpg") + 1, L"%s.gpg", name); + wchar_t *file_out = new wchar_t[mir_wstrlen(name) + mir_wstrlen(L".gpg") + 1]; + mir_snwprintf(file_out, mir_wstrlen(name) + mir_wstrlen(L".gpg") + 1, L"%s.gpg", name); cmd.push_back(szKeyid); if (db_get_b(hcnt, szGPGModuleName, "bAlwaysTrust", 0)) { cmd.push_back(L"--trust-model"); @@ -542,7 +542,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) continue; std::wstring path_out = encrypt_file(ccs->hContact, file[i]); mir_free(file[i]); - file[i] = mir_tstrdup(path_out.c_str()); + file[i] = mir_wstrdup(path_out.c_str()); transfers.push_back(path_out); } } @@ -553,7 +553,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) return 0; //we do not want to send file unencrypted (sometimes ack have wrong info) if (strstr(file[i], ".gpg")) continue; - wchar_t *tmp = mir_utf8decodeT(file[i]); + wchar_t *tmp = mir_utf8decodeW(file[i]); std::wstring path_out = encrypt_file(ccs->hContact, tmp); mir_free(tmp); char* tmp2 = mir_utf8encodeW(path_out.c_str()); @@ -618,11 +618,11 @@ int GetJabberInterface(WPARAM, LPARAM) //get interface for all jabber accounts, if (JIftmp) { (*p)->setJabberInterface(JIftmp); if (accounts[i]->tszAccountName) { - wchar_t* tmp = mir_tstrdup(accounts[i]->tszAccountName); + wchar_t* tmp = mir_wstrdup(accounts[i]->tszAccountName); (*p)->setAccountName(tmp); } else { - wchar_t *tmp = mir_a2t(accounts[i]->szModuleName); + wchar_t *tmp = mir_a2u(accounts[i]->szModuleName); (*p)->setAccountName(tmp); } (*p)->setAccountNumber(a); @@ -657,7 +657,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*) if (wcsstr(str, L"-----BEGIN PGP MESSAGE-----") && wcsstr(str, L"-----END PGP MESSAGE-----")) { wstring data = str; xmlSetText(local_node, L"This message is encrypted."); - wstring::size_type p1 = data.find(L"-----BEGIN PGP MESSAGE-----") + mir_tstrlen(L"-----BEGIN PGP MESSAGE-----"); + wstring::size_type p1 = data.find(L"-----BEGIN PGP MESSAGE-----") + mir_wstrlen(L"-----BEGIN PGP MESSAGE-----"); while (data.find(L"Version: ", p1) != wstring::npos) { p1 = data.find(L"Version: ", p1); p1 = data.find(L"\n", p1); @@ -713,7 +713,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*) inkeyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); } - ptrT pass; + ptrW pass; if (inkeyid[0]) { string dbsetting = "szKey_"; dbsetting += inkeyid; @@ -778,7 +778,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*) break; } if (data.find(L"-----BEGIN PGP SIGNATURE-----") != wstring::npos && data.find(L"-----END PGP SIGNATURE-----") != wstring::npos) { - wstring::size_type p1 = data.find(L"-----BEGIN PGP SIGNATURE-----") + mir_tstrlen(L"-----BEGIN PGP SIGNATURE-----"); + wstring::size_type p1 = data.find(L"-----BEGIN PGP SIGNATURE-----") + mir_wstrlen(L"-----BEGIN PGP SIGNATURE-----"); if (data.find(L"Version: ", p1) != wstring::npos) { p1 = data.find(L"Version: ", p1); p1 = data.find(L"\n", p1); @@ -978,7 +978,7 @@ bool isContactSecured(MCONTACT hContact) bool isContactHaveKey(MCONTACT hContact) { wchar_t *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); - if (mir_tstrlen(key) > 0) { + if (mir_wstrlen(key) > 0) { mir_free(key); return true; } @@ -1015,21 +1015,21 @@ bool isGPGValid() wchar_t *mir_path = (wchar_t*)mir_alloc(MAX_PATH * sizeof(wchar_t)); PathToAbsoluteW(L"\\", mir_path); SetCurrentDirectoryW(mir_path); - tmp = mir_tstrdup(mir_path); + tmp = mir_wstrdup(mir_path); mir_free(mir_path); - //mir_realloc(path, (mir_tstrlen(path)+64)*sizeof(wchar_t)); + //mir_realloc(path, (mir_wstrlen(path)+64)*sizeof(wchar_t)); wchar_t *gpg_path = (wchar_t*)mir_alloc(sizeof(wchar_t)*MAX_PATH); - mir_tstrcpy(gpg_path, tmp); - mir_tstrcat(gpg_path, L"\\GnuPG\\gpg.exe"); + mir_wstrcpy(gpg_path, tmp); + mir_wstrcat(gpg_path, L"\\GnuPG\\gpg.exe"); mir_free(tmp); tmp = NULL; p = boost::filesystem::path(gpg_path); if (boost::filesystem::exists(p) && boost::filesystem::is_regular_file(p)) { gpg_exists = true; - mir_tstrcpy(path, L"GnuPG\\gpg.exe"); + mir_wstrcpy(path, L"GnuPG\\gpg.exe"); } mir_free(gpg_path); - tmp = mir_tstrdup(path); + tmp = mir_wstrdup(path); mir_free(path); } @@ -1254,7 +1254,7 @@ void ExportGpGKeysFunc(int type) //TODO: handle error return; } - char *path = mir_t2a(p); + char *path = mir_u2a(p); delete[] p; std::ofstream file; file.open(path, std::ios::trunc | std::ios::out); @@ -1414,11 +1414,11 @@ void ExportGpGKeysFunc(int type) file.close(); wchar_t msg[512]; if (type == 2) - mir_sntprintf(msg, TranslateT("We have successfully exported %d public keys and all private keys."), exported_keys); + mir_snwprintf(msg, TranslateT("We have successfully exported %d public keys and all private keys."), exported_keys); else if (type == 1) - mir_sntprintf(msg, TranslateT("We have successfully exported all private keys.")); + mir_snwprintf(msg, TranslateT("We have successfully exported all private keys.")); else if (!type) - mir_sntprintf(msg, TranslateT("We have successfully exported %d public keys."), exported_keys); + mir_snwprintf(msg, TranslateT("We have successfully exported %d public keys."), exported_keys); MessageBox(NULL, msg, TranslateT("Keys export result"), MB_OK); } @@ -1438,7 +1438,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) } std::ifstream file; { - ptrA szPath(mir_t2a(p)); + ptrA szPath(mir_u2a(p)); delete[] p; file.open(szPath, std::ios::in); @@ -1724,8 +1724,8 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); wcsncpy(tmp2, ptmp, MAX_PATH - 1); mir_free(ptmp); - mir_tstrncat(tmp2, L"\\", _countof(tmp2) - mir_tstrlen(tmp2)); - mir_tstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_tstrlen(tmp2)); + mir_wstrncat(tmp2, L"\\", _countof(tmp2) - mir_wstrlen(tmp2)); + mir_wstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_wstrlen(tmp2)); boost::filesystem::remove(tmp2); wfstream f(tmp2, std::ios::out); f << toUTF16(key).c_str(); @@ -1752,9 +1752,9 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) file.close(); wchar_t msg[512]; if (processed_private_keys) - mir_sntprintf(msg, TranslateT("We have successfully processed %d public keys and some private keys."), processed_keys); + mir_snwprintf(msg, TranslateT("We have successfully processed %d public keys and some private keys."), processed_keys); else - mir_sntprintf(msg, TranslateT("We have successfully processed %d public keys."), processed_keys); + mir_snwprintf(msg, TranslateT("We have successfully processed %d public keys."), processed_keys); MessageBox(NULL, msg, TranslateT("Keys import result"), MB_OK); return 0; } @@ -1910,7 +1910,7 @@ static INT_PTR CALLBACK DlgProcChangePasswd(HWND hwndDlg, UINT msg, WPARAM wPara old_pass = toUTF8(buf); bool old_pass_match = false; wchar_t *pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); - if (!mir_tstrcmp(pass, buf)) + if (!mir_wstrcmp(pass, buf)) old_pass_match = true; mir_free(pass); @@ -1920,7 +1920,7 @@ static INT_PTR CALLBACK DlgProcChangePasswd(HWND hwndDlg, UINT msg, WPARAM wPara dbsetting += toUTF8(key_id_global); dbsetting += "_Password"; pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), L""); - if (!mir_tstrcmp(pass, buf)) + if (!mir_wstrcmp(pass, buf)) old_pass_match = true; mir_free(pass); } diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp index f72bee89fc..8b587f8779 100644 --- a/plugins/NewsAggregator/Src/Authentication.cpp +++ b/plugins/NewsAggregator/Src/Authentication.cpp @@ -29,11 +29,11 @@ void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg) else if (hwndDlg && IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)) {
wchar_t buf[MAX_PATH] = {0};
GetDlgItemText(hwndDlg, IDC_LOGIN, buf, _countof(buf));
- tlogin = mir_tstrdup(buf);
+ tlogin = mir_wstrdup(buf);
GetDlgItemText(hwndDlg, IDC_PASSWORD, buf, _countof(buf));
- tpass = mir_tstrdup(buf);
+ tpass = mir_wstrdup(buf);
}
- char *user = mir_t2a(tlogin), *pass = mir_t2a(tpass);
+ char *user = mir_u2a(tlogin), *pass = mir_u2a(tpass);
char str[MAX_PATH];
int len = mir_snprintf(str, "%s:%s", user, pass);
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 4abe1c0395..8586d20477 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -25,9 +25,9 @@ LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg) char *szData = NULL;
GetNewsData(tszURL, &szData, NULL, hwndDlg);
if (szData) {
- wchar_t *tszData = mir_utf8decodeT(szData);
+ wchar_t *tszData = mir_utf8decodeW(szData);
if (!tszData)
- tszData = mir_a2t(szData);
+ tszData = mir_a2u(szData);
int bytesParsed = 0;
HXML hXml = xmlParseString(tszData, &bytesParsed, NULL);
mir_free(tszData);
@@ -36,11 +36,11 @@ LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg) LPCTSTR codepage = NULL;
int childcount = 0;
HXML node;
- if (!mir_tstrcmpi(xmlGetName(hXml), L"xml")) {
+ if (!mir_wstrcmpi(xmlGetName(hXml), L"xml")) {
int attrcount = xmlGetAttrCount(hXml);
for (int i = 0; i < attrcount; i++) {
LPCTSTR szAttrName = xmlGetAttrName(hXml, i);
- if (!mir_tstrcmpi(szAttrName, L"encoding")) {
+ if (!mir_wstrcmpi(szAttrName, L"encoding")) {
codepage = xmlGetAttrValue(hXml, szAttrName);
break;
}
@@ -51,38 +51,38 @@ LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg) node = hXml;
while (node) {
LPCTSTR szNodeName = xmlGetName(node);
- if (!mir_tstrcmpi(szNodeName, L"rss") || !mir_tstrcmpi(szNodeName, L"rdf")) {
+ if (!mir_wstrcmpi(szNodeName, L"rss") || !mir_wstrcmpi(szNodeName, L"rdf")) {
HXML chan = xmlGetChild(node, 0);
for (int j = 0; j < xmlGetChildCount(chan); j++) {
HXML child = xmlGetChild(chan, j);
- if (!mir_tstrcmpi(xmlGetName(child), L"title")) {
+ if (!mir_wstrcmpi(xmlGetName(child), L"title")) {
wchar_t mes[MAX_PATH];
- mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
+ mir_snwprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
- if (!mir_tstrcmpi(codepage, L"koi8-r")) {
+ if (!mir_wstrcmpi(codepage, L"koi8-r")) {
wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
- return mir_tstrdup(buf);
+ return mir_wstrdup(buf);
}
else
- return mir_tstrdup(xmlGetText(child));
+ return mir_wstrdup(xmlGetText(child));
}
}
}
- else if (!mir_tstrcmpi(szNodeName, L"feed")) {
+ else if (!mir_wstrcmpi(szNodeName, L"feed")) {
for (int j = 0; j < xmlGetChildCount(node); j++) {
HXML child = xmlGetChild(node, j);
- if (!mir_tstrcmpi(xmlGetName(child), L"title")) {
+ if (!mir_wstrcmpi(xmlGetName(child), L"title")) {
wchar_t mes[MAX_PATH];
- mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
+ mir_snwprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
- if (!mir_tstrcmpi(codepage, L"koi8-r")) {
+ if (!mir_wstrcmpi(codepage, L"koi8-r")) {
wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
- return mir_tstrdup(buf);
+ return mir_wstrdup(buf);
}
else
- return mir_tstrdup(xmlGetText(child));
+ return mir_wstrdup(xmlGetText(child));
}
}
}
@@ -93,7 +93,7 @@ LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg) }
Netlib_LogfT(hNetlibUser, L"%s is not a valid feed's address.", tszURL);
wchar_t mes[MAX_PATH];
- mir_sntprintf(mes, TranslateT("%s\nis not a valid feed's address."), tszURL);
+ mir_snwprintf(mes, TranslateT("%s\nis not a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONERROR);
return NULL;
}
@@ -194,9 +194,9 @@ void CheckCurrentFeed(MCONTACT hContact) mir_free(szURL);
if (szData) {
- wchar_t *tszData = mir_utf8decodeT(szData);
+ wchar_t *tszData = mir_utf8decodeW(szData);
if (!tszData)
- tszData = mir_a2t(szData);
+ tszData = mir_a2u(szData);
int bytesParsed = 0;
HXML hXml = xmlParseString(tszData, &bytesParsed, NULL);
mir_free(tszData);
@@ -207,11 +207,11 @@ void CheckCurrentFeed(MCONTACT hContact) LPCTSTR codepage = NULL;
int childcount = 0;
HXML node;
- if (!mir_tstrcmpi(xmlGetName(hXml), L"xml")) {
+ if (!mir_wstrcmpi(xmlGetName(hXml), L"xml")) {
int attrcount = xmlGetAttrCount(hXml);
for (int i = 0; i < attrcount; i++) {
LPCTSTR szAttrName = xmlGetAttrName(hXml, i);
- if (!mir_tstrcmpi(szAttrName, L"encoding")) {
+ if (!mir_wstrcmpi(szAttrName, L"encoding")) {
codepage = xmlGetAttrValue(hXml, szAttrName);
break;
}
@@ -222,14 +222,14 @@ void CheckCurrentFeed(MCONTACT hContact) node = hXml;
while (node) {
LPCTSTR szNodeName = xmlGetName(node);
- bool isRSS = !mir_tstrcmpi(szNodeName, L"rss"), isAtom = !mir_tstrcmpi(szNodeName, L"rdf");
+ bool isRSS = !mir_wstrcmpi(szNodeName, L"rss"), isAtom = !mir_wstrcmpi(szNodeName, L"rdf");
if (isRSS || isAtom) {
if (isRSS) {
for (int i = 0; i < xmlGetAttrCount(node); i++) {
LPCTSTR szAttrName = xmlGetAttrName(node, i);
- if (!mir_tstrcmpi(szAttrName, L"version")) {
+ if (!mir_wstrcmpi(szAttrName, L"version")) {
wchar_t ver[MAX_PATH];
- mir_sntprintf(ver, L"RSS %s", xmlGetAttrValue(node, szAttrName));
+ mir_snwprintf(ver, L"RSS %s", xmlGetAttrValue(node, szAttrName));
db_set_ts(hContact, MODULE, "MirVer", ver);
break;
}
@@ -242,9 +242,9 @@ void CheckCurrentFeed(MCONTACT hContact) for (int j = 0; j < xmlGetChildCount(chan); j++) {
HXML child = xmlGetChild(chan, j);
LPCTSTR childName = xmlGetName(child);
- if (!mir_tstrcmpi(childName, L"title")) {
+ if (!mir_wstrcmpi(childName, L"title")) {
LPCTSTR szChildText = NULL;
- if (!mir_tstrcmpi(codepage, L"koi8-r")) {
+ if (!mir_wstrcmpi(codepage, L"koi8-r")) {
wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
@@ -254,9 +254,9 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText)
db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText));
}
- else if (!mir_tstrcmpi(childName, L"link")) {
+ else if (!mir_wstrcmpi(childName, L"link")) {
LPCTSTR szChildText = NULL;
- if (!mir_tstrcmpi(codepage, L"koi8-r")) {
+ if (!mir_wstrcmpi(codepage, L"koi8-r")) {
wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
@@ -266,9 +266,9 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText)
db_set_ts(hContact, MODULE, "Homepage", ClearText(szValue, szChildText));
}
- else if (!mir_tstrcmpi(childName, L"description")) {
+ else if (!mir_wstrcmpi(childName, L"description")) {
LPCTSTR szChildText = NULL;
- if (!mir_tstrcmpi(codepage, L"koi8-r")) {
+ if (!mir_wstrcmpi(codepage, L"koi8-r")) {
wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
@@ -281,9 +281,9 @@ void CheckCurrentFeed(MCONTACT hContact) db_set_ts(hContact, "CList", "StatusMsg", szValue);
}
}
- else if (!mir_tstrcmpi(childName, L"language")) {
+ else if (!mir_wstrcmpi(childName, L"language")) {
LPCTSTR szChildText = NULL;
- if (!mir_tstrcmpi(codepage, L"koi8-r")) {
+ if (!mir_wstrcmpi(codepage, L"koi8-r")) {
wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
@@ -293,9 +293,9 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText)
db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText));
}
- else if (!mir_tstrcmpi(childName, L"managingEditor")) {
+ else if (!mir_wstrcmpi(childName, L"managingEditor")) {
LPCTSTR szChildText = NULL;
- if (!mir_tstrcmpi(codepage, L"koi8-r")) {
+ if (!mir_wstrcmpi(codepage, L"koi8-r")) {
wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
@@ -305,9 +305,9 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText)
db_set_ts(hContact, MODULE, "e-mail", ClearText(szValue, szChildText));
}
- else if (!mir_tstrcmpi(childName, L"category")) {
+ else if (!mir_wstrcmpi(childName, L"category")) {
LPCTSTR szChildText = NULL;
- if (!mir_tstrcmpi(codepage, L"koi8-r")) {
+ if (!mir_wstrcmpi(codepage, L"koi8-r")) {
wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
@@ -317,9 +317,9 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText)
db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText));
}
- else if (!mir_tstrcmpi(childName, L"copyright")) {
+ else if (!mir_wstrcmpi(childName, L"copyright")) {
LPCTSTR szChildText = NULL;
- if (!mir_tstrcmpi(codepage, L"koi8-r")) {
+ if (!mir_wstrcmpi(codepage, L"koi8-r")) {
wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
@@ -329,10 +329,10 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText)
db_set_s(hContact, "UserInfo", "MyNotes", _T2A(ClearText(szValue, szChildText)));
}
- else if (!mir_tstrcmpi(childName, L"image")) {
+ else if (!mir_wstrcmpi(childName, L"image")) {
for (int x = 0; x < xmlGetChildCount(child); x++) {
HXML imageval = xmlGetChild(child, x);
- if (!mir_tstrcmpi(xmlGetName(imageval), L"url")) {
+ if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
db_set_ts(hContact, MODULE, "ImageURL", url);
@@ -346,7 +346,7 @@ void CheckCurrentFeed(MCONTACT hContact) CMString filename = szNick;
filename.Replace(L"/", L"_");
- mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename.c_str(), ext);
+ mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename.c_str(), ext);
CreateDirectoryTreeT(tszRoot);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
@@ -359,9 +359,9 @@ void CheckCurrentFeed(MCONTACT hContact) }
}
}
- else if (!mir_tstrcmpi(childName, L"lastBuildDate")) {
+ else if (!mir_wstrcmpi(childName, L"lastBuildDate")) {
LPCTSTR szChildText = NULL;
- if (!mir_tstrcmpi(codepage, L"koi8-r")) {
+ if (!mir_wstrcmpi(codepage, L"koi8-r")) {
wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
@@ -379,14 +379,14 @@ void CheckCurrentFeed(MCONTACT hContact) }
}
}
- else if (!mir_tstrcmpi(childName, L"item")) {
+ else if (!mir_wstrcmpi(childName, L"item")) {
CMString title, link, descr, author, comments, guid, category;
time_t stamp = 0;
for (int z = 0; z < xmlGetChildCount(child); z++) {
HXML itemval = xmlGetChild(child, z);
LPCTSTR itemName = xmlGetName(itemval);
LPCTSTR value = NULL;
- if (!mir_tstrcmpi(codepage, L"koi8-r")) {
+ if (!mir_wstrcmpi(codepage, L"koi8-r")) {
wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(itemval)), -1, buf, _countof(buf));
value = buf;
@@ -395,29 +395,29 @@ void CheckCurrentFeed(MCONTACT hContact) value = xmlGetText(itemval);
// We only use the first tag for now and ignore the rest.
- if (!mir_tstrcmpi(itemName, L"title"))
+ if (!mir_wstrcmpi(itemName, L"title"))
ClearText(title, value);
- else if (!mir_tstrcmpi(itemName, L"link"))
+ else if (!mir_wstrcmpi(itemName, L"link"))
ClearText(link, value);
- else if (!mir_tstrcmpi(itemName, L"pubDate") || !mir_tstrcmpi(itemName, L"date")) {
+ else if (!mir_wstrcmpi(itemName, L"pubDate") || !mir_wstrcmpi(itemName, L"date")) {
if (stamp == 0)
stamp = DateToUnixTime(value, 0);
}
- else if (!mir_tstrcmpi(itemName, L"description") || !mir_tstrcmpi(itemName, L"encoded"))
+ else if (!mir_wstrcmpi(itemName, L"description") || !mir_wstrcmpi(itemName, L"encoded"))
ClearText(descr, value);
- else if (!mir_tstrcmpi(itemName, L"author") || !mir_tstrcmpi(itemName, L"creator"))
+ else if (!mir_wstrcmpi(itemName, L"author") || !mir_wstrcmpi(itemName, L"creator"))
ClearText(author, value);
- else if (!mir_tstrcmpi(itemName, L"comments"))
+ else if (!mir_wstrcmpi(itemName, L"comments"))
ClearText(comments, value);
- else if (!mir_tstrcmpi(itemName, L"guid"))
+ else if (!mir_wstrcmpi(itemName, L"guid"))
ClearText(guid, value);
- else if (!mir_tstrcmpi(itemName, L"category"))
+ else if (!mir_wstrcmpi(itemName, L"category"))
ClearText(category, value);
}
@@ -425,27 +425,27 @@ void CheckCurrentFeed(MCONTACT hContact) }
}
}
- else if (!mir_tstrcmpi(szNodeName, L"feed")) {
+ else if (!mir_wstrcmpi(szNodeName, L"feed")) {
db_set_ts(hContact, MODULE, "MirVer", L"Atom 3");
for (int j = 0; j < xmlGetChildCount(node); j++) {
HXML child = xmlGetChild(node, j);
LPCTSTR szChildName = xmlGetName(child);
- if (!mir_tstrcmpi(szChildName, L"title")) {
+ if (!mir_wstrcmpi(szChildName, L"title")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText));
}
- else if (!mir_tstrcmpi(szChildName, L"link")) {
+ else if (!mir_wstrcmpi(szChildName, L"link")) {
for (int x = 0; x < xmlGetAttrCount(child); x++) {
- if (!mir_tstrcmpi(xmlGetAttrName(child, x), L"rel"))
- if (!mir_tstrcmpi(xmlGetAttrValue(child, xmlGetAttrName(child, x)), L"self"))
+ if (!mir_wstrcmpi(xmlGetAttrName(child, x), L"rel"))
+ if (!mir_wstrcmpi(xmlGetAttrValue(child, xmlGetAttrName(child, x)), L"self"))
break;
- if (!mir_tstrcmpi(xmlGetAttrName(child, x), L"href"))
+ if (!mir_wstrcmpi(xmlGetAttrName(child, x), L"href"))
db_set_ts(hContact, MODULE, "Homepage", xmlGetAttrValue(child, xmlGetAttrName(child, x)));
}
}
- else if (!mir_tstrcmpi(szChildName, L"subtitle")) {
+ else if (!mir_wstrcmpi(szChildName, L"subtitle")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText) {
ClearText(szValue, szChildText);
@@ -453,33 +453,33 @@ void CheckCurrentFeed(MCONTACT hContact) db_set_ts(hContact, "CList", "StatusMsg", szValue);
}
}
- else if (!mir_tstrcmpi(szChildName, L"language")) {
+ else if (!mir_wstrcmpi(szChildName, L"language")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText));
}
- else if (!mir_tstrcmpi(szChildName, L"author")) {
+ else if (!mir_wstrcmpi(szChildName, L"author")) {
for (int x = 0; x < xmlGetChildCount(child); x++) {
HXML authorval = xmlGetChild(child, x);
- if (!mir_tstrcmpi(xmlGetName(authorval), L"email")) {
+ if (!mir_wstrcmpi(xmlGetName(authorval), L"email")) {
db_set_ts(hContact, MODULE, "e-mail", xmlGetText(authorval));
break;
}
}
}
- else if (!mir_tstrcmpi(szChildName, L"category")) {
+ else if (!mir_wstrcmpi(szChildName, L"category")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText));
}
- else if (!mir_tstrcmpi(szChildName, L"icon")) {
+ else if (!mir_wstrcmpi(szChildName, L"icon")) {
for (int x = 0; x < xmlGetChildCount(child); x++) {
HXML imageval = xmlGetChild(child, x);
- if (!mir_tstrcmpi(xmlGetName(imageval), L"url")) {
+ if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
db_set_ts(hContact, MODULE, "ImageURL", url);
- ptrT szNick(db_get_tsa(hContact, MODULE, "Nick"));
+ ptrW szNick(db_get_tsa(hContact, MODULE, "Nick"));
if (szNick) {
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
@@ -487,7 +487,7 @@ void CheckCurrentFeed(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext);
wchar_t *filename = szNick;
- mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
+ mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
@@ -498,7 +498,7 @@ void CheckCurrentFeed(MCONTACT hContact) }
}
}
- else if (!mir_tstrcmpi(szChildName, L"updated")) {
+ else if (!mir_wstrcmpi(szChildName, L"updated")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText) {
wchar_t *lastupdtime = (wchar_t *)szChildText;
@@ -512,57 +512,57 @@ void CheckCurrentFeed(MCONTACT hContact) }
}
}
- else if (!mir_tstrcmpi(szChildName, L"entry")) {
+ else if (!mir_wstrcmpi(szChildName, L"entry")) {
CMString title, link, descr, author, comments, guid, category;
time_t stamp = 0;
for (int z = 0; z < xmlGetChildCount(child); z++) {
HXML itemval = xmlGetChild(child, z);
LPCTSTR szItemName = xmlGetName(itemval);
- if (!mir_tstrcmpi(szItemName, L"title")) {
+ if (!mir_wstrcmpi(szItemName, L"title")) {
LPCTSTR szItemText = xmlGetText(itemval);
if (szItemText)
ClearText(title, szItemText);
}
- else if (!mir_tstrcmpi(szItemName, L"link")) {
+ else if (!mir_wstrcmpi(szItemName, L"link")) {
for (int x = 0; x < xmlGetAttrCount(itemval); x++) {
- if (!mir_tstrcmpi(xmlGetAttrName(itemval, x), L"href")) {
+ if (!mir_wstrcmpi(xmlGetAttrName(itemval, x), L"href")) {
ClearText(link, xmlGetAttrValue(itemval, xmlGetAttrName(itemval, x)));
break;
}
}
}
- else if (!mir_tstrcmpi(szItemName, L"updated")) {
+ else if (!mir_wstrcmpi(szItemName, L"updated")) {
if (stamp == 0)
stamp = DateToUnixTime(xmlGetText(itemval), 0);
}
- else if (!mir_tstrcmpi(szItemName, L"summary") || !mir_tstrcmpi(szItemName, L"content")) {
+ else if (!mir_wstrcmpi(szItemName, L"summary") || !mir_wstrcmpi(szItemName, L"content")) {
LPCTSTR szItemText = xmlGetText(itemval);
if (szItemText)
ClearText(descr, szItemText);
}
- else if (!mir_tstrcmpi(szItemName, L"author")) {
+ else if (!mir_wstrcmpi(szItemName, L"author")) {
for (int x = 0; x < xmlGetChildCount(itemval); x++) {
HXML authorval = xmlGetChild(itemval, x);
- if (!mir_tstrcmpi(xmlGetName(authorval), L"name") && xmlGetText(authorval)) {
+ if (!mir_wstrcmpi(xmlGetName(authorval), L"name") && xmlGetText(authorval)) {
ClearText(author, xmlGetText(authorval));
break;
}
}
}
- else if (!mir_tstrcmpi(szItemName, L"comments")) {
+ else if (!mir_wstrcmpi(szItemName, L"comments")) {
LPCTSTR szItemText = xmlGetText(itemval);
if (szItemText)
ClearText(comments, szItemText);
}
- else if (!mir_tstrcmpi(szItemName, L"id")) {
+ else if (!mir_wstrcmpi(szItemName, L"id")) {
LPCTSTR szItemText = xmlGetText(itemval);
if (szItemText)
ClearText(guid, xmlGetText(itemval));
}
- else if (!mir_tstrcmpi(szItemName, L"category")) {
+ else if (!mir_wstrcmpi(szItemName, L"category")) {
for (int x = 0; x < xmlGetAttrCount(itemval); x++) {
LPCTSTR szAttrName = xmlGetAttrName(itemval, x);
- if (!mir_tstrcmpi(szAttrName, L"term") && xmlGetText(itemval)) {
+ if (!mir_wstrcmpi(szAttrName, L"term") && xmlGetText(itemval)) {
ClearText(category, xmlGetAttrValue(itemval, szAttrName));
break;
}
@@ -598,9 +598,9 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) if (szData == NULL)
return;
- wchar_t *tszData = mir_utf8decodeT(szData);
+ wchar_t *tszData = mir_utf8decodeW(szData);
if (!tszData)
- tszData = mir_a2t(szData);
+ tszData = mir_a2u(szData);
int bytesParsed = 0;
HXML hXml = xmlParseString(tszData, &bytesParsed, NULL);
mir_free(tszData);
@@ -612,14 +612,14 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) HXML node = xmlGetChild(hXml, childcount);
while (node) {
LPCTSTR szNodeName = xmlGetName(node);
- if (!mir_tstrcmpi(szNodeName, L"rss") || !mir_tstrcmpi(szNodeName, L"rdf")) {
+ if (!mir_wstrcmpi(szNodeName, L"rss") || !mir_wstrcmpi(szNodeName, L"rdf")) {
HXML chan = xmlGetChild(node, 0);
for (int j = 0; j < xmlGetChildCount(chan); j++) {
HXML child = xmlGetChild(chan, j);
- if (!mir_tstrcmpi(xmlGetName(child), L"image")) {
+ if (!mir_wstrcmpi(xmlGetName(child), L"image")) {
for (int x = 0; x < xmlGetChildCount(child); x++) {
HXML imageval = xmlGetChild(child, x);
- if (!mir_tstrcmpi(xmlGetName(imageval), L"url")) {
+ if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
db_set_ts(hContact, MODULE, "ImageURL", url);
@@ -632,7 +632,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext);
wchar_t *filename = szNick;
- mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
+ mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
@@ -646,17 +646,17 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) }
}
}
- else if (!mir_tstrcmpi(szNodeName, L"feed")) {
+ else if (!mir_wstrcmpi(szNodeName, L"feed")) {
for (int j = 0; j < xmlGetChildCount(node); j++) {
HXML child = xmlGetChild(node, j);
- if (!mir_tstrcmpi(xmlGetName(child), L"icon")) {
+ if (!mir_wstrcmpi(xmlGetName(child), L"icon")) {
for (int x = 0; x < xmlGetChildCount(child); x++) {
HXML imageval = xmlGetChild(child, x);
- if (!mir_tstrcmpi(xmlGetName(imageval), L"url")) {
+ if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
db_set_ts(hContact, MODULE, "ImageURL", url);
- ptrT szNick(db_get_tsa(hContact, MODULE, "Nick"));
+ ptrW szNick(db_get_tsa(hContact, MODULE, "Nick"));
if (szNick) {
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
@@ -665,7 +665,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext);
wchar_t *filename = szNick;
- mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
+ mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index 0943dcd303..e1a5b18e85 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -68,7 +68,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM node = xmlGetNextNode(node);
if (node)
break;
- } while (mir_tstrcmpi(xmlGetName(node), L"body"));
+ } while (mir_wstrcmpi(xmlGetName(node), L"body"));
}
}
else if (!xmlUrl && outlineChildsCount)
@@ -77,8 +77,8 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM wchar_t *text = NULL, *url = NULL, *siteurl = NULL, *group = NULL;
BYTE NeedToImport = FALSE;
for (int i = 0; i < outlineAttr; i++) {
- if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"text")) {
- text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
+ if (!mir_wstrcmpi(xmlGetAttrName(node, i), L"text")) {
+ text = mir_utf8decodeW(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if (!text) {
isTextUTF = 0;
text = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
@@ -88,15 +88,15 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM for (int j = 0; j < count; j++) {
wchar_t item[MAX_PATH];
SendMessage(FeedsImportList, LB_GETTEXT, (WPARAM)j, (LPARAM)item);
- if (!mir_tstrcmpi(item, text)) {
+ if (!mir_wstrcmpi(item, text)) {
NeedToImport = TRUE;
break;
}
}
continue;
}
- if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"xmlUrl")) {
- url = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
+ if (!mir_wstrcmpi(xmlGetAttrName(node, i), L"xmlUrl")) {
+ url = mir_utf8decodeW(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if ( !url) {
isURLUTF = false;
url = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
@@ -108,8 +108,8 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
continue;
}
- if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"htmlUrl")) {
- siteurl = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
+ if (!mir_wstrcmpi(xmlGetAttrName(node, i), L"htmlUrl")) {
+ siteurl = mir_utf8decodeW(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if ( !siteurl) {
isSiteURLUTF = false;
siteurl = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
@@ -124,13 +124,13 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (NeedToImport) {
HXML parent = xmlGetParent(node);
wchar_t tmpgroup[1024];
- while (mir_tstrcmpi(xmlGetName(parent), L"body")) {
+ while (mir_wstrcmpi(xmlGetName(parent), L"body")) {
for (int i = 0; i < xmlGetAttrCount(parent); i++) {
- if (!mir_tstrcmpi(xmlGetAttrName(parent, i), L"text")) {
+ if (!mir_wstrcmpi(xmlGetAttrName(parent, i), L"text")) {
if ( !group)
group = (wchar_t *)xmlGetAttrValue(parent, xmlGetAttrName(parent, i));
else {
- mir_sntprintf(tmpgroup, L"%s\\%s", xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group);
+ mir_snwprintf(tmpgroup, L"%s\\%s", xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group);
group = tmpgroup;
}
break;
@@ -141,7 +141,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM wchar_t *ptszGroup = NULL;
if (group) {
- ptszGroup = mir_utf8decodeT(_T2A(group));
+ ptszGroup = mir_utf8decodeW(_T2A(group));
if ( !ptszGroup) {
isGroupUTF = false;
ptszGroup = group;
@@ -183,7 +183,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (node)
break;
}
- while (mir_tstrcmpi(xmlGetName(tmpnode), L"body"));
+ while (mir_wstrcmpi(xmlGetName(tmpnode), L"body"));
}
}
}
@@ -195,9 +195,9 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
wchar_t mes[MAX_PATH];
if (DUPES)
- mir_sntprintf(mes, TranslateT("Imported %d feed(s)\r\nNot imported %d duplicate(s)."), count - DUPES, DUPES);
+ mir_snwprintf(mes, TranslateT("Imported %d feed(s)\r\nNot imported %d duplicate(s)."), count - DUPES, DUPES);
else
- mir_sntprintf(mes, TranslateT("Imported %d feed(s)."), count);
+ mir_snwprintf(mes, TranslateT("Imported %d feed(s)."), count);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
}
}
@@ -214,7 +214,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
wchar_t tmp[MAX_PATH];
- mir_sntprintf(tmp, L"%s (*.opml, *.xml)%c*.opml;*.xml%c%c", TranslateT("OPML files"), 0, 0, 0);
+ mir_snwprintf(tmp, L"%s (*.opml, *.xml)%c*.opml;*.xml%c%c", TranslateT("OPML files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
@@ -248,15 +248,15 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM node = xmlGetNextNode(node);
if (node)
break;
- } while (mir_tstrcmpi(xmlGetName(node), L"body"));
+ } while (mir_wstrcmpi(xmlGetName(node), L"body"));
}
}
else if (!xmlUrl && outlineChildsCount)
node = xmlGetFirstChild(node);
else if (xmlUrl) {
for (int i = 0; i < outlineAttr; i++) {
- if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"text")) {
- wchar_t *text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
+ if (!mir_wstrcmpi(xmlGetAttrName(node, i), L"text")) {
+ wchar_t *text = mir_utf8decodeW(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
bool isTextUTF;
if (!text) {
isTextUTF = false;
@@ -282,7 +282,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM node = xmlGetNextNode(node);
if (node)
break;
- } while (mir_tstrcmpi(xmlGetName(tmpnode), L"body"));
+ } while (mir_wstrcmpi(xmlGetName(tmpnode), L"body"));
}
}
}
@@ -477,7 +477,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
wchar_t tmp[MAX_PATH];
- mir_sntprintf(tmp, L"%s (*.opml)%c*.opml%c%c", TranslateT("OPML files"), 0, 0, 0);
+ mir_snwprintf(tmp, L"%s (*.opml)%c*.opml%c%c", TranslateT("OPML files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index e27cd761d9..fb3deb5320 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -44,7 +44,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA MessageBox(hwndDlg, TranslateT("Enter Feed name"), TranslateT("Error"), MB_OK);
break;
}
- if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_tstrcmp(str, L"http://") == 0) {
+ if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_wstrcmp(str, L"http://") == 0) {
MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK);
break;
}
@@ -95,7 +95,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_TAGHELP:
wchar_t tszTagHelp[1024];
- mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
+ mir_snwprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"#<title>#", TranslateT("The title of the item."),
L"#<description>#", TranslateT("The item synopsis."),
L"#<link>#", TranslateT("The URL of the item."),
@@ -116,7 +116,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
wchar_t tszURL[MAX_PATH] = { 0 };
wchar_t *tszTitle = NULL;
- if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0)
+ if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_wstrcmp(tszURL, L"http://") != 0)
tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg);
else
MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK);
@@ -152,12 +152,12 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_TIMEOUT_VALUE_SPIN, UDM_SETRANGE32, 0, 999);
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
- ptrT dbNick(db_get_tsa(hContact, MODULE, "Nick"));
- if ((dbNick == NULL) || (mir_tstrcmp(dbNick, SelItem.nick) != 0))
+ ptrW dbNick(db_get_tsa(hContact, MODULE, "Nick"));
+ if ((dbNick == NULL) || (mir_wstrcmp(dbNick, SelItem.nick) != 0))
continue;
- ptrT dbURL(db_get_tsa(hContact, MODULE, "URL"));
- if ((dbURL == NULL) || (mir_tstrcmp(dbURL, SelItem.url) != 0))
+ ptrW dbURL(db_get_tsa(hContact, MODULE, "URL"));
+ if ((dbURL == NULL) || (mir_wstrcmp(dbURL, SelItem.url) != 0))
continue;
ItemInfo *nSelItem = new ItemInfo(SelItem);
@@ -203,7 +203,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP MessageBox(hwndDlg, TranslateT("Enter Feed name"), TranslateT("Error"), MB_OK);
break;
}
- if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_tstrcmp(str, L"http://") == 0) {
+ if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_wstrcmp(str, L"http://") == 0) {
MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK);
break;
}
@@ -255,7 +255,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_TAGHELP:
wchar_t tszTagHelp[1024];
- mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
+ mir_snwprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"#<title>#", TranslateT("The title of the item."),
L"#<description>#", TranslateT("The item synopsis."),
L"#<link>#", TranslateT("The URL of the item."),
@@ -273,7 +273,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_DISCOVERY:
wchar_t tszURL[MAX_PATH] = { 0 };
- if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0) {
+ if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_wstrcmp(tszURL, L"http://") != 0) {
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
wchar_t *tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg);
@@ -361,7 +361,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP MessageBox(hwndDlg, TranslateT("Enter Feed name"), TranslateT("Error"), MB_OK);
break;
}
- if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_tstrcmp(str, L"http://") == 0) {
+ if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_wstrcmp(str, L"http://") == 0) {
MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK);
break;
}
@@ -411,7 +411,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_TAGHELP:
wchar_t tszTagHelp[1024];
- mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
+ mir_snwprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"#<title>#", TranslateT("The title of the item."),
L"#<description>#", TranslateT("The item synopsis."),
L"#<link>#", TranslateT("The URL of the item."),
@@ -429,7 +429,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_DISCOVERY:
wchar_t tszURL[MAX_PATH] = { 0 };
- if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0) {
+ if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_wstrcmp(tszURL, L"http://") != 0) {
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
wchar_t *tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg);
@@ -498,16 +498,16 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ListView_GetItemText(hwndList, sel, 1, url, _countof(url));
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
- ptrT dbNick(db_get_tsa(hContact, MODULE, "Nick"));
+ ptrW dbNick(db_get_tsa(hContact, MODULE, "Nick"));
if (dbNick == NULL)
break;
- if (mir_tstrcmp(dbNick, nick))
+ if (mir_wstrcmp(dbNick, nick))
continue;
- ptrT dbURL(db_get_tsa(hContact, MODULE, "URL"));
+ ptrW dbURL(db_get_tsa(hContact, MODULE, "URL"));
if (dbURL == NULL)
break;
- if (mir_tstrcmp(dbURL, url))
+ if (mir_wstrcmp(dbURL, url))
continue;
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index d3cdfb6839..6b613a231d 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -40,7 +40,7 @@ int NewsAggrInit(WPARAM, LPARAM) if (hNewsAggregatorFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("News Aggregator"), MIRANDA_USERDATAT L"\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)))
FoldersGetCustomPathT(hNewsAggregatorFolder, tszRoot, MAX_PATH, L"");
else
- mir_tstrncpy(tszRoot, VARST(L"%miranda_userdata%\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)), _countof(tszRoot));
+ mir_wstrncpy(tszRoot, VARST(L"%miranda_userdata%\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)), _countof(tszRoot));
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1))
diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index 6a7558ba34..8c6ba7e73b 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -54,7 +54,7 @@ void GetNewsData(wchar_t *tszUrl, char **szData, MCONTACT hContact, HWND hwndDlg nlhr.flags = NLHRF_DUMPASTEXT | NLHRF_HTTP11 | NLHRF_REDIRECT;
if (wcsstr(tszUrl, L"https://") != NULL)
nlhr.flags |= NLHRF_SSL;
- char *szUrl = mir_t2a(tszUrl);
+ char *szUrl = mir_u2a(tszUrl);
nlhr.szUrl = szUrl;
nlhr.nlc = hNetlibHttp;
@@ -197,52 +197,52 @@ time_t __stdcall DateToUnixTime(const wchar_t *stamp, bool FeedType) weekday = wcstok(p, L",");
p = wcstok(NULL, L",");
swscanf(p + 1, L"%d %3s %d %d:%d:%d %1s%02d%02d", &day, &monthstr, &year, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
- if (!mir_tstrcmpi(monthstr, L"Jan"))
+ if (!mir_wstrcmpi(monthstr, L"Jan"))
month = 1;
- if (!mir_tstrcmpi(monthstr, L"Feb"))
+ if (!mir_wstrcmpi(monthstr, L"Feb"))
month = 2;
- if (!mir_tstrcmpi(monthstr, L"Mar"))
+ if (!mir_wstrcmpi(monthstr, L"Mar"))
month = 3;
- if (!mir_tstrcmpi(monthstr, L"Apr"))
+ if (!mir_wstrcmpi(monthstr, L"Apr"))
month = 4;
- if (!mir_tstrcmpi(monthstr, L"May"))
+ if (!mir_wstrcmpi(monthstr, L"May"))
month = 5;
- if (!mir_tstrcmpi(monthstr, L"Jun"))
+ if (!mir_wstrcmpi(monthstr, L"Jun"))
month = 6;
- if (!mir_tstrcmpi(monthstr, L"Jul"))
+ if (!mir_wstrcmpi(monthstr, L"Jul"))
month = 7;
- if (!mir_tstrcmpi(monthstr, L"Aug"))
+ if (!mir_wstrcmpi(monthstr, L"Aug"))
month = 8;
- if (!mir_tstrcmpi(monthstr, L"Sep"))
+ if (!mir_wstrcmpi(monthstr, L"Sep"))
month = 9;
- if (!mir_tstrcmpi(monthstr, L"Oct"))
+ if (!mir_wstrcmpi(monthstr, L"Oct"))
month = 10;
- if (!mir_tstrcmpi(monthstr, L"Nov"))
+ if (!mir_wstrcmpi(monthstr, L"Nov"))
month = 11;
- if (!mir_tstrcmpi(monthstr, L"Dec"))
+ if (!mir_wstrcmpi(monthstr, L"Dec"))
month = 12;
if (year < 2000)
year += 2000;
- if (!mir_tstrcmp(timezonesign, L"+"))
- mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour - timezoneh, min - timezonem, sec);
- else if (!mir_tstrcmp(timezonesign, L"-"))
- mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour + timezoneh, min + timezonem, sec);
+ if (!mir_wstrcmp(timezonesign, L"+"))
+ mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour - timezoneh, min - timezonem, sec);
+ else if (!mir_wstrcmp(timezonesign, L"-"))
+ mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour + timezoneh, min + timezonem, sec);
else
- mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
+ mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
}
else if (wcsstr(p, L"T")) {
swscanf(p, L"%d-%d-%dT%d:%d:%d", &year, &month, &day, &hour, &min, &sec);
- mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
+ mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
}
else
{
swscanf(p, L"%d-%d-%d %d:%d:%d %1s%02d%02d", &year, &month, &day, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
- if (!mir_tstrcmp(timezonesign, L"+"))
- mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour - timezoneh, min - timezonem, sec);
- else if (!mir_tstrcmp(timezonesign, L"-"))
- mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour + timezoneh, min + timezonem, sec);
+ if (!mir_wstrcmp(timezonesign, L"+"))
+ mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour - timezoneh, min - timezonem, sec);
+ else if (!mir_wstrcmp(timezonesign, L"-"))
+ mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour + timezoneh, min + timezonem, sec);
else
- mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
+ mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
}
}
// Get the date part
@@ -290,7 +290,7 @@ bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal) nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_DUMPASTEXT | NLHRF_HTTP11;
- char *szUrl = mir_t2a(tszURL);
+ char *szUrl = mir_u2a(tszURL);
nlhr.szUrl = szUrl;
NETLIBHTTPHEADER headers[4];
nlhr.headersCount = 4;
@@ -320,8 +320,8 @@ bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal) }
}
if (date != NULL && size != NULL) {
- wchar_t *tdate = mir_a2t(date);
- wchar_t *tsize = mir_a2t(size);
+ wchar_t *tdate = mir_a2u(date);
+ wchar_t *tsize = mir_a2u(size);
struct _stat buf;
int fh = _wopen(tszLocal, _O_RDONLY);
@@ -471,7 +471,7 @@ MCONTACT GetContactByNick(const wchar_t *nick) for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
ptrW contactNick(::db_get_wsa(hContact, MODULE, "Nick"));
- if (!mir_tstrcmpi(contactNick, nick))
+ if (!mir_wstrcmpi(contactNick, nick))
break;
}
return hContact;
@@ -483,7 +483,7 @@ MCONTACT GetContactByURL(const wchar_t *url) for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
ptrW contactURL(::db_get_wsa(hContact, MODULE, "URL"));
- if (!mir_tstrcmpi(contactURL, url))
+ if (!mir_wstrcmpi(contactURL, url))
break;
}
return hContact;
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index 07bd984377..530463def5 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -86,7 +86,7 @@ int BrowseForFolder(HWND hwnd, char *szPath) LPMALLOC pMalloc;
if (SUCCEEDED(CoGetMalloc(1, &pMalloc))) {
- ptrT tszPath(mir_a2t(szPath));
+ ptrW tszPath(mir_a2u(szPath));
BROWSEINFO bi = { 0 };
bi.hwndOwner = hwnd;
bi.pszDisplayName = tszPath;
@@ -159,7 +159,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (!db_get_w(NULL, MODNAME, "Timer", 1))
SetDlgItemText(hwnd, IDC_TIMER_INTERVAL_MSG, TranslateT("Non-IM Contact protocol timer is Disabled"));
else {
- mir_sntprintf(string, TranslateT("Timer intervals... Non-IM Contact Protocol timer is %d seconds"), db_get_w(NULL, MODNAME, "Timer", 1));
+ mir_snwprintf(string, TranslateT("Timer intervals... Non-IM Contact Protocol timer is %d seconds"), db_get_w(NULL, MODNAME, "Timer", 1));
SetDlgItemText(hwnd, IDC_TIMER_INTERVAL_MSG, string);
}
}
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index 706e245013..dc506b5420 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -185,7 +185,7 @@ static void InitStickyNoteLogFont(STICKYNOTEFONT *pCustomFont, LOGFONT *lf) lf->lfHeight = pCustomFont->size; } - mir_tstrcpy(lf->lfFaceName, pCustomFont->szFace); + mir_strcpy(lf->lfFaceName, pCustomFont->szFace); lf->lfWidth = lf->lfEscapement = lf->lfOrientation = 0; lf->lfWeight = pCustomFont->style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL; @@ -518,7 +518,7 @@ void LoadNotes(BOOL bIsStartup) pCustomFont->size = (char)fsize; pCustomFont->style = (BYTE)fstyle; pCustomFont->charset = (BYTE)fcharset; - mir_tstrcpy(pCustomFont->szFace, TVal2); + mir_strcpy(pCustomFont->szFace, TVal2); pCustomFont->hFont = NULL; if ( !CreateStickyNoteFont(pCustomFont, NULL) ) @@ -989,7 +989,7 @@ static int FindMenuItem(HMENU h, LPTSTR lpszName) { if ( GetMenuString(h, i, s, 128, MF_BYPOSITION) ) { - if ( !mir_tstrcmp(s, lpszName) ) + if ( !mir_strcmp(s, lpszName) ) { return (int)i; } @@ -1042,7 +1042,7 @@ static void MeasureColorPresetMenuItem(HWND hdlg, LPMEASUREITEMSTRUCT lpMeasureI HDC hdc = GetDC(hdlg); LPSTR lpsz = TranslateTS(clrPresets->szName); SIZE sz; - GetTextExtentPoint32(hdc, lpsz, (int)mir_tstrlen(lpsz), &sz); + GetTextExtentPoint32(hdc, lpsz, (int)mir_strlen(lpsz), &sz); ReleaseDC(hdlg, hdc); lpMeasureItem->itemWidth = 50 + sz.cx; @@ -1558,7 +1558,7 @@ INT_PTR CALLBACK StickyNoteWndProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM l SN->pCustomFont->size = (char)lf.lfHeight; SN->pCustomFont->style = (lf.lfWeight >= FW_BOLD ? DBFONTF_BOLD : 0) | (lf.lfItalic ? DBFONTF_ITALIC : 0) | (lf.lfUnderline ? DBFONTF_UNDERLINE : 0) | (lf.lfStrikeOut ? DBFONTF_STRIKEOUT : 0); SN->pCustomFont->charset = lf.lfCharSet; - mir_tstrcpy(SN->pCustomFont->szFace, lf.lfFaceName); + mir_strcpy(SN->pCustomFont->szFace, lf.lfFaceName); if ( !CreateStickyNoteFont(SN->pCustomFont, &lf) ) { diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp index 616d95f8e9..88e4b16fbf 100644 --- a/plugins/NotifyAnything/src/main.cpp +++ b/plugins/NotifyAnything/src/main.cpp @@ -982,7 +982,7 @@ extern "C" int __declspec(dllexport) Load() mir_getLP(&pluginInfo);
wchar_t buf[MAX_PATH + 1];
- mir_tstrcpy(buf, L".");
+ mir_wstrcpy(buf, L".");
g_mirandaDir = _wgetcwd(buf, MAX_PATH);
registerSound(L"Notice");
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index c474591f69..d87d37e373 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -51,7 +51,7 @@ INT_PTR NudgeSend(WPARAM hContact, LPARAM lParam) int diff = time(NULL) - db_get_dw(hContact, "Nudge", "LastSent", time(NULL) - 30);
if (diff < GlobalNudge.sendTimeSec) {
wchar_t msg[500];
- mir_sntprintf(msg, TranslateT("You are not allowed to send too much nudge (only 1 each %d sec, %d sec left)"), GlobalNudge.sendTimeSec, 30 - diff);
+ mir_snwprintf(msg, TranslateT("You are not allowed to send too much nudge (only 1 each %d sec, %d sec left)"), GlobalNudge.sendTimeSec, 30 - diff);
if (GlobalNudge.useByProtocol) {
for (int i = 0; i < arNudges.getCount(); i++) {
CNudgeElement &p = arNudges[i];
@@ -523,7 +523,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto) p->hEvent = hevent;
wchar_t soundDesc[MAXMODULELABELLENGTH + 10];
- mir_sntprintf(soundDesc, LPGENW("Nudge for %s"), proto->tszAccountName);
+ mir_snwprintf(soundDesc, LPGENW("Nudge for %s"), proto->tszAccountName);
SkinAddNewSoundExT(p->NudgeSoundname, LPGENW("Nudge"), soundDesc);
arNudges.insert(p);
diff --git a/plugins/Nudge/src/options.cpp b/plugins/Nudge/src/options.cpp index 57dcaf9c0a..5954fdfdc9 100644 --- a/plugins/Nudge/src/options.cpp +++ b/plugins/Nudge/src/options.cpp @@ -94,14 +94,14 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM TranslateDialogDefault(hwnd);
{
wchar_t szBuf[20];
- mir_sntprintf(szBuf, L"%d", shake.nMoveClist);
+ mir_snwprintf(szBuf, L"%d", shake.nMoveClist);
SetDlgItemText(hwnd, IDC_LNUMBER_CLIST, szBuf);
- mir_sntprintf(szBuf, L"%d", shake.nMoveChat);
+ mir_snwprintf(szBuf, L"%d", shake.nMoveChat);
SetDlgItemText(hwnd, IDC_LNUMBER_CHAT, szBuf);
- mir_sntprintf(szBuf, L"%d", shake.nScaleClist);
+ mir_snwprintf(szBuf, L"%d", shake.nScaleClist);
SetDlgItemText(hwnd, IDC_LSCALE_CLIST, szBuf);
- mir_sntprintf(szBuf, L"%d", shake.nScaleChat);
+ mir_snwprintf(szBuf, L"%d", shake.nScaleChat);
SetDlgItemText(hwnd, IDC_LSCALE_CHAT, szBuf);
}
@@ -132,7 +132,7 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM {
wchar_t szBuf[20];
DWORD dwPos = SendMessage((HWND)lParam, TBM_GETPOS, 0, 0);
- mir_sntprintf(szBuf, L"%d", dwPos);
+ mir_snwprintf(szBuf, L"%d", dwPos);
if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CLIST))
SetDlgItemText(hwnd, IDC_LNUMBER_CLIST, szBuf);
if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CHAT))
diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index b22066e480..9670d9e905 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -115,8 +115,8 @@ void show_popup(HWND hDlg, LPCTSTR pszTitle, LPCTSTR pszText, int iNumber, int A pd.cbSize = sizeof(pd);
pd.lchContact = NULL; //(HANDLE)wParam;
pd.lchIcon = Skin_LoadIcon(PopupsList[iNumber].Icon);
- mir_tstrncpy(pd.lptzText, pszText, _countof(pd.lptzText));
- mir_tstrncpy(pd.lptzContactName, pszTitle, _countof(pd.lptzContactName));
+ mir_wstrncpy(pd.lptzText, pszText, _countof(pd.lptzText));
+ mir_wstrncpy(pd.lptzContactName, pszTitle, _countof(pd.lptzContactName));
switch (MyOptions.DefColors) {
case byCOLOR_WINDOWS:
pd.colorBack = GetSysColor(COLOR_BTNFACE);
@@ -179,7 +179,7 @@ static void __stdcall CreateDownloadDialog(void*) if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups3", DEFAULT_POPUP_ENABLED))
hDlgDld = CreateDialog(hInst, MAKEINTRESOURCE(IDD_POPUPDUMMI), NULL, DlgDownloadPop);
else if (db_get_b(NULL, MODNAME, "Popups3M", DEFAULT_MESSAGE_ENABLED)) {
- mir_tstrncpy(tszDialogMsg, Text, _countof(tszDialogMsg));
+ mir_wstrncpy(tszDialogMsg, Text, _countof(tszDialogMsg));
hDlgDld = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DOWNLOAD), NULL, DlgDownload);
}
}
@@ -307,7 +307,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam EnableWindow(hwOk, enableOk ? TRUE : FALSE);
}
if (nmlv->uNewState & LVIS_SELECTED) {
- if (mir_tstrcmp(todo[lvI.iItem].tszInfoURL, L""))
+ if (mir_wstrcmp(todo[lvI.iItem].tszInfoURL, L""))
EnableWindow(GetDlgItem(hDlg, IDC_INFO), TRUE);
else
EnableWindow(GetDlgItem(hDlg, IDC_INFO), FALSE);
@@ -349,38 +349,38 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam if (todo[i].enabled) {
switch (todo[i].FileType) {
case 1:
- mir_sntprintf(tszFileDest, L"%s\\Pack", tszRoot);
+ mir_snwprintf(tszFileDest, L"%s\\Pack", tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 2:
- mir_sntprintf(tszFileDest, L"%s\\Plugins", tszRoot);
+ mir_snwprintf(tszFileDest, L"%s\\Plugins", tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 3:
- mir_sntprintf(tszFileDest, L"%s\\Icons", tszRoot);
+ mir_snwprintf(tszFileDest, L"%s\\Icons", tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 4:
- mir_sntprintf(tszFileDest, L"%s\\Others", tszRoot);
+ mir_snwprintf(tszFileDest, L"%s\\Others", tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 5:
- mir_sntprintf(tszFileDest, L"%s\\Others", tszRoot);
+ mir_snwprintf(tszFileDest, L"%s\\Others", tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
default:
- mir_tstrncpy(tszFileDest, tszRoot, _countof(tszFileDest));
+ mir_wstrncpy(tszFileDest, tszRoot, _countof(tszFileDest));
break;
}
- mir_sntprintf(tszBuff, L"%s\\Backups", tszRoot);
+ mir_snwprintf(tszBuff, L"%s\\Backups", tszRoot);
CreateDirectory(tszBuff, NULL);
- mir_tstrncpy(tszFileName, todo[i].File.tszDiskPath, _countof(tszFileName));
- mir_sntprintf(todo[i].File.tszDiskPath, L"%s\\%s", tszFileDest, tszFileName);
+ mir_wstrncpy(tszFileName, todo[i].File.tszDiskPath, _countof(tszFileName));
+ mir_snwprintf(todo[i].File.tszDiskPath, L"%s\\%s", tszFileDest, tszFileName);
UpdatesCount++;
- tszExt = &todo[i].File.tszDownloadURL[mir_tstrlen(todo[i].File.tszDownloadURL) - 5];
- if (mir_tstrcmp(tszExt, L".html") == 0) {
- char* szUrl = mir_t2a(todo[i].File.tszDownloadURL);
+ tszExt = &todo[i].File.tszDownloadURL[mir_wstrlen(todo[i].File.tszDownloadURL) - 5];
+ if (mir_wstrcmp(tszExt, L".html") == 0) {
+ char* szUrl = mir_u2a(todo[i].File.tszDownloadURL);
Utils_OpenUrl(szUrl);
mir_free(szUrl);
}
@@ -399,7 +399,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam continue;
}
}
- mir_tstrncpy(todo[i].tszCurVer, todo[i].tszNewVer, _countof(todo[i].tszCurVer));
+ mir_wstrncpy(todo[i].tszCurVer, todo[i].tszNewVer, _countof(todo[i].tszCurVer));
mir_snprintf(szKey, "File_%d_CurrentVersion", todo[i].FileNum);
db_set_ts(NULL, MODNAME, szKey, todo[i].tszCurVer);
arFileType.push_back(todo[i].FileType);
@@ -412,11 +412,11 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam }
}
- if (UpdatesCount > 1 && mir_tstrcmp(arExt[0].c_str(), L".html") != 0)
- mir_tstrncpy(tszBuff, TranslateT("Downloads complete. Start updating? All your data will be saved and Miranda NG will be closed."), _countof(tszBuff));
- else if (UpdatesCount == 1 && mir_tstrcmp(arExt[0].c_str(), L".html") != 0)
- mir_tstrncpy(tszBuff, TranslateT("Download complete. Start updating? All your data will be saved and Miranda NG will be closed."), _countof(tszBuff));
- if (UpdatesCount > 0 && mir_tstrcmp(arExt[0].c_str(), L".html") != 0) {
+ if (UpdatesCount > 1 && mir_wstrcmp(arExt[0].c_str(), L".html") != 0)
+ mir_wstrncpy(tszBuff, TranslateT("Downloads complete. Start updating? All your data will be saved and Miranda NG will be closed."), _countof(tszBuff));
+ else if (UpdatesCount == 1 && mir_wstrcmp(arExt[0].c_str(), L".html") != 0)
+ mir_wstrncpy(tszBuff, TranslateT("Download complete. Start updating? All your data will be saved and Miranda NG will be closed."), _countof(tszBuff));
+ if (UpdatesCount > 0 && mir_wstrcmp(arExt[0].c_str(), L".html") != 0) {
INT rc = -1;
Title = TranslateT("Pack Updater");
Text = tszBuff;
@@ -451,11 +451,11 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam break;
case 2:
tszUtilRootPlug = Utils_ReplaceVarsT(L"%miranda_path%\\Plugins");
- if (mir_tstrcmp(arAdvFolder[i].c_str(), L"") == 0)
- mir_sntprintf(tszFilePathDest, L"%s\\%s", tszUtilRootPlug, arFileName[i].c_str());
+ if (mir_wstrcmp(arAdvFolder[i].c_str(), L"") == 0)
+ mir_snwprintf(tszFilePathDest, L"%s\\%s", tszUtilRootPlug, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRootPlug, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, L"%s\\Backups\\%s", tszRoot, arFileName[i].c_str());
+ mir_snwprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRootPlug, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_snwprintf(tszFilePathBack, L"%s\\Backups\\%s", tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRootPlug);
@@ -464,11 +464,11 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam break;
case 3:
tszUtilRootIco = Utils_ReplaceVarsT(L"%miranda_path%\\Icons");
- if (mir_tstrcmp(arAdvFolder[i].c_str(), L"") == 0)
- mir_sntprintf(tszFilePathDest, L"%s\\%s", tszUtilRootIco, arFileName[i].c_str());
+ if (mir_wstrcmp(arAdvFolder[i].c_str(), L"") == 0)
+ mir_snwprintf(tszFilePathDest, L"%s\\%s", tszUtilRootIco, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRootIco, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, L"%s\\Backups\\%s", tszRoot, arFileName[i].c_str());
+ mir_snwprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRootIco, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_snwprintf(tszFilePathBack, L"%s\\Backups\\%s", tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRootIco);
@@ -477,11 +477,11 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam break;
case 4:
tszUtilRoot = Utils_ReplaceVarsT(L"%miranda_path%");
- if (mir_tstrcmp(arAdvFolder[i].c_str(), L"") == 0)
- mir_sntprintf(tszFilePathDest, L"%s\\%s", tszUtilRoot, arFileName[i].c_str());
+ if (mir_wstrcmp(arAdvFolder[i].c_str(), L"") == 0)
+ mir_snwprintf(tszFilePathDest, L"%s\\%s", tszUtilRoot, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, L"%s\\Backups\\%s", tszRoot, arFileName[i].c_str());
+ mir_snwprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_snwprintf(tszFilePathBack, L"%s\\Backups\\%s", tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRoot);
@@ -490,11 +490,11 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam break;
case 5:
tszUtilRoot = Utils_ReplaceVarsT(L"%miranda_path%");
- if (mir_tstrcmp(arAdvFolder[i].c_str(), L"") == 0)
- mir_sntprintf(tszFilePathDest, L"%s\\%s", tszUtilRoot, arFileName[i].c_str());
+ if (mir_wstrcmp(arAdvFolder[i].c_str(), L"") == 0)
+ mir_snwprintf(tszFilePathDest, L"%s\\%s", tszUtilRoot, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, L"%s\\Backups\\%s", tszRoot, arFileName[i].c_str());
+ mir_snwprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_snwprintf(tszFilePathBack, L"%s\\Backups\\%s", tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRoot);
@@ -505,7 +505,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam else { //reminder for not installed pack update
if (Reminder && (UpdatesCount == 1) && (arFileType[0] == 1))
db_set_b(NULL, MODNAME, "Reminder", 2);
- mir_sntprintf(tszBuff, TranslateT("You have chosen not to install the pack update immediately.\nYou can install it manually from this location:\n\n%s"), arFilePath[0].c_str());
+ mir_snwprintf(tszBuff, TranslateT("You have chosen not to install the pack update immediately.\nYou can install it manually from this location:\n\n%s"), arFilePath[0].c_str());
Title = TranslateT("Pack Updater");
Text = tszBuff;
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED)) {
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp index eabc12dbba..d4df5c677f 100644 --- a/plugins/PackUpdater/Src/PackUpdater.cpp +++ b/plugins/PackUpdater/Src/PackUpdater.cpp @@ -55,7 +55,7 @@ extern "C" __declspec(dllexport) int Load(void) mir_getLP(&pluginInfoEx);
wchar_t *tszFolder = Utils_ReplaceVarsT(L"%miranda_userdata%\\" DEFAULT_UPDATES_FOLDER);
- mir_tstrncpy(tszRoot, tszFolder, _countof(tszRoot));
+ mir_wstrncpy(tszRoot, tszFolder, _countof(tszRoot));
hPackUpdaterFolder = FoldersRegisterCustomPathT(MODULEA, LPGEN("Pack Updater"), MIRANDA_USERDATAT L"\\" DEFAULT_UPDATES_FOLDER);
if (hPackUpdaterFolder)
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 62fa5d83e1..b555e97d37 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -112,7 +112,7 @@ BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal) nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_REDIRECT | NLHRF_DUMPASTEXT | NLHRF_HTTP11;
- char* szUrl = mir_t2a(tszURL);
+ char* szUrl = mir_u2a(tszURL);
nlhr.szUrl = szUrl;
nlhr.headersCount = 4;
nlhr.headers = (NETLIBHTTPHEADER*)mir_alloc(sizeof(NETLIBHTTPHEADER)*nlhr.headersCount);
@@ -164,7 +164,7 @@ BOOL Exists(LPCTSTR strName) BOOL IsPluginDisabled(wchar_t* filename)
{
- char* fname = mir_t2a(filename);
+ char* fname = mir_u2a(filename);
int res = db_get_b(NULL, "PluginDisable", fname, 0);
mir_free(fname);
return res;
@@ -190,7 +190,7 @@ static void CheckUpdates(void *) FileCount = db_get_dw(NULL, MODNAME, "FileCount", DEFAULT_FILECOUNT);
// Load files info
- ptrT tszDownloadURL(db_get_tsa(NULL, MODNAME, "File_VersionURL"));
+ ptrW tszDownloadURL(db_get_tsa(NULL, MODNAME, "File_VersionURL"));
if (!tszDownloadURL) { // URL is not set
Title = TranslateT("Pack Updater");
Text = TranslateT("URL for checking updates not found.");
@@ -205,10 +205,10 @@ static void CheckUpdates(void *) }
// Download version info
pFileUrl = (FILEURL *)mir_alloc(sizeof(*pFileUrl));
- mir_tstrncpy(pFileUrl->tszDownloadURL, tszDownloadURL, _countof(pFileUrl->tszDownloadURL));
- mir_sntprintf(tszBuff, L"%s\\tmp.ini", tszRoot);
- mir_tstrncpy(pFileUrl->tszDiskPath, tszBuff, _countof(pFileUrl->tszDiskPath));
- mir_tstrncpy(tszTmpIni, tszBuff, _countof(tszTmpIni));
+ mir_wstrncpy(pFileUrl->tszDownloadURL, tszDownloadURL, _countof(pFileUrl->tszDownloadURL));
+ mir_snwprintf(tszBuff, L"%s\\tmp.ini", tszRoot);
+ mir_wstrncpy(pFileUrl->tszDiskPath, tszBuff, _countof(pFileUrl->tszDiskPath));
+ mir_wstrncpy(tszTmpIni, tszBuff, _countof(tszTmpIni));
Title = TranslateT("Pack Updater");
Text = TranslateT("Downloading version info...");
DlgDownloadProc();
@@ -222,23 +222,23 @@ static void CheckUpdates(void *) FILEINFO FileInfo = { L"", L"", L"", L"", L"", L"", L"", { L"", L"" } };
mir_snprintf(szKey, "File_%d_CurrentVersion", CurrentFile + 1);
- ptrT tszCurVer(db_get_tsa(NULL, MODNAME, szKey));
+ ptrW tszCurVer(db_get_tsa(NULL, MODNAME, szKey));
if (tszCurVer)
- mir_tstrncpy(FileInfo.tszCurVer, tszCurVer, _countof(FileInfo.tszCurVer));
+ mir_wstrncpy(FileInfo.tszCurVer, tszCurVer, _countof(FileInfo.tszCurVer));
else
- mir_tstrncpy(FileInfo.tszCurVer, L"", _countof(FileInfo.tszCurVer));
+ mir_wstrncpy(FileInfo.tszCurVer, L"", _countof(FileInfo.tszCurVer));
mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1);
- ptrT tszLastVer(db_get_tsa(NULL, MODNAME, szKey));
+ ptrW tszLastVer(db_get_tsa(NULL, MODNAME, szKey));
if (tszLastVer)
- mir_tstrncpy(FileInfo.tszLastVer, tszLastVer, _countof(FileInfo.tszLastVer));
+ mir_wstrncpy(FileInfo.tszLastVer, tszLastVer, _countof(FileInfo.tszLastVer));
else
- mir_tstrncpy(FileInfo.tszLastVer, L"", _countof(FileInfo.tszLastVer));
+ mir_wstrncpy(FileInfo.tszLastVer, L"", _countof(FileInfo.tszLastVer));
Files.push_back(FileInfo);
// Read version info
- mir_sntprintf(tszFileInfo, L"FileInfo_%d", CurrentFile + 1);
+ mir_snwprintf(tszFileInfo, L"FileInfo_%d", CurrentFile + 1);
GetPrivateProfileString(tszFileInfo, L"FileVersion", L"", Files[CurrentFile].tszNewVer, _countof(Files[CurrentFile].tszNewVer), tszTmpIni);
GetPrivateProfileString(tszFileInfo, L"Message", L"", Files[CurrentFile].tszMessage, _countof(Files[CurrentFile].tszMessage), tszTmpIni);
GetPrivateProfileString(tszFileInfo, L"DownloadURL", L"", Files[CurrentFile].File.tszDownloadURL, _countof(Files[CurrentFile].File.tszDownloadURL), tszTmpIni);
@@ -257,17 +257,17 @@ static void CheckUpdates(void *) MessageBox(NULL, Text, Title, MB_ICONINFORMATION);
continue;
} // end check update name
- mir_tstrncpy(Files[CurrentFile].File.tszDiskPath, tszBuff, _countof(Files[CurrentFile].File.tszDiskPath));
+ mir_wstrncpy(Files[CurrentFile].File.tszDiskPath, tszBuff, _countof(Files[CurrentFile].File.tszDiskPath));
GetPrivateProfileString(tszFileInfo, L"InfoURL", L"", Files[CurrentFile].tszInfoURL, _countof(Files[CurrentFile].tszInfoURL), tszTmpIni);
Files[CurrentFile].FileType = GetPrivateProfileInt(tszFileInfo, L"FileType", 0, tszTmpIni);
Files[CurrentFile].Force = GetPrivateProfileInt(tszFileInfo, L"Force", 0, tszTmpIni);
Files[CurrentFile].FileNum = CurrentFile + 1;
if (Files[CurrentFile].FileType == 2) {
- if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
- mir_sntprintf(tszBuff, L"Plugins\\%s", Files[CurrentFile].File.tszDiskPath);
+ if (mir_wstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
+ mir_snwprintf(tszBuff, L"Plugins\\%s", Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszBuff, L"Plugins\\%s\\%s", Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_snwprintf(tszBuff, L"Plugins\\%s\\%s", Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
wchar_t pluginFolderName[MAX_PATH];
PathToAbsoluteT(tszBuff, pluginFolderName);
if (!Files[CurrentFile].Force && (IsPluginDisabled(Files[CurrentFile].File.tszDiskPath) || !Exists(pluginFolderName))) //check if plugin disabled or not exists
@@ -293,27 +293,27 @@ static void CheckUpdates(void *) break;
case 2: {
VARST tszUtilRootPlug(L"%miranda_path%\\Plugins");
- if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
- mir_sntprintf(tszFilePathDest, L"%s\\%s", tszUtilRootPlug, Files[CurrentFile].File.tszDiskPath);
+ if (mir_wstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
+ mir_snwprintf(tszFilePathDest, L"%s\\%s", tszUtilRootPlug, Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRootPlug, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_snwprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRootPlug, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
}
break;
case 3: {
VARST tszUtilRootIco(L"%miranda_path%\\Icons");
- if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
- mir_sntprintf(tszFilePathDest, L"%s\\%s", tszUtilRootIco, Files[CurrentFile].File.tszDiskPath);
+ if (mir_wstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
+ mir_snwprintf(tszFilePathDest, L"%s\\%s", tszUtilRootIco, Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRootIco, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_snwprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRootIco, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
}
break;
case 4:
case 5: {
wchar_t *tszUtilRoot = VARST(L"%miranda_path%");
- if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
- mir_sntprintf(tszFilePathDest, L"%s\\%s", tszUtilRoot, Files[CurrentFile].File.tszDiskPath);
+ if (mir_wstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
+ mir_snwprintf(tszFilePathDest, L"%s\\%s", tszUtilRoot, Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRoot, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_snwprintf(tszFilePathDest, L"%s\\%s\\%s", tszUtilRoot, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
}
break;
}//end* switch (Files[CurrentFile].FileType)
@@ -321,7 +321,7 @@ static void CheckUpdates(void *) if (Files[CurrentFile].Force || Exists(tszFilePathDest))
UpdateFiles.push_back(Files[CurrentFile]);
// Save last version
- mir_tstrncpy(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, _countof(Files[CurrentFile].tszLastVer));
+ mir_wstrncpy(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, _countof(Files[CurrentFile].tszLastVer));
mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1);
db_set_ts(NULL, MODNAME, szKey, Files[CurrentFile].tszLastVer);
} // end compare versions
diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index 628fdd9182..8efd3d1174 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -646,7 +646,7 @@ void Options::InitCodepageCB(HWND hwndCB, unsigned int codepage) if (selCpIdx == -1) {
wchar_t buf[10];
- mir_sntprintf(buf, L"%d", codepage);
+ mir_snwprintf(buf, L"%d", codepage);
ComboBox_SetText(hwndCB, buf);
}
else {
@@ -667,7 +667,7 @@ void Options::SetCodepageCB(HWND hwndCB, unsigned int codepage) if (selCpIdx == -1) {
wchar_t buf[10];
- mir_sntprintf(buf, L"%d", codepage);
+ mir_snwprintf(buf, L"%d", codepage);
ComboBox_SetText(hwndCB, buf);
}
else {
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 6c96d4d1ba..fe85a759c3 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -71,8 +71,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda std::wstring GetFile()
{
wchar_t filter[512];
- mir_tstrncpy(filter, TranslateT("All Files (*.*)"), _countof(filter));
- memcpy(filter + mir_tstrlen(filter), L"\0*.*\0", 6 * sizeof(wchar_t));
+ mir_wstrncpy(filter, TranslateT("All Files (*.*)"), _countof(filter));
+ memcpy(filter + mir_wstrlen(filter), L"\0*.*\0", 6 * sizeof(wchar_t));
wchar_t stzFilePath[1024];
stzFilePath[0] = 0;
stzFilePath[1] = 0;
diff --git a/plugins/PasteIt/src/PasteToWeb.cpp b/plugins/PasteIt/src/PasteToWeb.cpp index 8e0cecb447..3e62035de1 100644 --- a/plugins/PasteIt/src/PasteToWeb.cpp +++ b/plugins/PasteIt/src/PasteToWeb.cpp @@ -384,7 +384,7 @@ void PasteToWeb::FromFile(std::wstring file) {
if (fileSize.QuadPart > 512000LL)
{
- mir_sntprintf(bufErr, TranslateT("File size is %d KB, do you really want to paste such a large file?"), fileSize.LowPart / 1024);
+ mir_snwprintf(bufErr, TranslateT("File size is %d KB, do you really want to paste such a large file?"), fileSize.LowPart / 1024);
if (MessageBox(NULL, bufErr, TranslateT("Are You sure?"), MB_YESNO | MB_ICONQUESTION) != IDYES)
{
CloseHandle(hFile);
@@ -399,7 +399,7 @@ void PasteToWeb::FromFile(std::wstring file) mir_free(fromFileData.content);
fromFileData.content = NULL;
fromFileData.contentLen = 0;
- mir_sntprintf(bufErr, TranslateT("Cannot read file '%s'"), file.c_str());
+ mir_snwprintf(bufErr, TranslateT("Cannot read file '%s'"), file.c_str());
error = bufErr;
}
}
@@ -413,7 +413,7 @@ void PasteToWeb::FromFile(std::wstring file) }
else
{
- mir_sntprintf(bufErr, TranslateT("Cannot open file '%s'"), file.c_str());
+ mir_snwprintf(bufErr, TranslateT("Cannot open file '%s'"), file.c_str());
error = bufErr;
}
@@ -491,7 +491,7 @@ void PasteToWeb::FromFile(std::wstring file) }
else
{
- mir_sntprintf(bufErr, TranslateT("File '%s' is empty"), file.c_str());
+ mir_snwprintf(bufErr, TranslateT("File '%s' is empty"), file.c_str());
error = bufErr;
}
mir_free(fromFileData.content);
diff --git a/plugins/PasteIt/src/PasteToWeb1.cpp b/plugins/PasteIt/src/PasteToWeb1.cpp index 73b4b77667..a7de2c10fc 100644 --- a/plugins/PasteIt/src/PasteToWeb1.cpp +++ b/plugins/PasteIt/src/PasteToWeb1.cpp @@ -304,7 +304,7 @@ void PasteToWeb1::SendToServer(std::wstring str, std::wstring fileName, std::wst {
if (memcmp(L"Bad API request, ", resCont, 17 * sizeof(wchar_t)) == 0)
{
- mir_sntprintf(bufErr, TranslateT("Error during sending text to web page: %s"), resCont + 17);
+ mir_snwprintf(bufErr, TranslateT("Error during sending text to web page: %s"), resCont + 17);
error = bufErr;
}
else
@@ -336,7 +336,7 @@ std::wstring PasteToWeb1::GetUserKey(std::wstring& user, std::wstring& password) {
if (memcmp(L"Bad API request, ", resCont, 17 * sizeof(wchar_t)) == 0)
{
- mir_sntprintf(bufErr, TranslateT("Error during getting user key from web page: %s"), resCont + 17);
+ mir_snwprintf(bufErr, TranslateT("Error during getting user key from web page: %s"), resCont + 17);
MessageBox(NULL, bufErr, TranslateT("Error"), MB_OK | MB_ICONERROR);
}
else
diff --git a/plugins/PasteIt/src/PasteToWeb2.cpp b/plugins/PasteIt/src/PasteToWeb2.cpp index f9645ee447..a5843149a3 100644 --- a/plugins/PasteIt/src/PasteToWeb2.cpp +++ b/plugins/PasteIt/src/PasteToWeb2.cpp @@ -109,7 +109,7 @@ void PasteToWeb2::SendToServer(std::wstring str, std::wstring fileName, std::wst if (hXml != NULL)
{
HXML node = xmlGetChildByPath(hXml, L"params/param/value/array/data/value/int", 0);
- if (node != NULL && !mir_tstrcmp(xmlGetText(node), L"1"))
+ if (node != NULL && !mir_wstrcmp(xmlGetText(node), L"1"))
{
node = xmlGetChildByPath(hXml, L"params/param/value/array/data", 0);
if (node != NULL)
@@ -120,7 +120,7 @@ void PasteToWeb2::SendToServer(std::wstring str, std::wstring fileName, std::wst node = xmlGetChildByPath(node, L"string", 0);
if (node != NULL)
{
- char* s = mir_t2a_cp(xmlGetText(node), CP_ACP);
+ char* s = mir_u2a_cp(xmlGetText(node), CP_ACP);
mir_strncpy(szFileLink, s, _countof(szFileLink));
mir_free(s);
error = NULL;
@@ -149,7 +149,7 @@ std::list<PasteFormat> PasteToWeb2::GetFormats() if (hXml != NULL)
{
HXML node = xmlGetChildByPath(hXml, L"params/param/value/array/data/value/int", 0);
- if (node != NULL && !mir_tstrcmp(xmlGetText(node), L"1"))
+ if (node != NULL && !mir_wstrcmp(xmlGetText(node), L"1"))
{
node = xmlGetChildByPath(hXml, L"params/param/value/array/data", 0);
if (node != NULL)
diff --git a/plugins/Ping/src/log.cpp b/plugins/Ping/src/log.cpp index 01bb07e671..c99af91c06 100644 --- a/plugins/Ping/src/log.cpp +++ b/plugins/Ping/src/log.cpp @@ -34,10 +34,10 @@ INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) { wchar_t *filename = (wchar_t *)lParam;
if (db_get_ts(0, PLUG, "LogFilename", &dbv)) {
CallService(MS_DB_GETPROFILEPATHT, wParam, (LPARAM)filename);
- mir_tstrncat(filename, L"\\ping_log.txt", wParam - mir_tstrlen(filename));
+ mir_wstrncat(filename, L"\\ping_log.txt", wParam - mir_wstrlen(filename));
}
else {
- mir_tstrncpy(filename, dbv.ptszVal, wParam);
+ mir_wstrncpy(filename, dbv.ptszVal, wParam);
db_free(&dbv);
}
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index 853473e3cc..1f77da46d2 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -82,7 +82,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_BTN_LOGBROWSE:
{
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s%c*.txt%c%s%c*.*%c", TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0);
+ mir_snwprintf(filter, L"%s%c*.txt%c%s%c*.*%c", TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFile = options.log_filename;
diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp index f8a5fef2c5..1b95e95649 100644 --- a/plugins/Ping/src/pinggraph.cpp +++ b/plugins/Ping/src/pinggraph.cpp @@ -190,20 +190,20 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar wchar_t buff[64];
if (wd->show_grid)
{
- mir_sntprintf(buff, TranslateT("%d ms"), MARK_TIME);
- TextOut(hdc, r.right - 100, r.bottom - (int)(unit_height * MARK_TIME + 0.5f), buff, (int)mir_tstrlen(buff));
+ mir_snwprintf(buff, TranslateT("%d ms"), MARK_TIME);
+ TextOut(hdc, r.right - 100, r.bottom - (int)(unit_height * MARK_TIME + 0.5f), buff, (int)mir_wstrlen(buff));
}
if (wd->show_stat)
{
SetTextColor(hdc, RGB(255, 0, 0));
- mir_sntprintf(buff, TranslateT("AVG %.1lf ms"), avg);
- TextOut(hdc, r.left + 10, r.bottom - (int)(avg * unit_height + 0.5f), buff, (int)mir_tstrlen(buff));
+ mir_snwprintf(buff, TranslateT("AVG %.1lf ms"), avg);
+ TextOut(hdc, r.left + 10, r.bottom - (int)(avg * unit_height + 0.5f), buff, (int)mir_wstrlen(buff));
if (max_value != avg) {
- mir_sntprintf(buff, TranslateT("MAX %hd ms"), max_value);
- TextOut(hdc, r.left + 10, r.bottom - (int)(max_value * unit_height + 0.5f), buff, (int)mir_tstrlen(buff));
- mir_sntprintf(buff, TranslateT("MIN %hd ms"), min_value);
- TextOut(hdc, r.left + 10, r.bottom - (int)(min_value * unit_height + 0.5f), buff, (int)mir_tstrlen(buff));
+ mir_snwprintf(buff, TranslateT("MAX %hd ms"), max_value);
+ TextOut(hdc, r.left + 10, r.bottom - (int)(max_value * unit_height + 0.5f), buff, (int)mir_wstrlen(buff));
+ mir_snwprintf(buff, TranslateT("MIN %hd ms"), min_value);
+ TextOut(hdc, r.left + 10, r.bottom - (int)(min_value * unit_height + 0.5f), buff, (int)mir_wstrlen(buff));
}
}
@@ -276,10 +276,10 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { RegisterClass(&wndclass);
wchar_t title[256];
- mir_tstrncpy(title, TranslateT("Ping Graph"), _countof(title));
+ mir_wstrncpy(title, TranslateT("Ping Graph"), _countof(title));
if (lParam) {
- mir_tstrncat(title, L" - ", _countof(title) - mir_tstrlen(title));
- mir_tstrncat(title, (wchar_t *)lParam, _countof(title) - mir_tstrlen(title));
+ mir_wstrncat(title, L" - ", _countof(title) - mir_wstrlen(title));
+ mir_wstrncat(title, (wchar_t *)lParam, _countof(title) - mir_wstrlen(title));
}
HWND parent = 0;
diff --git a/plugins/Ping/src/pinglist.cpp b/plugins/Ping/src/pinglist.cpp index c08d279610..9ba42dad03 100644 --- a/plugins/Ping/src/pinglist.cpp +++ b/plugins/Ping/src/pinglist.cpp @@ -68,11 +68,11 @@ void write_ping_address(PINGADDRESS &i) db_set_w(0, buff, "Status", i.status);
db_set_dw(0, buff, "Port", i.port);
db_set_s(0, buff, "Proto", i.pszProto);
- if (mir_tstrlen(i.pszCommand))
+ if (mir_wstrlen(i.pszCommand))
db_set_ts(0, buff, "Command", i.pszCommand);
else
db_unset(0, buff, "Command");
- if (mir_tstrlen(i.pszParams))
+ if (mir_wstrlen(i.pszParams))
db_set_ts(0, buff, "CommandParams", i.pszParams);
else
db_unset(0, buff, "CommandParams");
@@ -116,13 +116,13 @@ bool read_ping_address(PINGADDRESS &pa) { DBVARIANT dbv;
if (!db_get_ts(0, buff, "Address", &dbv)) {
- mir_tstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
+ mir_wstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
db_free(&dbv);
}
else return false;
if (!db_get_ts(0, buff, "Label", &dbv)) {
- mir_tstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
+ mir_wstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
db_free(&dbv);
}
else return false;
@@ -139,13 +139,13 @@ bool read_ping_address(PINGADDRESS &pa) { else pa.pszProto[0] = '\0';
if (!db_get_ts(0, buff, "Command", &dbv)) {
- mir_tstrncpy(pa.pszCommand, dbv.ptszVal, _countof(pa.pszCommand));
+ mir_wstrncpy(pa.pszCommand, dbv.ptszVal, _countof(pa.pszCommand));
db_free(&dbv);
}
else
pa.pszCommand[0] = '\0';
if (!db_get_ts(0, buff, "CommandParams", &dbv)) {
- mir_tstrncpy(pa.pszParams, dbv.ptszVal, _countof(pa.pszParams));
+ mir_wstrncpy(pa.pszParams, dbv.ptszVal, _countof(pa.pszParams));
db_free(&dbv);
}
else
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 0381c05b35..7e6ccdbfc4 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -70,7 +70,7 @@ void SetProtoStatus(wchar_t *pszLabel, char *pszProto, int if_status, int new_st if (CallProtoService(pszProto, PS_GETSTATUS, 0, 0) == if_status) {
if (options.logging) {
wchar_t buf[1024];
- mir_sntprintf(buf, TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status);
+ mir_snwprintf(buf, TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
CallProtoService(pszProto, PS_SETSTATUS, new_status, 0);
@@ -118,8 +118,8 @@ void __cdecl sttCheckStatusThreadProc(void*) pa.item_id = i->item_id;
pa.miss_count = i->miss_count;
pa.port = i->port;
- mir_tstrncpy(pa.pszLabel, i->pszLabel, _countof(pa.pszLabel));
- mir_tstrncpy(pa.pszName, i->pszName, _countof(pa.pszName));
+ mir_wstrncpy(pa.pszLabel, i->pszLabel, _countof(pa.pszLabel));
+ mir_wstrncpy(pa.pszName, i->pszName, _countof(pa.pszName));
mir_strncpy(pa.pszProto, i->pszProto, _countof(pa.pszProto));
pa.set_status = i->set_status;
pa.status = i->status;
@@ -195,7 +195,7 @@ void __cdecl sttCheckStatusThreadProc(void*) }
if (pa.miss_count == -1 - options.retries && options.logging) {
wchar_t buf[512];
- mir_sntprintf(buf, TranslateT("%s - reply, %d"), pa.pszLabel, pa.round_trip_time);
+ mir_snwprintf(buf, TranslateT("%s - reply, %d"), pa.pszLabel, pa.round_trip_time);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
SetProtoStatus(pa.pszLabel, pa.pszProto, pa.get_status, pa.set_status);
@@ -209,7 +209,7 @@ void __cdecl sttCheckStatusThreadProc(void*) }
if (pa.miss_count == 1 + options.retries && options.logging) {
wchar_t buf[512];
- mir_sntprintf(buf, TranslateT("%s - timeout"), pa.pszLabel);
+ mir_snwprintf(buf, TranslateT("%s - timeout"), pa.pszLabel);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
}
@@ -308,9 +308,9 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) if (frame_id != -1 && ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
wchar_t TBcapt[255];
if (total > 0)
- mir_sntprintf(TBcapt, L"Ping (%d/%d)", upCount, total);
+ mir_snwprintf(TBcapt, L"Ping (%d/%d)", upCount, total);
else
- mir_sntprintf(TBcapt, L"Ping");
+ mir_snwprintf(TBcapt, L"Ping");
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt);
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt);
@@ -384,20 +384,20 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar dis->rcItem.left += options.indent;
DrawIconEx(dis->hDC, dis->rcItem.left, dis->rcItem.top + ((options.row_height - 16) >> 1), hIcon, 0, 0, 0, NULL, DI_NORMAL);
- GetTextExtentPoint32(dis->hDC, itemData.pszLabel, (int)mir_tstrlen(itemData.pszLabel), &textSize);
- TextOut(dis->hDC, dis->rcItem.left + 16 + 4, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, itemData.pszLabel, (int)mir_tstrlen(itemData.pszLabel));
+ GetTextExtentPoint32(dis->hDC, itemData.pszLabel, (int)mir_wstrlen(itemData.pszLabel), &textSize);
+ TextOut(dis->hDC, dis->rcItem.left + 16 + 4, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, itemData.pszLabel, (int)mir_wstrlen(itemData.pszLabel));
if (itemData.status != PS_DISABLED) {
wchar_t buf[256];
if (itemData.responding) {
- mir_sntprintf(buf, TranslateT("%d ms"), itemData.round_trip_time);
- GetTextExtentPoint32(dis->hDC, buf, (int)mir_tstrlen(buf), &textSize);
- TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_tstrlen(buf));
+ mir_snwprintf(buf, TranslateT("%d ms"), itemData.round_trip_time);
+ GetTextExtentPoint32(dis->hDC, buf, (int)mir_wstrlen(buf), &textSize);
+ TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_wstrlen(buf));
}
else if (itemData.miss_count > 0) {
- mir_sntprintf(buf, L"[%d]", itemData.miss_count);
- GetTextExtentPoint32(dis->hDC, buf, (int)mir_tstrlen(buf), &textSize);
- TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_tstrlen(buf));
+ mir_snwprintf(buf, L"[%d]", itemData.miss_count);
+ GetTextExtentPoint32(dis->hDC, buf, (int)mir_wstrlen(buf), &textSize);
+ TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_wstrlen(buf));
}
}
SetBkMode(dis->hDC, OPAQUE);
@@ -717,7 +717,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (options.logging) {
wchar_t buf[1024];
- mir_sntprintf(buf, L"%s - %s", pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked")));
+ mir_snwprintf(buf, L"%s - %s", pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked")));
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
}
@@ -917,25 +917,25 @@ void InitList() }
font_id.cbSize = sizeof(FontIDT);
- mir_tstrncpy(font_id.group, LPGENW("Ping"), _countof(font_id.group));
- mir_tstrncpy(font_id.name, LPGENW("List"), _countof(font_id.name));
+ mir_wstrncpy(font_id.group, LPGENW("Ping"), _countof(font_id.group));
+ mir_wstrncpy(font_id.name, LPGENW("List"), _countof(font_id.name));
mir_strncpy(font_id.dbSettingsGroup, "PING", _countof(font_id.dbSettingsGroup));
mir_strncpy(font_id.prefix, "Font", _countof(font_id.prefix));
- mir_tstrncpy(font_id.backgroundGroup, L"Ping", _countof(font_id.backgroundGroup));
- mir_tstrncpy(font_id.backgroundName, L"Background", _countof(font_id.backgroundName));
+ mir_wstrncpy(font_id.backgroundGroup, L"Ping", _countof(font_id.backgroundGroup));
+ mir_wstrncpy(font_id.backgroundName, L"Background", _countof(font_id.backgroundName));
font_id.order = 0;
font_id.flags = FIDF_DEFAULTVALID;
font_id.deffontsettings.charset = DEFAULT_CHARSET;
font_id.deffontsettings.size = -14;
font_id.deffontsettings.style = 0;
font_id.deffontsettings.colour = RGB(255, 255, 255);
- mir_tstrncpy(font_id.deffontsettings.szFace, L"Tahoma", _countof(font_id.deffontsettings.szFace));
+ mir_wstrncpy(font_id.deffontsettings.szFace, L"Tahoma", _countof(font_id.deffontsettings.szFace));
FontRegisterT(&font_id);
bk_col_id.cbSize = sizeof(ColourIDT);
- mir_tstrncpy(bk_col_id.group, L"Ping", _countof(bk_col_id.group));
- mir_tstrncpy(bk_col_id.name, L"Background", _countof(bk_col_id.name));
+ mir_wstrncpy(bk_col_id.group, L"Ping", _countof(bk_col_id.group));
+ mir_wstrncpy(bk_col_id.name, L"Background", _countof(bk_col_id.name));
mir_strncpy(bk_col_id.dbSettingsGroup, "PING", _countof(bk_col_id.dbSettingsGroup));
mir_strncpy(bk_col_id.setting, "BgColor", _countof(bk_col_id.setting));
bk_col_id.defcolour = RGB(0, 0, 0);
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index db10527710..37c01d0d28 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -38,8 +38,8 @@ void __stdcall ShowPopup(wchar_t *line1, wchar_t *line2, int flags) ppd->lchContact = NULL;
ppd->lchIcon = (flags ? hIconResponding : hIconNotResponding);
- mir_tstrncpy(ppd->lptzContactName, line1, _countof(ppd->lptzContactName));
- mir_tstrncpy(ppd->lptzText, line2, _countof(ppd->lptzText));
+ mir_wstrncpy(ppd->lptzContactName, line1, _countof(ppd->lptzContactName));
+ mir_wstrncpy(ppd->lptzText, line2, _countof(ppd->lptzText));
ppd->colorBack = GetSysColor(COLOR_BTNFACE);
ppd->colorText = GetSysColor(COLOR_WINDOWTEXT);
@@ -89,7 +89,7 @@ INT_PTR PluginPing(WPARAM, LPARAM lParam) //GetLocalTime(&systime);
NETLIBOPENCONNECTION conn = { 0 };
conn.cbSize = sizeof(NETLIBOPENCONNECTION);
- conn.szHost = mir_t2a(pa->pszName);
+ conn.szHost = mir_u2a(pa->pszName);
conn.wPort = pa->port;
conn.timeout = options.ping_timeout;
@@ -205,7 +205,7 @@ INT_PTR DblClick(WPARAM wParam, LPARAM) { CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
if (i->item_id == (DWORD)wParam) {
- if (mir_tstrlen(i->pszCommand)) {
+ if (mir_wstrlen(i->pszCommand)) {
ShellExecute(0, L"open", i->pszCommand, i->pszParams, 0, SW_SHOW);
}
else {
@@ -222,19 +222,19 @@ void import_ping_address(int index, PINGADDRESS &pa) { char buf[256];
mir_snprintf(buf, "Address%d", index);
if (!db_get_ts(0, "PingPlug", buf, &dbv)) {
- mir_tstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
+ mir_wstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
db_free(&dbv);
}
else
- mir_tstrncpy(pa.pszName, TranslateT("Unknown Address"), _countof(pa.pszName));
+ mir_wstrncpy(pa.pszName, TranslateT("Unknown Address"), _countof(pa.pszName));
mir_snprintf(buf, "Label%d", index);
if (!db_get_ts(0, "PingPlug", buf, &dbv)) {
- mir_tstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
+ mir_wstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
db_free(&dbv);
}
else
- mir_tstrncpy(pa.pszLabel, TranslateT("Unknown"), _countof(pa.pszLabel));
+ mir_wstrncpy(pa.pszLabel, TranslateT("Unknown"), _countof(pa.pszLabel));
mir_snprintf(buf, "Port%d", index);
pa.port = (int)db_get_dw(0, "PingPlug", buf, -1);
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index 89ccf41904..7f28faab29 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -55,10 +55,10 @@ static void ApplyDownloads(void *param) //create needed folders after escalating priviledges. Folders creates when we actually install updates
wchar_t tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
- mir_sntprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
+ mir_snwprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
SafeCreateDirectory(tszFileBack);
- mir_sntprintf(tszFileTemp, L"%s\\Temp", g_tszRoot);
+ mir_snwprintf(tszFileTemp, L"%s\\Temp", g_tszRoot);
SafeCreateDirectory(tszFileTemp);
VARST tszMirandaPath(L"%miranda_path%");
@@ -116,7 +116,7 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP wchar_t *p = wcschr(tszFileName, L'.'); *p = 0;
wchar_t link[MAX_PATH];
- mir_sntprintf(link, PLUGIN_INFO_URL, tszFileName);
+ mir_snwprintf(link, PLUGIN_INFO_URL, tszFileName);
Utils_OpenUrlT(link);
}
}
@@ -362,8 +362,8 @@ static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const wchar_t* tp = wcschr(tszRelFileName, L'\\'); if (tp) tp++; else tp = tszRelFileName;
wcslwr(tp);
- mir_sntprintf(FileInfo->File.tszDiskPath, L"%s\\Temp\\%s.zip", g_tszRoot, tszFileName);
- mir_sntprintf(FileInfo->File.tszDownloadURL, L"%s/%s.zip", tszBaseUrl, tszRelFileName);
+ mir_snwprintf(FileInfo->File.tszDiskPath, L"%s\\Temp\\%s.zip", g_tszRoot, tszFileName);
+ mir_snwprintf(FileInfo->File.tszDownloadURL, L"%s/%s.zip", tszBaseUrl, tszRelFileName);
for (tp = wcschr(FileInfo->File.tszDownloadURL, '\\'); tp != 0; tp = wcschr(tp, '\\'))
*tp++ = '/';
FileInfo->File.CRCsum = hash.m_crc;
@@ -385,7 +385,7 @@ static void GetList(void *) if (tszTempPath[dwLen-1] == '\\')
tszTempPath[dwLen-1] = 0;
- ptrT updateUrl( GetDefaultUrl()), baseUrl;
+ ptrW updateUrl( GetDefaultUrl()), baseUrl;
SERVLIST hashes(50, CompareHashes);
if (!ParseHashes(updateUrl, baseUrl, hashes)) {
hListThread = NULL;
@@ -399,7 +399,7 @@ static void GetList(void *) ServListEntry &hash = hashes[i];
wchar_t tszPath[MAX_PATH];
- mir_sntprintf(tszPath, L"%s\\%s", dirname, hash.m_name);
+ mir_snwprintf(tszPath, L"%s\\%s", dirname, hash.m_name);
if (GetFileAttributes(tszPath) == INVALID_FILE_ATTRIBUTES) {
FILEINFO *FileInfo = ServerEntryToFileInfo(hash, baseUrl, tszPath);
@@ -462,14 +462,14 @@ static INT_PTR ParseUriService(WPARAM, LPARAM lParam) return 1;
wchar_t pluginPath[MAX_PATH];
- mir_tstrcpy(pluginPath, p + 1);
+ mir_wstrcpy(pluginPath, p + 1);
p = wcschr(pluginPath, '/');
if (p) *p = '\\';
if (GetFileAttributes(pluginPath) != INVALID_FILE_ATTRIBUTES)
return 0;
- ptrT updateUrl(GetDefaultUrl()), baseUrl;
+ ptrW updateUrl(GetDefaultUrl()), baseUrl;
SERVLIST hashes(50, CompareHashes);
if (!ParseHashes(updateUrl, baseUrl, hashes)) {
hListThread = NULL;
@@ -482,7 +482,7 @@ static INT_PTR ParseUriService(WPARAM, LPARAM lParam) VARST dirName(L"%miranda_path%");
wchar_t tszPath[MAX_PATH];
- mir_sntprintf(tszPath, L"%s\\%s", dirName, hash->m_name);
+ mir_snwprintf(tszPath, L"%s\\%s", dirName, hash->m_name);
FILEINFO *fileInfo = ServerEntryToFileInfo(*hash, baseUrl, tszPath);
FILELIST *fileList = new FILELIST(1);
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 27f8377952..9f02de304d 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -61,9 +61,9 @@ static void ApplyUpdates(void *param) HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES);
//create needed folders after escalating priviledges. Folders creates when we actually install updates
wchar_t tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
- mir_sntprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
+ mir_snwprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
SafeCreateDirectory(tszFileBack);
- mir_sntprintf(tszFileTemp, L"%s\\Temp", g_tszRoot);
+ mir_snwprintf(tszFileTemp, L"%s\\Temp", g_tszRoot);
SafeCreateDirectory(tszFileTemp);
// 2) Download all plugins
@@ -103,7 +103,7 @@ static void ApplyUpdates(void *param) if (p.bDeleteOnly) {
// we need only to backup the old file
wchar_t *ptszRelPath = p.tszNewName + wcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
- mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, ptszRelPath);
+ mir_snwprintf(tszBackFile, L"%s\\%s", tszFileBack, ptszRelPath);
BackupFile(p.tszNewName, tszBackFile);
}
else {
@@ -111,8 +111,8 @@ static void ApplyUpdates(void *param) // otherwise it would be replaced by unzip
if ( wcsicmp(p.tszOldName, p.tszNewName)) {
wchar_t tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
- mir_sntprintf(tszSrcPath, L"%s\\%s", tszMirandaPath, p.tszOldName);
- mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, p.tszOldName);
+ mir_snwprintf(tszSrcPath, L"%s\\%s", tszMirandaPath, p.tszOldName);
+ mir_snwprintf(tszBackFile, L"%s\\%s", tszFileBack, p.tszOldName);
BackupFile(tszSrcPath, tszBackFile);
}
@@ -125,7 +125,7 @@ static void ApplyUpdates(void *param) #if MIRANDA_VER < 0x0A00
// 4) Change title of clist
- ptrT title(db_get_tsa(NULL, "CList", "TitleText"));
+ ptrW title(db_get_tsa(NULL, "CList", "TitleText"));
if (!lstrcmpi(title, L"Miranda IM"))
db_set_ts(NULL, "CList", "TitleText", L"Miranda NG");
#endif
@@ -143,7 +143,7 @@ static void ApplyUpdates(void *param) db_unset(NULL, MODNAME, DB_SETTING_CHANGEPLATFORM);
}
else {
- ptrT oldbin(db_get_tsa(NULL, MODNAME, "OldBin2"));
+ ptrW oldbin(db_get_tsa(NULL, MODNAME, "OldBin2"));
if (oldbin) {
SafeDeleteFile(oldbin);
db_unset(NULL, MODNAME, "OldBin2");
@@ -165,9 +165,9 @@ static void ApplyUpdates(void *param) wchar_t mirstartpath[MAX_PATH];
#ifdef _WIN64
- mir_sntprintf(mirstartpath, L"%s\\miranda32.exe", tszMirandaPath);
+ mir_snwprintf(mirstartpath, L"%s\\miranda32.exe", tszMirandaPath);
#else
- mir_sntprintf(mirstartpath, L"%s\\miranda64.exe", tszMirandaPath);
+ mir_snwprintf(mirstartpath, L"%s\\miranda64.exe", tszMirandaPath);
#endif
CallServiceSync(MS_SYSTEM_RESTART, bRestartCurrentProfile, (LPARAM)mirstartpath);
}
@@ -412,10 +412,10 @@ static void DlgUpdateSilent(void *param) //create needed folders after escalating priviledges. Folders creates when we actually install updates
wchar_t tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
- mir_sntprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
+ mir_snwprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
SafeCreateDirectory(tszFileBack);
- mir_sntprintf(tszFileTemp, L"%s\\Temp", g_tszRoot);
+ mir_snwprintf(tszFileTemp, L"%s\\Temp", g_tszRoot);
SafeCreateDirectory(tszFileTemp);
// 2) Download all plugins
@@ -453,7 +453,7 @@ static void DlgUpdateSilent(void *param) if (p.bDeleteOnly) {
// we need only to backup the old file
wchar_t *ptszRelPath = p.tszNewName + wcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
- mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, ptszRelPath);
+ mir_snwprintf(tszBackFile, L"%s\\%s", tszFileBack, ptszRelPath);
BackupFile(p.tszNewName, tszBackFile);
}
else {
@@ -461,8 +461,8 @@ static void DlgUpdateSilent(void *param) // otherwise it would be replaced by unzip
if (wcsicmp(p.tszOldName, p.tszNewName)) {
wchar_t tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
- mir_sntprintf(tszSrcPath, L"%s\\%s", tszMirandaPath, p.tszOldName);
- mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, p.tszOldName);
+ mir_snwprintf(tszSrcPath, L"%s\\%s", tszMirandaPath, p.tszOldName);
+ mir_snwprintf(tszBackFile, L"%s\\%s", tszFileBack, p.tszOldName);
BackupFile(tszSrcPath, tszBackFile);
}
@@ -477,7 +477,7 @@ static void DlgUpdateSilent(void *param) #if MIRANDA_VER < 0x0A00
// 4) Change title of clist
- ptrT title = db_get_tsa(NULL, "CList", "TitleText");
+ ptrW title = db_get_tsa(NULL, "CList", "TitleText");
if (!wcsicmp(title, L"Miranda IM"))
db_set_ts(NULL, "CList", "TitleText", L"Miranda NG");
#endif
@@ -493,7 +493,7 @@ static void DlgUpdateSilent(void *param) // 5) Prepare Restart
wchar_t tszTitle[100];
- mir_sntprintf(tszTitle, TranslateT("%d component(s) was updated"), count);
+ mir_snwprintf(tszTitle, TranslateT("%d component(s) was updated"), count);
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) {
ShowPopup(tszTitle,TranslateT("You need to restart your Miranda to apply installed updates."),POPUP_TYPE_MSG);
@@ -515,7 +515,7 @@ static void DlgUpdateSilent(void *param) if (!notified) {
// Error, let's try to show MessageBox as last way to inform user about successful update
wchar_t tszText[200];
- mir_sntprintf(tszText, L"%s\n\n%s", TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
+ mir_snwprintf(tszText, L"%s\n\n%s", TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(NULL, tszText, tszTitle, MB_ICONINFORMATION | MB_YESNO) == IDYES)
#if MIRANDA_VER >= 0x0A00
@@ -606,7 +606,7 @@ static renameTable[] = static bool CheckFileRename(const wchar_t *ptszOldName, wchar_t *pNewName)
{
for (int i = 0; i < _countof(renameTable); i++) {
- if (wildcmpit(ptszOldName, renameTable[i].oldName)) {
+ if (wildcmpiw(ptszOldName, renameTable[i].oldName)) {
wchar_t *ptszDest = renameTable[i].newName;
if (ptszDest == NULL)
*pNewName = 0;
@@ -642,7 +642,7 @@ static bool isValidDirectory(const wchar_t *ptszDirName) static int ScanFolder(const wchar_t *tszFolder, size_t cbBaseLen, const wchar_t *tszBaseUrl, SERVLIST& hashes, OBJLIST<FILEINFO> *UpdateFiles, int level = 0)
{
wchar_t tszBuf[MAX_PATH];
- mir_sntprintf(tszBuf, L"%s\\*", tszFolder);
+ mir_snwprintf(tszBuf, L"%s\\*", tszFolder);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(tszBuf, &ffd);
@@ -656,7 +656,7 @@ static int ScanFolder(const wchar_t *tszFolder, size_t cbBaseLen, const wchar_t if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
// Scan recursively all subfolders
if (isValidDirectory(ffd.cFileName)) {
- mir_sntprintf(tszBuf, L"%s\\%s", tszFolder, ffd.cFileName);
+ mir_snwprintf(tszBuf, L"%s\\%s", tszFolder, ffd.cFileName);
count += ScanFolder(tszBuf, cbBaseLen, tszBaseUrl, hashes, UpdateFiles, level + 1);
}
}
@@ -666,17 +666,17 @@ static int ScanFolder(const wchar_t *tszFolder, size_t cbBaseLen, const wchar_t if (CheckFileRename(ffd.cFileName, tszNewName)) {
Netlib_LogfT(hNetlibUser, L"File %s will be renamed to %s.", ffd.cFileName, tszNewName);
// Yes, we need the old file name, because this will be hashed later
- mir_sntprintf(tszBuf, L"%s\\%s", tszFolder, ffd.cFileName);
+ mir_snwprintf(tszBuf, L"%s\\%s", tszFolder, ffd.cFileName);
}
else {
if (level == 0) {
// Rename Miranda*.exe
- wcsncpy_s(tszNewName, opts.bChangePlatform && !mir_tstrcmpi(ffd.cFileName, OLD_FILENAME) ? NEW_FILENAME : ffd.cFileName, _TRUNCATE);
- mir_sntprintf(tszBuf, L"%s\\%s", tszFolder, tszNewName);
+ wcsncpy_s(tszNewName, opts.bChangePlatform && !mir_wstrcmpi(ffd.cFileName, OLD_FILENAME) ? NEW_FILENAME : ffd.cFileName, _TRUNCATE);
+ mir_snwprintf(tszBuf, L"%s\\%s", tszFolder, tszNewName);
}
else {
- mir_sntprintf(tszNewName, L"%s\\%s", tszFolder + cbBaseLen, ffd.cFileName);
- mir_sntprintf(tszBuf, L"%s\\%s", tszFolder, ffd.cFileName);
+ mir_snwprintf(tszNewName, L"%s\\%s", tszFolder + cbBaseLen, ffd.cFileName);
+ mir_snwprintf(tszBuf, L"%s\\%s", tszFolder, ffd.cFileName);
}
}
@@ -698,13 +698,13 @@ static int ScanFolder(const wchar_t *tszFolder, size_t cbBaseLen, const wchar_t // remove trailing w or W and try again
int iPos = int(p - tszNewName) - 1;
- strdelt(p - 1, 1);
+ strdelw(p - 1, 1);
if ((item = hashes.find((ServListEntry*)&pName)) == NULL) {
Netlib_LogfT(hNetlibUser, L"File %s: Not found on server, skipping", ffd.cFileName);
continue;
}
- strdelt(tszNewName + iPos, 1);
+ strdelw(tszNewName + iPos, 1);
}
#if MIRANDA_VER >= 0x0A00
@@ -761,8 +761,8 @@ static int ScanFolder(const wchar_t *tszFolder, size_t cbBaseLen, const wchar_t p = (p) ? p + 1 : tszBuf;
wcslwr(p);
- mir_sntprintf(FileInfo->File.tszDiskPath, L"%s\\Temp\\%s.zip", g_tszRoot, p);
- mir_sntprintf(FileInfo->File.tszDownloadURL, L"%s/%s.zip", tszBaseUrl, tszBuf);
+ mir_snwprintf(FileInfo->File.tszDiskPath, L"%s\\Temp\\%s.zip", g_tszRoot, p);
+ mir_snwprintf(FileInfo->File.tszDownloadURL, L"%s/%s.zip", tszBaseUrl, tszBuf);
for (p = wcschr(FileInfo->File.tszDownloadURL, '\\'); p != 0; p = wcschr(p, '\\'))
*p++ = '/';
@@ -797,7 +797,7 @@ static void CheckUpdates(void *) if (!opts.bSilent)
ShowPopup(TranslateT("Plugin Updater"), TranslateT("Checking for new updates..."), POPUP_TYPE_INFO);
- ptrT updateUrl(GetDefaultUrl()), baseUrl;
+ ptrW updateUrl(GetDefaultUrl()), baseUrl;
SERVLIST hashes(50, CompareHashes);
bool success = ParseHashes(updateUrl, baseUrl, hashes);
if (success) {
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index 5741de81bd..819cf521e3 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -71,7 +71,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hPopup, UINT uMsg, WPARAM wParam, LPAR static void _stdcall RestartPrompt(void *)
{
wchar_t tszText[200];
- mir_sntprintf(tszText, L"%s\n\n%s", TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
+ mir_snwprintf(tszText, L"%s\n\n%s", TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(0, tszText, TranslateT("Plugin Updater"), MB_YESNO | MB_ICONQUESTION | MB_TOPMOST) == IDYES)
CallService(MS_SYSTEM_RESTART, db_get_b(NULL, MODNAME, "RestartCurrentProfile", 1) ? 1 : 0, 0);
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 5d54e559fe..38dd4d5802 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -33,7 +33,7 @@ static int GetUpdateMode() // Check if there is url for custom mode
if (UpdateMode == UPDATE_MODE_CUSTOM) {
- ptrT url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
+ ptrW url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
if (url == NULL || !wcslen(url)) {
// No url for custom mode, reset that setting so it will be determined automatically
db_unset(NULL, MODNAME, DB_SETTING_UPDATE_MODE);
@@ -56,14 +56,14 @@ wchar_t* GetDefaultUrl() wchar_t url[MAX_PATH];
switch (GetUpdateMode()) {
case UPDATE_MODE_STABLE:
- mir_sntprintf(url, DEFAULT_UPDATE_URL, opts.bChangePlatform ? DEFAULT_OPP_BITS : DEFAULT_BITS);
- return mir_tstrdup(url);
+ mir_snwprintf(url, DEFAULT_UPDATE_URL, opts.bChangePlatform ? DEFAULT_OPP_BITS : DEFAULT_BITS);
+ return mir_wstrdup(url);
case UPDATE_MODE_TRUNK:
- mir_sntprintf(url, DEFAULT_UPDATE_URL_TRUNK, opts.bChangePlatform ? DEFAULT_OPP_BITS : DEFAULT_BITS);
- return mir_tstrdup(url);
+ mir_snwprintf(url, DEFAULT_UPDATE_URL_TRUNK, opts.bChangePlatform ? DEFAULT_OPP_BITS : DEFAULT_BITS);
+ return mir_wstrdup(url);
case UPDATE_MODE_TRUNK_SYMBOLS:
- mir_sntprintf(url, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS, opts.bChangePlatform ? DEFAULT_OPP_BITS : DEFAULT_BITS);
- return mir_tstrdup(url);
+ mir_snwprintf(url, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS, opts.bChangePlatform ? DEFAULT_OPP_BITS : DEFAULT_BITS);
+ return mir_wstrdup(url);
default:
return db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL);
}
@@ -121,17 +121,17 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar switch (GetUpdateMode()) {
case UPDATE_MODE_STABLE:
- mir_sntprintf(defurl, DEFAULT_UPDATE_URL, GetBits(hwndDlg));
+ mir_snwprintf(defurl, DEFAULT_UPDATE_URL, GetBits(hwndDlg));
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
CheckDlgButton(hwndDlg, IDC_STABLE, BST_CHECKED);
break;
case UPDATE_MODE_TRUNK:
- mir_sntprintf(defurl, DEFAULT_UPDATE_URL_TRUNK, GetBits(hwndDlg));
+ mir_snwprintf(defurl, DEFAULT_UPDATE_URL_TRUNK, GetBits(hwndDlg));
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
CheckDlgButton(hwndDlg, IDC_TRUNK, BST_CHECKED);
break;
case UPDATE_MODE_TRUNK_SYMBOLS:
- mir_sntprintf(defurl, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS, GetBits(hwndDlg));
+ mir_snwprintf(defurl, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS, GetBits(hwndDlg));
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
CheckDlgButton(hwndDlg, IDC_TRUNK_SYMBOLS, BST_CHECKED);
break;
@@ -140,7 +140,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE_PLATFORM), FALSE);
- ptrT url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
+ ptrW url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
if (url == NULL)
url = GetDefaultUrl();
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, url);
@@ -181,7 +181,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar case IDC_TRUNK_SYMBOLS:
EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE_PLATFORM), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), FALSE);
- mir_sntprintf(defurl, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS, GetBits(hwndDlg));
+ mir_snwprintf(defurl, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS, GetBits(hwndDlg));
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -189,7 +189,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar case IDC_TRUNK:
EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE_PLATFORM), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), FALSE);
- mir_sntprintf(defurl, DEFAULT_UPDATE_URL_TRUNK, GetBits(hwndDlg));
+ mir_snwprintf(defurl, DEFAULT_UPDATE_URL_TRUNK, GetBits(hwndDlg));
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -197,7 +197,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar case IDC_STABLE:
EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE_PLATFORM), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), FALSE);
- mir_sntprintf(defurl, DEFAULT_UPDATE_URL, GetBits(hwndDlg));
+ mir_snwprintf(defurl, DEFAULT_UPDATE_URL, GetBits(hwndDlg));
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -206,7 +206,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE_PLATFORM), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
{
- ptrT url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
+ ptrW url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
if (url == NULL)
url = GetDefaultUrl();
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, url);
@@ -227,15 +227,15 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar case IDC_CHANGE_PLATFORM:
if (IsDlgButtonChecked(hwndDlg, IDC_STABLE)) {
- mir_sntprintf(defurl, DEFAULT_UPDATE_URL, GetBits(hwndDlg));
+ mir_snwprintf(defurl, DEFAULT_UPDATE_URL, GetBits(hwndDlg));
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
}
else if (IsDlgButtonChecked(hwndDlg, IDC_TRUNK)) {
- mir_sntprintf(defurl, DEFAULT_UPDATE_URL_TRUNK, GetBits(hwndDlg));
+ mir_snwprintf(defurl, DEFAULT_UPDATE_URL_TRUNK, GetBits(hwndDlg));
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
}
else if (IsDlgButtonChecked(hwndDlg, IDC_TRUNK_SYMBOLS)) {
- mir_sntprintf(defurl, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS, GetBits(hwndDlg));
+ mir_snwprintf(defurl, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS, GetBits(hwndDlg));
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp index d5b1b23564..3a2a2fdb1d 100644 --- a/plugins/PluginUpdater/src/PluginUpdater.cpp +++ b/plugins/PluginUpdater/src/PluginUpdater.cpp @@ -132,7 +132,7 @@ extern "C" __declspec(dllexport) int Load(void) #if MIRANDA_VER >= 0x0A00
// Upgrade old settings
if (-1 == db_get_b(0, MODNAME, DB_SETTING_UPDATE_MODE, -1)) {
- ptrT dbvUpdateURL(db_get_tsa(0, MODNAME, DB_SETTING_UPDATE_URL));
+ ptrW dbvUpdateURL(db_get_tsa(0, MODNAME, DB_SETTING_UPDATE_URL));
if (dbvUpdateURL) {
if (!wcscmp(dbvUpdateURL, _A2W(DEFAULT_UPDATE_URL_OLD))) {
db_set_b(0, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
diff --git a/plugins/PluginUpdater/src/Services.cpp b/plugins/PluginUpdater/src/Services.cpp index bd12b68f17..698fac6021 100644 --- a/plugins/PluginUpdater/src/Services.cpp +++ b/plugins/PluginUpdater/src/Services.cpp @@ -27,7 +27,7 @@ static INT_PTR srvParseHashes(WPARAM wParam, LPARAM lParam) return NULL;
SERVLIST *pList = new SERVLIST(50, CompareHashes);
- ptrT baseUrl;
+ ptrW baseUrl;
if ( ParseHashes(ptszUrl, baseUrl, *pList)) {
wcsncpy(ptszBaseUrl, baseUrl, MAX_PATH);
return (INT_PTR)pList;
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 00009c75d1..26b395a1c4 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -128,7 +128,7 @@ int CompareHashes(const ServListEntry *p1, const ServListEntry *p2) return wcsicmp(p1->m_name, p2->m_name);
}
-bool ParseHashes(const wchar_t *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes)
+bool ParseHashes(const wchar_t *ptszUrl, ptrW &baseUrl, SERVLIST &arHashes)
{
REPLACEVARSARRAY vars[2];
#if MIRANDA_VER >=0x0A00
@@ -152,8 +152,8 @@ bool ParseHashes(const wchar_t *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes) // Download version info
FILEURL pFileUrl;
- mir_sntprintf(pFileUrl.tszDownloadURL, L"%s/hashes.zip", baseUrl);
- mir_sntprintf(pFileUrl.tszDiskPath, L"%s\\hashes.zip", g_tszTempPath);
+ mir_snwprintf(pFileUrl.tszDownloadURL, L"%s/hashes.zip", baseUrl);
+ mir_snwprintf(pFileUrl.tszDiskPath, L"%s\\hashes.zip", g_tszTempPath);
pFileUrl.CRCsum = 0;
HANDLE nlc;
@@ -177,7 +177,7 @@ bool ParseHashes(const wchar_t *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes) DeleteFile(pFileUrl.tszDiskPath);
wchar_t tszTmpIni[MAX_PATH] = {0};
- mir_sntprintf(tszTmpIni, L"%s\\hashes.txt", g_tszTempPath);
+ mir_snwprintf(tszTmpIni, L"%s\\hashes.txt", g_tszTempPath);
FILE *fp = _wfopen(tszTmpIni, L"r");
if (!fp) {
Netlib_LogfT(hNetlibUser,L"Opening %s failed", g_tszTempPath);
@@ -243,7 +243,7 @@ bool DownloadFile(FILEURL *pFileURL, HANDLE &nlc) #endif
nlhr.requestType = REQUEST_GET;
nlhr.nlc = nlc;
- char *szUrl = mir_t2a(pFileURL->tszDownloadURL);
+ char *szUrl = mir_u2a(pFileURL->tszDownloadURL);
nlhr.szUrl = szUrl;
nlhr.headersCount = 4;
nlhr.headers=(NETLIBHTTPHEADER*)mir_alloc(sizeof(NETLIBHTTPHEADER)*nlhr.headersCount);
@@ -285,7 +285,7 @@ bool DownloadFile(FILEURL *pFileURL, HANDLE &nlc) else {
// try to write it via PU stub
wchar_t tszTempFile[MAX_PATH];
- mir_sntprintf(tszTempFile, L"%s\\pulocal.tmp", g_tszTempPath);
+ mir_snwprintf(tszTempFile, L"%s\\pulocal.tmp", g_tszTempPath);
hFile = CreateFile(tszTempFile, GENERIC_READ | GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
DWORD dwBytes;
@@ -502,7 +502,7 @@ bool PrepareEscalation() else {
// Elevate the process. Create a pipe for a stub first
wchar_t tszPipeName[MAX_PATH];
- mir_sntprintf(tszPipeName, L"\\\\.\\pipe\\Miranda_Pu_%d", GetCurrentProcessId());
+ mir_snwprintf(tszPipeName, L"\\\\.\\pipe\\Miranda_Pu_%d", GetCurrentProcessId());
hPipe = CreateNamedPipe(tszPipeName, PIPE_ACCESS_DUPLEX, PIPE_READMODE_BYTE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL);
if (hPipe == INVALID_HANDLE_VALUE) {
hPipe = NULL;
@@ -512,7 +512,7 @@ bool PrepareEscalation() GetModuleFileName(NULL, szPath, ARRAYSIZE(szPath));
if ((p = wcsrchr(szPath, '\\')) != 0)
wcscpy(p+1, L"pu_stub.exe");
- mir_sntprintf(cmdLine, L"%d", GetCurrentProcessId());
+ mir_snwprintf(cmdLine, L"%d", GetCurrentProcessId());
// Launch a stub
SHELLEXECUTEINFO sei = { sizeof(sei) };
diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h index 2fa09762b7..096ef9e247 100644 --- a/plugins/PluginUpdater/src/stdafx.h +++ b/plugins/PluginUpdater/src/stdafx.h @@ -188,7 +188,7 @@ public: struct ServListEntry
{
ServListEntry(const char* _name, const char* _hash, int _crc) :
- m_name( mir_a2t(_name)),
+ m_name( mir_a2u(_name)),
m_crc(_crc)
{
strncpy(m_szHash, _hash, sizeof(m_szHash));
@@ -225,7 +225,7 @@ void UnloadNetlib(); void BackupFile(wchar_t *ptszSrcFileName, wchar_t *ptszBackFileName);
-bool ParseHashes(const wchar_t *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes);
+bool ParseHashes(const wchar_t *ptszUrl, ptrW &baseUrl, SERVLIST &arHashes);
int CompareHashes(const ServListEntry *p1, const ServListEntry *p2);
wchar_t* GetDefaultUrl();
diff --git a/plugins/PluginUpdater/src/unzipfile.cpp b/plugins/PluginUpdater/src/unzipfile.cpp index 979dcd289e..7698e056a0 100644 --- a/plugins/PluginUpdater/src/unzipfile.cpp +++ b/plugins/PluginUpdater/src/unzipfile.cpp @@ -32,7 +32,7 @@ extern "C" static void PrepareFileName(wchar_t *dest, size_t destSize, const wchar_t *ptszPath, const wchar_t *ptszFileName)
{
- mir_sntprintf(dest, destSize, L"%s\\%s", ptszPath, ptszFileName);
+ mir_snwprintf(dest, destSize, L"%s\\%s", ptszPath, ptszFileName);
for (wchar_t *p = dest; *p; ++p)
if (*p == '/')
@@ -57,9 +57,9 @@ bool extractCurrentFile(unzFile uf, wchar_t *ptszDestPath, wchar_t *ptszBackPath return true;
wchar_t tszDestFile[MAX_PATH], tszBackFile[MAX_PATH];
- wchar_t *ptszNewName = mir_utf8decodeT(filename);
+ wchar_t *ptszNewName = mir_utf8decodeW(filename);
if (ptszNewName == NULL)
- ptszNewName = mir_a2t(filename);
+ ptszNewName = mir_a2u(filename);
if (!(file_info.external_fa & FILE_ATTRIBUTE_DIRECTORY)) {
err = unzOpenCurrentFile(uf);
diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp index 92ae2f282b..5a84d99d0e 100644 --- a/plugins/Popup/src/actions.cpp +++ b/plugins/Popup/src/actions.cpp @@ -236,9 +236,9 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM LVGROUP group = { 0 };
group.cbSize = sizeof(group);
group.mask = LVGF_HEADER | LVGF_GROUPID;
- LPTSTR wszGroup = mir_a2t(szGroup);
+ LPTSTR wszGroup = mir_a2u(szGroup);
group.pszHeader = TranslateTS(wszGroup);
- group.cchHeader = (int)mir_tstrlen(wszGroup);
+ group.cchHeader = (int)mir_wstrlen(wszGroup);
grpId = group.iGroupId = groups.getCount();
ListView_InsertGroup(hwndList, -1, &group);
mir_free(wszGroup);
@@ -248,7 +248,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM LVITEM item = { 0 };
item.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_TEXT | LVIF_STATE | LVIF_INDENT;
item.iItem = i;
- ptrT tszName(mir_a2t(szName));
+ ptrW tszName(mir_a2u(szName));
item.pszText = TranslateTS(tszName);
item.iImage = ImageList_AddIcon(hImgList, gActions[i]->lchIcon);
item.lParam = i;
diff --git a/plugins/Popup/src/avatars.cpp b/plugins/Popup/src/avatars.cpp index 4f278f3572..73bd43ede4 100644 --- a/plugins/Popup/src/avatars.cpp +++ b/plugins/Popup/src/avatars.cpp @@ -28,8 +28,8 @@ PopupAvatar *PopupAvatar::create(MCONTACT hContact) if (hContact) {
if (ServiceExists(MS_AV_GETAVATARBITMAP)) {
avatarCacheEntry *av = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0);
- if (av && (mir_tstrlen(av->szFilename) > 4))
- if (!mir_tstrcmpi(av->szFilename + mir_tstrlen(av->szFilename) - 4, L".gif"))
+ if (av && (mir_wstrlen(av->szFilename) > 4))
+ if (!mir_wstrcmpi(av->szFilename + mir_wstrlen(av->szFilename) - 4, L".gif"))
if (db_get_b(NULL, MODULNAME, "EnableGifAnimation", 1) && GDIPlus_IsAnimatedGIF(av->szFilename))
return new GifAvatar(hContact);
}
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp index 9e2c094464..945be3e482 100644 --- a/plugins/Popup/src/bitmap_funcs.cpp +++ b/plugins/Popup/src/bitmap_funcs.cpp @@ -596,7 +596,7 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h) void MyBitmap::Draw_Text(wchar_t *str, int x, int y)
{
- SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
+ SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_wstrlen(str), &sz);
RECT rc; SetRect(&rc, x, y, x + 10000, y + 10000);
this->saveAlpha(x, y, sz.cx, sz.cy);
DrawText(this->getDC(), str, -1, &rc, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_NOPREFIX);
@@ -680,7 +680,7 @@ bool MyBitmap::loadFromFile_pixel(const wchar_t *fn) {
allocate(1, 1);
int r, g, b, a = 255;
- const wchar_t *p = fn + mir_tstrlen(L"pixel:");
+ const wchar_t *p = fn + mir_wstrlen(L"pixel:");
r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
g = (hex2dec(p[2]) << 4) + hex2dec(p[3]);
b = (hex2dec(p[4]) << 4) + hex2dec(p[5]);
@@ -690,7 +690,7 @@ bool MyBitmap::loadFromFile_pixel(const wchar_t *fn) bool MyBitmap::loadFromFile_gradient(const wchar_t *fn)
{
- const wchar_t *p = fn + mir_tstrlen(L"gradient:");
+ const wchar_t *p = fn + mir_wstrlen(L"gradient:");
if (*p == 'h') allocate(256, 1);
else allocate(1, 256);
@@ -724,10 +724,10 @@ bool MyBitmap::loadFromFile(const wchar_t *fn) {
if (bits) freemem();
- if (!wcsncmp(fn, L"pixel:", mir_tstrlen(L"pixel:")))
+ if (!wcsncmp(fn, L"pixel:", mir_wstrlen(L"pixel:")))
return loadFromFile_pixel(fn);
- if (!wcsncmp(fn, L"gradient:", mir_tstrlen(L"gradient:")))
+ if (!wcsncmp(fn, L"gradient:", mir_wstrlen(L"gradient:")))
return loadFromFile_gradient(fn);
SIZE sz;
diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index 28eac5417f..5fff5e0444 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -70,9 +70,9 @@ inline INT_PTR DBGetContactSettingStringX(MCONTACT hContact, const char *ModuleN break;
case DBVT_TCHAR:
if (!result)
- ret = (INT_PTR)mir_tstrdup(dbv.ptszVal);
+ ret = (INT_PTR)mir_wstrdup(dbv.ptszVal);
else
- ret = (INT_PTR)mir_a2t(Default);
+ ret = (INT_PTR)mir_a2u(Default);
break;
}
if (!result)
@@ -89,7 +89,7 @@ inline void AddTooltipTranslated(HWND hwndToolTip, HWND hwnd, int id, RECT rc, c ti.uId = id;
SendMessage(hwndToolTip, TTM_DELTOOL, 0, (LPARAM)&ti);
- LPTSTR wtext = mir_a2t(text);
+ LPTSTR wtext = mir_a2u(text);
ti.uFlags = TTF_SUBCLASS;
ti.hwnd = hwnd;
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index 56b9c26eca..23a6156b55 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -30,52 +30,52 @@ void InitFonts() // Fonts
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
- mir_tstrncpy(fid.group, PU_FNT_AND_COLORW, _countof(fid.group));
+ mir_wstrncpy(fid.group, PU_FNT_AND_COLORW, _countof(fid.group));
mir_strncpy(fid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, _countof(fid.dbSettingsGroup));
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.size = -11;
- mir_tstrncpy(fid.backgroundGroup, PU_FNT_AND_COLORW, _countof(fid.backgroundGroup));
- mir_tstrncpy(fid.backgroundName, PU_COL_BACK_NAME, _countof(fid.backgroundName));
- mir_tstrncpy(fid.deffontsettings.szFace, L"Tahoma", _countof(fid.deffontsettings.szFace));
+ mir_wstrncpy(fid.backgroundGroup, PU_FNT_AND_COLORW, _countof(fid.backgroundGroup));
+ mir_wstrncpy(fid.backgroundName, PU_COL_BACK_NAME, _countof(fid.backgroundName));
+ mir_wstrncpy(fid.deffontsettings.szFace, L"Tahoma", _countof(fid.deffontsettings.szFace));
- mir_tstrncpy(fid.name, PU_FNT_NAME_TITLE, _countof(fid.name));
+ mir_wstrncpy(fid.name, PU_FNT_NAME_TITLE, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
fid.deffontsettings.style = DBFONTF_BOLD;
fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name));
+ mir_wstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name));
+ mir_wstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
fid.deffontsettings.style = 0;
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, PU_FNT_NAME_ACTION, _countof(fid.name));
+ mir_wstrncpy(fid.name, PU_FNT_NAME_ACTION, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
fid.deffontsettings.colour = RGB(0, 0, 255);
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, PU_FNT_NAME_HOVERED_ACTION, _countof(fid.name));
+ mir_wstrncpy(fid.name, PU_FNT_NAME_HOVERED_ACTION, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
fid.deffontsettings.style = DBFONTF_UNDERLINE;
FontRegisterT(&fid);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
- mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
+ mir_wstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
mir_strncpy(cid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, _countof(cid.dbSettingsGroup));
- mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
+ mir_wstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
mir_strncpy(cid.setting, PU_COL_BACK_SETTING, _countof(cid.setting));
cid.defcolour = SETTING_BACKCOLOUR_DEFAULT;
ColourRegisterT(&cid);
- mir_tstrncpy(cid.name, PU_COL_AVAT_NAME, _countof(cid.name));
+ mir_wstrncpy(cid.name, PU_COL_AVAT_NAME, _countof(cid.name));
mir_strncpy(cid.setting, PU_COL_AVAT_SETTING, _countof(cid.setting));
cid.defcolour = SETTING_TEXTCOLOUR_DEFAULT;
ColourRegisterT(&cid);
@@ -95,36 +95,36 @@ void ReloadFonts() LOGFONT lf = { 0 };
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
- mir_tstrncpy(fid.group, PU_FNT_AND_COLORW, _countof(fid.name));
+ mir_wstrncpy(fid.group, PU_FNT_AND_COLORW, _countof(fid.name));
- mir_tstrncpy(fid.name, PU_FNT_NAME_TITLE, _countof(fid.name));
+ mir_wstrncpy(fid.name, PU_FNT_NAME_TITLE, _countof(fid.name));
fonts.clTitle = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.title = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name));
+ mir_wstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name));
fonts.clClock = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.clock = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name));
+ mir_wstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name));
fonts.clText = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.text = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, PU_FNT_NAME_ACTION, _countof(fid.name));
+ mir_wstrncpy(fid.name, PU_FNT_NAME_ACTION, _countof(fid.name));
fonts.clAction = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.action = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, PU_FNT_NAME_HOVERED_ACTION, _countof(fid.name));
+ mir_wstrncpy(fid.name, PU_FNT_NAME_HOVERED_ACTION, _countof(fid.name));
fonts.clActionHover = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.actionHover = CreateFontIndirect(&lf);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
- mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
- mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
+ mir_wstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
+ mir_wstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
fonts.clBack = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
- mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
- mir_tstrncpy(cid.name, PU_COL_AVAT_NAME, _countof(cid.name));
+ mir_wstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
+ mir_wstrncpy(cid.name, PU_COL_AVAT_NAME, _countof(cid.name));
fonts.clAvatarBorder = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
// update class popupps(only temp at this point, must rework)
diff --git a/plugins/Popup/src/font.h b/plugins/Popup/src/font.h index 0967bb4c12..c94739c13f 100644 --- a/plugins/Popup/src/font.h +++ b/plugins/Popup/src/font.h @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PU_FNT_AND_COLOR_DB MODULNAME //use eg mir_strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB);
#define PU_FNT_PREFIX "fnt%s" //use eg mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_....);
-#define PU_FNT_NAME_TITLE LPGENW("Title") //use eg mir_tstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT
+#define PU_FNT_NAME_TITLE LPGENW("Title") //use eg mir_wstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT
#define PU_FNT_NAME_CLOCK LPGENW("Clock")
#define PU_FNT_NAME_TEXT LPGENW("Text")
#define PU_FNT_NAME_ACTION LPGENW("Action")
diff --git a/plugins/Popup/src/formula.h b/plugins/Popup/src/formula.h index 0abbc50565..65a9eae3ee 100644 --- a/plugins/Popup/src/formula.h +++ b/plugins/Popup/src/formula.h @@ -79,10 +79,10 @@ private: int eval_atom(wchar_t *&s, Args *args, bool *vars) const;
public:
- Formula() :m_str(mir_tstrdup(L"")) {}
- Formula(wchar_t *s) :m_str(mir_tstrdup(s)) {}
+ Formula() :m_str(mir_wstrdup(L"")) {}
+ Formula(wchar_t *s) :m_str(mir_wstrdup(s)) {}
~Formula() { mir_free(m_str); }
- void set(wchar_t *s){ mir_free(m_str); m_str = mir_tstrdup(s); }
+ void set(wchar_t *s){ mir_free(m_str); m_str = mir_wstrdup(s); }
int eval(Args *args, bool *vars = 0) const;
};
diff --git a/plugins/Popup/src/history.cpp b/plugins/Popup/src/history.cpp index daf8e90a73..4746c4d4a9 100644 --- a/plugins/Popup/src/history.cpp +++ b/plugins/Popup/src/history.cpp @@ -74,8 +74,8 @@ void PopupHistoryAdd(POPUPDATA2 *ppdNew) POPUPDATA2 *ppd = (POPUPDATA2*)mir_alloc(sizeof(POPUPDATA2));
*ppd = *ppdNew;
if (ppd->flags & PU2_UNICODE) {
- ppd->lptzTitle = mir_tstrdup(ppd->lpwzTitle);
- ppd->lptzText = mir_tstrdup(ppd->lptzText);
+ ppd->lptzTitle = mir_wstrdup(ppd->lpwzTitle);
+ ppd->lptzText = mir_wstrdup(ppd->lptzText);
}
else {
ppd->lpzTitle = mir_strdup(ppd->lpzTitle);
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index ff38a8977a..b572ae477c 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -265,7 +265,7 @@ static int ModulesLoaded(WPARAM, LPARAM) const PopupSkin *skin;
if (skin = skins.getSkin(PopupOptions.SkinPack)) {
mir_free(PopupOptions.SkinPack);
- PopupOptions.SkinPack = mir_tstrdup(skin->getName());
+ PopupOptions.SkinPack = mir_wstrdup(skin->getName());
skin->loadOpts();
}
// init PopupEfects
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index 9958db8c7d..ad176ca7ed 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -29,9 +29,9 @@ HANDLE g_hntfError, g_hntfWarning, g_hntfNotification; int TreeDataSortFunc(const POPUPTREEDATA *p1, const POPUPTREEDATA *p2)
{
- if (int cmp = mir_tstrcmp(p1->pszTreeRoot, p2->pszTreeRoot))
+ if (int cmp = mir_wstrcmp(p1->pszTreeRoot, p2->pszTreeRoot))
return cmp;
- return mir_tstrcmp(p1->pszDescription, p2->pszDescription);
+ return mir_wstrcmp(p1->pszDescription, p2->pszDescription);
}
LIST<POPUPTREEDATA> gTreeData(20, TreeDataSortFunc);
@@ -172,8 +172,8 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) POPUPTREEDATA *ptd = (POPUPTREEDATA *)mir_alloc(sizeof(POPUPTREEDATA));
ptd->signature = PopupNotificationData_SIGNATURE;
ptd->typ = 1;
- ptd->pszTreeRoot = mir_a2t(notification->lpzGroup);
- ptd->pszDescription = mir_a2t(notification->lpzName);
+ ptd->pszTreeRoot = mir_a2u(notification->lpzGroup);
+ ptd->pszDescription = mir_a2u(notification->lpzName);
ptd->notification = *notification;
ptd->hIcoLib = notification->lchIcoLib;
if (!ptd->notification.lpzLAction) ptd->notification.lpzLAction = POPUP_ACTION_NOTHING;
@@ -215,7 +215,7 @@ HANDLE FindTreeData(LPTSTR group, LPTSTR name, BYTE typ) {
for (int i = 0; i < gTreeData.getCount(); i++) {
POPUPTREEDATA *p = gTreeData[i];
- if (p->typ == typ && (!group || (mir_tstrcmp(p->pszTreeRoot, group) == 0)) && (!name || (mir_tstrcmp(p->pszDescription, name) == 0)))
+ if (p->typ == typ && (!group || (mir_wstrcmp(p->pszTreeRoot, group) == 0)) && (!name || (mir_wstrcmp(p->pszDescription, name) == 0)))
return p;
}
return NULL;
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index 323bd1ce7b..b85db14921 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -32,7 +32,7 @@ LRESULT CALLBACK AlphaTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA LIST<wchar_t> g_lstPopupVfx(5, wcsicmp);
void OptAdv_RegisterVfx(char *name)
{
- g_lstPopupVfx.insert(mir_a2t(name));
+ g_lstPopupVfx.insert(mir_a2u(name));
}
void OptAdv_UnregisterVfx()
@@ -161,7 +161,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETPOS, TRUE, PopupOptions.Alpha);
mir_subclassWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER), AlphaTrackBarWndProc);
- mir_sntprintf(tstr, L"%d%%", Byte2Percentile(PopupOptions.Alpha));
+ mir_snwprintf(tstr, L"%d%%", Byte2Percentile(PopupOptions.Alpha));
SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
CheckDlgButton(hwnd, IDC_TRANS_OPAQUEONHOVER, PopupOptions.OpaqueOnHover ? BST_CHECKED : BST_UNCHECKED);
{
@@ -210,7 +210,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM for (int i = 0; i < g_lstPopupVfx.getCount(); ++i) {
DWORD dwItem = ComboBox_AddString(hCtrl, TranslateTS(g_lstPopupVfx[i]));
ComboBox_SetItemData(hCtrl, dwItem, i);
- if (PopupOptions.UseEffect && !mir_tstrcmp(g_lstPopupVfx[i], PopupOptions.Effect))
+ if (PopupOptions.UseEffect && !mir_wstrcmp(g_lstPopupVfx[i], PopupOptions.Effect))
dwActiveItem = dwItem;
}
SendDlgItemMessage(hwnd, IDC_EFFECT, CB_SETCURSEL, dwActiveItem, 0);
@@ -236,7 +236,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_TRANS_SLIDER:
PopupOptions.Alpha = (BYTE)SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_GETPOS, 0, 0);
- mir_sntprintf(tstr, TranslateT("%d%%"), Byte2Percentile(PopupOptions.Alpha));
+ mir_snwprintf(tstr, TranslateT("%d%%"), Byte2Percentile(PopupOptions.Alpha));
SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
@@ -341,7 +341,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM int iEffect = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
PopupOptions.UseEffect = (iEffect != -2) ? TRUE : FALSE;
mir_free(PopupOptions.Effect);
- PopupOptions.Effect = mir_tstrdup((iEffect >= 0) ? g_lstPopupVfx[iEffect] : L"");
+ PopupOptions.Effect = mir_wstrdup((iEffect >= 0) ? g_lstPopupVfx[iEffect] : L"");
BOOL enable = PopupOptions.UseAnimations || PopupOptions.UseEffect;
EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), enable);
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index 170603d799..29b2702137 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -191,11 +191,11 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (p->typ == 1) { // Treeview part for typ 1 (notification)
iconIndex = ImageList_ReplaceIcon(hImgLst, -1, IcoLib_GetIconByHandle(p->hIcoLib));
- mir_sntprintf(itemName, L"%s/%s", p->pszTreeRoot, p->pszDescription);
+ mir_snwprintf(itemName, L"%s/%s", p->pszTreeRoot, p->pszDescription);
}
else { // Treeview part typ 2 (popup class api)
iconIndex = ImageList_ReplaceIcon(hImgLst, -1, p->pupClass.hIcon);
- mir_sntprintf(itemName, L"%s/%s", LPGENW("CLASS Plugins"), p->pszDescription);
+ mir_snwprintf(itemName, L"%s/%s", LPGENW("CLASS Plugins"), p->pszDescription);
}
OptTree_AddItem(hwndTree, itemName, (LPARAM)p, iconIndex);
}
@@ -266,7 +266,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l // combo left action (EXTRA)
hCtrl = GetDlgItem(hwnd, IDC_LACTION);
for (i = 0; i < ptd->notification.actionCount; ++i) {
- psztAction = mir_a2t(ptd->notification.lpActions[i].lpzTitle);
+ psztAction = mir_a2u(ptd->notification.lpActions[i].lpzTitle);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)), ptd->notification.lpActions[i].lpzTitle);
mir_free(psztAction); psztAction = NULL;
}
@@ -274,7 +274,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l hCtrl = GetDlgItem(hwnd, IDC_RACTION);
psztAction = NULL;
for (i = 0; i < ptd->notification.actionCount; ++i) {
- psztAction = mir_a2t(ptd->notification.lpActions[i].lpzTitle);
+ psztAction = mir_a2u(ptd->notification.lpActions[i].lpzTitle);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)), ptd->notification.lpActions[i].lpzTitle);
mir_free(psztAction); psztAction = NULL;
}
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 70272f8176..b2b6fba0e7 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -47,24 +47,24 @@ int AddStatusMode(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag) if (!flag) return pos;
options[pos].dwFlag = flag;
options[pos].groupId = OPTTREE_CHECK;
- options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t) * mir_tstrlen(prefix) + 32);
- options[pos].pszSettingName = mir_tstrdup(prefix);
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t) * mir_wstrlen(prefix) + 32);
+ options[pos].pszSettingName = mir_wstrdup(prefix);
options[pos].iconIndex = 0;
- mir_tstrcpy(options[pos].pszOptionName, prefix);
- mir_tstrcat(options[pos].pszOptionName, L"/");
+ mir_wstrcpy(options[pos].pszOptionName, prefix);
+ mir_wstrcat(options[pos].pszOptionName, L"/");
switch (flag)
{
- case PF2_IDLE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Offline")); break;
- case PF2_ONLINE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Online")); break;
- case PF2_INVISIBLE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Invisible")); break;
- case PF2_SHORTAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENW("Away")); break;
- case PF2_LONGAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENW("Not available")); break;
- case PF2_LIGHTDND: mir_tstrcat(options[pos].pszOptionName, LPGENW("Occupied")); break;
- case PF2_HEAVYDND: mir_tstrcat(options[pos].pszOptionName, LPGENW("Do not disturb")); break;
- case PF2_FREECHAT: mir_tstrcat(options[pos].pszOptionName, LPGENW("Free for chat")); break;
- case PF2_OUTTOLUNCH: mir_tstrcat(options[pos].pszOptionName, LPGENW("Out to lunch")); break;
- case PF2_ONTHEPHONE: mir_tstrcat(options[pos].pszOptionName, LPGENW("On the phone")); break;
+ case PF2_IDLE: mir_wstrcat(options[pos].pszOptionName, LPGENW("Offline")); break;
+ case PF2_ONLINE: mir_wstrcat(options[pos].pszOptionName, LPGENW("Online")); break;
+ case PF2_INVISIBLE: mir_wstrcat(options[pos].pszOptionName, LPGENW("Invisible")); break;
+ case PF2_SHORTAWAY: mir_wstrcat(options[pos].pszOptionName, LPGENW("Away")); break;
+ case PF2_LONGAWAY: mir_wstrcat(options[pos].pszOptionName, LPGENW("Not available")); break;
+ case PF2_LIGHTDND: mir_wstrcat(options[pos].pszOptionName, LPGENW("Occupied")); break;
+ case PF2_HEAVYDND: mir_wstrcat(options[pos].pszOptionName, LPGENW("Do not disturb")); break;
+ case PF2_FREECHAT: mir_wstrcat(options[pos].pszOptionName, LPGENW("Free for chat")); break;
+ case PF2_OUTTOLUNCH: mir_wstrcat(options[pos].pszOptionName, LPGENW("Out to lunch")); break;
+ case PF2_ONTHEPHONE: mir_wstrcat(options[pos].pszOptionName, LPGENW("On the phone")); break;
}
return pos + 1;
}
@@ -225,7 +225,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM continue;
wchar_t prefix[128];
- mir_sntprintf(prefix, LPGENW("Protocol Status")L"/%s", protocols[i]->tszAccountName);
+ mir_snwprintf(prefix, LPGENW("Protocol Status")L"/%s", protocols[i]->tszAccountName);
pos = AddStatusModes(statusOptions, pos, prefix, protoFlags);
}
}
@@ -243,7 +243,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName);
wchar_t pszSettingName[256];
- mir_sntprintf(pszSettingName, LPGENW("Protocol Status")L"/%s", protocols[i]->tszAccountName);
+ mir_snwprintf(pszSettingName, LPGENW("Protocol Status")L"/%s", protocols[i]->tszAccountName);
OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, prefix, 0), pszSettingName);
}
}
@@ -529,7 +529,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName);
wchar_t pszSettingName[256];
- mir_sntprintf(pszSettingName, L"Protocol Status/%s", protocols[i]->tszAccountName);
+ mir_snwprintf(pszSettingName, L"Protocol Status/%s", protocols[i]->tszAccountName);
db_set_dw(NULL, MODULNAME, prefix, OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName));
}
}
@@ -581,7 +581,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM void ErrorMSG(int minValue, int maxValue)
{
wchar_t str[128];
- mir_sntprintf(str, TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue);
+ mir_snwprintf(str, TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue);
MSGERROR(str);
}
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index a86b82c380..2274390955 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -48,7 +48,7 @@ void RegisterOptPrevBox() err = GetLastError();
if (!g_wndClass.cPopupPreviewBoxWndclass) {
wchar_t msg[1024];
- mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_snwprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -62,7 +62,7 @@ void RegisterOptPrevBox() err = GetLastError();
if (!g_wndClass.cPopupPlusDlgBox) {
wchar_t msg[1024];
- mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_snwprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
}
@@ -184,9 +184,9 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos options[pos].dwFlag = (DWORD)(1 << (i - 1));
options[pos].groupId = OPTTREE_CHECK;
options[pos].iconIndex = 0;
- options[pos].pszSettingName = mir_tstrdup(L"Skin options");
+ options[pos].pszSettingName = mir_wstrdup(L"Skin options");
options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t)*(
- mir_tstrlen(options[pos].pszSettingName) +
+ mir_wstrlen(options[pos].pszSettingName) +
mir_strlen(skin->getFlagName(i)) + 10));
wsprintf(options[pos].pszOptionName, L"%s/%hs", options[pos].pszSettingName, skin->getFlagName(i)); // !!!!!!!!!!!!!
options[pos].bState = skin->getFlag(i) ? TRUE : FALSE;
@@ -245,10 +245,10 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos, options[pos].dwFlag = (1 << i);
options[pos].groupId = OPTTREE_CHECK;
options[pos].iconIndex = 0;
- options[pos].pszSettingName = mir_tstrdup(LPGENW("Global settings"));
+ options[pos].pszSettingName = mir_wstrdup(LPGENW("Global settings"));
options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t)*(
- mir_tstrlen(options[pos].pszSettingName) +
- mir_tstrlen(mainOption[i]) + 10));
+ mir_wstrlen(options[pos].pszSettingName) +
+ mir_wstrlen(mainOption[i]) + 10));
wsprintf(options[pos].pszOptionName, L"%s/%s", options[pos].pszSettingName, mainOption[i]); // !!!!!!!!!!!!!
options[pos].bState = bCheck;
pos++;
@@ -314,13 +314,13 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR int index = -1;
OptTree_ProcessMessage(hwndDlg, msg, wParam, lParam, &index, IDC_SKIN_LIST_OPT, skinOptions, skinOptionsCount);
if (index != -1) {
- if (mir_tstrcmp(skinOptions[index].pszSettingName, L"Skin options") == 0) {
+ if (mir_wstrcmp(skinOptions[index].pszSettingName, L"Skin options") == 0) {
const PopupSkin *skin = 0;
if (skin = skins.getSkin(PopupOptions.SkinPack)) {
skin->setFlag(skinOptions[index].Data, skinOptions[index].bState ? true : false);
}
}
- else if (mir_tstrcmp(skinOptions[index].pszSettingName, L"Global settings") == 0) {
+ else if (mir_wstrcmp(skinOptions[index].pszSettingName, L"Global settings") == 0) {
switch (skinOptions[index].dwFlag) {
case (1 << 0) :
PopupOptions.DisplayTime = skinOptions[index].bState;
@@ -416,9 +416,9 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR // make shure we have select skin (ListBox_SetCurSel may be fail)
wchar_t szNewSkin[128];
ListBox_GetText(hCtrl, ListBox_GetCurSel(hCtrl), &szNewSkin);
- if (mir_tstrcmp(pszOldSkin, szNewSkin) != 0) {
+ if (mir_wstrcmp(pszOldSkin, szNewSkin) != 0) {
mir_free(PopupOptions.SkinPack);
- PopupOptions.SkinPack = mir_tstrdup(szNewSkin);
+ PopupOptions.SkinPack = mir_wstrdup(szNewSkin);
}
const PopupSkin *skin = 0;
@@ -440,7 +440,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR {
// Skin list change
mir_free(PopupOptions.SkinPack);
- PopupOptions.SkinPack = mir_tstrdup((wchar_t *)SendDlgItemMessage(
+ PopupOptions.SkinPack = mir_wstrdup((wchar_t *)SendDlgItemMessage(
hwndDlg,
IDC_SKINLIST,
LB_GETITEMDATA,
@@ -449,7 +449,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR const PopupSkin *skin = 0;
if (skin = skins.getSkin(PopupOptions.SkinPack)) {
mir_free(PopupOptions.SkinPack);
- PopupOptions.SkinPack = mir_tstrdup(skin->getName());
+ PopupOptions.SkinPack = mir_wstrdup(skin->getName());
// update Skin Option List
bDlgInit = false;
diff --git a/plugins/Popup/src/opttree.cpp b/plugins/Popup/src/opttree.cpp index c86ec17fb2..cc2e48e141 100644 --- a/plugins/Popup/src/opttree.cpp +++ b/plugins/Popup/src/opttree.cpp @@ -85,7 +85,7 @@ HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wcha while (tvi.hItem) {
TreeView_GetItem(hwndTree, &tvi);
- if (!mir_tstrcmp(tvi.pszText, name))
+ if (!mir_wstrcmp(tvi.pszText, name))
return tvi.hItem;
tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
@@ -101,7 +101,7 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconInd int sectionLevel = 0;
HTREEITEM hSection = NULL, result = NULL;
- mir_tstrcpy(itemName, name);
+ mir_wstrcpy(itemName, name);
sectionName = itemName;
while (sectionName) {
@@ -176,7 +176,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res int sectionLevel = 0;
HTREEITEM hSection = NULL;
- mir_tstrcpy(itemName, options[indx].pszOptionName);
+ mir_wstrcpy(itemName, options[indx].pszOptionName);
sectionName = itemName;
while (sectionName) {
@@ -324,7 +324,7 @@ DWORD OptTree_GetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int op int i;
for (i = 0; i < optionCount; ++i) {
if ((!options[i].pszSettingName && !pszSettingName) ||
- (options[i].pszSettingName && pszSettingName && !mir_tstrcmp(options[i].pszSettingName, pszSettingName)))
+ (options[i].pszSettingName && pszSettingName && !mir_wstrcmp(options[i].pszSettingName, pszSettingName)))
{
TVITEM tvi = { 0 };
tvi.mask = TVIF_HANDLE | TVIF_IMAGE;
@@ -342,7 +342,7 @@ void OptTree_SetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int opt HWND hwndTree = GetDlgItem(hwnd, idcTree);
for (int i = 0; i < optionCount; ++i) {
if ((!options[i].pszSettingName && !pszSettingName) ||
- (options[i].pszSettingName && pszSettingName && !mir_tstrcmp(options[i].pszSettingName, pszSettingName)))
+ (options[i].pszSettingName && pszSettingName && !mir_wstrcmp(options[i].pszSettingName, pszSettingName)))
{
TVITEM tvi;
tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index a2a42b263d..54dc146040 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -232,7 +232,7 @@ static unsigned __stdcall PopupThread(void *) err = GetLastError();
if (!g_wndClass.cPopupThreadManagerWnd) {
wchar_t msg[1024];
- mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_snwprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index b64c225c26..a31ce9b23e 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -61,7 +61,7 @@ bool LoadPopupWnd2() if (!g_wndClass.cPopupWnd2) {
res = false;
wchar_t msg[1024];
- mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_snwprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MessageBox(NULL, msg, MODULNAME_LONG, MB_ICONSTOP | MB_OK);
}
@@ -76,7 +76,7 @@ bool LoadPopupWnd2() err = GetLastError();
if (!g_wndClass.cPopupEditBox) {
wchar_t msg[2048];
- mir_sntprintf(msg, TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
+ mir_snwprintf(msg, TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
wclw.cbSize, wclw.style, wclw.lpfnWndProc, wclw.cbClsExtra, wclw.cbWndExtra, wclw.hInstance, wclw.hIcon, wclw.hCursor,
wclw.hbrBackground, wclw.lpszMenuName, wclw.lpszClassName, wclw.hIconSm);
@@ -101,7 +101,7 @@ bool LoadPopupWnd2() if (!g_wndClass.cPopupMenuHostWnd) {
res = false;
wchar_t msg[1024];
- mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_snwprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -261,7 +261,7 @@ void PopupWnd2::update() if (*m_time && skin->useInternalClock()) {
SetTextColor(hdc, m_clClock);
HFONT hfnSave = (HFONT)SelectObject(m_bmpBase->getDC(), fonts.clock);
- SIZE sz; GetTextExtentPoint32(m_bmpBase->getDC(), m_time, (int)mir_tstrlen(m_time), &sz);
+ SIZE sz; GetTextExtentPoint32(m_bmpBase->getDC(), m_time, (int)mir_wstrlen(m_time), &sz);
m_bmpBase->Draw_Text(m_time, this->m_sz.cx - sz.cx - STYLE_SZ_GAP - skin->getRightGap(), STYLE_SZ_GAP);
SelectObject(m_bmpBase->getDC(), hfnSave);
}
@@ -688,8 +688,8 @@ void PopupWnd2::updateData(POPUPDATAW_V2 *ppd) if (m_textType == TT_NONE)
m_textType = TT_UNICODE;
- replaceStrT(m_lptzTitle, ppd->lptzContactName);
- replaceStrT(m_lptzText, ppd->lptzText);
+ replaceStrW(m_lptzTitle, ppd->lptzContactName);
+ replaceStrW(m_lptzText, ppd->lptzText);
setIcon(ppd->lchIcon);
m_hNotification = ppd->hNotification;
@@ -717,12 +717,12 @@ void PopupWnd2::updateData(POPUPDATA2 *ppd) if (ppd->flags & PU2_UNICODE) {
if (m_textType == TT_NONE)
m_textType = TT_UNICODE;
- replaceStrT(m_lptzTitle, ppd->lptzTitle);
- replaceStrT(m_lptzText, ppd->lptzText);
+ replaceStrW(m_lptzTitle, ppd->lptzTitle);
+ replaceStrW(m_lptzText, ppd->lptzText);
}
else {
- replaceStrT(m_lptzTitle, NULL);
- replaceStrT(m_lptzText, NULL);
+ replaceStrW(m_lptzTitle, NULL);
+ replaceStrW(m_lptzText, NULL);
}
setIcon(ppd->lchIcon);
@@ -733,7 +733,7 @@ void PopupWnd2::updateData(POPUPDATA2 *ppd) m_customPopup = (ppd->flags & PU2_CUSTOM_POPUP) != 0;
m_hbmAvatar = ppd->hbmAvatar;
- m_lpzSkin = mir_a2t(ppd->lpzSkin);
+ m_lpzSkin = mir_a2u(ppd->lpzSkin);
if (m_options->DisplayTime) {
if (ppd->dwTimestamp)
@@ -768,7 +768,7 @@ void PopupWnd2::buildMText() void PopupWnd2::updateText(wchar_t *text)
{
if (m_lptzText) {
- replaceStrT(m_lptzText, text);
+ replaceStrW(m_lptzText, text);
if (m_textType == TT_MTEXT)
buildMText();
}
@@ -778,7 +778,7 @@ void PopupWnd2::updateText(wchar_t *text) void PopupWnd2::updateTitle(wchar_t *title)
{
if (m_lptzTitle) {
- replaceStrT(m_lptzTitle, title);
+ replaceStrW(m_lptzTitle, title);
if (m_textType == TT_MTEXT)
buildMText();
}
@@ -985,7 +985,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara EmptyClipboard();
HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, (tszText.GetLength() + 1) * sizeof(wchar_t));
wchar_t *buffer = (wchar_t *)GlobalLock(clipbuffer);
- mir_tstrcpy(buffer, tszText);
+ mir_wstrcpy(buffer, tszText);
GlobalUnlock(clipbuffer);
SetClipboardData(CF_UNICODETEXT, clipbuffer);
CloseClipboard();
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 676ac0beab..23f5ac5026 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -364,15 +364,15 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->signature = 0/*PopupNotificationData_SIGNATURE*/;
ptd->typ = 2;
memcpy(&ptd->pupClass, pc, sizeof(POPUPCLASS));
- ptd->pszTreeRoot = mir_a2t(pc->pszName);
+ ptd->pszTreeRoot = mir_a2u(pc->pszName);
ptd->pupClass.pszName = mir_strdup(pc->pszName);
if (pc->flags & PCF_UNICODE) {
ptd->pupClass.pwszDescription = mir_wstrdup(pc->pwszDescription);
- ptd->pszDescription = mir_u2t(pc->pwszDescription);
+ ptd->pszDescription = mir_wstrdup(pc->pwszDescription);
}
else {
ptd->pupClass.pszDescription = mir_strdup(pc->pszDescription);
- ptd->pszDescription = mir_a2t(pc->pszDescription);
+ ptd->pszDescription = mir_a2u(pc->pszDescription);
}
LoadClassSettings(ptd, PU_MODULCLASS);
@@ -381,13 +381,13 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
- mir_sntprintf(fid.group, _A2W(PU_FNT_AND_COLOR) L"/%S", ptd->pupClass.pszName);
+ mir_snwprintf(fid.group, _A2W(PU_FNT_AND_COLOR) L"/%S", ptd->pupClass.pszName);
mir_strncpy(fid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup) - 1);
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.size = -11;
- mir_tstrncpy(fid.deffontsettings.szFace, L"Verdana", _countof(fid.deffontsettings.szFace) - 1);
- mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name) - 1);
+ mir_wstrncpy(fid.deffontsettings.szFace, L"Verdana", _countof(fid.deffontsettings.szFace) - 1);
+ mir_wstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name) - 1);
mir_strncpy(fid.prefix, setting, _countof(fid.prefix));
mir_snprintf(fid.prefix, "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
fid.deffontsettings.style = 0;
@@ -399,9 +399,9 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
- mir_sntprintf(cid.group, _A2W(PU_FNT_AND_COLOR) L"/%S", ptd->pupClass.pszName);
+ mir_snwprintf(cid.group, _A2W(PU_FNT_AND_COLOR) L"/%S", ptd->pupClass.pszName);
mir_strncpy(cid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup));
- mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
+ mir_wstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
mir_snprintf(cid.setting, "%s/BgCol", ptd->pupClass.pszName);
cid.defcolour = fonts.clBack;
ColourRegisterT(&cid);
@@ -438,7 +438,7 @@ INT_PTR Popup_CreateClassPopup(WPARAM wParam, LPARAM lParam) if (wParam)
pc = (POPUPCLASS*)wParam;
else {
- LPTSTR group = mir_a2t(pdc->pszClassName);
+ LPTSTR group = mir_a2u(pdc->pszClassName);
POPUPTREEDATA *ptd = (POPUPTREEDATA *)FindTreeData(group, NULL, 2);
if (ptd)
pc = &ptd->pupClass;
@@ -481,13 +481,13 @@ INT_PTR Popup_LoadSkin(WPARAM, LPARAM lParam) if (lParam)
{
mir_free(PopupOptions.SkinPack);
- PopupOptions.SkinPack = mir_a2t((char*)lParam);
+ PopupOptions.SkinPack = mir_a2u((char*)lParam);
}
const PopupSkin *skin = 0;
if (skin = skins.getSkin(PopupOptions.SkinPack)) {
mir_free(PopupOptions.SkinPack);
- PopupOptions.SkinPack = mir_tstrdup(skin->getName());
+ PopupOptions.SkinPack = mir_wstrdup(skin->getName());
}
return 1;
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index 242bf7b4c2..73756e4e51 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -33,7 +33,7 @@ PopupSkin::PopupSkin(LPCTSTR aName) for (int i = 0; i < 32; i++)
m_flag_names[i] = NULL;
m_elements = 0;
- m_name = aName ? mir_tstrdup(aName) : NULL;
+ m_name = aName ? mir_wstrdup(aName) : NULL;
}
PopupSkin::~PopupSkin()
@@ -61,9 +61,9 @@ SIZE PopupSkin::measureAction(HDC hdc, POPUPACTION *act) const else ++name;
SIZE szText, szSpace;
- LPTSTR wname = mir_a2t(name);
+ LPTSTR wname = mir_a2u(name);
wchar_t *str = TranslateTS(wname);
- GetTextExtentPoint32(hdc, str, (int)mir_tstrlen(str), &szText);
+ GetTextExtentPoint32(hdc, str, (int)mir_wstrlen(str), &szText);
mir_free(wname);
GetTextExtentPoint32(hdc, L" ", 1, &szSpace);
@@ -124,9 +124,9 @@ void PopupSkin::drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool h GetTextExtentPoint32(bmp->getDC(), L" ", 1, &szSpace);
- LPTSTR wname = mir_a2t(name);
+ LPTSTR wname = mir_a2u(name);
wchar_t *str = TranslateTS(wname);
- GetTextExtentPoint32(bmp->getDC(), str, (int)mir_tstrlen(str), &szText);
+ GetTextExtentPoint32(bmp->getDC(), str, (int)mir_wstrlen(str), &szText);
bmp->Draw_Text(str,
(PopupOptions.actions&ACT_LARGE) ? (x + szSpace.cx + 32) : (x + szSpace.cx + 16),
max(y + 2, y + 2 + (((PopupOptions.actions&ACT_LARGE) ? 32 : 16) - szText.cy) / 2));
@@ -197,7 +197,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options }
else { // normal clock
HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
- SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz);
+ SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), (int)mir_wstrlen(wnd->getTime()), &sz);
SelectObject(hdc, hfnSave);
wnd->getArgs()->add("clock.width", sz.cx + 2 * STYLE_SZ_GAP);
wnd->getArgs()->add("clock.height", sz.cy);
@@ -239,7 +239,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options case PopupWnd2::TT_UNICODE:
{
RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
- DrawTextEx(hdc, wnd->getText(), (int)mir_tstrlen(wnd->getText()), &rc,
+ DrawTextEx(hdc, wnd->getText(), (int)mir_wstrlen(wnd->getText()), &rc,
DT_CALCRECT | DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
szNew.cx = rc.right;
szNew.cy = rc.bottom;
@@ -282,7 +282,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options case PopupWnd2::TT_UNICODE:
{
RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
- DrawTextEx(hdc, wnd->getTitle(), (int)mir_tstrlen(wnd->getTitle()), &rc,
+ DrawTextEx(hdc, wnd->getTitle(), (int)mir_wstrlen(wnd->getTitle()), &rc,
DT_CALCRECT | DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
szNew.cx = rc.right;
szNew.cy = rc.bottom;
@@ -345,7 +345,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options else {
HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
SIZE szClock;
- GetTextExtentPoint32(hdc, wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &szClock);
+ GetTextExtentPoint32(hdc, wnd->getTime(), (int)mir_wstrlen(wnd->getTime()), &szClock);
SelectObject(hdc, hfnSave);
wnd->getArgs()->add("clock.width", szClock.cx + 2 * STYLE_SZ_GAP);
wnd->getArgs()->add("clock.height", szClock.cy);
@@ -439,7 +439,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW }
else {
HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
- SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz);
+ SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), (int)mir_wstrlen(wnd->getTime()), &sz);
SelectObject(hdc, hfnSave);
STYLE_SZ_CLOCK = sz.cx + 2 * STYLE_SZ_GAP;
}
@@ -501,7 +501,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW case PopupWnd2::TT_UNICODE:
{
RECT rc; SetRect(&rc, pt.x, pt.y, pt.x + sz.cx, pt.y + sz.cy);
- DrawTextEx(hdc, wnd->getText(), (int)mir_tstrlen(wnd->getText()), &rc,
+ DrawTextEx(hdc, wnd->getText(), (int)mir_wstrlen(wnd->getText()), &rc,
DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
}
break;
@@ -549,7 +549,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW {
HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title);
RECT rc; SetRect(&rc, pt.x, pt.y, pt.x + sz.cx, pt.y + sz.cy);
- DrawTextEx(hdc, wnd->getTitle(), (int)mir_tstrlen(wnd->getTitle()), &rc,
+ DrawTextEx(hdc, wnd->getTitle(), (int)mir_wstrlen(wnd->getTitle()), &rc,
DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
SelectObject(hdc, hFntSave);
}
@@ -689,7 +689,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW SetTextColor(hdc, wnd->getClockColor());
HFONT hfnSave = (HFONT)SelectObject(bmp->getDC(), fonts.clock);
- GetTextExtentPoint32(bmp->getDC(), wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz);
+ GetTextExtentPoint32(bmp->getDC(), wnd->getTime(), (int)mir_wstrlen(wnd->getTime()), &sz);
bmp->Draw_Text(wnd->getTime(), x, y);
SelectObject(bmp->getDC(), hfnSave);
}
@@ -748,7 +748,7 @@ void PopupSkin::loadOptions(std::wistream &f) f.ignore(1024, '\n');
continue;
}
- if (!mir_tstrcmp(buf, L"option")) {
+ if (!mir_wstrcmp(buf, L"option")) {
int id, val;
f >> id >> val;
f.getline(buf, 1024);
@@ -758,16 +758,16 @@ void PopupSkin::loadOptions(std::wistream &f) wchar_t *p = buf;
while (isspace(*p))
p++;
- wchar_t *q = p + mir_tstrlen(p) - 1;
+ wchar_t *q = p + mir_wstrlen(p) - 1;
while ((q >= p) && isspace(*q))
*q-- = 0;
- m_flag_names[id] = mir_t2a(p);
+ m_flag_names[id] = mir_u2a(p);
if (val)
m_flags |= 1 << id;
else
m_flags &= ~(1 << id);
}
- else if (!mir_tstrcmp(buf, L"end"))
+ else if (!mir_wstrcmp(buf, L"end"))
break;
}
delete[] buf;
@@ -840,40 +840,40 @@ void PopupSkin::loadSkin(std::wistream &f) continue;
}
- if (!mir_tstrcmp(buf, L"popup-version")) {
+ if (!mir_wstrcmp(buf, L"popup-version")) {
f >> m_popup_version;
m_popup_version = PLUGIN_MAKE_VERSION((m_popup_version / 1000000) % 100, (m_popup_version / 10000) % 100, (m_popup_version / 100) % 100, (m_popup_version / 1) % 100);
if (!isCompatible())
break;
}
- else if (!mir_tstrcmp(buf, L"padding-right")) {
+ else if (!mir_wstrcmp(buf, L"padding-right")) {
f >> m_right_gap;
}
- else if (!mir_tstrcmp(buf, L"padding-bottom")) {
+ else if (!mir_wstrcmp(buf, L"padding-bottom")) {
f >> m_bottom_gap;
}
- else if (!mir_tstrcmp(buf, L"shadow-region-opacity")) {
+ else if (!mir_wstrcmp(buf, L"shadow-region-opacity")) {
f >> m_shadow_region_opacity;
}
- else if (!mir_tstrcmp(buf, L"legacy-region-opacity")) {
+ else if (!mir_wstrcmp(buf, L"legacy-region-opacity")) {
f >> m_legacy_region_opacity;
}
- else if (!mir_tstrcmp(buf, L"w")) {
+ else if (!mir_wstrcmp(buf, L"w")) {
f.getline(buf, 1024);
m_fw.set(buf);
}
- else if (!mir_tstrcmp(buf, L"h")) {
+ else if (!mir_wstrcmp(buf, L"h")) {
f.getline(buf, 1024);
m_fh.set(buf);
}
- else if (!mir_tstrcmp(buf, L"object")) {
+ else if (!mir_wstrcmp(buf, L"object")) {
head->next = loadObject(f);
if (head->next && ((head->next->type & ST_TYPEMASK) == ST_CLOCK))
m_internalClock = false;
head = head->next;
head->next = NULL;
}
- else if (!mir_tstrcmp(buf, L"options")) {
+ else if (!mir_wstrcmp(buf, L"options")) {
loadOptions(f);
}
}
@@ -928,76 +928,76 @@ PopupSkin::SKINELEMENT *PopupSkin::loadObject(std::wistream &f) continue;
}
- if (!mir_tstrcmp(buf, L"type")) {
+ if (!mir_wstrcmp(buf, L"type")) {
f >> buf;
- if (!mir_tstrcmp(buf, L"icon"))
+ if (!mir_wstrcmp(buf, L"icon"))
element->type = (element->type & ~ST_TYPEMASK) | ST_ICON;
- else if (!mir_tstrcmp(buf, L"bitmap"))
+ else if (!mir_wstrcmp(buf, L"bitmap"))
element->type = (element->type & ~ST_TYPEMASK) | ST_MYBITMAP;
- else if (!mir_tstrcmp(buf, L"text")) {
+ else if (!mir_wstrcmp(buf, L"text")) {
element->type = (element->type & ~ST_TYPEMASK) | ST_TEXT;
element->textColor = (COLORREF)0xffffffff;
element->hfn = 0;
}
- else if (!mir_tstrcmp(buf, L"title")) {
+ else if (!mir_wstrcmp(buf, L"title")) {
element->type = (element->type & ~ST_TYPEMASK) | ST_TITLE;
element->textColor = (COLORREF)0xffffffff;
element->hfn = 0;
}
- else if (!mir_tstrcmp(buf, L"avatar")) {
+ else if (!mir_wstrcmp(buf, L"avatar")) {
element->type = (element->type & ~ST_TYPEMASK) | ST_AVATAR;
}
- else if (!mir_tstrcmp(buf, L"clock")) {
+ else if (!mir_wstrcmp(buf, L"clock")) {
element->type = (element->type & ~ST_TYPEMASK) | ST_CLOCK;
element->textColor = (COLORREF)0xffffffff;
element->hfn = 0;
}
}
- else if (!mir_tstrcmp(buf, L"source")) {
+ else if (!mir_wstrcmp(buf, L"source")) {
f >> buf;
if (((element->type & ST_TYPEMASK) == ST_MYBITMAP) || ((element->type & ST_TYPEMASK) == ST_CLOCK))
element->myBmp = new MyBitmap(buf);
}
- else if (!mir_tstrcmp(buf, L"mono")) {
+ else if (!mir_wstrcmp(buf, L"mono")) {
element->type |= ST_MONO;
}
- else if (!mir_tstrcmp(buf, L"layer")) {
+ else if (!mir_wstrcmp(buf, L"layer")) {
element->type |= ST_BLEND;
}
- else if (!mir_tstrcmp(buf, L"proportional")) {
+ else if (!mir_wstrcmp(buf, L"proportional")) {
f >> element->proportional;
}
- else if (!mir_tstrcmp(buf, L"x")) {
+ else if (!mir_wstrcmp(buf, L"x")) {
f.getline(buf, 1024);
element->fx.set(buf);
element->type &= ~ST_BADPOS;
}
- else if (!mir_tstrcmp(buf, L"y")) {
+ else if (!mir_wstrcmp(buf, L"y")) {
f.getline(buf, 1024);
element->fy.set(buf);
element->type &= ~ST_BADPOS;
}
- else if (!mir_tstrcmp(buf, L"w")) {
+ else if (!mir_wstrcmp(buf, L"w")) {
f.getline(buf, 1024);
element->fw.set(buf);
}
- else if (!mir_tstrcmp(buf, L"h")) {
+ else if (!mir_wstrcmp(buf, L"h")) {
f.getline(buf, 1024);
element->fh.set(buf);
}
- else if (!mir_tstrcmp(buf, L"ifset")) {
+ else if (!mir_wstrcmp(buf, L"ifset")) {
int id;
f >> id; id--;
element->flag_mask |= 1 << id;
element->flags |= 1 << id;
}
- else if (!mir_tstrcmp(buf, L"ifnotset")) {
+ else if (!mir_wstrcmp(buf, L"ifnotset")) {
int id;
f >> id; id--;
element->flag_mask |= 1 << id;
element->flags &= ~(1 << id);
}
- else if (!mir_tstrcmp(buf, L"color")) {
+ else if (!mir_wstrcmp(buf, L"color")) {
if (((element->type & ST_TYPEMASK) != ST_TEXT) &&
((element->type & ST_TYPEMASK) != ST_TITLE) &&
((element->type & ST_TYPEMASK) != ST_CLOCK)) continue;
@@ -1006,7 +1006,7 @@ PopupSkin::SKINELEMENT *PopupSkin::loadObject(std::wistream &f) f >> r >> g >> b;
element->textColor = RGB(r, g, b);
}
- else if (!mir_tstrcmp(buf, L"clocksize")) {
+ else if (!mir_wstrcmp(buf, L"clocksize")) {
element->clockstart[0] = 0;
f >> element->clocksize[0];
for (int i = 1; i < CLOCK_ITEMS; i++) {
@@ -1014,7 +1014,7 @@ PopupSkin::SKINELEMENT *PopupSkin::loadObject(std::wistream &f) f >> element->clocksize[i];
}
}
- else if (!mir_tstrcmp(buf, L"end")) {
+ else if (!mir_wstrcmp(buf, L"end")) {
break;
}
}
@@ -1086,9 +1086,9 @@ bool Skins::load() SKINLIST *skin = new SKINLIST;
skin->next = m_skins;
m_skins = skin;
- m_skins->name = mir_tstrdup(L"* Popup Classic");
+ m_skins->name = mir_wstrdup(L"* Popup Classic");
m_skins->dir = new wchar_t[1024];
- mir_tstrcpy(m_skins->dir, L"res:classic.popupskin");
+ mir_wstrcpy(m_skins->dir, L"res:classic.popupskin");
m_skins->skin = 0;
wchar_t dir[1024] = { '\0' };
@@ -1098,7 +1098,7 @@ bool Skins::load() return false;
}
else {
- mir_tstrncpy(dir, VARST(L"%miranda_path%\\skins\\popup"), _countof(dir));
+ mir_wstrncpy(dir, VARST(L"%miranda_path%\\skins\\popup"), _countof(dir));
DWORD fa = GetFileAttributes(dir);
if ((fa == INVALID_FILE_ATTRIBUTES) || !(fa&FILE_ATTRIBUTE_DIRECTORY))
return false;
@@ -1111,13 +1111,13 @@ bool Skins::load() WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(L"*.*", &ffd);
while (hFind != INVALID_HANDLE_VALUE) {
- if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && mir_tstrcmp(L".", ffd.cFileName) && mir_tstrcmp(L"..", ffd.cFileName)) {
+ if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && mir_wstrcmp(L".", ffd.cFileName) && mir_wstrcmp(L"..", ffd.cFileName)) {
SetCurrentDirectory(ffd.cFileName);
skin = new SKINLIST;
skin->next = m_skins;
m_skins = skin;
- m_skins->name = mir_tstrdup(ffd.cFileName);
+ m_skins->name = mir_wstrdup(ffd.cFileName);
m_skins->dir = new wchar_t[1024];
GetCurrentDirectory(1024, m_skins->dir);
m_skins->skin = 0;
@@ -1139,9 +1139,9 @@ const PopupSkin *Skins::getSkin(LPCTSTR name) {
SKINLIST *any = 0;
for (SKINLIST *p = m_skins; p; p = p->next) {
- if (!mir_tstrcmp(p->name, L"* Popup Classic") || !any)
+ if (!mir_wstrcmp(p->name, L"* Popup Classic") || !any)
any = p;
- if (!mir_tstrcmpi(p->name, name)) {
+ if (!mir_wstrcmpi(p->name, name)) {
any = p;
break;
}
@@ -1166,7 +1166,7 @@ const PopupSkin *Skins::getSkin(LPCTSTR name) void Skins::loadActiveSkin()
{
for (SKINLIST *p = m_skins; p; p = p->next)
- if (!mir_tstrcmpi(p->name, PopupOptions.SkinPack)) {
+ if (!mir_wstrcmpi(p->name, PopupOptions.SkinPack)) {
if (p->skin)
break;
@@ -1179,7 +1179,7 @@ void Skins::loadActiveSkin() void Skins::freeAllButActive()
{
for (SKINLIST *p = m_skins; p; p = p->next)
- if (mir_tstrcmpi(p->name, PopupOptions.SkinPack)) {
+ if (mir_wstrcmpi(p->name, PopupOptions.SkinPack)) {
delete p->skin;
p->skin = NULL;
}
diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index 44c62b11c6..9bc378596b 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -71,7 +71,7 @@ static INT_PTR CheckDb(WPARAM, LPARAM) STARTUPINFO si = { 0 };
si.cb = sizeof(si);
GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
- mir_sntprintf(cmdLine, L"\"%s\" /restart:%d /svc:dbchecker", mirandaPath, GetCurrentProcessId());
+ mir_snwprintf(cmdLine, L"\"%s\" /restart:%d /svc:dbchecker", mirandaPath, GetCurrentProcessId());
CallService("CloseAction", 0, 0);
CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
}
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index a50b89881c..855c5df62d 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -249,7 +249,7 @@ wchar_t *GetListName(c_struct *cs) {
if (opts.group_append && cs->szgroup[0] != '\0')
{
- mir_sntprintf(tmp_list_name, L"%s (%s)", cs->szname, cs->szgroup);
+ mir_snwprintf(tmp_list_name, L"%s (%s)", cs->szname, cs->szgroup);
return tmp_list_name;
}
else
@@ -267,7 +267,7 @@ int lstreq(wchar_t *a, wchar_t *b, size_t len = -1) if (len > 0)
ret = wcsncmp(a, b, len);
else
- ret = mir_tstrcmp(a, b);
+ ret = mir_wstrcmp(a, b);
free(a);
free(b);
return ret;
@@ -403,7 +403,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) if (db_get_ts(hMeta == NULL ? hContact : hMeta, "CList", "Group", &dbv) == 0)
{
if (dbv.ptszVal != NULL)
- mir_tstrncpy(contact->szgroup, dbv.ptszVal, _countof(contact->szgroup));
+ mir_wstrncpy(contact->szgroup, dbv.ptszVal, _countof(contact->szgroup));
db_free(&dbv);
}
@@ -411,11 +411,11 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) // Make contact name
wchar_t *tmp = (wchar_t *) pcli->pfnGetContactDisplayName(hContact, 0);
- mir_tstrncpy(contact->szname, tmp, _countof(contact->szname));
+ mir_wstrncpy(contact->szname, tmp, _countof(contact->szname));
PROTOACCOUNT *acc = Proto_GetAccount(pszProto);
if (acc != NULL)
- mir_tstrncpy(contact->proto, acc->tszAccountName, _countof(contact->proto));
+ mir_wstrncpy(contact->proto, acc->tszAccountName, _countof(contact->proto));
contact->hcontact = hContact;
contacts.insert(contact);
@@ -483,7 +483,7 @@ int CheckText(HWND hdlg, wchar_t *sztext, BOOL only_enable = FALSE) if(sztext == NULL || sztext[0] == '\0')
return 0;
- size_t len = mir_tstrlen(sztext);
+ size_t len = mir_wstrlen(sztext);
if (only_enable)
{
@@ -533,7 +533,7 @@ MCONTACT GetSelectedContact(HWND hwndDlg) for(int loop = 0; loop < contacts.getCount(); loop++)
{
- if(!mir_tstrcmpi(cname, GetListName(contacts[loop])))
+ if(!mir_wstrcmpi(cname, GetListName(contacts[loop])))
return contacts[loop]->hcontact;
}
@@ -570,7 +570,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) GetWindowText(hdlg, sztext, _countof(sztext));
- BOOL at_end = (mir_tstrlen(sztext) == (int)end);
+ BOOL at_end = (mir_wstrlen(sztext) == (int)end);
if (ret != -1)
{
@@ -716,7 +716,7 @@ static void FillButton(HWND hwndDlg, int dlgItem, wchar_t *name, wchar_t *key, H if (key == NULL)
full = TranslateTS(name);
else
- mir_sntprintf(tmp, L"%s (%s)", TranslateTS(name), key);
+ mir_snwprintf(tmp, L"%s (%s)", TranslateTS(name), key);
SendDlgItemMessage(hwndDlg, dlgItem, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, dlgItem, BUTTONADDTOOLTIP, (LPARAM)full, BATF_TCHAR);
@@ -732,7 +732,7 @@ static void FillCheckbox(HWND hwndDlg, int dlgItem, wchar_t *name, wchar_t *key) if (key == NULL)
full = TranslateTS(name);
else
- mir_sntprintf(tmp, L"%s (%s)", TranslateTS(name), key);
+ mir_snwprintf(tmp, L"%s (%s)", TranslateTS(name), key);
SetDlgItemText(hwndDlg, dlgItem, full);
}
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index 82aa13cd5a..b5f1943aed 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -356,8 +356,8 @@ wchar_t* getMenuEntry(int buttonnum, int entrynum, BYTE mode) } if (!db_get_ts(NULL, PLGNAME, szMEntry, &dbv)) { - if (mir_tstrlen(dbv.ptszVal)) - buffer = mir_tstrdup(dbv.ptszVal); + if (mir_wstrlen(dbv.ptszVal)) + buffer = mir_wstrdup(dbv.ptszVal); db_free(&dbv); } @@ -453,7 +453,7 @@ wchar_t* ParseString(MCONTACT hContact, wchar_t* ptszQValIn, wchar_t* ptszText, break; case 'P': ptszName = mir_a2u(GetContactProto(hContact)); - NameLenght = (int)mir_tstrlen(ptszName); + NameLenght = (int)mir_wstrlen(ptszName); p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t)); if (!p) { mir_free(ptszName); @@ -478,7 +478,7 @@ wchar_t* ParseString(MCONTACT hContact, wchar_t* ptszQValIn, wchar_t* ptszText, case 'n': ptszName = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0); - NameLenght = (int)mir_tstrlen(ptszName); + NameLenght = (int)mir_wstrlen(ptszName); p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t)); if (!p) break; @@ -501,7 +501,7 @@ wchar_t* ParseString(MCONTACT hContact, wchar_t* ptszQValIn, wchar_t* ptszText, ptszName = Contact_GetInfo(CNF_FIRSTNAME, hContact); if (ptszName == NULL) break; - NameLenght = (int)mir_tstrlen(ptszName); + NameLenght = (int)mir_wstrlen(ptszName); p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t)); if (!p) { mir_free(ptszName); @@ -528,7 +528,7 @@ wchar_t* ParseString(MCONTACT hContact, wchar_t* ptszQValIn, wchar_t* ptszText, if (ptszName == NULL) break; - NameLenght = (int)mir_tstrlen(ptszName); + NameLenght = (int)mir_wstrlen(ptszName); p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t)); if (!p) { mir_free(ptszName); diff --git a/plugins/QuickMessages/src/main.cpp b/plugins/QuickMessages/src/main.cpp index 6dc22694c7..267dd279b0 100644 --- a/plugins/QuickMessages/src/main.cpp +++ b/plugins/QuickMessages/src/main.cpp @@ -94,8 +94,8 @@ static int InputMenuPopup(WPARAM, LPARAM lParam) hData = GetClipboardData(CF_UNICODETEXT);
chBuffer = (wchar_t*)GlobalLock(hData);
- textLength = (int)mir_tstrlen(chBuffer);
- pszCBText = mir_tstrdup(chBuffer);
+ textLength = (int)mir_wstrlen(chBuffer);
+ pszCBText = mir_wstrdup(chBuffer);
GlobalUnlock(hData);
CloseClipboard();
}
@@ -110,7 +110,7 @@ static int InputMenuPopup(WPARAM, LPARAM lParam) SendMessage(mwpd->hwnd, EM_GETSELTEXT, 0, (LPARAM)pszText);
}
if (qd->ptszValue) {
- ptszQValue = ParseString(mwpd->hContact, qd->ptszValue, pszText ? pszText : L"", pszCBText ? pszCBText : L"", (int)mir_tstrlen(qd->ptszValue), textlenght, pszCBText ? (int)mir_tstrlen(pszCBText) : 0);
+ ptszQValue = ParseString(mwpd->hContact, qd->ptszValue, pszText ? pszText : L"", pszCBText ? pszCBText : L"", (int)mir_wstrlen(qd->ptszValue), textlenght, pszCBText ? (int)mir_wstrlen(pszCBText) : 0);
if ((bIsService = qd->bIsService) && ptszQValue)
CallService(mir_u2a(ptszQValue), (WPARAM)mwpd->hContact, 0);
@@ -163,8 +163,8 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam) hData = GetClipboardData(CF_UNICODETEXT);
chBuffer = (wchar_t*)GlobalLock(hData);
- textLength = (int)mir_tstrlen(chBuffer);
- pszCBText = mir_tstrdup(chBuffer);
+ textLength = (int)mir_wstrlen(chBuffer);
+ pszCBText = mir_wstrdup(chBuffer);
GlobalUnlock(hData);
CloseClipboard();
}
@@ -195,7 +195,7 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam) switch (state) {
case 1:
if (ButtonsList[cbcd->dwButtonId]->ptszQValue)
- ptszQValue = ParseString(cbcd->hContact, ButtonsList[cbcd->dwButtonId]->ptszQValue, pszText ? pszText : L"", pszCBText ? pszCBText : L"", (int)mir_tstrlen(ButtonsList[cbcd->dwButtonId]->ptszQValue), textlenght, pszCBText ? (int)mir_tstrlen(pszCBText) : 0);
+ ptszQValue = ParseString(cbcd->hContact, ButtonsList[cbcd->dwButtonId]->ptszQValue, pszText ? pszText : L"", pszCBText ? pszCBText : L"", (int)mir_wstrlen(ButtonsList[cbcd->dwButtonId]->ptszQValue), textlenght, pszCBText ? (int)mir_wstrlen(pszCBText) : 0);
if ((bIsService = ButtonsList[cbcd->dwButtonId]->bIsServName) && ptszQValue)
CallService(mir_u2a(ptszQValue), (WPARAM)cbcd->hContact, 0);
break;
@@ -204,7 +204,7 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam) {
ButtonData *bd = (ButtonData *)sl->items[0];
if (bd && bd->pszValue) {
- ptszQValue = ParseString(cbcd->hContact, bd->pszValue, pszText ? pszText : L"", pszCBText ? pszCBText : L"", (int)mir_tstrlen(bd->pszValue), textlenght, pszCBText ? (int)mir_tstrlen(pszCBText) : 0);
+ ptszQValue = ParseString(cbcd->hContact, bd->pszValue, pszText ? pszText : L"", pszCBText ? pszCBText : L"", (int)mir_wstrlen(bd->pszValue), textlenght, pszCBText ? (int)mir_wstrlen(pszCBText) : 0);
if ((bIsService = bd->bIsServName) && ptszQValue)
CallService(mir_u2a(ptszQValue), (WPARAM)cbcd->hContact, 0);
}
@@ -246,7 +246,7 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam) ButtonData *bd = (ButtonData *)sl->items[res - 1];
bCTRL = (GetKeyState(VK_CONTROL) & 0x8000) ? 1 : 0;
if (bd->pszValue) {
- ptszQValue = ParseString(cbcd->hContact, bd->pszValue, pszText ? pszText : L"", pszCBText ? pszCBText : L"", (int)mir_tstrlen(bd->pszValue), textlenght, pszCBText ? (int)mir_tstrlen(pszCBText) : 0);
+ ptszQValue = ParseString(cbcd->hContact, bd->pszValue, pszText ? pszText : L"", pszCBText ? pszCBText : L"", (int)mir_wstrlen(bd->pszValue), textlenght, pszCBText ? (int)mir_wstrlen(pszCBText) : 0);
if ((bIsService = bd->bIsServName) && ptszQValue)
CallService(mir_u2a(ptszQValue), (WPARAM)cbcd->hContact, 0);
}
diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index 65d55d874a..297a6b0f9f 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -121,10 +121,10 @@ void SetMenuEntryProperties(HWND hdlg) ListData* ld = (ListData*)tvi.lParam;
wchar_t szValue[256];
GetDlgItemText(hdlg, IDC_RCLICKVALUE, szValue, _countof(szValue));
- if (mir_tstrlen(szValue)) {
+ if (mir_wstrlen(szValue)) {
if (ld->ptszOPQValue && (ld->ptszOPQValue != ld->ptszQValue))
mir_free(ld->ptszOPQValue);
- ld->ptszOPQValue = mir_tstrdup(szValue);
+ ld->ptszOPQValue = mir_wstrdup(szValue);
}
ld->bIsOpServName = IsDlgButtonChecked(hdlg, IDC_ISSERVNAME2);
}
@@ -139,10 +139,10 @@ void SetMenuEntryProperties(HWND hdlg) ButtonData *bd = (ButtonData*)tvi.lParam;
wchar_t szValue[256];
GetDlgItemText(hdlg, IDC_MENUVALUE, szValue, _countof(szValue));
- if (mir_tstrlen(szValue)) {
- if (mir_tstrlen(bd->pszOpValue) && (bd->pszOpValue != bd->pszValue))
+ if (mir_wstrlen(szValue)) {
+ if (mir_wstrlen(bd->pszOpValue) && (bd->pszOpValue != bd->pszValue))
mir_free(bd->pszOpValue);
- bd->pszOpValue = mir_tstrdup(szValue);
+ bd->pszOpValue = mir_wstrdup(szValue);
}
bd->bOpInQMenu = IsDlgButtonChecked(hdlg, IDC_INQMENU);
bd->bIsOpServName = IsDlgButtonChecked(hdlg, IDC_ISSERVNAME);
@@ -177,7 +177,7 @@ void SetMenuEntryProperties(HWND hdlg) }
else {
if (!bd->pszOpValue)
- bd->pszOpValue = mir_tstrdup(LPGENW("Enter Value"));
+ bd->pszOpValue = mir_wstrdup(LPGENW("Enter Value"));
}
if (TreeView_GetParent(hMenuTree, tvi.hItem))
bd->fEntryOpType |= QMF_EX_CHILD;
@@ -244,7 +244,7 @@ void SaveMenuTree() TreeView_GetItem(hButtonsList, &tvi);
}
- ld->ptszButtonName = mir_tstrdup(tvi.pszText);
+ ld->ptszButtonName = mir_wstrdup(tvi.pszText);
if (ld->ptszQValue) {
mir_snprintf(szMEntry, "ButtonValue_%u", iBl);
@@ -748,9 +748,9 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) GetWindowText(hwndEdit, szLabel, _countof(szLabel));
hwndEdit = NULL;
- if (!mir_tstrlen(szLabel)) break;
+ if (!mir_wstrlen(szLabel)) break;
if (bd = (ButtonData*)tvi.lParam) {
- if (!mir_tstrcmp(szLabel, L"---")) {
+ if (!mir_wstrcmp(szLabel, L"---")) {
if (TreeView_GetChild(hMenuTree, tvi.hItem))
break;
else {
@@ -767,7 +767,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) SetDlgItemText(hdlg, IDC_MENUVALUE, bd->pszOpValue/*?bd->pszOpValue:bd->pszValue*/);
}
- bd->pszOpName = mir_tstrdup(szLabel);
+ bd->pszOpName = mir_wstrdup(szLabel);
tvi.pszText = szLabel;
TreeView_SetItem(hMenuTree, &tvi);
@@ -804,10 +804,10 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) if (bd) {
wchar_t szValue[256];
GetDlgItemText(hdlg, IDC_MENUVALUE, szValue, _countof(szValue));
- if (mir_tstrlen(szValue)) {
+ if (mir_wstrlen(szValue)) {
if (bd->pszOpValue && (bd->pszOpValue != bd->pszValue))
mir_free(bd->pszOpValue);
- bd->pszOpValue = mir_tstrdup(szValue);
+ bd->pszOpValue = mir_wstrdup(szValue);
}
bd->bOpInQMenu = IsDlgButtonChecked(hdlg, IDC_INQMENU);
bd->bIsOpServName = IsDlgButtonChecked(hdlg, IDC_ISSERVNAME);
@@ -877,7 +877,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) GetWindowText(hwndEdit, szLabel, _countof(szLabel));
hwndEdit = NULL;
- if (!mir_tstrlen(szLabel)) break;
+ if (!mir_wstrlen(szLabel)) break;
tvi.pszText = szLabel;
((ListData*)tvi.lParam)->dwOPFlags |= QMF_RENAMED;
@@ -964,7 +964,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) GetDlgItemText(hdlg, IDC_BUTTONNAME, namebuff, _countof(namebuff));
tvis.item.mask = TVIF_PARAM | TVIF_TEXT;
- tvis.item.pszText = (mir_tstrlen(namebuff)) ? namebuff : TranslateT("New Button");
+ tvis.item.pszText = (mir_wstrlen(namebuff)) ? namebuff : TranslateT("New Button");
tvis.item.lParam = (LPARAM)ld;
TreeView_SelectItem(hButtonsList, TreeView_InsertItem(hButtonsList, &tvis));
}break;
@@ -1014,9 +1014,9 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) GetDlgItemText(hdlg, IDC_MENUNAME, namebuff, _countof(namebuff));
bd->dwOPPos = TreeView_GetCount(hMenuTree) - 1;
- bd->pszOpName = mir_tstrlen(namebuff) ? mir_tstrdup(namebuff) : mir_tstrdup(TranslateT("New Menu Entry"));
- bd->pszOpValue = mir_tstrdup(bd->pszOpName);
- bd->fEntryOpType = !mir_tstrcmp(namebuff, L"---") ? QMF_EX_SEPARATOR : 0;
+ bd->pszOpName = mir_wstrlen(namebuff) ? mir_wstrdup(namebuff) : mir_wstrdup(TranslateT("New Menu Entry"));
+ bd->pszOpValue = mir_wstrdup(bd->pszOpName);
+ bd->fEntryOpType = !mir_wstrcmp(namebuff, L"---") ? QMF_EX_SEPARATOR : 0;
bd->dwOPFlags = QMF_NEW;
bd->pszName = NULL;
bd->pszValue = NULL;
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index 4a3b57da5c..0c575930dd 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -116,7 +116,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) else
replyList.insert(variables_parsedup(value, 0, wParam));
- if (!mir_tstrcmp(value, L"---"))
+ if (!mir_wstrcmp(value, L"---"))
AppendMenu((HMENU)hMenu, MF_SEPARATOR, i + 1, NULL);
else
AppendMenu((HMENU)hMenu, MF_STRING, i + 1, replyList[i]);
@@ -129,7 +129,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) int index = TrackPopupMenu(hMenu, TPM_RETURNCMD, cbcd->pt.x, cbcd->pt.y, 0, cbcd->hwndFrom, NULL);
if (index > 0)
{
- if (mir_tstrcmp(replyList[index - 1], L""))
+ if (mir_wstrcmp(replyList[index - 1], L""))
{
HWND hEdit = GetDlgItem(cbcd->hwndFrom, IDC_MESSAGE);
if (!hEdit) hEdit = GetDlgItem(cbcd->hwndFrom, IDC_CHATMESSAGE);
diff --git a/plugins/Quotes/src/CurrencyConverter.cpp b/plugins/Quotes/src/CurrencyConverter.cpp index 45f5628890..c86356aa27 100644 --- a/plugins/Quotes/src/CurrencyConverter.cpp +++ b/plugins/Quotes/src/CurrencyConverter.cpp @@ -107,11 +107,11 @@ INT_PTR CALLBACK CurrencyConverterDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM LRESULT nFrom = ::SendMessage(hcbxFrom, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(pszName));
LRESULT nTo = ::SendMessage(hcbxTo, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(pszName));
- if (0 == mir_tstrcmpi(rQuote.GetID().c_str(), sFromQuoteID.c_str())) {
+ if (0 == mir_wstrcmpi(rQuote.GetID().c_str(), sFromQuoteID.c_str())) {
::SendMessage(hcbxFrom, CB_SETCURSEL, nFrom, 0);
}
- if (0 == mir_tstrcmpi(rQuote.GetID().c_str(), sToQuoteID.c_str())) {
+ if (0 == mir_wstrcmpi(rQuote.GetID().c_str(), sToQuoteID.c_str())) {
::SendMessage(hcbxTo, CB_SETCURSEL, nTo, 0);
}
}
diff --git a/plugins/Quotes/src/HTTPSession.cpp b/plugins/Quotes/src/HTTPSession.cpp index 16583b071a..fb2ab0d62c 100644 --- a/plugins/Quotes/src/HTTPSession.cpp +++ b/plugins/Quotes/src/HTTPSession.cpp @@ -97,7 +97,7 @@ public: char* pResult = &*(apBuffer.begin());
int nIndex = find_header(pReply, "Content-Type");
if ((-1 != nIndex) && (NULL != strstr(_strlwr(pReply->headers[nIndex].szValue), "utf-8"))) {
- wchar_t* p = mir_utf8decodeT(pResult);
+ wchar_t* p = mir_utf8decodeW(pResult);
rsResponce = p;
mir_free(p);
}
diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp index ca9e9440fa..6818c5c879 100644 --- a/plugins/Quotes/src/ImportExport.cpp +++ b/plugins/Quotes/src/ImportExport.cpp @@ -140,25 +140,25 @@ LPCTSTR prepare_filter(LPTSTR pszBuffer, size_t cBuffer) {
LPTSTR p = pszBuffer;
LPCTSTR pszXml = TranslateT("XML File (*.xml)");
- mir_tstrncpy(p, pszXml, (int)cBuffer);
- size_t nLen = mir_tstrlen(pszXml) + 1;
+ mir_wstrncpy(p, pszXml, (int)cBuffer);
+ size_t nLen = mir_wstrlen(pszXml) + 1;
p += nLen;
if (nLen < cBuffer) {
- mir_tstrncpy(p, L"*.xml", (int)(cBuffer - nLen));
+ mir_wstrncpy(p, L"*.xml", (int)(cBuffer - nLen));
p += 6;
nLen += 6;
}
if (nLen < cBuffer) {
LPCTSTR pszAll = TranslateT("All files (*.*)");
- mir_tstrncpy(p, pszAll, (int)(cBuffer - nLen));
- size_t n = mir_tstrlen(pszAll) + 1;
+ mir_wstrncpy(p, pszAll, (int)(cBuffer - nLen));
+ size_t n = mir_wstrlen(pszAll) + 1;
nLen += n;
p += n;
}
if (nLen < cBuffer) {
- mir_tstrncpy(p, L"*.*", (int)(cBuffer - nLen));
+ mir_wstrncpy(p, L"*.*", (int)(cBuffer - nLen));
p += 4;
nLen += 4;
}
@@ -255,13 +255,13 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) std::string s = quotes_t2a(sModuleName.c_str());
dbs.szModule = s.c_str();//T2CA(sModuleName.c_str());
- bool bCListModule = 0 == mir_tstrcmpi(sModuleName.c_str(), L"CList");
+ bool bCListModule = 0 == mir_wstrcmpi(sModuleName.c_str(), L"CList");
size_t cChild = pXmlModule->GetChildCount();
for (size_t i = 0; i < cChild; ++i) {
IXMLNode::TXMLNodePtr pSetting = pXmlModule->GetChildNode(i);
tstring sSetting = pSetting->GetName();
- if (0 == mir_tstrcmpi(g_pszXmlSetting, sSetting.c_str())) {
+ if (0 == mir_wstrcmpi(g_pszXmlSetting, sSetting.c_str())) {
size_t cSetChild = pSetting->GetChildCount();
if (cSetChild >= 2) {
tstring sName;
@@ -270,10 +270,10 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) for (size_t j = 0; j < cSetChild; ++j) {
IXMLNode::TXMLNodePtr pNode = pSetting->GetChildNode(j);
tstring sNode = pNode->GetName();
- if (0 == mir_tstrcmpi(g_pszXmlName, sNode.c_str())) {
+ if (0 == mir_wstrcmpi(g_pszXmlName, sNode.c_str())) {
sName = pNode->GetText();
}
- else if (0 == mir_tstrcmpi(g_pszXmlValue, sNode.c_str())) {
+ else if (0 == mir_wstrcmpi(g_pszXmlValue, sNode.c_str())) {
sValue = pNode->GetText();
sType = pNode->GetAttributeValue(g_pszXmlType);
}
@@ -282,7 +282,7 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) if ((false == sName.empty()) && (false == sType.empty())) {
std::string s1 = quotes_t2a(sName.c_str());
dbs.szSetting = s1.c_str();
- if (0 == mir_tstrcmpi(g_pszXmlTypeByte, sType.c_str())) {
+ if (0 == mir_wstrcmpi(g_pszXmlTypeByte, sType.c_str())) {
tistringstream in(sValue.c_str());
in.imbue(GetSystemLocale());
dbs.value.cVal = in.get();
@@ -292,7 +292,7 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) ++cCreatedRecords;
}
}
- else if (0 == mir_tstrcmpi(g_pszXmlTypeWord, sType.c_str())) {
+ else if (0 == mir_wstrcmpi(g_pszXmlTypeWord, sType.c_str())) {
tistringstream in(sValue.c_str());
in.imbue(GetSystemLocale());
in >> dbs.value.wVal;
@@ -302,7 +302,7 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) ++cCreatedRecords;
}
}
- else if (0 == mir_tstrcmpi(g_pszXmlTypeDword, sType.c_str())) {
+ else if (0 == mir_wstrcmpi(g_pszXmlTypeDword, sType.c_str())) {
tistringstream in(sValue.c_str());
in.imbue(GetSystemLocale());
in >> dbs.value.dVal;
@@ -312,22 +312,22 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) ++cCreatedRecords;
}
}
- else if (0 == mir_tstrcmpi(g_pszXmlTypeAsciiz, sType.c_str())) {
- ptrA v(mir_t2a(sValue.c_str()));
+ else if (0 == mir_wstrcmpi(g_pszXmlTypeAsciiz, sType.c_str())) {
+ ptrA v(mir_u2a(sValue.c_str()));
dbs.value.pszVal = v;
dbs.value.type = DBVT_ASCIIZ;
if (set_contact_settings(hContact, dbs))
++cCreatedRecords;
}
- else if (0 == mir_tstrcmpi(g_pszXmlTypeUtf8, sType.c_str())) {
+ else if (0 == mir_wstrcmpi(g_pszXmlTypeUtf8, sType.c_str())) {
T2Utf szValue(sValue.c_str());
dbs.value.pszVal = szValue;
dbs.value.type = DBVT_UTF8;
if (set_contact_settings(hContact, dbs))
++cCreatedRecords;
}
- else if (0 == mir_tstrcmpi(g_pszXmlTypeWchar, sType.c_str())) {
- ptrW val(mir_t2u(sValue.c_str()));
+ else if (0 == mir_wstrcmpi(g_pszXmlTypeWchar, sType.c_str())) {
+ ptrW val(mir_wstrdup(sValue.c_str()));
dbs.value.pwszVal = val;
dbs.value.type = DBVT_WCHAR;
if (set_contact_settings(hContact, dbs))
@@ -335,7 +335,7 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) mir_free(dbs.value.pwszVal);
}
- else if (0 == mir_tstrcmpi(g_pszXmlTypeBlob, sType.c_str())) {
+ else if (0 == mir_wstrcmpi(g_pszXmlTypeBlob, sType.c_str())) {
unsigned bufLen;
mir_ptr<BYTE> buf((PBYTE)mir_base64_decode(_T2A(sValue.c_str()), &bufLen));
if (buf) {
@@ -348,7 +348,7 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) }
}
- if ((true == bCListModule) && (0 == mir_tstrcmpi(sName.c_str(), L"Group")))
+ if ((true == bCListModule) && (0 == mir_wstrcmpi(sName.c_str(), L"Group")))
Clist_GroupCreate(NULL, sValue.c_str());
}
}
@@ -367,13 +367,13 @@ size_t count_contacts(const IXMLNode::TXMLNodePtr& pXmlRoot, bool bInContactsGro IXMLNode::TXMLNodePtr pNode = pXmlRoot->GetChildNode(i);
tstring sName = pNode->GetName();
if (false == bInContactsGroup) {
- if (0 == mir_tstrcmpi(g_pszXmlContacts, sName.c_str()))
+ if (0 == mir_wstrcmpi(g_pszXmlContacts, sName.c_str()))
cContacts += count_contacts(pNode, true);
else
cContacts += count_contacts(pNode, false);
}
else {
- if (0 == mir_tstrcmpi(g_pszXmlContact, sName.c_str()))
+ if (0 == mir_wstrcmpi(g_pszXmlContact, sName.c_str()))
++cContacts;
}
}
@@ -405,8 +405,8 @@ IXMLNode::TXMLNodePtr find_quotes_module(const IXMLNode::TXMLNodePtr& pXmlContac for (size_t i = 0; i < cChild; ++i) {
IXMLNode::TXMLNodePtr pNode = pXmlContact->GetChildNode(i);
tstring sName = pNode->GetName();
- if ((0 == mir_tstrcmpi(g_pszXmlModule, sName.c_str()))
- && (0 == mir_tstrcmpi(g_sQuotes.c_str(), pNode->GetText().c_str()))) {
+ if ((0 == mir_wstrcmpi(g_pszXmlModule, sName.c_str()))
+ && (0 == mir_wstrcmpi(g_sQuotes.c_str(), pNode->GetText().c_str()))) {
return pNode;
}
}
@@ -424,10 +424,10 @@ TNameValue parse_setting_node(const IXMLNode::TXMLNodePtr& pXmlSetting) for (size_t j = 0; j < cSettingChildItems; ++j) {
IXMLNode::TXMLNodePtr pXMLSetChild = pXmlSetting->GetChildNode(j);
if (pXMLSetChild) {
- if (0 == mir_tstrcmpi(g_pszXmlName, pXMLSetChild->GetName().c_str())) {
+ if (0 == mir_wstrcmpi(g_pszXmlName, pXMLSetChild->GetName().c_str())) {
sName = pXMLSetChild->GetText();
}
- else if (0 == mir_tstrcmpi(g_pszXmlValue, pXMLSetChild->GetName().c_str())) {
+ else if (0 == mir_wstrcmpi(g_pszXmlValue, pXMLSetChild->GetName().c_str())) {
sValue = pXMLSetChild->GetText();
}
}
@@ -443,9 +443,9 @@ CQuotesProviders::TQuotesProviderPtr find_provider(const IXMLNode::TXMLNodePtr& size_t cChild = pXmlQuotesModule->GetChildCount();
for (size_t i = 0; i < cChild; ++i) {
IXMLNode::TXMLNodePtr pXMLSetting = pXmlQuotesModule->GetChildNode(i);
- if (pXMLSetting && (0 == mir_tstrcmpi(g_pszXmlSetting, pXMLSetting->GetName().c_str()))) {
+ if (pXMLSetting && (0 == mir_wstrcmpi(g_pszXmlSetting, pXMLSetting->GetName().c_str()))) {
TNameValue Item = parse_setting_node(pXMLSetting);
- if ((0 == mir_tstrcmpi(g_sQuotesProvider.c_str(), Item.first.c_str())) && (false == Item.second.empty())) {
+ if ((0 == mir_wstrcmpi(g_sQuotesProvider.c_str(), Item.first.c_str())) && (false == Item.second.empty())) {
return CModuleInfo::GetInstance().GetQuoteProvidersPtr()->FindProvider(Item.second);
}
}
@@ -486,12 +486,12 @@ bool get_contact_state(const IXMLNode::TXMLNodePtr& pXmlContact, CContactState& size_t cChild = m_pXmlQuotes->GetChildCount();
for (size_t i = 0; i < cChild; ++i) {
IXMLNode::TXMLNodePtr pNode = m_pXmlQuotes->GetChildNode(i);
- if (pNode && (0 == mir_tstrcmpi(g_pszXmlSetting, pNode->GetName().c_str()))) {
+ if (pNode && (0 == mir_wstrcmpi(g_pszXmlSetting, pNode->GetName().c_str()))) {
TNameValue Item = parse_setting_node(pNode);
- if (0 == mir_tstrcmpi(g_sFromID.c_str(), Item.first.c_str())) {
+ if (0 == mir_wstrcmpi(g_sFromID.c_str(), Item.first.c_str())) {
sFromID = Item.second;
}
- else if (0 == mir_tstrcmpi(g_sToID.c_str(), Item.first.c_str())) {
+ else if (0 == mir_wstrcmpi(g_sToID.c_str(), Item.first.c_str())) {
sToID = Item.second;
}
}
@@ -518,9 +518,9 @@ bool get_contact_state(const IXMLNode::TXMLNodePtr& pXmlContact, CContactState& size_t cChild = m_pXmlQuotes->GetChildCount();
for (size_t i = 0; i < cChild; ++i) {
IXMLNode::TXMLNodePtr pNode = m_pXmlQuotes->GetChildNode(i);
- if (pNode && (0 == mir_tstrcmpi(g_pszXmlSetting, pNode->GetName().c_str()))) {
+ if (pNode && (0 == mir_wstrcmpi(g_pszXmlSetting, pNode->GetName().c_str()))) {
TNameValue Item = parse_setting_node(pNode);
- if (0 == mir_tstrcmpi(Item.first.c_str(), sXMLNodeName.c_str())) {
+ if (0 == mir_wstrcmpi(Item.first.c_str(), sXMLNodeName.c_str())) {
sValue = Item.second;
break;
}
@@ -568,7 +568,7 @@ bool import_contact(const IXMLNode::TXMLNodePtr& pXmlContact, CImportContext& im for (size_t i = 0; i < cChild && bResult; ++i) {
IXMLNode::TXMLNodePtr pNode = pXmlContact->GetChildNode(i);
tstring sName = pNode->GetName();
- if (0 == mir_tstrcmpi(g_pszXmlModule, sName.c_str()))
+ if (0 == mir_wstrcmpi(g_pszXmlModule, sName.c_str()))
bResult &= handle_module(cst.m_hContact, pNode);
}
@@ -590,7 +590,7 @@ size_t import_contacts(const IXMLNode::TXMLNodePtr& pXmlContacts, CImportContext for (size_t i = 0; i < cChild; ++i) {
IXMLNode::TXMLNodePtr pNode = pXmlContacts->GetChildNode(i);
tstring sName = pNode->GetName();
- if (0 == mir_tstrcmpi(g_pszXmlContact, sName.c_str()))
+ if (0 == mir_wstrcmpi(g_pszXmlContact, sName.c_str()))
if (true == import_contact(pNode, impctx))
++cContacts;
}
@@ -606,7 +606,7 @@ size_t handle_contacts_node(const IXMLNode::TXMLNodePtr& pXmlRoot, CImportContex for (size_t i = 0; i < cChild; ++i) {
IXMLNode::TXMLNodePtr pNode = pXmlRoot->GetChildNode(i);
tstring sName = pNode->GetName();
- if (0 == mir_tstrcmpi(g_pszXmlContacts, sName.c_str()))
+ if (0 == mir_wstrcmpi(g_pszXmlContacts, sName.c_str()))
cContacts += import_contacts(pNode, impctx);
else
cContacts += handle_contacts_node(pNode, impctx);
diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp index 263df84fac..7c058e6830 100644 --- a/plugins/Quotes/src/QuotesProviderBase.cpp +++ b/plugins/Quotes/src/QuotesProviderBase.cpp @@ -26,15 +26,15 @@ bool parse_quote(const IXMLNode::TXMLNodePtr& pTop, CQuotesProviderBase::CQuote& for (size_t i = 0; i < cChild; ++i) {
IXMLNode::TXMLNodePtr pNode = pTop->GetChildNode(i);
tstring sName = pNode->GetName();
- if (0 == mir_tstrcmpi(L"symbol", sName.c_str())) {
+ if (0 == mir_wstrcmpi(L"symbol", sName.c_str())) {
sSymbol = pNode->GetText();
if (true == sSymbol.empty())
return false;
}
- else if (0 == mir_tstrcmpi(L"description", sName.c_str())) {
+ else if (0 == mir_wstrcmpi(L"description", sName.c_str())) {
sDescription = pNode->GetText();
}
- else if (0 == mir_tstrcmpi(L"id", sName.c_str())) {
+ else if (0 == mir_wstrcmpi(L"id", sName.c_str())) {
sID = pNode->GetText();
if (true == sID.empty())
return false;
@@ -55,17 +55,17 @@ bool parse_section(const IXMLNode::TXMLNodePtr& pTop, CQuotesProviderBase::CQuot for (size_t i = 0; i < cChild; ++i) {
IXMLNode::TXMLNodePtr pNode = pTop->GetChildNode(i);
tstring sName = pNode->GetName();
- if (0 == mir_tstrcmpi(L"section", sName.c_str())) {
+ if (0 == mir_wstrcmpi(L"section", sName.c_str())) {
CQuotesProviderBase::CQuoteSection qs1;
if (true == parse_section(pNode, qs1))
aSections.push_back(qs1);
}
- else if (0 == mir_tstrcmpi(L"quote", sName.c_str())) {
+ else if (0 == mir_wstrcmpi(L"quote", sName.c_str())) {
CQuotesProviderBase::CQuote q;
if (true == parse_quote(pNode, q))
aQuotes.push_back(q);
}
- else if (0 == mir_tstrcmpi(L"name", sName.c_str())) {
+ else if (0 == mir_wstrcmpi(L"name", sName.c_str())) {
sSectionName = pNode->GetText();
if (true == sSectionName.empty())
return false;
@@ -83,7 +83,7 @@ IXMLNode::TXMLNodePtr find_provider(const IXMLNode::TXMLNodePtr& pRoot) for (size_t i = 0; i < cChild; ++i) {
IXMLNode::TXMLNodePtr pNode = pRoot->GetChildNode(i);
tstring sName = pNode->GetName();
- if (0 == mir_tstrcmpi(L"Provider", sName.c_str())) {
+ if (0 == mir_wstrcmpi(L"Provider", sName.c_str())) {
pProvider = pNode;
break;
}
@@ -111,16 +111,16 @@ CQuotesProviderBase::CXMLFileInfo parse_ini_file(const tstring& rsXMLFile, bool& for (size_t i = 0; i < cChild; ++i) {
IXMLNode::TXMLNodePtr pNode = pProvider->GetChildNode(i);
tstring sName = pNode->GetName();
- if (0 == mir_tstrcmpi(L"section", sName.c_str())) {
+ if (0 == mir_wstrcmpi(L"section", sName.c_str())) {
CQuotesProviderBase::CQuoteSection qs;
if (true == parse_section(pNode, qs))
aSections.push_back(qs);
}
- else if (0 == mir_tstrcmpi(L"Name", sName.c_str()))
+ else if (0 == mir_wstrcmpi(L"Name", sName.c_str()))
res.m_pi.m_sName = pNode->GetText();
- else if (0 == mir_tstrcmpi(L"ref", sName.c_str()))
+ else if (0 == mir_wstrcmpi(L"ref", sName.c_str()))
res.m_pi.m_sURL = pNode->GetText();
- else if (0 == mir_tstrcmpi(L"url", sName.c_str()))
+ else if (0 == mir_wstrcmpi(L"url", sName.c_str()))
res.m_sURL = pNode->GetText();
}
}
@@ -508,11 +508,11 @@ bool show_popup(const IQuotesProvider* pProvider, CQuotesProviderVisitorFormater visitor(hContact, 's', 0);
pProvider->Accept(visitor);
const tstring& sTitle = visitor.GetResult();
- mir_tstrncpy(ppd.lptzContactName, sTitle.c_str(), MAX_CONTACTNAME);
+ mir_wstrncpy(ppd.lptzContactName, sTitle.c_str(), MAX_CONTACTNAME);
{
- ptrT ss(variables_parsedup((wchar_t*)rsFormat.c_str(), 0, hContact));
+ ptrW ss(variables_parsedup((wchar_t*)rsFormat.c_str(), 0, hContact));
tstring sText = format_rate(pProvider, hContact, tstring(ss));
- mir_tstrncpy(ppd.lptzText, sText.c_str(), MAX_SECONDLINE);
+ mir_wstrncpy(ppd.lptzText, sText.c_str(), MAX_SECONDLINE);
}
if (CPopupSettings::colourDefault == ps.GetColourMode()) {
diff --git a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp index 8404c2b479..8ecfcf1498 100644 --- a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp +++ b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp @@ -114,13 +114,13 @@ void parse_row(const THTMLNodePtr& pRow, TEconomicRates& raRates) if (pCol) {
tstring sColID = pCol->GetAttribute(L"id");
if (false == sColID.empty()) {
- if (0 == mir_tstrcmpi(sColID.c_str(), L"stock")) {
+ if (0 == mir_wstrcmpi(sColID.c_str(), L"stock")) {
ri.m_sName = pCol->GetText();
if (false == ri.m_sName.empty()) {
++cColsHandled;
}
}
- else if (0 == mir_tstrcmpi(sSidID.str().c_str(), sColID.c_str())) {
+ else if (0 == mir_wstrcmpi(sSidID.str().c_str(), sColID.c_str())) {
tstring sRate = pCol->GetText();
if ((false == sRate.empty()) && (true == string2double(sRate.c_str(), ri.m_dCurRate))) {
ri.m_dPrevRate = ri.m_dCurRate;
diff --git a/plugins/Quotes/src/QuotesProviderFinance.cpp b/plugins/Quotes/src/QuotesProviderFinance.cpp index 9403611d54..9f02e9e2b2 100644 --- a/plugins/Quotes/src/QuotesProviderFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderFinance.cpp @@ -106,9 +106,9 @@ namespace for (int i = 0; i < cItems; ++i) {
const CQuotesProviderBase::CQuote* pQuote = get_quote_ptr_from_lb_index(hwndList, i);
if ((nullptr != pQuote)
- && ((0 == mir_tstrcmpi(rsQuoteID.c_str(), pQuote->GetID().c_str()))
- || (0 == mir_tstrcmpi(rsQuoteID.c_str(), pQuote->GetName().c_str()))
- || (0 == mir_tstrcmpi(rsQuoteID.c_str(), pQuote->GetSymbol().c_str())))) {
+ && ((0 == mir_wstrcmpi(rsQuoteID.c_str(), pQuote->GetID().c_str()))
+ || (0 == mir_wstrcmpi(rsQuoteID.c_str(), pQuote->GetName().c_str()))
+ || (0 == mir_wstrcmpi(rsQuoteID.c_str(), pQuote->GetSymbol().c_str())))) {
return i;
}
}
@@ -218,7 +218,7 @@ namespace [&apCurrent, pProvider](const CQuotesProviderBase::CQuote& quote)
{
if (apCurrent.end() == std::find_if(apCurrent.begin(), apCurrent.end(),
- ["e](const CQuotesProviderBase::CQuote* pQuote) { return 0 == mir_tstrcmpi(pQuote->GetID().c_str(), quote.GetID().c_str()); })) {
+ ["e](const CQuotesProviderBase::CQuote* pQuote) { return 0 == mir_wstrcmpi(pQuote->GetID().c_str(), quote.GetID().c_str()); })) {
pProvider->WatchForQuote(quote, false);
}
});
@@ -228,7 +228,7 @@ namespace {
if (aTemp.end() ==
std::find_if(aTemp.begin(), aTemp.end(),
- [pQuote](const CQuotesProviderBase::CQuote& quote) { return 0 == mir_tstrcmpi(pQuote->GetID().c_str(), quote.GetID().c_str()); })) {
+ [pQuote](const CQuotesProviderBase::CQuote& quote) { return 0 == mir_wstrcmpi(pQuote->GetID().c_str(), quote.GetID().c_str()); })) {
pProvider->WatchForQuote(*pQuote, true);
}
diff --git a/plugins/Quotes/src/QuotesProviderGoogle.cpp b/plugins/Quotes/src/QuotesProviderGoogle.cpp index 95e15ca85b..a124a1b002 100644 --- a/plugins/Quotes/src/QuotesProviderGoogle.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogle.cpp @@ -21,8 +21,8 @@ inline bool is_rate_watched(MCONTACT hContact, {
tstring sFrom = Quotes_DBGetStringT(hContact, QUOTES_PROTOCOL_NAME, DB_STR_FROM_ID);
tstring sTo = Quotes_DBGetStringT(hContact, QUOTES_PROTOCOL_NAME, DB_STR_TO_ID);
- return ((0 == mir_tstrcmpi(from.GetID().c_str(), sFrom.c_str()))
- && (0 == mir_tstrcmpi(to.GetID().c_str(), sTo.c_str())));
+ return ((0 == mir_wstrcmpi(from.GetID().c_str(), sFrom.c_str()))
+ && (0 == mir_wstrcmpi(to.GetID().c_str(), sTo.c_str())));
}
bool CQuotesProviderGoogle::WatchForRate(const CRateInfo& ri,
@@ -102,7 +102,7 @@ typedef IHTMLNode::THTMLNodePtr THTMLNodePtr; bool parse_html_node(const THTMLNodePtr& pNode, double& rdRate)
{
tstring sID = pNode->GetAttribute(L"id");
- if ((false == sID.empty()) && (0 == mir_tstrcmpi(sID.c_str(), L"currency_converter_result"))) {
+ if ((false == sID.empty()) && (0 == mir_wstrcmpi(sID.c_str(), L"currency_converter_result"))) {
size_t cChild = pNode->GetChildCount();
// assert(1 == cChild);
if (cChild > 0) {
@@ -218,8 +218,8 @@ TWatchedRates g_aWatchedRates; bool is_equal_rate(const CQuotesProviderGoogle::CRateInfo& riL, const CQuotesProviderGoogle::CRateInfo& riR)
{
- return ((0 == mir_tstrcmpi(riL.m_from.GetID().c_str(), riR.m_from.GetID().c_str()))
- && ((0 == mir_tstrcmpi(riL.m_to.GetID().c_str(), riR.m_to.GetID().c_str()))));
+ return ((0 == mir_wstrcmpi(riL.m_from.GetID().c_str(), riR.m_from.GetID().c_str()))
+ && ((0 == mir_wstrcmpi(riL.m_to.GetID().c_str(), riR.m_to.GetID().c_str()))));
}
INT_PTR CALLBACK GoogleOptDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
@@ -419,8 +419,8 @@ namespace {
tstring sFrom = Quotes_DBGetStringT(hContact, QUOTES_PROTOCOL_NAME, DB_STR_FROM_ID);
tstring sTo = Quotes_DBGetStringT(hContact, QUOTES_PROTOCOL_NAME, DB_STR_TO_ID);
- return ((0 == mir_tstrcmpi(rsFromID.c_str(), sFrom.c_str()))
- && (0 == mir_tstrcmpi(rsToID.c_str(), sTo.c_str())));
+ return ((0 == mir_wstrcmpi(rsFromID.c_str(), sFrom.c_str()))
+ && (0 == mir_wstrcmpi(rsToID.c_str(), sTo.c_str())));
}
}
diff --git a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp index cfcda85e76..4b18bdf7ac 100644 --- a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp @@ -80,7 +80,7 @@ tstring get_var_value(const tstring& rsHTML, LPCTSTR pszVarName, size_t cVarName tstring get_company_id(const tstring& rsHTML)
{
static LPCTSTR pszVarName = L"setCompanyId(";
- static size_t cVarNameLength = mir_tstrlen(pszVarName);
+ static size_t cVarNameLength = mir_wstrlen(pszVarName);
tstring sResult;
tstring::size_type n = rsHTML.find(pszVarName);
@@ -100,7 +100,7 @@ tstring get_company_id(const tstring& rsHTML) tstring get_company_name(const tstring& rsHTML)
{
static LPCTSTR pszVarName = L"var _companyName = ";
- static size_t cVarNameLength = mir_tstrlen(pszVarName);
+ static size_t cVarNameLength = mir_wstrlen(pszVarName);
tstring s = get_var_value(rsHTML, pszVarName, cVarNameLength);
if (s.size() > 0 && '\'' == s[0])
@@ -151,7 +151,7 @@ bool get_inline_data(const IHTMLNode::THTMLNodePtr& pNode, CGoogleInfo& rInfo) IHTMLNode::THTMLNodePtr pName = pChild->GetChildPtr(0);
tstring sName = pName->GetText();
- if (0 == mir_tstrcmpi(sName.c_str(), L"Open")) {
+ if (0 == mir_wstrcmpi(sName.c_str(), L"Open")) {
IHTMLNode::THTMLNodePtr pValue = pChild->GetChildPtr(1);
tstring sValue = pValue->GetText();
if (true == get_double_value(sValue, rInfo.m_dOpenValue)) {
diff --git a/plugins/Quotes/src/QuotesProviders.cpp b/plugins/Quotes/src/QuotesProviders.cpp index 0a3e220d7f..3a316df3d3 100644 --- a/plugins/Quotes/src/QuotesProviders.cpp +++ b/plugins/Quotes/src/QuotesProviders.cpp @@ -82,7 +82,7 @@ CQuotesProviders::TQuotesProviderPtr CQuotesProviders::FindProvider(const tstrin for (TQuotesProviders::const_iterator i = m_apProviders.begin(); i != m_apProviders.end(); ++i) {
const TQuotesProviderPtr& pProvider = *i;
const IQuotesProvider::CProviderInfo& rInfo = pProvider->GetInfo();
- if (0 == ::mir_tstrcmpi(rsName.c_str(), rInfo.m_sName.c_str())) {
+ if (0 == ::mir_wstrcmpi(rsName.c_str(), rInfo.m_sName.c_str())) {
pResult = pProvider;
break;
}
diff --git a/plugins/Quotes/src/SettingsDlg.cpp b/plugins/Quotes/src/SettingsDlg.cpp index 5e8b0f0751..c11f038809 100644 --- a/plugins/Quotes/src/SettingsDlg.cpp +++ b/plugins/Quotes/src/SettingsDlg.cpp @@ -977,7 +977,7 @@ tstring GenerateLogFileName(const tstring &rsLogFilePattern, const tstring &rsQu if (tstring::npos != n) {
tstring s = rsQuoteSymbol;
std::for_each(s.begin(), s.end(), boost::bind(replace_invalid_char, _1, '_'));
- sPath.replace(n, mir_tstrlen(g_pszVariableQuoteName), s.c_str());
+ sPath.replace(n, mir_wstrlen(g_pszVariableQuoteName), s.c_str());
}
}
diff --git a/plugins/Quotes/src/XMLEngineMI.cpp b/plugins/Quotes/src/XMLEngineMI.cpp index 5f694a31d0..ed63a63784 100644 --- a/plugins/Quotes/src/XMLEngineMI.cpp +++ b/plugins/Quotes/src/XMLEngineMI.cpp @@ -77,7 +77,7 @@ public: virtual void Write(tostream& o)const
{
- ptrT ss(xmlToString(m_hXML, NULL));
+ ptrW ss(xmlToString(m_hXML, NULL));
if (ss != NULL)
o << (char*)T2Utf(ss);
}
@@ -109,7 +109,7 @@ IXMLNode::TXMLNodePtr CXMLEngineMI::LoadFile(const tstring& rsFileName)const pBuffer[cBytes] = '\0';
int nLen = (int)cBytes;
- ptrT ss(mir_utf8decodeT(pBuffer));
+ ptrW ss(mir_utf8decodeW(pBuffer));
if (ss) {
HXML h = xmlParseString(ss, &nLen, NULL);
if (h)
diff --git a/plugins/Quotes/src/stdafx.h b/plugins/Quotes/src/stdafx.h index d4c5d2ffc1..fe0bde6b88 100644 --- a/plugins/Quotes/src/stdafx.h +++ b/plugins/Quotes/src/stdafx.h @@ -53,7 +53,7 @@ typedef boost::posix_time::wtime_facet ttime_facet; inline std::string quotes_t2a(const wchar_t* t)
{
std::string s;
- char* p = mir_t2a(t);
+ char* p = mir_u2a(t);
if (p) {
s = p;
mir_free(p);
@@ -64,7 +64,7 @@ inline std::string quotes_t2a(const wchar_t* t) inline tstring quotes_a2t(const char* s)
{
tstring t;
- wchar_t* p = mir_a2t(s);
+ wchar_t* p = mir_a2u(s);
if (p) {
t = p;
mir_free(p);
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index d6256e4726..7f36b72935 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -445,10 +445,10 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) if (lf) {
if (db_get(NULL, SRMMMOD, str, &dbv)) {
- mir_tstrncpy(lf->lfFaceName, fontOptionsList[0].szDefFace, _countof(lf->lfFaceName));
+ mir_wstrncpy(lf->lfFaceName, fontOptionsList[0].szDefFace, _countof(lf->lfFaceName));
}
else {
- mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName));
+ mir_wstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName));
db_free(&dbv);
}
diff --git a/plugins/SMS/src/options.cpp b/plugins/SMS/src/options.cpp index 5a464a79c5..2157187e06 100644 --- a/plugins/SMS/src/options.cpp +++ b/plugins/SMS/src/options.cpp @@ -38,7 +38,7 @@ INT_PTR CALLBACK DlgProcEditorOptions(HWND hWndDlg, UINT msg, WPARAM wParam, LPA TranslateDialogDefault(hWndDlg);
if (DB_SMS_GetStaticStringW(NULL,"Signature",tszSign,_countof(tszSign),NULL)==FALSE)
- mir_sntprintf(tszSign, TranslateT("From %s:\r\n\r\n"), pcli->pfnGetContactDisplayName(0, 0));
+ mir_snwprintf(tszSign, TranslateT("From %s:\r\n\r\n"), pcli->pfnGetContactDisplayName(0, 0));
SetDlgItemText(hWndDlg,IDC_SIGNATURE,tszSign);
{
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index 9779f46907..e4f50f03e8 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -158,7 +158,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) GetXMLFieldExBuff(lpszXML, dwXMLSize, szBuff, sizeof(szBuff), NULL, "sms_response", "error", "params", "param", NULL);
}
- mir_sntprintf(tszErrorMessage, TranslateT("SMS message didn't send by %S to %s because: %S"), szNetwork, tszPhone, lpszErrorDescription);
+ mir_snwprintf(tszErrorMessage, TranslateT("SMS message didn't send by %S to %s because: %S"), szNetwork, tszPhone, lpszErrorDescription);
ShowWindow(hWndDlg, SW_SHOWNORMAL);
EnableWindow(hWndDlg, FALSE);
HWND hwndTimeOut = CreateDialog(ssSMSSettings.hInstance, MAKEINTRESOURCE(IDD_SENDSMSTIMEDOUT), hWndDlg, SMSTimedOutDlgProc);
@@ -232,7 +232,7 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) }
else {
memcpy(pszServiceFunctionName, SMS_READ, sizeof(SMS_READ));
- mir_sntprintf(szToolTip, TranslateT("SMS Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szToolTip, TranslateT("SMS Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = {};
cle.flags = CLEF_TCHAR;
@@ -255,7 +255,7 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) UINT iIcon;
if (GetDataFromMessage((LPSTR)dbei.pBlob, dbei.cbBlob, NULL, NULL, 0, NULL, &iIcon)) {
memcpy(pszServiceFunctionName, SMS_READ_ACK, sizeof(SMS_READ_ACK));
- mir_sntprintf(szToolTip, TranslateT("SMS Confirmation from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szToolTip, TranslateT("SMS Confirmation from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = {};
cle.flags = CLEF_TCHAR;
diff --git a/plugins/SMS/src/recvdlg.cpp b/plugins/SMS/src/recvdlg.cpp index a2a231e20e..4734d8cf0e 100644 --- a/plugins/SMS/src/recvdlg.cpp +++ b/plugins/SMS/src/recvdlg.cpp @@ -210,7 +210,7 @@ HWND RecvSMSWindowAdd(MCONTACT hContact, DWORD dwEventType, LPWSTR lpwszPhone, s }
lpwszContactDisplayName = pcli->pfnGetContactDisplayName(hContact, 0);
- mir_sntprintf(wszTitle, L"%s - %s", lpwszContactDisplayName, lpwszTitlepart);
+ mir_snwprintf(wszTitle, L"%s - %s", lpwszContactDisplayName, lpwszTitlepart);
MultiByteToWideChar(CP_UTF8, 0, lpszMessage, (int)dwMessageSize, lpwszMessage, (int)dwMessageSize + MAX_PATH);
SetWindowText(prswdWindowData->hWnd, wszTitle);
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp index 96f36d700a..637ccfae0c 100644 --- a/plugins/SMS/src/senddlg.cpp +++ b/plugins/SMS/src/senddlg.cpp @@ -154,7 +154,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA EnableWindow(GetDlgItem(hWndDlg, IDOK), dwSignLen != 0);
}
- mir_sntprintf(tszSign, L"%d/%d", dwSignLen, GetSMSMessageLenMax(hWndDlg));
+ mir_snwprintf(tszSign, L"%d/%d", dwSignLen, GetSMSMessageLenMax(hWndDlg));
SetDlgItemText(hWndDlg, IDC_COUNT, tszSign);
}
@@ -222,7 +222,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA else {
GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone));
}
- mir_sntprintf(tszMessage, TranslateT("The SMS message send to %s timed out."), tszPhone);
+ mir_snwprintf(tszMessage, TranslateT("The SMS message send to %s timed out."), tszPhone);
KillTimer(hWndDlg, wParam);
ShowWindow(hWndDlg, SW_SHOWNORMAL);
EnableWindow(hWndDlg, FALSE);
@@ -281,7 +281,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA tvi.pszText = tszPhone;
tvi.cchTextMax = _countof(tszPhone);
TreeView_GetItem(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), &tvi);
- dwPhoneSize = mir_tstrlen(tszPhone);
+ dwPhoneSize = mir_wstrlen(tszPhone);
}
else dwPhoneSize = GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone));
@@ -386,7 +386,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
EnableWindow(GetDlgItem(hWndDlg, IDOK), dwMessageSize != 0);
- mir_sntprintf(tszBuff, L"%d/%d", dwMessageSize, GetSMSMessageLenMax(hWndDlg));
+ mir_snwprintf(tszBuff, L"%d/%d", dwMessageSize, GetSMSMessageLenMax(hWndDlg));
SetDlgItemText(hWndDlg, IDC_COUNT, tszBuff);
}
break;
@@ -400,7 +400,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA size_t dwPhoneSize = GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, (_countof(tszPhone) - 4));
if (IsPhoneW(tszPhone, dwPhoneSize)) {
if (IsContactPhone(psswdWindowData->hMyContact, tszPhone, dwPhoneSize) == FALSE) {
- mir_tstrcat(tszPhone, L" SMS");
+ mir_wstrcat(tszPhone, L" SMS");
for (DWORD i = 0; bCont; i++) {
mir_snprintf(szBuff, "MyPhone%d", i);
if (db_get(psswdWindowData->hMyContact, "UserInfo", szBuff, &dbv)) bCont = FALSE;
@@ -559,7 +559,7 @@ HWND SendSMSWindowAdd(MCONTACT hContact) LPTSTR lptszContactDisplayName = pcli->pfnGetContactDisplayName(hContact, 0);
wchar_t tszTitle[MAX_PATH];
- mir_sntprintf(tszTitle, L"%s - %s", lptszContactDisplayName, TranslateT("Send SMS"));
+ mir_snwprintf(tszTitle, L"%s - %s", lptszContactDisplayName, TranslateT("Send SMS"));
SetWindowText(psswdWindowData->hWnd, tszTitle);
SendDlgItemMessage(psswdWindowData->hWnd, IDC_NAME, CB_ADDSTRING, 0, (LPARAM)lptszContactDisplayName);
SendDlgItemMessage(psswdWindowData->hWnd, IDC_NAME, CB_SETCURSEL, 0, 0);
diff --git a/plugins/Scriver/src/chat/manager.cpp b/plugins/Scriver/src/chat/manager.cpp index e71eecc249..1d4e61c90a 100644 --- a/plugins/Scriver/src/chat/manager.cpp +++ b/plugins/Scriver/src/chat/manager.cpp @@ -48,7 +48,7 @@ SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* cu while (pTemp != NULL) {
if (pTemp != currSession && !mir_strcmpi(pszModule, pTemp->pszModule)) {
if (my_strstri(pTemp->ptszName, pszOriginal) == pTemp->ptszName) {
- if (prevSession != pTemp && mir_tstrcmpi(pTemp->ptszName, pszCurrent) > 0 && (!pszName || mir_tstrcmpi(pTemp->ptszName, pszName) < 0)) {
+ if (prevSession != pTemp && mir_wstrcmpi(pTemp->ptszName, pszCurrent) > 0 && (!pszName || mir_wstrcmpi(pTemp->ptszName, pszName) < 0)) {
pResult = pTemp;
pszName = pTemp->ptszName;
}
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index 6f83994009..985077fde9 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -226,10 +226,10 @@ static void InitSetting(wchar_t **ppPointer, char *pszSetting, wchar_t *pszDefau {
DBVARIANT dbv;
if ( !db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv )) {
- replaceStrT(*ppPointer, dbv.ptszVal);
+ replaceStrW(*ppPointer, dbv.ptszVal);
db_free(&dbv);
}
- else replaceStrT(*ppPointer, pszDefault);
+ else replaceStrW(*ppPointer, pszDefault);
}
#define OPT_FIXHEADINGS (WM_USER+1)
@@ -365,7 +365,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa wchar_t tszTooltipText[2048];
RECT rect;
- mir_sntprintf(tszTooltipText,
+ mir_snwprintf(tszTooltipText,
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n"
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n"
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
@@ -464,9 +464,9 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa LPITEMIDLIST idList = SHBrowseForFolder(&bi);
if (idList) {
SHGetPathFromIDList(idList, tszDirectory);
- mir_tstrcat(tszDirectory, L"\\");
+ mir_wstrcat(tszDirectory, L"\\");
PathToRelativeT(tszDirectory, tszTemp);
- SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
+ SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, mir_wstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
psMalloc->Free(idList);
psMalloc->Release();
@@ -543,7 +543,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa free(pszText1);
}
else {
- mir_tstrncpy(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH);
+ mir_wstrncpy(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH);
db_unset(NULL, CHAT_MODULE, "LogDirectory");
}
pci->SM_InvalidateLogDirectories();
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index eebd6fdd00..3b9c78291c 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -53,7 +53,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s if (pszWordText && pszWordText[0]) {
wchar_t szMenuText[4096];
- mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
+ mir_snwprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
SetSearchEngineIcons(*hMenu, g_dat.hSearchEngineIconList);
}
@@ -63,12 +63,12 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s else if (iIndex == 0) {
wchar_t szTemp[50];
if (pszWordText)
- mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
+ mir_snwprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
- mir_tstrncpy(szTemp, TranslateT("&Message"), _countof(szTemp) - 1);
+ mir_wstrncpy(szTemp, TranslateT("&Message"), _countof(szTemp) - 1);
- if (mir_tstrlen(szTemp) > 40)
- mir_tstrncpy(szTemp + 40, L"...", 4);
+ if (mir_wstrlen(szTemp) > 40)
+ mir_wstrncpy(szTemp + 40, L"...", 4);
ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp);
gcmi.Type = MENU_ON_NICKLIST;
}
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 9e5d799407..0be7880de0 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -217,7 +217,7 @@ static void TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si) start -= 2;
if (dat->szSearchResult != NULL) {
- int cbResult = (int)mir_tstrlen(dat->szSearchResult);
+ int cbResult = (int)mir_wstrlen(dat->szSearchResult);
if (start >= cbResult && !wcsnicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) {
start -= cbResult;
goto LBL_SkipEnd;
@@ -243,8 +243,8 @@ LBL_SkipEnd: if (dat->szSearchQuery == NULL) {
dat->szSearchQuery = (wchar_t*)mir_alloc(sizeof(wchar_t)*(end - start + 1));
- mir_tstrncpy(dat->szSearchQuery, pszText + start, end - start + 1);
- dat->szSearchResult = mir_tstrdup(dat->szSearchQuery);
+ mir_wstrncpy(dat->szSearchQuery, pszText + start, end - start + 1);
+ dat->szSearchResult = mir_wstrdup(dat->szSearchQuery);
dat->lastSession = NULL;
}
@@ -258,23 +258,23 @@ LBL_SkipEnd: else pszName = pci->UM_FindUserAutoComplete(si->pUsers, dat->szSearchQuery, dat->szSearchResult);
mir_free(pszText);
- replaceStrT(dat->szSearchResult, NULL);
+ replaceStrW(dat->szSearchResult, NULL);
if (pszName == NULL) {
if (end != start) {
SendMessage(hwnd, EM_SETSEL, start, end);
SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM)dat->szSearchQuery);
}
- replaceStrT(dat->szSearchQuery, NULL);
+ replaceStrW(dat->szSearchQuery, NULL);
}
else {
- dat->szSearchResult = mir_tstrdup(pszName);
+ dat->szSearchResult = mir_wstrdup(pszName);
if (end != start) {
- ptrT szReplace;
+ ptrW szReplace;
if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) {
- szReplace = (wchar_t*)mir_alloc((mir_tstrlen(pszName) + 4) * sizeof(wchar_t));
- mir_tstrcpy(szReplace, pszName);
- mir_tstrcat(szReplace, L": ");
+ szReplace = (wchar_t*)mir_alloc((mir_wstrlen(pszName) + 4) * sizeof(wchar_t));
+ mir_wstrcpy(szReplace, pszName);
+ mir_wstrcat(szReplace, L": ");
pszName = szReplace;
}
SendMessage(hwnd, EM_SETSEL, start, end);
@@ -684,7 +684,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ptl.y = (LONG)pt.y;
ScreenToClient(hwnd, (LPPOINT)&ptl);
{
- ptrT pszWord(GetRichTextWord(hwnd, &ptl));
+ ptrW pszWord(GetRichTextWord(hwnd, &ptl));
inMenu = TRUE;
CHARRANGE all = { 0, -1 };
@@ -795,7 +795,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO * p }
if (tszBuf[0] == 0)
- mir_sntprintf(tszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
+ mir_snwprintf(tszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status));
@@ -956,18 +956,18 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break;
}
else if (wParam == '\b' && si->szSearch[0]) // backspace
- si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0';
+ si->szSearch[mir_wstrlen(si->szSearch) - 1] = '\0';
else if (wParam < ' ')
break;
else {
wchar_t szNew[2];
szNew[0] = (wchar_t)wParam;
szNew[1] = '\0';
- if (mir_tstrlen(si->szSearch) >= _countof(si->szSearch) - 2) {
+ if (mir_wstrlen(si->szSearch) >= _countof(si->szSearch) - 2) {
MessageBeep(MB_OK);
break;
}
- mir_tstrcat(si->szSearch, szNew);
+ mir_wstrcat(si->szSearch, szNew);
}
if (si->szSearch[0]) {
// iterate over the (sorted) list of nicknames and search for the
@@ -976,7 +976,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, for (int i = 0; i < iItems; i++) {
USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i);
if (ui) {
- if (!wcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) {
+ if (!wcsnicmp(ui->pszNick, si->szSearch, mir_wstrlen(si->szSearch))) {
SendMessage(hwnd, LB_SETCURSEL, i, 0);
InvalidateRect(hwnd, NULL, FALSE);
return 0;
@@ -985,7 +985,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, }
MessageBeep(MB_OK);
- si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0';
+ si->szSearch[mir_wstrlen(si->szSearch) - 1] = '\0';
return 0;
}
break;
@@ -1177,17 +1177,17 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR switch (si->iType) {
case GCW_CHATROOM:
- mir_sntprintf(szTemp,
+ mir_snwprintf(szTemp,
(si->nUsersInNicklist == 1) ? TranslateT("%s: chat room (%u user)") : TranslateT("%s: chat room (%u users)"),
si->ptszName, si->nUsersInNicklist);
break;
case GCW_PRIVMESS:
- mir_sntprintf(szTemp,
+ mir_snwprintf(szTemp,
(si->nUsersInNicklist == 1) ? TranslateT("%s: message session") : TranslateT("%s: message session (%u users)"),
si->ptszName, si->nUsersInNicklist);
break;
case GCW_SERVER:
- mir_sntprintf(szTemp, L"%s: Server", si->ptszName);
+ mir_snwprintf(szTemp, L"%s: Server", si->ptszName);
break;
}
tbd.iFlags = TBDF_TEXT | TBDF_ICON;
@@ -1200,7 +1200,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR {
MODULEINFO *mi = pci->MM_FindModule(si->pszModule);
hIcon = si->wStatus == ID_STATUS_ONLINE ? mi->hOnlineIcon : mi->hOfflineIcon;
- mir_sntprintf(szTemp, L"%s : %s", mi->ptszModDispName, si->ptszStatusbarText ? si->ptszStatusbarText : L"");
+ mir_snwprintf(szTemp, L"%s : %s", mi->ptszModDispName, si->ptszStatusbarText ? si->ptszStatusbarText : L"");
StatusBarData sbd;
sbd.iItem = 0;
@@ -1411,7 +1411,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR }
SetTextColor(dis->hDC, ui->iStatusEx == 0 ? g_Settings.crUserListColor : g_Settings.crUserListHeadingsColor);
- TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, (int)mir_tstrlen(ui->pszNick));
+ TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, (int)mir_wstrlen(ui->pszNick));
SelectObject(dis->hDC, hOldFont);
}
return TRUE;
@@ -1428,7 +1428,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR char szIndicator = SM_GetStatusIndicator(si, ui);
if (szIndicator > '\0') {
static wchar_t ptszBuf[128];
- mir_sntprintf(ptszBuf, L"%c%s", szIndicator, ui->pszNick);
+ mir_snwprintf(ptszBuf, L"%c%s", szIndicator, ui->pszNick);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ptszBuf);
}
else SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ui->pszNick);
@@ -1637,7 +1637,7 @@ LABEL_SHOWWINDOW: USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
if (ui != NULL) {
static wchar_t ptszBuf[1024];
- mir_sntprintf(ptszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
+ mir_snwprintf(ptszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status));
@@ -1667,12 +1667,12 @@ LABEL_SHOWWINDOW: if (GetKeyState(VK_SHIFT) & 0x8000) {
LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETSEL, 0, 0);
int start = LOWORD(lResult);
- size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 4);
+ size_t dwNameLenMax = (mir_wstrlen(ui->pszUID) + 4);
wchar_t* pszName = (wchar_t*)alloca(sizeof(wchar_t) * dwNameLenMax);
if (start == 0)
- mir_sntprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID);
+ mir_snwprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID);
else
- mir_sntprintf(pszName, dwNameLenMax, L"%s ", ui->pszUID);
+ mir_snwprintf(pszName, dwNameLenMax, L"%s ", ui->pszUID);
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)pszName);
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
@@ -1706,7 +1706,7 @@ LABEL_SHOWWINDOW: // takes pszRtf to a queue, no leak here
si->cmdList = tcmdlist_append(si->cmdList, pszRtf, 20, FALSE);
- CMString ptszText(ptrT(mir_utf8decodeT(pszRtf)));
+ CMString ptszText(ptrW(mir_utf8decodeW(pszRtf)));
pci->DoRtfToTags(ptszText, mi->nColorCount, mi->crColors);
ptszText.Trim();
ptszText.Replace(L"%", L"%%");
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 42ec8e52c0..cf50d1ad42 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -131,8 +131,8 @@ static int ackevent(WPARAM, LPARAM lParam) SendMessage(hwndSender, DM_STOPMESSAGESENDING, 0, 0);
ErrorWindowData *ewd = (ErrorWindowData*)mir_alloc(sizeof(ErrorWindowData));
- ewd->szName = mir_tstrdup(pcli->pfnGetContactDisplayName(item->hContact, 0));
- ewd->szDescription = mir_a2t((char *)pAck->lParam);
+ ewd->szName = mir_wstrdup(pcli->pfnGetContactDisplayName(item->hContact, 0));
+ ewd->szDescription = mir_a2u((char *)pAck->lParam);
ewd->szText = GetSendBufferMsg(item);
ewd->hwndParent = hwndSender;
ewd->queueItem = item;
diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp index 0175199ccc..8ff69e1288 100644 --- a/plugins/Scriver/src/infobar.cpp +++ b/plugins/Scriver/src/infobar.cpp @@ -79,14 +79,14 @@ void RefreshInfobar(InfobarWindowData* idat) {
HWND hwnd = idat->hWnd;
SrmmWindowData *dat = idat->mwd;
- ptrT szContactStatusMsg(db_get_tsa(dat->hContact, "CList", "StatusMsg"));
- ptrT szXStatusName(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusName"));
- ptrT szXStatusMsg(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusMsg"));
+ ptrW szContactStatusMsg(db_get_tsa(dat->hContact, "CList", "StatusMsg"));
+ ptrW szXStatusName(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusName"));
+ ptrW szXStatusMsg(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusMsg"));
HICON hIcon = GetExtraStatusIcon(idat);
wchar_t szText[2048];
SETTEXTEX st;
if (szXStatusMsg && *szXStatusMsg)
- mir_sntprintf(szText, L"%s (%s)", TranslateTS(szXStatusName), szXStatusMsg);
+ mir_snwprintf(szText, L"%s (%s)", TranslateTS(szXStatusName), szXStatusMsg);
else
wcsncpy_s(szText, TranslateTS(szXStatusName), _TRUNCATE);
st.flags = ST_DEFAULT;
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index d9ecad41e3..e0e838ddbc 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -399,8 +399,8 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK * if (!OpenClipboard(hwndDlg))
break;
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_tstrlen(tr.lpstrText) + 1));
- mir_tstrcpy((LPWSTR)GlobalLock(hData), tr.lpstrText);
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_wstrlen(tr.lpstrText) + 1));
+ mir_wstrcpy((LPWSTR)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 341c9c6a3a..5aab926147 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -48,7 +48,7 @@ static wchar_t* GetIEViewSelection(SrmmWindowData *dat) evt.hwnd = dat->hwndLog;
evt.hContact = dat->hContact;
evt.iType = IEE_GET_SELECTION;
- return mir_tstrdup((wchar_t*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&evt));
+ return mir_wstrdup((wchar_t*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&evt));
}
static wchar_t* GetQuotedTextW(wchar_t *text)
@@ -160,17 +160,17 @@ static void AddToFileList(wchar_t ***pppFiles, int *totalCount, const wchar_t* s {
*pppFiles = (wchar_t**)mir_realloc(*pppFiles, (++*totalCount + 1)*sizeof(wchar_t*));
(*pppFiles)[*totalCount] = NULL;
- (*pppFiles)[*totalCount - 1] = mir_tstrdup(szFilename);
+ (*pppFiles)[*totalCount - 1] = mir_wstrdup(szFilename);
if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) {
WIN32_FIND_DATA fd;
wchar_t szPath[MAX_PATH];
- mir_sntprintf(szPath, L"%s\\*", szFilename);
+ mir_snwprintf(szPath, L"%s\\*", szFilename);
HANDLE hFind = FindFirstFile(szPath, &fd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
- if (!mir_tstrcmp(fd.cFileName, L".") || !mir_tstrcmp(fd.cFileName, L"..")) continue;
- mir_sntprintf(szPath, L"%s\\%s", szFilename, fd.cFileName);
+ if (!mir_wstrcmp(fd.cFileName, L".") || !mir_wstrcmp(fd.cFileName, L"..")) continue;
+ mir_snwprintf(szPath, L"%s\\%s", szFilename, fd.cFileName);
AddToFileList(pppFiles, totalCount, szPath);
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
@@ -295,10 +295,10 @@ static LRESULT CALLBACK LogEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, POINTL ptl = { (LONG)pt.x, (LONG)pt.y };
ScreenToClient(hwnd, (LPPOINT)&ptl);
- ptrT pszWord(GetRichTextWord(hwnd, &ptl));
+ ptrW pszWord(GetRichTextWord(hwnd, &ptl));
if (pszWord && pszWord[0]) {
wchar_t szMenuText[4096];
- mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWord);
+ mir_snwprintf(szMenuText, TranslateT("Look up '%s':"), pszWord);
ModifyMenu(hSubMenu, 5, MF_STRING | MF_BYPOSITION, 5, szMenuText);
SetSearchEngineIcons(hMenu, g_dat.hSearchEngineIconList);
}
@@ -552,7 +552,7 @@ static void UpdateReadChars(HWND hwndDlg, SrmmWindowData *dat) sbd.iFlags = SBDF_TEXT | SBDF_ICON;
sbd.hIcon = NULL;
sbd.pszText = szText;
- mir_sntprintf(szText, L"%d", len);
+ mir_snwprintf(szText, L"%d", len);
SendMessage(dat->hwndParent, CM_UPDATESTATUSBAR, (WPARAM)&sbd, (LPARAM)hwndDlg);
}
}
@@ -759,7 +759,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText);
}
else if (g_dat.flags & SMF_SAVEDRAFTS) {
- ptrT ptszSavedMsg(db_get_tsa(dat->hContact, "SRMM", "SavedMsg"));
+ ptrW ptszSavedMsg(db_get_tsa(dat->hContact, "SRMM", "SavedMsg"));
if (ptszSavedMsg)
len = SetRichText(GetDlgItem(hwndDlg, IDC_MESSAGE), ptszSavedMsg);
PostMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETSEL, len, len);
@@ -1351,19 +1351,19 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->messagesInProgress && (g_dat.flags & SMF_SHOWPROGRESS)) {
sbd.hIcon = GetCachedIcon("scriver_DELIVERING");
sbd.pszText = szText;
- mir_sntprintf(szText, TranslateT("Sending in progress: %d message(s) left..."), dat->messagesInProgress);
+ mir_snwprintf(szText, TranslateT("Sending in progress: %d message(s) left..."), dat->messagesInProgress);
}
else if (dat->nTypeSecs) {
sbd.hIcon = GetCachedIcon("scriver_TYPING");
sbd.pszText = szText;
- mir_sntprintf(szText, TranslateT("%s is typing a message..."), pcli->pfnGetContactDisplayName(dat->hContact, 0));
+ mir_snwprintf(szText, TranslateT("%s is typing a message..."), pcli->pfnGetContactDisplayName(dat->hContact, 0));
dat->nTypeSecs--;
}
else if (dat->lastMessage) {
wchar_t date[64], time[64];
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0);
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"t", time, _countof(time), 0);
- mir_sntprintf(szText, TranslateT("Last message received on %s at %s."), date, time);
+ mir_snwprintf(szText, TranslateT("Last message received on %s at %s."), date, time);
sbd.pszText = szText;
}
else sbd.pszText = L"";
@@ -1576,7 +1576,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETPARAFORMAT, 0, (LPARAM)&pf2);
int bufSize = GetRichTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE), 1200, TRUE) + 2;
- ptrT ptszUnicode((wchar_t*)mir_alloc(bufSize * sizeof(wchar_t)));
+ ptrW ptszUnicode((wchar_t*)mir_alloc(bufSize * sizeof(wchar_t)));
MessageSendQueueItem msi = { 0 };
if (pf2.wEffects & PFE_RTLPARA)
@@ -1590,7 +1590,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (RTL_Detect(ptszUnicode))
msi.flags |= PREF_RTL;
- msi.sendBuffer = mir_utf8encodeT(ptszUnicode);
+ msi.sendBuffer = mir_utf8encodeW(ptszUnicode);
msi.sendBufferSize = (int)mir_strlen(msi.sendBuffer);
if (msi.sendBufferSize == 0)
break;
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index fc1bdea405..f75057670b 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -147,7 +147,7 @@ EventData* getEventFromDB(SrmmWindowData *dat, MCONTACT hContact, MEVENT hDbEven if (evt->dwFlags & IEEDF_SENT)
evt->pszNickT = Contact_GetInfo(CNF_DISPLAY, NULL, dat->szProto);
else
- evt->pszNickT = mir_tstrdup(pcli->pfnGetContactDisplayName(hContact, 0));
+ evt->pszNickT = mir_wstrdup(pcli->pfnGetContactDisplayName(hContact, 0));
if (evt->eventType == EVENTTYPE_FILE) {
char *filename = ((char*)dbei.pBlob) + sizeof(DWORD);
@@ -179,24 +179,24 @@ static EventData* GetTestEvents() {
EventData *evt, *firstEvent, *prevEvent;
firstEvent = prevEvent = evt = GetTestEvent(IEEDF_SENT);
- evt->pszNickT = mir_tstrdup(TranslateT("Me"));
- evt->pszTextT = mir_tstrdup(TranslateT("O Lord, bless this Thy hand grenade that with it Thou mayest blow Thine enemies"));
+ evt->pszNickT = mir_wstrdup(TranslateT("Me"));
+ evt->pszTextT = mir_wstrdup(TranslateT("O Lord, bless this Thy hand grenade that with it Thou mayest blow Thine enemies"));
evt = GetTestEvent(IEEDF_SENT);
- evt->pszNickT = mir_tstrdup(TranslateT("Me"));
- evt->pszTextT = mir_tstrdup(TranslateT("to tiny bits, in Thy mercy"));
+ evt->pszNickT = mir_wstrdup(TranslateT("Me"));
+ evt->pszTextT = mir_wstrdup(TranslateT("to tiny bits, in Thy mercy"));
prevEvent->next = evt;
prevEvent = evt;
evt = GetTestEvent(0);
- evt->pszNickT = mir_tstrdup(TranslateT("My contact"));
- evt->pszTextT = mir_tstrdup(TranslateT("Lorem ipsum dolor sit amet,"));
+ evt->pszNickT = mir_wstrdup(TranslateT("My contact"));
+ evt->pszTextT = mir_wstrdup(TranslateT("Lorem ipsum dolor sit amet,"));
prevEvent->next = evt;
prevEvent = evt;
evt = GetTestEvent(0);
- evt->pszNickT = mir_tstrdup(TranslateT("My contact"));
- evt->pszTextT = mir_tstrdup(TranslateT("consectetur adipisicing elit"));
+ evt->pszNickT = mir_wstrdup(TranslateT("My contact"));
+ evt->pszTextT = mir_wstrdup(TranslateT("consectetur adipisicing elit"));
prevEvent->next = evt;
prevEvent = evt;
return firstEvent;
@@ -364,31 +364,31 @@ wchar_t* TimestampToString(DWORD dwFlags, time_t check, int mode) today = mktime(&tm_today);
if (dwFlags & SMF_RELATIVEDATE && check >= today) {
- mir_tstrcpy(szResult, TranslateT("Today"));
+ mir_wstrcpy(szResult, TranslateT("Today"));
if (mode == 0)
- mir_tstrcat(szResult, L",");
+ mir_wstrcat(szResult, L",");
}
else if (dwFlags & SMF_RELATIVEDATE && check > (today - 86400)) {
- mir_tstrcpy(szResult, TranslateT("Yesterday"));
+ mir_wstrcpy(szResult, TranslateT("Yesterday"));
if (mode == 0)
- mir_tstrcat(szResult, L",");
+ mir_wstrcat(szResult, L",");
}
else {
if (dwFlags & SMF_LONGDATE)
- mir_tstrcpy(format, L"D");
+ mir_wstrcpy(format, L"D");
else
- mir_tstrcpy(format, L"d");
+ mir_wstrcpy(format, L"d");
}
}
if (mode == 0 || mode == 2) {
if (mode == 0 && (dwFlags & SMF_SHOWDATE))
- mir_tstrcat(format, L" ");
+ mir_wstrcat(format, L" ");
- mir_tstrcat(format, (dwFlags & SMF_SHOWSECONDS) ? L"s" : L"t");
+ mir_wstrcat(format, (dwFlags & SMF_SHOWSECONDS) ? L"s" : L"t");
}
if (format[0] != '\0') {
TimeZone_PrintTimeStamp(NULL, check, format, str, _countof(str), 0);
- mir_tstrncat(szResult, str, _countof(szResult) - mir_tstrlen(szResult));
+ mir_wstrncat(szResult, str, _countof(szResult) - mir_wstrlen(szResult));
}
return szResult;
}
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 85f3f26fcc..6685fdc099 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -188,9 +188,9 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, "%s%d", "SRMFont", i);
- ptrT tszFace(db_get_tsa(NULL, SRMMMOD, str));
+ ptrW tszFace(db_get_tsa(NULL, SRMMMOD, str));
if (tszFace == NULL)
- mir_tstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
+ mir_wstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
else
wcsncpy(lf->lfFaceName, tszFace, _countof(lf->lfFaceName));
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 41c9fc09e9..19f42b14f9 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -121,7 +121,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) }
if (hwnd == NULL || !IsWindowVisible(GetParent(hwnd))) {
wchar_t toolTip[256];
- mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = {};
cle.flags = CLEF_TCHAR;
@@ -206,7 +206,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) SendMessage(hwnd, DM_TYPING, 0, lParam);
else if (lParam && (g_dat.flags2 & SMF2_SHOWTYPINGTRAY)) {
wchar_t szTip[256];
- mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags2 & SMF2_SHOWTYPINGCLIST)) {
MIRANDASYSTRAYNOTIFY tn;
@@ -302,7 +302,7 @@ static void RestoreUnreadMessageAlerts(void) for (int i = 0; i < arEvents.getCount(); i++) {
MSavedEvent &e = arEvents[i];
- mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0));
+ mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0));
cle.hContact = e.hContact;
cle.hDbEvent = e.hEvent;
pcli->pfnAddEvent(&cle);
@@ -647,7 +647,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
wchar_t sztName[64];
- mir_sntprintf(sztName, L"s%u", nextStgId++);
+ mir_snwprintf(sztName, L"s%u", nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
return pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
diff --git a/plugins/Scriver/src/msgtimedout.cpp b/plugins/Scriver/src/msgtimedout.cpp index 1db437ddbf..61c930800a 100644 --- a/plugins/Scriver/src/msgtimedout.cpp +++ b/plugins/Scriver/src/msgtimedout.cpp @@ -50,7 +50,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar SendDlgItemMessage(hwndDlg, IDC_MSGTEXT, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)ewd->szText);
}
if (ewd->szName)
- mir_sntprintf(szText, L"%s - %s", TranslateT("Send error"), ewd->szName);
+ mir_snwprintf(szText, L"%s - %s", TranslateT("Send error"), ewd->szName);
else
wcsncpy_s(szText, TranslateT("Send error"), _TRUNCATE);
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index 3bf73b1fb3..8744cb1b64 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -37,7 +37,7 @@ static const wchar_t *titleTokenNames[] = { L"%name%", L"%status%", L"%statusmsg wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto)
{
- ptrT tmplt;
+ ptrW tmplt;
const wchar_t* tokens[4] = { 0 };
CMString tszTemplate, tszStatus, tszTitle;
@@ -45,7 +45,7 @@ wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto) tokens[0] = pcli->pfnGetContactDisplayName(hContact, 0);
tokens[1] = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
- tszStatus = ptrT(db_get_tsa(hContact, "CList", "StatusMsg"));
+ tszStatus = ptrW(db_get_tsa(hContact, "CList", "StatusMsg"));
tszStatus.Replace(L"\r\n", L" ");
tokens[2] = tszStatus;
@@ -53,7 +53,7 @@ wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto) if (accModule != NULL) {
PROTOACCOUNT* proto = Proto_GetAccount(accModule);
if (proto != NULL)
- tokens[3] = mir_tstrdup(proto->tszAccountName);
+ tokens[3] = mir_wstrdup(proto->tszAccountName);
}
tmplt = db_get_tsa(NULL, SRMMMOD, SRMSGSET_WINDOWTITLE);
@@ -71,7 +71,7 @@ wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto) if (*p == '%') {
int i;
for (i = 0; i < _countof(titleTokenNames); i++) {
- size_t tnlen = mir_tstrlen(titleTokenNames[i]);
+ size_t tnlen = mir_wstrlen(titleTokenNames[i]);
if (!wcsncmp(p, titleTokenNames[i], tnlen)) {
if (tokens[i] != NULL)
tszTitle.Append(tokens[i]);
@@ -1209,7 +1209,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (tbd->iFlags & TBDF_TEXT) {
wchar_t oldtitle[256];
GetWindowText(hwndDlg, oldtitle, _countof(oldtitle));
- if (mir_tstrcmp(tbd->pszText, oldtitle))
+ if (mir_wstrcmp(tbd->pszText, oldtitle))
SetWindowText(hwndDlg, tbd->pszText);
}
if (tbd->iFlags & TBDF_ICON) {
diff --git a/plugins/Scriver/src/sendqueue.cpp b/plugins/Scriver/src/sendqueue.cpp index 770d00dc9c..d192556df0 100644 --- a/plugins/Scriver/src/sendqueue.cpp +++ b/plugins/Scriver/src/sendqueue.cpp @@ -104,8 +104,8 @@ void ReportSendQueueTimeouts(HWND hwndSender) if (item->hwndSender == hwndSender && item->hwndErrorDlg == NULL) {
if (hwndSender != NULL) {
ErrorWindowData *ewd = (ErrorWindowData *)mir_alloc(sizeof(ErrorWindowData));
- ewd->szName = mir_tstrdup(pcli->pfnGetContactDisplayName(item->hContact, 0));
- ewd->szDescription = mir_tstrdup(TranslateT("The message send timed out."));
+ ewd->szName = mir_wstrdup(pcli->pfnGetContactDisplayName(item->hContact, 0));
+ ewd->szDescription = mir_wstrdup(TranslateT("The message send timed out."));
ewd->szText = GetSendBufferMsg(item);
ewd->hwndParent = hwndSender;
ewd->queueItem = item;
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index 8e771e2485..e52f9db5cc 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -143,7 +143,7 @@ char* GetRichTextRTF(HWND hwnd) void rtrimText(wchar_t *text)
{
static wchar_t szTrimString[] = L":;,.!?\'\"><()[]- \r\n";
- size_t iLen = mir_tstrlen(text) - 1;
+ size_t iLen = mir_wstrlen(text) - 1;
while (wcschr(szTrimString, text[iLen])) {
text[iLen] = '\0';
iLen--;
@@ -152,7 +152,7 @@ void rtrimText(wchar_t *text) wchar_t* limitText(wchar_t *text, int limit)
{
- size_t len = mir_tstrlen(text);
+ size_t len = mir_wstrlen(text);
if (len > g_dat.limitNamesLength) {
wchar_t *ptszTemp = (wchar_t*)mir_alloc(sizeof(wchar_t) * (limit + 4));
wcsncpy(ptszTemp, text, limit + 1);
@@ -387,7 +387,7 @@ void SetSearchEngineIcons(HMENU hMenu, HIMAGELIST hImageList) void GetContactUniqueId(SrmmWindowData *dat, char *buf, int maxlen)
{
- ptrT id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact, dat->szProto));
+ ptrW id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact, dat->szProto));
if (id != NULL)
strncpy_s(buf, maxlen, _T2A(id), _TRUNCATE);
}
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 0adf09a814..acbe31564a 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -1624,7 +1624,7 @@ BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) {
char szFile[MAX_PATH] = "rsa_pub.asc";
if (priv)
- mir_tstrcpy(szFile, "rsa_priv.asc");
+ mir_strcpy(szFile, "rsa_priv.asc");
OPENFILENAME ofn = { sizeof(ofn) };
char temp[MAX_PATH];
@@ -1652,7 +1652,7 @@ BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) {
char szFile[MAX_PATH] = "rsa_pub.asc";
if (priv)
- mir_tstrcpy(szFile, "rsa_priv.asc");
+ mir_strcpy(szFile, "rsa_priv.asc");
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp index 5337d2ecb5..bd61b7a820 100644 --- a/plugins/SeenPlugin/src/file.cpp +++ b/plugins/SeenPlugin/src/file.cpp @@ -30,18 +30,18 @@ static wchar_t *g_ptszFileStamp, *g_ptszFileName; void InitFileOutput(void)
{
- ptrT tszFileName(db_get_tsa(NULL, S_MOD, "FileName"));
+ ptrW tszFileName(db_get_tsa(NULL, S_MOD, "FileName"));
if (tszFileName == NULL)
- tszFileName = mir_tstrdup(DEFAULT_FILENAME);
- replaceStrT(g_ptszFileName, VARST(tszFileName));
+ tszFileName = mir_wstrdup(DEFAULT_FILENAME);
+ replaceStrW(g_ptszFileName, VARST(tszFileName));
wchar_t *tszPath = NEWWSTR_ALLOCA(g_ptszFileName);
wchar_t *p = wcsrchr(tszPath, '\\');
if (p) *p = 0;
CreateDirectoryTreeT(tszPath);
- ptrT tszFileStamp(db_get_tsa(NULL, S_MOD, "FileStamp"));
- replaceStrT(g_ptszFileStamp, (tszFileStamp == NULL) ? DEFAULT_FILESTAMP : tszFileStamp);
+ ptrW tszFileStamp(db_get_tsa(NULL, S_MOD, "FileStamp"));
+ replaceStrW(g_ptszFileStamp, (tszFileStamp == NULL) ? DEFAULT_FILESTAMP : tszFileStamp);
}
void UninitFileOutput()
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 4aa5d23d1b..a89a7f2ce3 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -174,7 +174,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA TranslateDialogDefault(hwndDlg);
hContact = (MCONTACT)lparam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lparam);
- mir_sntprintf(sztemp, L"%s: %s",
+ mir_snwprintf(sztemp, L"%s: %s",
pcli->pfnGetContactDisplayName(hContact, 0),
TranslateT("last seen history"));
SetWindowText(hwndDlg, sztemp);
diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index a5fec18486..b2728560d2 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -43,7 +43,7 @@ int BuildContactMenu(WPARAM hContact, LPARAM) }
LPCTSTR ptszName;
- ptrT tszStamp(db_get_tsa(NULL, S_MOD, "MenuStamp"));
+ ptrW tszStamp(db_get_tsa(NULL, S_MOD, "MenuStamp"));
if (tszStamp != NULL)
ptszName = ParseString(tszStamp , hContact);
else
@@ -51,7 +51,7 @@ int BuildContactMenu(WPARAM hContact, LPARAM) int flags = 0;
HICON hIcon = NULL;
- if (!mir_tstrcmp(ptszName, TranslateT("<unknown>"))) {
+ if (!mir_wstrcmp(ptszName, TranslateT("<unknown>"))) {
if (IsWatchedProtocol(szProto))
flags |= CMIF_GRAYED;
else
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index 5288c204f5..a3ce568a16 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -105,18 +105,16 @@ int ShowMissed(void) if (!mcs.count)
return 0;
- wchar_t sztemp[1024], szcount[7];
+ CMStringW buf;
for (int loop = 0; loop < mcs.count; loop++) {
- mir_tstrncat(sztemp, (wchar_t*)pcli->pfnGetContactDisplayName(mcs.wpcontact[loop], 0), _countof(sztemp) - mir_tstrlen(sztemp));
- if (db_get_b(NULL, S_MOD, "MissedOnes_Count", 0)) {
- mir_sntprintf(szcount, L" [%i]", mcs.times[loop]);
- mir_tstrcat(sztemp, szcount);
- }
+ buf.Append(pcli->pfnGetContactDisplayName(mcs.wpcontact[loop], 0));
+ if (db_get_b(NULL, S_MOD, "MissedOnes_Count", 0))
+ buf.AppendFormat(L" [%i]", mcs.times[loop]);
- mir_tstrcat(sztemp, L"\n");
+ buf.AppendChar('\n');
}
- CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_MISSED), NULL, MissedDlgProc, (LPARAM)sztemp);
+ CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_MISSED), NULL, MissedDlgProc, (LPARAM)buf.c_str());
return 0;
}
diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index 318e336278..4fb56ce9f7 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -41,11 +41,11 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar case WM_REFRESH_UI:
{
- ptrT szout(db_get_tsa(NULL, S_MOD, "UserStamp"));
+ ptrW szout(db_get_tsa(NULL, S_MOD, "UserStamp"));
wchar_t *str = ParseString((szout != NULL) ? szout : DEFAULT_USERSTAMP, wparam);
SetDlgItemText(hdlg, IDC_INFOTEXT, str);
- if (!mir_tstrcmp(str, TranslateT("<unknown>")))
+ if (!mir_wstrcmp(str, TranslateT("<unknown>")))
EnableWindow(GetDlgItem(hdlg, IDC_INFOTEXT), FALSE);
}
break;
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index e820fa97b6..8ff36e51f0 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -161,12 +161,12 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) SYSTEMTIME st;
if (!isSeen(hcontact, &st)) {
- mir_tstrcat(sztemp, TranslateT("<never seen>"));
+ mir_wstrcat(sztemp, TranslateT("<never seen>"));
return sztemp;
}
char *szProto = hcontact ? GetContactProto(hcontact) : courProtoName;
- ptrT info;
+ ptrW info;
wchar_t *d = sztemp;
for (wchar_t *p = szstring; *p; p++) {
@@ -209,7 +209,7 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) }
charPtr = TranslateTS(weekdays[isetting]);
LBL_charPtr:
- d += mir_sntprintf(d, MAXSIZE - (d - sztemp), L"%s", charPtr);
+ d += mir_snwprintf(d, MAXSIZE - (d - sztemp), L"%s", charPtr);
break;
case 'w':
@@ -282,8 +282,8 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "StatusTriger" : courProtoName, 0)) {
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));
+ mir_wstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_wstrlen(szdbsetting));
+ mir_wstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_wstrlen(szdbsetting));
}
charPtr = szdbsetting;
goto LBL_charPtr;
@@ -294,7 +294,7 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) if (db_get_ts(hcontact, "CList", "StatusMsg", &dbv))
goto LBL_noData;
- d += mir_sntprintf(d, MAXSIZE - (d - sztemp), L"%s", dbv.ptszVal);
+ d += mir_snwprintf(d, MAXSIZE - (d - sztemp), L"%s", dbv.ptszVal);
db_free(&dbv);
break;
@@ -302,8 +302,8 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "OldStatus" : courProtoName, 0)) {
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));
+ mir_wstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_wstrlen(szdbsetting));
+ mir_wstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_wstrlen(szdbsetting));
}
charPtr = szdbsetting;
goto LBL_charPtr;
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index cfbbb32b07..ac1082df93 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -94,7 +94,7 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(ICO_MAIN)); { CSend* self = (CSend*)lParam; - wchar_t* tmp = mir_tstrdup(TranslateT("Resulting URL from\n")); + wchar_t* tmp = mir_wstrdup(TranslateT("Resulting URL from\n")); mir_tstradd(tmp, self->m_pszSendTyp); SetDlgItemText(hwndDlg, IDC_HEADERBAR, tmp); mir_free(tmp); @@ -189,7 +189,7 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, EmptyClipboard(); HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE, len*sizeof(wchar_t) + sizeof(wchar_t)); wchar_t* tmp2 = (wchar_t*)GlobalLock(clipbuffer); - mir_tstrncpy(tmp2, tmp, len + 1); tmp2[len] = '\0'; + mir_wstrncpy(tmp2, tmp, len + 1); tmp2[len] = '\0'; GlobalUnlock(clipbuffer); SetClipboardData(CF_UNICODETEXT, clipbuffer); CloseClipboard(); @@ -211,11 +211,11 @@ void CSend::svcSendMsgExit(const char* szMessage) } if (!m_hContact) { if (!m_pszFileDesc) - m_pszFileDesc = mir_a2t(szMessage); + m_pszFileDesc = mir_a2u(szMessage); Exit(CSEND_DIALOG); return; } if (m_ChatRoom) { - wchar_t* tmp = mir_a2t(szMessage); + wchar_t* tmp = mir_a2u(szMessage); if (m_pszFileDesc) { mir_tstradd(tmp, L"\r\n"); mir_tstradd(tmp, m_pszFileDesc); @@ -252,7 +252,7 @@ void CSend::svcSendMsgExit(const char* szMessage) memset(m_szEventMsg, 0, (sizeof(char) * m_cbEventMsg)); mir_strcpy(m_szEventMsg, szMessage); if (m_pszFileDesc && m_pszFileDesc[0] != NULL) { - char *temp = mir_t2a(m_pszFileDesc); + char *temp = mir_u2a(m_pszFileDesc); mir_stradd(m_szEventMsg, "\r\n"); mir_stradd(m_szEventMsg, temp); m_cbEventMsg = (DWORD)mir_strlen(m_szEventMsg) + 1; @@ -286,13 +286,13 @@ void CSend::svcSendFileExit() Exit(ACKRESULT_FAILED); return; } mir_freeAndNil(m_szEventMsg); - char* szFile = mir_t2a(m_pszFile); + char* szFile = mir_u2a(m_pszFile); m_cbEventMsg = (DWORD)mir_strlen(szFile) + 2; m_szEventMsg = (char*)mir_realloc(m_szEventMsg, (sizeof(char) * m_cbEventMsg)); memset(m_szEventMsg, 0, (sizeof(char) * m_cbEventMsg)); mir_strcpy(m_szEventMsg, szFile); if (m_pszFileDesc && m_pszFileDesc[0] != NULL) { - char* temp = mir_t2a(m_pszFileDesc); + char* temp = mir_u2a(m_pszFileDesc); m_cbEventMsg += (DWORD)mir_strlen(temp); m_szEventMsg = (char*)mir_realloc(m_szEventMsg, sizeof(char)*m_cbEventMsg); mir_strcpy(m_szEventMsg + mir_strlen(szFile) + 1, temp); @@ -308,8 +308,8 @@ void CSend::svcSendFileExit() // Start miranda PSS_FILE based on mir ver (T) wchar_t* ppFile[2] = { 0, 0 }; - wchar_t* pDesc = mir_tstrdup(m_pszFileDesc); - ppFile[0] = mir_tstrdup(m_pszFile); + wchar_t* pDesc = mir_wstrdup(m_pszFileDesc); + ppFile[0] = mir_wstrdup(m_pszFile); ppFile[1] = NULL; m_hSend = (HANDLE)ProtoChainSend(m_hContact, PSS_FILE, (WPARAM)pDesc, (LPARAM)ppFile); mir_free(pDesc); @@ -399,14 +399,14 @@ void CSend::Error(LPCTSTR pszFormat, ...) { wchar_t tszMsg[MAX_SECONDLINE]; - mir_sntprintf(tszMsg, L"%s - %s", _A2W(SZ_SENDSS), TranslateT("Error")); - mir_free(m_ErrorTitle), m_ErrorTitle = mir_tstrdup(tszMsg); + mir_snwprintf(tszMsg, L"%s - %s", _A2W(SZ_SENDSS), TranslateT("Error")); + mir_free(m_ErrorTitle), m_ErrorTitle = mir_wstrdup(tszMsg); va_list vl; va_start(vl, pszFormat); - mir_vsntprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl); + mir_vsnwprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl); va_end(vl); - mir_free(m_ErrorMsg), m_ErrorMsg = mir_tstrdup(tszMsg); + mir_free(m_ErrorMsg), m_ErrorMsg = mir_wstrdup(tszMsg); memset(&m_box, 0, sizeof(MSGBOX)); m_box.cbSize = sizeof(MSGBOX); diff --git a/plugins/SendScreenshotPlus/src/CSend.h b/plugins/SendScreenshotPlus/src/CSend.h index 293e34f077..3c5362be3f 100644 --- a/plugins/SendScreenshotPlus/src/CSend.h +++ b/plugins/SendScreenshotPlus/src/CSend.h @@ -56,9 +56,9 @@ class CSend { virtual int Send() = NULL; // returns 1 if sent (you must delete class) and 0 when still sending (class deletes itself) int SendSilent() {m_bAsync=m_bSilent=true; return Send();}; - void SetFile(wchar_t* file){mir_free(m_pszFile), m_pszFile=mir_tstrdup(file);}; - void SetFile(char* file){mir_free(m_pszFile), m_pszFile=mir_a2t(file);}; - void SetDescription(wchar_t* descr){mir_free(m_pszFileDesc), m_pszFileDesc=mir_tstrdup(descr);}; + void SetFile(wchar_t* file){mir_free(m_pszFile), m_pszFile=mir_wstrdup(file);}; + void SetFile(char* file){mir_free(m_pszFile), m_pszFile=mir_a2u(file);}; + void SetDescription(wchar_t* descr){mir_free(m_pszFileDesc), m_pszFileDesc=mir_wstrdup(descr);}; void SetContact(MCONTACT hContact); char* GetURL(){return m_URL;}; char* GetURLthumbnail(){return m_URLthumb;}; diff --git a/plugins/SendScreenshotPlus/src/CSendEmail.cpp b/plugins/SendScreenshotPlus/src/CSendEmail.cpp index dc91c4a867..9b8eb752d3 100644 --- a/plugins/SendScreenshotPlus/src/CSendEmail.cpp +++ b/plugins/SendScreenshotPlus/src/CSendEmail.cpp @@ -61,11 +61,11 @@ int CSendEmail::Send() m_pszFileName = GetFileNameA(m_pszFile); mir_free(m_pszFileA); - m_pszFileA = mir_t2a(m_pszFile); + m_pszFileA = mir_u2a(m_pszFile); - m_Email = mir_t2a(ptrT(Contact_GetInfo(CNF_EMAIL, m_hContact, m_pszProto))); - m_FriendlyName = mir_t2a(ptrT(Contact_GetInfo(CNF_DISPLAY, m_hContact, m_pszProto))); - m_Subject = mir_t2a(m_pszFileDesc); + m_Email = mir_u2a(ptrW(Contact_GetInfo(CNF_EMAIL, m_hContact, m_pszProto))); + m_FriendlyName = mir_u2a(ptrW(Contact_GetInfo(CNF_DISPLAY, m_hContact, m_pszProto))); + m_Subject = mir_u2a(m_pszFileDesc); //SendByEmail(m_pszFileA, "", m_FriendlyName, m_Email, m_Subject); diff --git a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp index 870ae89f82..559efceaae 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp @@ -50,7 +50,7 @@ int CSendHost_ImageShack::Send() return !m_bAsync; } memset(&m_nlhr, 0, sizeof(m_nlhr)); - char* tmp; tmp = mir_t2a(m_pszFile); + char* tmp; tmp = mir_u2a(m_pszFile); HTTPFormData frm[] = { // {"Referer",HTTPFORM_HEADER("http://www.imageshack.us/upload_api.php")}, { "fileupload", HTTPFORM_FILE(tmp) }, @@ -101,10 +101,10 @@ void CSendHost_ImageShack::SendThread() else {/// check error mess from server url = GetHTMLContent(reply->pData, "<error ", "</error>"); wchar_t* err = NULL; - if (url) err = mir_a2t(url); + if (url) err = mir_a2u(url); if (!err || !*err) {/// fallback to server response mess mir_free(err); - err = mir_a2t(reply->pData); + err = mir_a2u(reply->pData); } Error(L"%s", err); mir_free(err); diff --git a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp index a6eb7c6e57..e87cc78e3f 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp @@ -35,7 +35,7 @@ int CSendHost_Imgur::Send() return !m_bAsync; } memset(&m_nlhr, 0, sizeof(m_nlhr)); - char* tmp; tmp = mir_t2a(m_pszFile); + char* tmp; tmp = mir_u2a(m_pszFile); HTTPFormData frm[] = { { "Authorization", HTTPFORM_HEADER("Client-ID 2a7303d78abe041") }, { "image", HTTPFORM_FILE(tmp) }, diff --git a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp index 68232006ce..731bdc08f2 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp @@ -35,7 +35,7 @@ int CSendHost_UploadPie::Send() return !m_bAsync; } memset(&m_nlhr, 0, sizeof(m_nlhr)); - char* tmp; tmp = mir_t2a(m_pszFile); + char* tmp; tmp = mir_u2a(m_pszFile); HTTPFormData frm[] = { { "MAX_FILE_SIZE", HTTPFORM_INT(3145728) },// ?? { "upload", HTTPFORM_INT(1) },// ?? @@ -93,8 +93,8 @@ void CSendHost_UploadPie::SendThread(void* obj) else {/// check error mess from server const char* err = GetHTMLContent(reply->pData, "<p id=\"error\"", "</p>"); wchar_t* werr; - if (err) werr = mir_a2t(err); - else werr = mir_a2t(reply->pData); + if (err) werr = mir_a2u(err); + else werr = mir_a2u(reply->pData); self->Error(L"%s", werr); mir_free(werr); } diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index c2db7bff90..dd1e9f5111 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -75,7 +75,7 @@ wchar_t* GetCustomPath() wchar_t szPath[1024] = { 0 }; FoldersGetCustomPathT(m_hFolderScreenshot, szPath, 1024, pszPath); mir_free(pszPath); - pszPath = mir_tstrdup(szPath); + pszPath = mir_wstrdup(szPath); } if (!pszPath) { MessageBox(NULL, L"Can not retrieve screenshot path.", L"SendSS", MB_OK | MB_ICONERROR | MB_APPLMODAL); @@ -84,7 +84,7 @@ wchar_t* GetCustomPath() int result = CreateDirectoryTreeT(pszPath); if (result) { wchar_t szError[MAX_PATH]; - mir_sntprintf(szError, MAX_PATH, TranslateT("Could not create screenshot folder (error code: %d):\n%s\nDo you have write permissions?"), result, pszPath); + mir_snwprintf(szError, MAX_PATH, TranslateT("Could not create screenshot folder (error code: %d):\n%s\nDo you have write permissions?"), result, pszPath); MessageBox(NULL, szError, L"SendSS", MB_OK | MB_ICONERROR | MB_APPLMODAL); mir_free(pszPath); return 0; @@ -194,7 +194,7 @@ INT_PTR service_Send2ImageShack(WPARAM wParam, LPARAM lParam) result = mir_strdup(cSend->GetURL()); } else { - result = mir_t2a(cSend->GetErrorMsg()); + result = mir_u2a(cSend->GetErrorMsg()); } delete cSend; return (INT_PTR)result; diff --git a/plugins/SendScreenshotPlus/src/UAboutForm.cpp b/plugins/SendScreenshotPlus/src/UAboutForm.cpp index ae216cbbcd..2ef1e9470c 100644 --- a/plugins/SendScreenshotPlus/src/UAboutForm.cpp +++ b/plugins/SendScreenshotPlus/src/UAboutForm.cpp @@ -102,7 +102,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM, LPARAM) char* data = (char*)mir_alloc(size + 1); memcpy(data, LockResource(LoadResource(g_hSendSS, hRes)), size); data[size] = '\0'; - wchar_t* pszCopyright = mir_a2t(data); + wchar_t* pszCopyright = mir_a2u(data); mir_free(data); mir_tstradd(pszText, pszCopyright); mir_free(pszCopyright); @@ -117,7 +117,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM, LPARAM) char* data = (char*)mir_alloc(size + 1); memcpy(data, LockResource(LoadResource(g_hSendSS, hRes)), size); data[size] = '\0'; - wchar_t* pszText = mir_a2t(data); + wchar_t* pszText = mir_a2u(data); mir_free(data); SetDlgItemText(m_hWnd, IDC_CREDIT, pszText); mir_free(pszText); @@ -203,9 +203,9 @@ void TfrmAbout::btnPageClick() } SetWindowText(hCtrl, button); wchar_t newTitle[128]; - wchar_t* pszPlug = mir_a2t(__PLUGIN_NAME); - wchar_t* pszVer = mir_a2t(__VERSION_STRING_DOTS); - mir_sntprintf(newTitle, L"%s - %s\nv%s", pszPlug, title, pszVer); + wchar_t* pszPlug = mir_a2u(__PLUGIN_NAME); + wchar_t* pszVer = mir_a2u(__VERSION_STRING_DOTS); + mir_snwprintf(newTitle, L"%s - %s\nv%s", pszPlug, title, pszVer); mir_free(pszPlug); mir_free(pszVer); SetDlgItemText(m_hWnd, IDC_HEADERBAR, newTitle); diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 765cbfc410..9d7ac40e04 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -175,7 +175,7 @@ void TfrmMain::wmInitdialog(WPARAM, LPARAM) /// Taskbar and Window icon Window_SetIcon_IcoLib(m_hWnd, GetIconHandle(ICO_MAIN)); - wchar_t *pt = mir_tstrdup(pcli->pfnGetContactDisplayName(m_hContact, 0)); + wchar_t *pt = mir_wstrdup(pcli->pfnGetContactDisplayName(m_hContact, 0)); if (pt && (m_hContact != 0)) { CMString string; string.AppendFormat(TranslateT("Send screenshot to %s"), pt); @@ -240,7 +240,7 @@ void TfrmMain::wmInitdialog(WPARAM, LPARAM) if (m_MonitorCount > 1) { wchar_t tszTemp[120]; for (size_t mon = 0; mon < m_MonitorCount; ++mon) { /// @todo : fix format for non MSVC compilers - mir_sntprintf(tszTemp, L"%Iu. %s%s", + mir_snwprintf(tszTemp, L"%Iu. %s%s", mon + 1, TranslateT("Monitor"), (m_Monitors[mon].dwFlags & MONITORINFOF_PRIMARY) ? TranslateT(" (primary)") : L"" ); @@ -783,7 +783,7 @@ void TfrmMain::SaveOptions(void) //--------------------------------------------------------------------------- void TfrmMain::Init(wchar_t* DestFolder, MCONTACT Contact) { - m_FDestFolder = mir_tstrdup(DestFolder); + m_FDestFolder = mir_wstrdup(DestFolder); m_hContact = Contact; // create window @@ -810,7 +810,7 @@ void TfrmMain::btnCaptureClick() return; } fclose(fp); - mir_free(m_pszFile); m_pszFile = mir_tstrdup(filename); + mir_free(m_pszFile); m_pszFile = mir_wstrdup(filename); } else if (!m_hTargetWindow) { wchar_t *err = TranslateT("Select a target window."); @@ -944,8 +944,8 @@ void TfrmMain::edtSizeUpdate(HWND hWnd, BOOL ClientArea, HWND hTarget, UINT Ctrl _itow(rect.right - rect.left, B, 10); // _itow_s(rect.bottom - rect.top, H, 16, 10); _itow(rect.bottom - rect.top, H, 10); - mir_tstrncat(B, L"x", _countof(B) - mir_tstrlen(B)); - mir_tstrncat(B, H, _countof(B) - mir_tstrlen(B)); + mir_wstrncat(B, L"x", _countof(B) - mir_wstrlen(B)); + mir_wstrncat(B, H, _countof(B) - mir_wstrlen(B)); SetDlgItemText(hTarget, Ctrl, B); } @@ -956,8 +956,8 @@ void TfrmMain::edtSizeUpdate(RECT rect, HWND hTarget, UINT Ctrl) _itow(ABS(rect.right - rect.left), B, 10); // _itow_s(ABS(rect.bottom - rect.top), H, 16, 10); _itow(ABS(rect.bottom - rect.top), H, 10); - mir_tstrncat(B, L"x", _countof(B) - mir_tstrlen(B)); - mir_tstrncat(B, H, _countof(B) - mir_tstrlen(B)); + mir_wstrncat(B, L"x", _countof(B) - mir_wstrlen(B)); + mir_wstrncat(B, H, _countof(B) - mir_wstrlen(B)); SetDlgItemText(hTarget, Ctrl, B); } @@ -975,11 +975,11 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) if (FileNumber > 99999) FileNumber = 1; //Generate FileName mir_tstradd(path, m_FDestFolder); - if (path[mir_tstrlen(path) - 1] != '\\') mir_tstradd(path, L"\\"); + if (path[mir_wstrlen(path) - 1] != '\\') mir_tstradd(path, L"\\"); mir_tstradd(path, L"shot%.5u");//on format change, adapt "len" below - size_t len = mir_tstrlen(path) + 2; + size_t len = mir_wstrlen(path) + 2; pszFilename = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len)); - mir_sntprintf(pszFilename, len, path, FileNumber); + mir_snwprintf(pszFilename, len, path, FileNumber); mir_free(path); //Generate a description according to the screenshot @@ -1103,7 +1103,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) //wchar_t* pszFormat = (wchar_t*)ComboBox_GetItemData(hwndCombo, ComboBox_GetCurSel(hwndCombo)); wchar_t pszFormat[6]; ComboBox_GetText(hwndCombo, pszFormat, 6); - if(ret && (mir_tstrcmpi (pszFormat,L"png") != 0)) { + if(ret && (mir_wstrcmpi (pszFormat,L"png") != 0)) { fif = FIP->FI_GetFIFFromFilenameU(ret); dib_new = FIP->FI_LoadU(fif, ret,0); @@ -1130,7 +1130,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) } else { mir_free(pszFileDesc); - m_pszFileDesc = mir_tstrdup(L""); + m_pszFileDesc = mir_wstrdup(L""); } if (m_cSend) { diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp index 260631038f..21b70fc890 100644 --- a/plugins/SendScreenshotPlus/src/Utils.cpp +++ b/plugins/SendScreenshotPlus/src/Utils.cpp @@ -343,15 +343,15 @@ wchar_t* GetFileNameW(const wchar_t* pszPath) const wchar_t* slash = wcsrchr(pszPath, '\\'); if (!slash) slash = wcsrchr(pszPath, '/'); if (slash) - return mir_t2u(slash + 1); + return mir_wstrdup(slash + 1); else - return mir_t2u(pszPath); + return mir_wstrdup(pszPath); } wchar_t* GetFileExtW(const wchar_t* pszPath) { const wchar_t* slash = wcsrchr(pszPath, '.'); if (slash) - return mir_t2u(slash); + return mir_wstrdup(slash); return NULL; } @@ -360,15 +360,15 @@ char* GetFileNameA(const wchar_t* pszPath) const wchar_t* slash = wcsrchr(pszPath, '\\'); if (!slash) slash = wcsrchr(pszPath, '/'); if (slash) - return mir_t2a(slash + 1); + return mir_u2a(slash + 1); else - return mir_t2a(pszPath); + return mir_u2a(pszPath); } char* GetFileExtA(const wchar_t* pszPath) { const wchar_t* slash = wcsrchr(pszPath, '.'); if (slash) - return mir_t2a(slash); + return mir_u2a(slash); return NULL; } @@ -406,7 +406,7 @@ void SaveGIF(HBITMAP hBmp, wchar_t* szFilename) // Get the CLSID of the GIF encoder. CLSID clsidEncoder; if (GetEncoderClsid(L"image/gif", clsidEncoder)) { - LPWSTR pswFile = mir_t2u(szFilename); + LPWSTR pswFile = mir_wstrdup(szFilename); pBitmap->Save((const WCHAR*)pswFile, &clsidEncoder, NULL); mir_free(pswFile); } @@ -445,7 +445,7 @@ void SaveTIF(HBITMAP hBmp, wchar_t* szFilename) EncParams->Parameter[1].NumberOfValues = 1; EncParams->Parameter[1].Value = &ulColorDepth; - LPWSTR pswFile = mir_t2u(szFilename); + LPWSTR pswFile = mir_wstrdup(szFilename); stat = pBitmap->Save((const WCHAR*)pswFile, &EncCLSID, EncParams); mir_free(pswFile); free(EncParams); diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp index 975be30b92..95b567af0f 100644 --- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp @@ -507,8 +507,8 @@ static INT_PTR CALLBACK MsgBoxPop(HWND hDlg, UINT uMsg, WPARAM, LPARAM lParam) pd.lchContact = NULL; //(HANDLE)wParam; // icon pd.lchIcon = MsgLoadIcon(pMsgBox); - mir_tstrncpy(pd.lptzContactName, pMsgBox->ptszTitle, _countof(pd.lptzContactName)); - mir_tstrncpy(pd.lptzText, pMsgBox->ptszMsg, _countof(pd.lptzText)); + mir_wstrncpy(pd.lptzContactName, pMsgBox->ptszTitle, _countof(pd.lptzContactName)); + mir_wstrncpy(pd.lptzText, pMsgBox->ptszMsg, _countof(pd.lptzText)); // CALLBAC Proc pd.PluginWindowProc = PopupProc; @@ -677,7 +677,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI va_list vl; va_start(vl, pszFormat); - mir_vsntprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl); + mir_vsnwprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl); va_end(vl); MSGBOX mb = { 0 }; @@ -700,11 +700,11 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...) { wchar_t tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE]; - mir_sntprintf(tszTitle, L"%s - %s", _A2W(MODNAME), TranslateT("Error")); + mir_snwprintf(tszTitle, L"%s - %s", _A2W(MODNAME), TranslateT("Error")); va_list vl; va_start(vl, pszFormat); - mir_vsntprintf(tszMsg, TranslateTS(pszFormat), vl); + mir_vsnwprintf(tszMsg, TranslateTS(pszFormat), vl); va_end(vl); MSGBOX mb = { 0 }; diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 7a88a5816f..6c11fafe4f 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -459,7 +459,7 @@ INT_PTR OpenSessionsManagerWindow(WPARAM, LPARAM) return 0;
}
- ptrT
+ ptrW
tszSession(db_get_tsa(NULL, MODNAME, "SessionDate_0")),
tszUserSession(db_get_tsa(NULL, MODNAME, "UserSessionDsc_0"));
if (g_bIncompletedSave || tszSession || tszUserSession) {
@@ -485,7 +485,7 @@ int SaveSessionDate() GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szDateBuf, DateSize);
int lenn = (DateSize + TimeSize + 5);
wchar_t *szSessionTime = (wchar_t*)mir_alloc(lenn*sizeof(wchar_t));
- mir_sntprintf(szSessionTime, lenn, L"%s - %s", szTimeBuf, szDateBuf);
+ mir_snwprintf(szSessionTime, lenn, L"%s - %s", szTimeBuf, szDateBuf);
char szSetting[256];
mir_snprintf(szSetting, "%s_%d", "SessionDate", 0);
@@ -607,7 +607,7 @@ int DelUserDefSession(int ses_count) for (int i = ses_count + 1;; i++) {
mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", i);
- ptrT szSessionNameBuf(db_get_tsa(NULL, MODNAME, szSessionName));
+ ptrW szSessionNameBuf(db_get_tsa(NULL, MODNAME, szSessionName));
mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", i - 1);
if (szSessionNameBuf) {
@@ -640,7 +640,7 @@ int DeleteAutoSession(int ses_count) for (int i = ses_count + 1;; i++) {
mir_snprintf(szSessionName, "%s_%u", "SessionDate", i);
- ptrT szSessionNameBuf(db_get_tsa(NULL, MODNAME, szSessionName));
+ ptrW szSessionNameBuf(db_get_tsa(NULL, MODNAME, szSessionName));
mir_snprintf(szSessionName, "%s_%u", "SessionDate", i - 1);
if (szSessionNameBuf)
diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index e052f2fda7..9fe7d6aee2 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -30,7 +30,7 @@ static void InitControls(HWND hwndDlg) int comReg = IsCOMRegistered();
wchar_t szBuf[MAX_PATH];
- mir_sntprintf(szBuf, L"%s (%s)",
+ mir_snwprintf(szBuf, L"%s (%s)",
TranslateTS(COM_OKSTR[(comReg & COMREG_OK) != 0]),
TranslateTS(COM_APPROVEDSTR[(comReg & COMREG_APPROVED) != 0]));
SetDlgItemText(hwndDlg, IDC_STATUS, szBuf);
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index f711fb1512..e984015fe7 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -301,7 +301,7 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode) // create an IPC slot for each contact and store display name, etc
for (i = 0; i < dwContacts; i++) {
- ptrA szContact(mir_t2a(pcli->pfnGetContactDisplayName(pContacts[i].hContact, 0)));
+ ptrA szContact(mir_u2a(pcli->pfnGetContactDisplayName(pContacts[i].hContact, 0)));
if (szContact != NULL) {
ptrA szGroup;
if (bGroupMode)
@@ -552,7 +552,7 @@ void CheckUnregisterServer() // launches regsvr to remove the dll under admin.
wchar_t szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
GetModuleFileName(hInst, szFileName, _countof(szFileName));
- mir_sntprintf(szBuf, L"/s /u \"%s\"", szFileName);
+ mir_snwprintf(szBuf, L"/s /u \"%s\"", szFileName);
SHELLEXECUTEINFO sei = { sizeof(sei) };
sei.lpVerb = L"runas";
@@ -581,7 +581,7 @@ void CheckRegisterServer() TranslateT("Miranda NG - Shell context menus (shellext.dll)"), MB_OK | MB_ICONINFORMATION);
// /s = silent
GetModuleFileName(hInst, szFileName, _countof(szFileName));
- mir_sntprintf(szBuf, L"/s \"%s\"", szFileName);
+ mir_snwprintf(szBuf, L"/s \"%s\"", szFileName);
SHELLEXECUTEINFO sei = { sizeof(sei) };
sei.lpVerb = L"runas";
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 451539ba83..a9b9200fd3 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -196,18 +196,18 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) return FALSE;
}
- msgLen += mir_tstrlen(ptszVal);
+ msgLen += mir_wstrlen(ptszVal);
wchar_t *ptszHead = db_get_tsa(NULL, protocolname, KEY_HEADING);
if (ptszHead != NULL) {
ptszTemp = ptszHead;
ptszTemp.Replace(L"%user%", ptszNick);
- msgLen += mir_tstrlen(ptszTemp);
+ msgLen += mir_wstrlen(ptszTemp);
mir_free(ptszHead);
}
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);
+ mir_snwprintf(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);
}
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index dc3896efa3..177282ccad 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -41,9 +41,9 @@ static wchar_t *StrNormNewline(wchar_t *tszStr) nCR++;
if (!nCR)
- return mir_tstrdup(tszStr);
+ return mir_wstrdup(tszStr);
- wchar_t *tszNewStr = (wchar_t *)mir_alloc((mir_tstrlen(tszStr) + nCR + 1) * sizeof(wchar_t)), *ptszStr = tszNewStr;
+ wchar_t *tszNewStr = (wchar_t *)mir_alloc((mir_wstrlen(tszStr) + nCR + 1) * sizeof(wchar_t)), *ptszStr = tszNewStr;
while (*tszStr) {
if (*tszStr == 0x0A)
*ptszStr++ = 0x0D;
@@ -86,14 +86,14 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP wchar_t *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, format, status, contactName);
+ mir_snwprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
if (dat->hSeq) {
GetDlgItemText(hwndDlg, IDC_RETRIEVING, format, _countof(format));
- mir_sntprintf(str, format, status);
+ mir_snwprintf(str, format, status);
}
else {
- mir_sntprintf(str, TranslateT("Failed to retrieve %s message."), status);
+ mir_snwprintf(str, TranslateT("Failed to retrieve %s message."), status);
SetDlgItemText(hwndDlg, IDOK, TranslateT("&Close"));
}
SetDlgItemText(hwndDlg, IDC_RETRIEVING, str);
@@ -205,7 +205,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
wchar_t str[256], format[128];
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, format, contactName);
+ mir_snwprintf(str, format, contactName);
SetWindowText(hwndDlg, str);
if (!dat->hSeq)
DestroyWindow(hwndDlg);
@@ -237,7 +237,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP wchar_t *tszMsg = StrNormNewline((wchar_t *)ack->lParam);
wcsncpy_s(msg, tszMsg, _TRUNCATE);
mir_free(tszMsg);
- size_t len = mir_tstrlen(msg);
+ size_t len = mir_wstrlen(msg);
if (len) {
LPTSTR lptstrCopy;
HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t));
@@ -344,17 +344,17 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
HICON hIcon = Skin_LoadProtoIcon(szProto, iStatus);
- mir_sntprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_snwprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hAwayMsgMenuItem, str, hIcon, 0);
IcoLib_ReleaseIcon(hIcon);
ptrA szMsg(db_get_sa(hContact, "CList", "StatusMsg"));
if (szMsg != NULL) {
- mir_sntprintf(str, TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_snwprintf(str, TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hCopyMsgMenuItem, str);
if (StrFindURL(szMsg) != NULL) {
- mir_sntprintf(str, TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_snwprintf(str, TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hGoToURLMenuItem, str);
}
}
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 942eaa19a5..13893bcc83 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -122,7 +122,7 @@ static wchar_t *GetWinampSong(void) if (pstr < szTitle + (iTitleLen / 2))
{
- memmove(szTitle, pstr + 9, mir_tstrlen(pstr + 9) * sizeof(wchar_t));
+ memmove(szTitle, pstr + 9, mir_wstrlen(pstr + 9) * sizeof(wchar_t));
pstr = wcsstr(pstr + 1, L" - Winamp");
if (pstr == NULL)
{
@@ -140,7 +140,7 @@ static wchar_t *GetWinampSong(void) }
pstr += 2;
- res = mir_tstrdup(pstr);
+ res = mir_wstrdup(pstr);
mir_free(szTitle);
return res;
@@ -149,7 +149,7 @@ static wchar_t *GetWinampSong(void) wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
{
int i, count = 0, len;
- wchar_t substituteStr[1024], *msg = mir_tstrdup(in);
+ wchar_t substituteStr[1024], *msg = mir_wstrdup(in);
for (i = 0; msg[i]; i++)
{
@@ -163,7 +163,7 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) if (i + 2 <= 1024 && msg[i + 2])
{
count++;
- memmove(p, p + 1, (mir_tstrlen(p) - 1) * sizeof(wchar_t));
+ memmove(p, p + 1, (mir_wstrlen(p) - 1) * sizeof(wchar_t));
}
else
{
@@ -184,21 +184,21 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) if (ptszWinampTitle != NULL)
{
mir_free(g_ptszWinampSong);
- g_ptszWinampSong = mir_tstrdup(ptszWinampTitle);
+ g_ptszWinampSong = mir_wstrdup(ptszWinampTitle);
}
- else if (g_ptszWinampSong && mir_tstrcmp(g_ptszWinampSong, L"SimpleStatusMsg")
+ else if (g_ptszWinampSong && mir_wstrcmp(g_ptszWinampSong, L"SimpleStatusMsg")
&& db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
{
- ptszWinampTitle = mir_tstrdup(g_ptszWinampSong);
+ ptszWinampTitle = mir_wstrdup(g_ptszWinampSong);
}
else
continue;
- if (mir_tstrlen(ptszWinampTitle) > 12)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(ptszWinampTitle) - 12) * sizeof(wchar_t));
+ if (mir_wstrlen(ptszWinampTitle) > 12)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(ptszWinampTitle) - 12) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(ptszWinampTitle), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(wchar_t));
- memcpy(msg + i, ptszWinampTitle, mir_tstrlen(ptszWinampTitle) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(ptszWinampTitle), msg + i + 12, (mir_wstrlen(msg) - i - 11) * sizeof(wchar_t));
+ memcpy(msg + i, ptszWinampTitle, mir_wstrlen(ptszWinampTitle) * sizeof(wchar_t));
mir_free(ptszWinampTitle);
}
@@ -229,28 +229,28 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) }
else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, substituteStr, _countof(substituteStr));
- if (mir_tstrlen(substituteStr) > 6)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(wchar_t));
+ if (mir_wstrlen(substituteStr) > 6)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(substituteStr) - 6) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(wchar_t));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(substituteStr), msg + i + 6, (mir_wstrlen(msg) - i - 5) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
else if (!wcsnicmp(msg + i, L"%date%", 6))
{
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, _countof(substituteStr));
- if (mir_tstrlen(substituteStr) > 6)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(wchar_t));
+ if (mir_wstrlen(substituteStr) > 6)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(substituteStr) - 6) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(wchar_t));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(substituteStr), msg + i + 6, (mir_wstrlen(msg) - i - 5) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
else if (!wcsnicmp(msg+i, L"%rand(", 6))
{
wchar_t *temp, *token;
int ran_from, ran_to, k;
- temp = mir_tstrdup(msg + i + 6);
+ temp = mir_wstrdup(msg + i + 6);
token = wcstok(temp, L",)");
ran_from = _wtoi(token);
token = wcstok(NULL, L",)%%");
@@ -258,14 +258,14 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) if (ran_to > ran_from)
{
- mir_sntprintf(substituteStr, L"%d", GetRandom(ran_from, ran_to));
+ mir_snwprintf(substituteStr, L"%d", GetRandom(ran_from, ran_to));
for (k = i + 1; msg[k]; k++) if (msg[k] == '%') { k++; break; }
- if (mir_tstrlen(substituteStr) > k - i)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - (k - i)) * sizeof(wchar_t));
+ if (mir_wstrlen(substituteStr) > k - i)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(substituteStr) - (k - i)) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + (k - i), (mir_tstrlen(msg) - i - (k - i - 1)) * sizeof(wchar_t));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(substituteStr), msg + i + (k - i), (mir_wstrlen(msg) - i - (k - i - 1)) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
mir_free(temp);
}
@@ -293,10 +293,10 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) if (tszStatusMsg == NULL)
continue;
- mir_tstrcpy(substituteStr, tszStatusMsg);
+ mir_wstrcpy(substituteStr, tszStatusMsg);
mir_free(tszStatusMsg);
- if (!mir_tstrlen(substituteStr))
+ if (!mir_wstrlen(substituteStr))
continue;
if (wcsstr(substituteStr, L"%randmsg%") != NULL || wcsstr(substituteStr, L"%randdefmsg%") != NULL)
@@ -306,13 +306,13 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) else rmark[0] = TRUE;
}
- if (k2 == maxk || k2 > maxk) mir_tstrcpy(substituteStr, L"");
+ if (k2 == maxk || k2 > maxk) mir_wstrcpy(substituteStr, L"");
- if (mir_tstrlen(substituteStr) > 9)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 9) * sizeof(wchar_t));
+ if (mir_wstrlen(substituteStr) > 9)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(substituteStr) - 9) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 9, (mir_tstrlen(msg) - i - 8) * sizeof(wchar_t));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(substituteStr), msg + i + 9, (mir_wstrlen(msg) - i - 8) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
else if (!wcsnicmp(msg+i, L"%randdefmsg%", 12))
{
@@ -338,10 +338,10 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) if (tszStatusMsg == NULL)
continue;
- mir_tstrcpy(substituteStr, tszStatusMsg);
+ mir_wstrcpy(substituteStr, tszStatusMsg);
mir_free(tszStatusMsg);
- if (!mir_tstrlen(substituteStr))
+ if (!mir_wstrlen(substituteStr))
continue;
if (wcsstr(substituteStr, L"%randmsg%") != NULL || wcsstr(substituteStr, L"%randdefmsg%") != NULL)
@@ -351,24 +351,24 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) else rmark[0] = TRUE;
}
- if (k2 == maxk || k2 > maxk) mir_tstrcpy(substituteStr, L"");
+ if (k2 == maxk || k2 > maxk) mir_wstrcpy(substituteStr, L"");
- if (mir_tstrlen(substituteStr) > 12)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg)+1+mir_tstrlen(substituteStr)-12) * sizeof(wchar_t));
+ if (mir_wstrlen(substituteStr) > 12)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg)+1+mir_wstrlen(substituteStr)-12) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(wchar_t));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(substituteStr), msg + i + 12, (mir_wstrlen(msg) - i - 11) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
}
- if (count) msg[mir_tstrlen(msg) - count] = 0;
+ if (count) msg[mir_wstrlen(msg) - count] = 0;
if (szProto)
{
char szSetting[80];
mir_snprintf(szSetting, "Proto%sMaxLen", szProto);
len = db_get_w(NULL, "SimpleStatusMsg", szSetting, 1024);
- if (len < mir_tstrlen(msg))
+ if (len < mir_wstrlen(msg))
{
msg = (wchar_t *)mir_realloc(msg, len * sizeof(wchar_t));
msg[len] = 0;
@@ -404,7 +404,7 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto) if (flags & STATUS_EMPTY_MSG)
{
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
else if (flags & STATUS_LAST_STATUS_MSG)
{
@@ -424,7 +424,7 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto) char *szLastMsg = db_get_sa(NULL, "SimpleStatusMsg", szSetting);
if (szLastMsg == NULL)
- return NULL; //mir_tstrdup(L"");
+ return NULL; //mir_wstrdup(L"");
format = db_get_tsa(NULL, "SimpleStatusMsg", szLastMsg);
mir_free(szLastMsg);
@@ -438,17 +438,17 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto) format = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting));
if (format == NULL)
- format = mir_tstrdup(L"");
+ format = mir_wstrdup(L"");
}
else
- format = mir_tstrdup(GetDefaultMessage(iStatus));
+ format = mir_wstrdup(GetDefaultMessage(iStatus));
return format;
}
void DBWriteMessage(char *szSetting, wchar_t *tszMsg)
{
- if (tszMsg && mir_tstrlen(tszMsg))
+ if (tszMsg && mir_wstrlen(tszMsg))
db_set_ts(NULL, "SimpleStatusMsg", szSetting, tszMsg);
else
db_unset(NULL, "SimpleStatusMsg", szSetting);
@@ -527,7 +527,7 @@ static wchar_t *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVar //if (flags & PROTO_NO_MSG)
//{
- // format = mir_tstrdup(L"");
+ // format = mir_wstrdup(L"");
//}
//else
if (flags & PROTO_THIS_MSG)
@@ -535,7 +535,7 @@ static wchar_t *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVar mir_snprintf(szSetting, "Proto%sDefault", szProto);
format = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (format == NULL)
- format = mir_tstrdup(L"");
+ format = mir_wstrdup(L"");
}
else if (flags & PROTO_NOCHANGE && szProto)
{
@@ -1306,7 +1306,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) mir_snprintf(szBuffer, "Cur%sMsg", accounts->pa[i]->szModuleName);
tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szBuffer);
- if ((tszMsg && tszStatusMsg && !mir_tstrcmp(tszMsg, tszStatusMsg)) || (!tszMsg && !tszStatusMsg))
+ if ((tszMsg && tszStatusMsg && !mir_wstrcmp(tszMsg, tszStatusMsg)) || (!tszMsg && !tszStatusMsg))
{
mir_free(tszStatusMsg);
mir_free(tszMsg);
@@ -1315,7 +1315,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) else
mir_free(tszStatusMsg);
- if (tszMsg && mir_tstrlen(tszMsg))
+ if (tszMsg && mir_wstrlen(tszMsg))
{
#ifdef _DEBUG
log2file("UpdateMsgTimerProc(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iCurrentStatus, ""), tszMsg, accounts->pa[i]->szModuleName);
@@ -1419,7 +1419,7 @@ static int ChangeStatusMsgPrebuild(WPARAM, LPARAM) if (Proto_IsAccountLocked(pa[i]))
{
wchar_t szBuffer[256];
- mir_sntprintf(szBuffer, TranslateT("%s (locked)"), pa[i]->tszAccountName);
+ mir_snwprintf(szBuffer, TranslateT("%s (locked)"), pa[i]->tszAccountName);
mi.root = Menu_CreateRoot(MO_STATUS, szBuffer, mi.position);
}
else mi.root = Menu_CreateRoot(MO_STATUS, pa[i]->tszAccountName, mi.position);
@@ -1520,7 +1520,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM) char buff[80];
bool found = false;
- wchar_t *szMsgW = mir_t2u(ps[i]->szMsg);
+ wchar_t *szMsgW = mir_wstrdup(ps[i]->szMsg);
#ifdef _DEBUG
@@ -1533,7 +1533,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM) wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg != NULL)
{
- if (!mir_tstrcmp(tszStatusMsg, szMsgW))
+ if (!mir_wstrcmp(tszStatusMsg, szMsgW))
{
found = true;
mir_snprintf(szSetting, "Last%sMsg", ps[i]->szName);
@@ -1578,10 +1578,10 @@ static wchar_t *ParseWinampSong(ARGUMENTSINFO *ai) if (ptszWinampTitle != NULL) {
mir_free(g_ptszWinampSong);
- g_ptszWinampSong = mir_tstrdup(ptszWinampTitle);
+ g_ptszWinampSong = mir_wstrdup(ptszWinampTitle);
}
- else if (g_ptszWinampSong && mir_tstrcmp(g_ptszWinampSong, L"SimpleStatusMsg") && db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
- ptszWinampTitle = mir_tstrdup(g_ptszWinampSong);
+ else if (g_ptszWinampSong && mir_wstrcmp(g_ptszWinampSong, L"SimpleStatusMsg") && db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
+ ptszWinampTitle = mir_wstrdup(g_ptszWinampSong);
return ptszWinampTitle;
}
@@ -1595,7 +1595,7 @@ static wchar_t *ParseDate(ARGUMENTSINFO *ai) ai->flags |= AIF_DONTPARSE;
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szStr, _countof(szStr));
- return mir_tstrdup(szStr);
+ return mir_wstrdup(szStr);
}
int ICQMsgTypeToStatus(int iMsgType)
@@ -1720,7 +1720,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) g_ptszWinampSong = db_get_tsa(NULL, "SimpleStatusMsg", "AmpLastTitle");
if (g_ptszWinampSong == NULL)
- g_ptszWinampSong = mir_tstrdup(L"SimpleStatusMsg");
+ g_ptszWinampSong = mir_wstrdup(L"SimpleStatusMsg");
if (db_get_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1))
g_uUpdateMsgTimer = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10) * 1000, UpdateMsgTimerProc);
@@ -1769,7 +1769,7 @@ static int OnOkToExit(WPARAM, LPARAM) db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)CallProtoService(accounts->pa[i]->szModuleName, PS_GETSTATUS, 0, 0));
}
- if (g_ptszWinampSong && mir_tstrcmp(g_ptszWinampSong, L"SimpleStatusMsg") /*&& db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1)*/)
+ if (g_ptszWinampSong && mir_wstrcmp(g_ptszWinampSong, L"SimpleStatusMsg") /*&& db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1)*/)
DBWriteMessage("AmpLastTitle", g_ptszWinampSong);
}
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index 6162d10dbe..20bc2a0347 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -274,12 +274,12 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) else if (data->m_iDlgFlags & DLG_SHOW_BUTTONS_INLIST) { if (found) { if (data->m_iDlgFlags & DLG_SHOW_LIST_ICONS) { - mir_sntprintf(text, TranslateT("Clear history")); + mir_snwprintf(text, TranslateT("Clear history")); cbei.iImage = I_ICON_CLEAR; cbei.iSelectedImage = I_ICON_CLEAR; } else { - mir_sntprintf(text, L"## %s ##", TranslateT("Clear history")); + mir_snwprintf(text, L"## %s ##", TranslateT("Clear history")); cbei.iIndent = 1; } cbei.iItem = -1; @@ -291,12 +291,12 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) cbei.iItem = -1; if (data->m_iDlgFlags & DLG_SHOW_LIST_ICONS) { - mir_sntprintf(text, TranslateT("Add to predefined")); + mir_snwprintf(text, TranslateT("Add to predefined")); cbei.iImage = I_ICON_ADD; cbei.iSelectedImage = I_ICON_ADD; } else { - mir_sntprintf(text, L"## %s ##", TranslateT("Add to predefined")); + mir_snwprintf(text, L"## %s ##", TranslateT("Add to predefined")); cbei.iIndent = 1; } cbei.pszText = (LPTSTR)text; @@ -305,13 +305,13 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) SendMessage(handle, CBEM_INSERTITEM, 0, (LPARAM)&cbei); if (data->m_iDlgFlags & DLG_SHOW_LIST_ICONS) { - mir_sntprintf(text, TranslateT("Delete selected")); + mir_snwprintf(text, TranslateT("Delete selected")); cbei.iImage = I_ICON_DEL; cbei.iSelectedImage = I_ICON_DEL; } else { cbei.iIndent = 1; - mir_sntprintf(text, L"## %s ##", TranslateT("Delete selected")); + mir_snwprintf(text, L"## %s ##", TranslateT("Delete selected")); } cbei.iItem = -1; cbei.pszText = (LPTSTR)text; @@ -468,7 +468,7 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control) wchar_t item_string[128]; GetMenuString(hmenu, m_selection, (LPTSTR)&item_string, 128, MF_BYCOMMAND); - int len = (int)mir_tstrlen(item_string); + int len = (int)mir_wstrlen(item_string); if (len) { LPTSTR lptstrCopy; HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t)); @@ -609,7 +609,7 @@ int AddToPredefined(HWND hwndDlg, struct MsgBoxData *data) newitem.pszText = text; SendMessage(data->recent_cbex, CBEM_GETITEM, 0, (LPARAM)&newitem); - if (LOWORD(newitem.lParam) == PREDEFINED_MSG && !mir_tstrcmp(text, msg)) + if (LOWORD(newitem.lParam) == PREDEFINED_MSG && !mir_wstrcmp(text, msg)) return num_items; } @@ -692,7 +692,7 @@ void DisplayCharsCount(struct MsgBoxData *dlg_data, HWND hwndDlg) lines++; } } - mir_sntprintf(status_text, TranslateT("OK (%d)"), len - (lines - 1)); + mir_snwprintf(status_text, TranslateT("OK (%d)"), len - (lines - 1)); SetDlgItemText(hwndDlg, IDC_OK, status_text); } @@ -779,12 +779,12 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) wchar_t szTitle[256], szProtoName[128]; BOOL bDisabled = msgbox_data->m_szProto && !(CallProtoService(msgbox_data->m_szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND); - mir_sntprintf(szProtoName, msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); + mir_snwprintf(szProtoName, msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); if (iStatus == ID_STATUS_CURRENT) { if (msgbox_data->m_bOnStartup) - mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<startup>"), szProtoName); + mir_snwprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<startup>"), szProtoName); else - mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<current>"), szProtoName); + mir_snwprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<current>"), szProtoName); } else if (iStatus > ID_STATUS_CURRENT) { wchar_t buff[128]; @@ -793,10 +793,10 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) CallService(MS_SS_GETPROFILENAME, iStatus - 40083, (LPARAM)buff1); MultiByteToWideChar(Langpack_GetDefaultCodePage(), 0, buff1, -1, buff, 128); - mir_sntprintf(szTitle, TranslateT("%s message (%s)"), buff, szProtoName); + mir_snwprintf(szTitle, TranslateT("%s message (%s)"), buff, szProtoName); } else - mir_sntprintf(szTitle, TranslateT("%s message (%s)"), pcli->pfnGetStatusModeDescription(iStatus, 0), szProtoName); + mir_snwprintf(szTitle, TranslateT("%s message (%s)"), pcli->pfnGetStatusModeDescription(iStatus, 0), szProtoName); SetWindowText(hwndDlg, szTitle); if (iStatus == ID_STATUS_CURRENT) @@ -904,16 +904,16 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA TranslateDialogDefault(hwndDlg); init_data = (struct MsgBoxInitData *)lParam; GetWindowText(hwndDlg, szFormat, _countof(szFormat)); - mir_sntprintf(szProtoName, init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global")); + mir_snwprintf(szProtoName, init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global")); if (init_data->m_iStatus == ID_STATUS_CURRENT) { if (init_data->m_bOnStartup) - mir_sntprintf(szTitle, szFormat, TranslateT("<startup>"), szProtoName); + mir_snwprintf(szTitle, szFormat, TranslateT("<startup>"), szProtoName); else - mir_sntprintf(szTitle, szFormat, TranslateT("<current>"), szProtoName); + mir_snwprintf(szTitle, szFormat, TranslateT("<current>"), szProtoName); } else - mir_sntprintf(szTitle, szFormat, pcli->pfnGetStatusModeDescription(init_data->m_iStatus, 0), szProtoName); + mir_snwprintf(szTitle, szFormat, pcli->pfnGetStatusModeDescription(init_data->m_iStatus, 0), szProtoName); SetWindowText(hwndDlg, szTitle); int icoStatus = ID_STATUS_OFFLINE; @@ -1097,7 +1097,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA } else { wchar_t str[64]; - mir_sntprintf(str, TranslateT("Closing in %d"), msgbox_data->m_iCountdown); + mir_snwprintf(str, TranslateT("Closing in %d"), msgbox_data->m_iCountdown); SetDlgItemText(hwndDlg, IDC_OK, str); } msgbox_data->m_iCountdown--; @@ -1174,7 +1174,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA mir_snprintf(buff, "SMsg%d", i); wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff); if (tszStatusMsg != NULL) { - if (!mir_tstrcmp(tszStatusMsg, tszMsg)) { + if (!mir_wstrcmp(tszStatusMsg, tszMsg)) { found = true; if (msgbox_data->m_szProto) { mir_snprintf(buff2, "Last%sMsg", msgbox_data->m_szProto); diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index e7695ca304..ebed7ada43 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -138,8 +138,8 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, "Flags"), STATUS_DEFAULT);
data->status_msg[0].flags[i - ID_STATUS_ONLINE] = val;
- ptrT text( db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, "Default")));
- mir_tstrncpy(data->status_msg[0].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
+ ptrW text( db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, "Default")));
+ mir_wstrncpy(data->status_msg[0].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
for (j = 0; j < accounts->count; j++)
{
@@ -151,7 +151,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l data->status_msg[j+1].flags[i-ID_STATUS_ONLINE] = val;
mir_snprintf(setting, "%sDefault", accounts->pa[j]->szModuleName);
text = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, setting));
- mir_tstrncpy(data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
+ mir_wstrncpy(data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
}
}
}
@@ -452,9 +452,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (szSetting)
{
wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
- if (tszStatusMsg && mir_tstrlen(tszStatusMsg))
+ if (tszStatusMsg && mir_wstrlen(tszStatusMsg))
{
- if (tszStatusMsg && mir_tstrlen(tszStatusMsg))
+ if (tszStatusMsg && mir_wstrlen(tszStatusMsg))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
mir_free(tszStatusMsg);
@@ -870,11 +870,11 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (len > 0)
{
if (data->proto_msg[j].msg == NULL)
- data->proto_msg[j].msg = mir_tstrdup(msg);
+ data->proto_msg[j].msg = mir_wstrdup(msg);
else
{
mir_free(data->proto_msg[j].msg);
- data->proto_msg[j].msg = mir_tstrdup(msg);
+ data->proto_msg[j].msg = mir_wstrdup(msg);
}
}
else
@@ -889,7 +889,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l else
{
GetDlgItemText(hwndDlg, IDC_OPTEDIT1, msg, _countof(msg));
- mir_tstrcpy(data->status_msg[j].msg[i], msg);
+ mir_wstrcpy(data->status_msg[j].msg[i], msg);
}
}
break;
@@ -911,7 +911,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l {
data->status_msg[0].flags[i-ID_STATUS_ONLINE] = data->status_msg[j].flags[i-ID_STATUS_ONLINE];
if (data->status_msg[j].flags[i-ID_STATUS_ONLINE] & STATUS_THIS_MSG)
- mir_tstrcpy(data->status_msg[0].msg[i-ID_STATUS_ONLINE], data->status_msg[j].msg[i-ID_STATUS_ONLINE]);
+ mir_wstrcpy(data->status_msg[0].msg[i-ID_STATUS_ONLINE], data->status_msg[j].msg[i-ID_STATUS_ONLINE]);
}
}
}
@@ -929,15 +929,15 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (data->proto_msg[j].flags & PROTO_THIS_MSG)
{
- size_t len = mir_tstrlen(data->proto_msg[j].msg);
+ size_t len = mir_wstrlen(data->proto_msg[j].msg);
if (len > 0)
{
if (data->proto_msg[k+1].msg == NULL)
- data->proto_msg[k+1].msg = mir_tstrdup(data->proto_msg[j].msg);
+ data->proto_msg[k+1].msg = mir_wstrdup(data->proto_msg[j].msg);
else
{
mir_free(data->proto_msg[k+1].msg);
- data->proto_msg[k+1].msg = mir_tstrdup(data->proto_msg[j].msg);
+ data->proto_msg[k+1].msg = mir_wstrdup(data->proto_msg[j].msg);
}
}
else
@@ -957,7 +957,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l {
data->status_msg[k + 1].flags[i - ID_STATUS_ONLINE] = data->status_msg[j].flags[i - ID_STATUS_ONLINE];
if (data->status_msg[j].flags[i - ID_STATUS_ONLINE] & STATUS_THIS_MSG)
- mir_tstrcpy(data->status_msg[k + 1].msg[i - ID_STATUS_ONLINE], data->status_msg[j].msg[i - ID_STATUS_ONLINE]);
+ mir_wstrcpy(data->status_msg[k + 1].msg[i - ID_STATUS_ONLINE], data->status_msg[j].msg[i - ID_STATUS_ONLINE]);
}
}
}
@@ -983,7 +983,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l {
data->status_msg[j].flags[k - ID_STATUS_ONLINE] = data->status_msg[j].flags[i];
if (data->status_msg[j].flags[i] & STATUS_THIS_MSG)
- mir_tstrcpy(data->status_msg[j].msg[k - ID_STATUS_ONLINE], data->status_msg[j].msg[i]);
+ mir_wstrcpy(data->status_msg[j].msg[k - ID_STATUS_ONLINE], data->status_msg[j].msg[i]);
}
}
break;
@@ -1235,7 +1235,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w if (!ServiceExists(MS_SS_GETPROFILECOUNT)) {
wchar_t szText[100];
- mir_sntprintf(szText, L"%s *", TranslateT("Show status profiles in status list"));
+ mir_snwprintf(szText, L"%s *", TranslateT("Show status profiles in status list"));
SetDlgItemText(hwndDlg, IDC_CPROFILES, szText);
EnableWindow(GetDlgItem(hwndDlg, IDC_CPROFILES), FALSE);
ShowWindow(GetDlgItem(hwndDlg, IDC_NOTE1), SW_SHOW);
diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp index a61a014e9c..64fdd3d17e 100644 --- a/plugins/SmileyAdd/src/customsmiley.cpp +++ b/plugins/SmileyAdd/src/customsmiley.cpp @@ -78,7 +78,7 @@ bool SmileyCType::CreateTriggerText(char *text) return false;
char save = res[reslen]; res[reslen] = 0; // safe because of mir_alloc
- wchar_t *txt = mir_utf8decodeT(res);
+ wchar_t *txt = mir_utf8decodeW(res);
res[reslen] = save;
if (txt == NULL)
diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index 2f45d51950..8a46c4fc70 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -213,7 +213,7 @@ void GetSmileyCacheFolder(void) FoldersGetCustomPathT(hFolder, cachepath, MAX_PATH, L"");
HookEvent(ME_FOLDERS_PATH_CHANGED, FolderChanged);
}
- else mir_tstrncpy(cachepath, VARST(L"%miranda_userdata%\\SmileyCache"), MAX_PATH);
+ else mir_wstrncpy(cachepath, VARST(L"%miranda_userdata%\\SmileyCache"), MAX_PATH);
}
void DownloadInit(void)
diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp index 0a27734c92..4fda95dd92 100644 --- a/plugins/SmileyAdd/src/general.cpp +++ b/plugins/SmileyAdd/src/general.cpp @@ -232,8 +232,8 @@ void ReportError(const wchar_t *errmsg) static const wchar_t title[] = L"Miranda SmileyAdd";
POPUPDATAT pd = { 0 };
- mir_tstrcpy(pd.lpwzContactName, title);
- mir_tstrcpy(pd.lpwzText, errmsg);
+ mir_wstrcpy(pd.lpwzContactName, title);
+ mir_wstrcpy(pd.lpwzText, errmsg);
pd.iSeconds = -1;
if (PUAddPopupT(&pd) == CALLSERVICE_NOTFOUND)
MessageBox(NULL, errmsg, title, MB_OK | MB_ICONWARNING | MB_TOPMOST);
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index 8466424240..eca94429b5 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -481,16 +481,16 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) ofn.hwndOwner = m_hwndDialog;
wchar_t filter[512], *pfilter;
- mir_tstrcpy(filter, TranslateT("Smiley packs"));
- mir_tstrcat(filter, L" (*.msl;*.asl;*.xep)");
- pfilter = filter + mir_tstrlen(filter) + 1;
- mir_tstrcpy(pfilter, L"*.msl;*.asl;*.xep");
- pfilter = pfilter + mir_tstrlen(pfilter) + 1;
- mir_tstrcpy(pfilter, TranslateT("All files"));
- mir_tstrcat(pfilter, L" (*.*)");
- pfilter = pfilter + mir_tstrlen(pfilter) + 1;
- mir_tstrcpy(pfilter, L"*.*");
- pfilter = pfilter + mir_tstrlen(pfilter) + 1;
+ mir_wstrcpy(filter, TranslateT("Smiley packs"));
+ mir_wstrcat(filter, L" (*.msl;*.asl;*.xep)");
+ pfilter = filter + mir_wstrlen(filter) + 1;
+ mir_wstrcpy(pfilter, L"*.msl;*.asl;*.xep");
+ pfilter = pfilter + mir_wstrlen(pfilter) + 1;
+ mir_wstrcpy(pfilter, TranslateT("All files"));
+ mir_wstrcat(pfilter, L" (*.*)");
+ pfilter = pfilter + mir_wstrlen(pfilter) + 1;
+ mir_wstrcpy(pfilter, L"*.*");
+ pfilter = pfilter + mir_wstrlen(pfilter) + 1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
@@ -592,7 +592,7 @@ void OptionsType::ReadPackFileName(CMString &filename, const CMString &name, con {
CMString settingKey = name + L"-filename";
- ptrT tszValue(db_get_tsa(NULL, "SmileyAdd", _T2A(settingKey.c_str())));
+ ptrW tszValue(db_get_tsa(NULL, "SmileyAdd", _T2A(settingKey.c_str())));
filename = (tszValue != NULL) ? (wchar_t*)tszValue : defaultFilename;
}
@@ -604,7 +604,7 @@ void OptionsType::WritePackFileName(const CMString &filename, const CMString &na void OptionsType::ReadCustomCategories(CMString &cats)
{
- ptrT tszValue(db_get_tsa(NULL, "SmileyAdd", "CustomCategories"));
+ ptrW tszValue(db_get_tsa(NULL, "SmileyAdd", "CustomCategories"));
if (tszValue != NULL)
cats = tszValue;
}
@@ -619,7 +619,7 @@ void OptionsType::WriteCustomCategories(const CMString &cats) void OptionsType::ReadContactCategory(MCONTACT hContact, CMString &cats)
{
- ptrT tszValue(db_get_tsa(hContact, "SmileyAdd", "CustomCategory"));
+ ptrW tszValue(db_get_tsa(hContact, "SmileyAdd", "CustomCategory"));
if (tszValue != NULL)
cats = tszValue;
}
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index c2f70ffc31..213e8307d0 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -212,7 +212,7 @@ static DWORD_PTR ConvertServiceParam(MCONTACT hContact, const wchar_t *param) {
if (param == NULL)
return 0;
- if (mir_tstrcmpi(L"hContact", param) == 0)
+ if (mir_wstrcmpi(L"hContact", param) == 0)
return hContact;
if (iswdigit(*param))
return _wtoi(param);
@@ -359,7 +359,7 @@ bool SmileyPackType::LoadSmileyFile(const CMString &filename, const CMString &pa if (!noerr) {
static const wchar_t errmsg[] = LPGENW("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys.");
wchar_t msgtxt[1024];
- mir_sntprintf(msgtxt, TranslateTS(errmsg), modpath.c_str(), packname);
+ mir_snwprintf(msgtxt, TranslateTS(errmsg), modpath.c_str(), packname);
ReportError(msgtxt);
}
@@ -519,7 +519,7 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & if (!noerr) {
static const wchar_t errmsg[] = LPGENW("Smiley #%u in file %s for smiley pack %s not found.");
wchar_t msgtxt[1024];
- mir_sntprintf(msgtxt, TranslateTS(errmsg), smnum, resname.c_str(), modpath.c_str());
+ mir_snwprintf(msgtxt, TranslateTS(errmsg), smnum, resname.c_str(), modpath.c_str());
CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, _T2A(msgtxt));
errorFound = true;
}
@@ -733,7 +733,7 @@ SmileyPackType* SmileyPackListType::GetSmileyPack(CMString &filename) for (int i = 0; i < m_SmileyPacks.getCount(); i++) {
CMString modpath1;
pathToAbsolute(m_SmileyPacks[i].GetFilename(), modpath1);
- if (mir_tstrcmpi(modpath.c_str(), modpath1.c_str()) == 0) return &m_SmileyPacks[i];
+ if (mir_wstrcmpi(modpath.c_str(), modpath1.c_str()) == 0) return &m_SmileyPacks[i];
}
return NULL;
}
@@ -1068,13 +1068,13 @@ SmileyLookup::SmileyLookup(const CMString &str, const bool regexs, const int ind matcher->getStartingIndex() != matcher->getEndingIndex());
if (!m_valid) {
static const wchar_t errmsg[] = LPGENW("Regular expression \"%s\" in smiley pack \"%s\" could produce \"empty matches\".");
- mir_sntprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
+ mir_snwprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
}
delete matcher;
}
else {
static const wchar_t errmsg[] = LPGENW("Regular expression \"%s\" in smiley pack \"%s\" malformed.");
- mir_sntprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
+ mir_snwprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
}
if (!m_valid)
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index 550c9143e6..6cdaf66110 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -7,9 +7,9 @@ wchar_t* _getCOptS(wchar_t *buf, unsigned int buflen, MCONTACT hContact, const c DBVARIANT dbv = {0};
wcsnset(buf, 0, buflen);
if (db_get_ts(hContact, PLUGIN_NAME, option, &dbv) != 0)
- wcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
+ wcsncpy(buf, def, min(buflen, mir_wstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- wcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
+ wcsncpy(buf, dbv.ptszVal, min(buflen, mir_wstrlen(dbv.ptszVal)+1));
}
db_free(&dbv);
return buf;
@@ -20,12 +20,12 @@ wchar_t* _getMOptS(wchar_t *buf, unsigned int buflen, const char* module, const DBVARIANT dbv = {0};
wcsnset(buf, 0, buflen);
if (db_get_s(NULL, module, option, &dbv) != 0)
- wcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
+ wcsncpy(buf, def, min(buflen, mir_wstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- wcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
+ wcsncpy(buf, dbv.ptszVal, min(buflen, mir_wstrlen(dbv.ptszVal)+1));
} else {
tmp = mir_a2u(dbv.pszVal);
- wcsncpy(buf, tmp, min(buflen, mir_tstrlen(tmp)+1));
+ wcsncpy(buf, tmp, min(buflen, mir_wstrlen(tmp)+1));
mir_free(tmp);
}
db_free(&dbv);
@@ -130,7 +130,7 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM {
lvi.iItem = i;
_getMOptS(pName, 200*sizeof(wchar_t), pd[i]->szModuleName, "AM_BaseProto", L"");
- if (mir_tstrcmp(pName, L"ICQ") != 0)
+ if (mir_wstrcmp(pName, L"ICQ") != 0)
continue;
lvi.pszText = mir_a2u(pd[i]->szModuleName);
ListView_InsertItem(hProtocolsList, &lvi);
@@ -436,17 +436,17 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA EnableControlsBayes(optDlg, bEnabled);
- mir_sntprintf(buf, L"%0.02f", (double)_getOptD("BayesSpamScore", defaultBayesSpamScore)*SCORE_C);
+ mir_snwprintf(buf, L"%0.02f", (double)_getOptD("BayesSpamScore", defaultBayesSpamScore)*SCORE_C);
SetDlgItemText(optDlg, IDC_OPT_BAYES_SPAM_SCORE, buf);
- mir_sntprintf(buf, L"%.02f", (double)_getOptD("BayesHamScore", defaultBayesHamScore)*SCORE_C);
+ mir_snwprintf(buf, L"%.02f", (double)_getOptD("BayesHamScore", defaultBayesHamScore)*SCORE_C);
SetDlgItemText(optDlg, IDC_OPT_BAYES_HAM_SCORE, buf);
- mir_sntprintf(buf, L"%d", _getOptD("BayesWaitApprove", defaultBayesWaitApprove));
+ mir_snwprintf(buf, L"%d", _getOptD("BayesWaitApprove", defaultBayesWaitApprove));
SetDlgItemText(optDlg, IDC_OPT_BAYES_WAIT_APPROVE, buf);
if (bEnabled) {
- mir_sntprintf(buf, L"%d", get_msg_count(SPAM));
+ mir_snwprintf(buf, L"%d", get_msg_count(SPAM));
SetDlgItemText(optDlg, IDC_STATIC_SPAM_COUNT, buf);
- mir_sntprintf(buf, L"%d", get_msg_count(HAM));
+ mir_snwprintf(buf, L"%d", get_msg_count(HAM));
SetDlgItemText(optDlg, IDC_STATIC_HAM_COUNT, buf);
}
@@ -490,9 +490,9 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA SetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, L"");
free(dbuf);
- mir_sntprintf(buf, L"%d", get_msg_count(SPAM));
+ mir_snwprintf(buf, L"%d", get_msg_count(SPAM));
SetDlgItemText(optDlg, IDC_STATIC_SPAM_COUNT, buf);
- mir_sntprintf(buf, L"%d", get_msg_count(HAM));
+ mir_snwprintf(buf, L"%d", get_msg_count(HAM));
SetDlgItemText(optDlg, IDC_STATIC_HAM_COUNT, buf);
return FALSE;
@@ -507,9 +507,9 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA SetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, L"");
free(dbuf);
- mir_sntprintf(buf, L"%d", get_msg_count(SPAM));
+ mir_snwprintf(buf, L"%d", get_msg_count(SPAM));
SetDlgItemText(optDlg, IDC_STATIC_SPAM_COUNT, buf);
- mir_sntprintf(buf, L"%d", get_msg_count(HAM));
+ mir_snwprintf(buf, L"%d", get_msg_count(HAM));
SetDlgItemText(optDlg, IDC_STATIC_HAM_COUNT, buf);
return FALSE;
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index a96cc0551b..4951bac756 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -179,7 +179,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) bCorrectResponse = TRUE;
} else {
if (_tcsstr_cc(message, buf, _getOptB("ResponseCC", defaultResponseCC)) &&
- (mir_tstrlen(message) == mir_tstrlen(buf)))
+ (mir_wstrlen(message) == mir_wstrlen(buf)))
bCorrectResponse = TRUE;
}
break;
@@ -196,7 +196,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) }
} else {
if (_tcsstr_cc(message, buf, _getOptB("ResponseCC", defaultResponseCC)) &&
- (mir_tstrlen(message) == mir_tstrlen(buf))) {
+ (mir_wstrlen(message) == mir_wstrlen(buf))) {
bCorrectResponse = TRUE;
break;
}
@@ -208,7 +208,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) if (message == NULL)
break;
_itow(_getCOptD(hContact, "ResponseMath", -1), buf, 10);
- if (wcsstr(message, buf) && (mir_tstrlen(buf) == mir_tstrlen(message))) {
+ if (wcsstr(message, buf) && (mir_wstrlen(buf) == mir_wstrlen(message))) {
bCorrectResponse = TRUE;
}
break;
@@ -290,7 +290,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) // Completely reject if duplicate incoming message found
if (_getOptD("MaxSameMsgCountPerDay", defaultMaxSameMsgCountPerDay) > 0 &&
_getCOptD(hContact, "SameMsgCount", 0) >= _getOptD("MaxSameMsgCountPerDay", defaultMaxSameMsgCountPerDay) &&
- mir_tstrcmp(message, _getCOptS(buf, buflen, hContact, "LastInMsg", L"")) == 0) {
+ mir_wstrcmp(message, _getCOptS(buf, buflen, hContact, "LastInMsg", L"")) == 0) {
_notify(hContact, POPUP_BLOCKED, TranslateT("Message from %s rejected because it reached a maximum for same responses per day."), message);
if (bayesEnabled)
queue_message(hContact, dbei->timestamp, message);
@@ -388,7 +388,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) case SPAMOTRON_MODE_MATH:
a = (rand() % 10) + 1;
b = (rand() % 10) + 1;
- mir_sntprintf(mexpr, L"%d + %d", a, b);
+ mir_snwprintf(mexpr, L"%d + %d", a, b);
if (dbei->eventType == EVENTTYPE_AUTHREQUEST)
_getOptS(challengeW, maxmsglen, "AuthChallengeMath", defaultAuthChallengeMath);
else
@@ -423,7 +423,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) // Save Last Msg and update SameMsgCount
if (message != NULL) {
- if (mir_tstrcmp(_getCOptS(buf, buflen, hContact, "LastInMsg", L""), message) == 0)
+ if (mir_wstrcmp(_getCOptS(buf, buflen, hContact, "LastInMsg", L""), message) == 0)
_setCOptD(hContact, "SameMsgCount", 1+_getCOptD(hContact, "SameMsgCount", 0));
else
_setCOptD(hContact, "SameMsgCount", 1);
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index 4d5ca64280..a95f2a976f 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -7,7 +7,7 @@ wchar_t *_tcstolower(wchar_t *dst) if (dst == NULL) return NULL; - SIZE_T dst_len = mir_tstrlen(dst); + SIZE_T dst_len = mir_wstrlen(dst); for (SIZE_T i = 0; i < dst_len; i ++) dst[i] = towlower(dst[i]); return dst; @@ -18,7 +18,7 @@ wchar_t *_tcstoupper(wchar_t *dst) if (dst == NULL) return NULL; - SIZE_T dst_len = mir_tstrlen(dst); + SIZE_T dst_len = mir_wstrlen(dst); for (SIZE_T i = 0; i < dst_len; i ++) dst[i] = towupper(dst[i]); return dst; @@ -39,10 +39,10 @@ BOOL _isregex(wchar_t* strSearch) re = pcre16_compile(regex_parse, 0, &error, &erroroffs, NULL); if (re == NULL) return FALSE; - regex = mir_tstrdup(strSearch); + regex = mir_wstrdup(strSearch); if (regex == NULL) goto err_out; - rc = pcre16_exec(re, NULL, regex, (int)mir_tstrlen(regex), 0, 0, ovector, 9); + rc = pcre16_exec(re, NULL, regex, (int)mir_wstrlen(regex), 0, 0, ovector, 9); if (rc == 3) ret = TRUE; mir_free(regex); @@ -68,12 +68,12 @@ BOOL _isvalidregex(wchar_t* strSearch) re = pcre16_compile(regex_parse, 0, &error, &erroroffs, NULL); if (re == NULL) return FALSE; - regex = mir_tstrdup(strSearch); + regex = mir_wstrdup(strSearch); if (regex == NULL) { pcre16_free(re); return FALSE; } - rc = pcre16_exec(re, NULL, regex, (int)mir_tstrlen(regex), 0, 0, ovector, 9); + rc = pcre16_exec(re, NULL, regex, (int)mir_wstrlen(regex), 0, 0, ovector, 9); pcre16_free(re); if (rc != 3) goto err_out; @@ -116,12 +116,12 @@ BOOL _regmatch(wchar_t* str, wchar_t* strSearch) re = pcre16_compile(regex_parse, 0, &error, &erroroffs, NULL); if (re == NULL) return FALSE; // [TODO] and log some error - regex = mir_tstrdup(strSearch); + regex = mir_wstrdup(strSearch); if (regex == NULL) { pcre16_free(re); return FALSE; } - rc = pcre16_exec(re, NULL, regex, (int)mir_tstrlen(regex), 0, 0, ovector, 9); + rc = pcre16_exec(re, NULL, regex, (int)mir_wstrlen(regex), 0, 0, ovector, 9); pcre16_free(re); if (rc != 3) goto err_out; // [TODO] and log some error (better check for valid regex on options save) @@ -130,7 +130,7 @@ BOOL _regmatch(wchar_t* str, wchar_t* strSearch) mod = regex + ovector[4]; mod[ovector[5] - ovector[4]] = 0; - data = mir_tstrdup(str); + data = mir_wstrdup(str); if (data == NULL) goto err_out; if (wcsstr(mod, L"i")) @@ -143,7 +143,7 @@ BOOL _regmatch(wchar_t* str, wchar_t* strSearch) re = pcre16_compile(regexp, opts, &error, &erroroffs, NULL); if (re == NULL) goto err_out; - rc = pcre16_exec(re, NULL, data, (int)mir_tstrlen(data), 0, 0, NULL, 0); + rc = pcre16_exec(re, NULL, data, (int)mir_wstrlen(data), 0, 0, NULL, 0); pcre16_free(re); if (rc >= 0) ret = TRUE; @@ -169,12 +169,12 @@ int get_response_id(const wchar_t* strvar) re = pcre16_compile(regex, 0, &error, &erroroffs, NULL); if (re == NULL) return 0; // [TODO] and log some error - _strvar = mir_tstrdup(strvar); + _strvar = mir_wstrdup(strvar); if (_strvar == NULL) { pcre16_free(re); return 0; } - rc = pcre16_exec(re, NULL, _strvar, (int)mir_tstrlen(_strvar), 0, 0, ovector, 9); + rc = pcre16_exec(re, NULL, _strvar, (int)mir_wstrlen(_strvar), 0, 0, ovector, 9); pcre16_free(re); if (rc < 0) { ret = -1; @@ -195,7 +195,7 @@ int get_response_num(const wchar_t *str) if (str == NULL) return 0; - strc = mir_tstrdup(str); + strc = mir_wstrdup(str); if (strc == NULL) return 0; tmp = wcstok(strc, L"\r\n"); @@ -222,7 +222,7 @@ wchar_t* get_response(wchar_t* dst, unsigned int dstlen, int num) tmp = wcstok(src, L"\r\n"); while (tmp) { if (i == num) { - mir_tstrcpy(dst, tmp); + mir_wstrcpy(dst, tmp); mir_free(src); return dst; } @@ -242,10 +242,10 @@ wchar_t* _tcsstr_cc(wchar_t* str, wchar_t* strSearch, BOOL cc) if (cc) return wcsstr(str, strSearch); - _str = mir_tstrdup(str); + _str = mir_wstrdup(str); if (_str == NULL) goto err_out; - _strSearch = mir_tstrdup(strSearch); + _strSearch = mir_wstrdup(strSearch); if (_strSearch == NULL) goto err_out; ret = wcsstr(_tcstolower(_str), _tcstolower(_strSearch)); @@ -266,17 +266,17 @@ BOOL Contains(wchar_t* dst, wchar_t* src) // Checks for occurence of substring f if (dst == NULL || src == NULL) return FALSE; - tsrc = mir_tstrdup(src); + tsrc = mir_wstrdup(src); if (tsrc == NULL) goto err_out; - tdst = mir_tstrdup(dst); + tdst = mir_wstrdup(dst); if (tdst == NULL) goto err_out; tdst = _tcstoupper(tdst); - dst_len = mir_tstrlen(tdst); + dst_len = mir_wstrlen(tdst); token = wcstok(tsrc, L","); while (token) { - token_end = (token + mir_tstrlen(token)); + token_end = (token + mir_wstrlen(token)); while (!wcsncmp(token, L" ", 1)) { /* Skeep spaces at start. */ token ++; } @@ -328,9 +328,9 @@ wchar_t* ReplaceVar(wchar_t *dst, unsigned int len, const wchar_t *var, const wc if (dst == NULL || var == NULL || rvar == NULL) return NULL; - dst_len = mir_tstrlen(dst); - var_len = mir_tstrlen(var); - rvar_len = mir_tstrlen(rvar); + dst_len = mir_wstrlen(dst); + var_len = mir_wstrlen(var); + rvar_len = mir_wstrlen(rvar); var_start = wcsstr(dst, var); while (var_start) { if (len < (dst_len + rvar_len - var_len + 1)) @@ -382,14 +382,14 @@ wchar_t* ReplaceVarsNum(wchar_t *dst, unsigned int len, int num) } do { - _str = mir_tstrdup(dst); - dstcopy = mir_tstrdup(dst); + _str = mir_wstrdup(dst); + dstcopy = mir_wstrdup(dst); if (_str == NULL || dstcopy == NULL) { mir_free(_str); mir_free(dstcopy); goto err_out; } - rc = pcre16_exec(re, NULL, _str, (int)mir_tstrlen(_str), 0, 0, ovector, 9); + rc = pcre16_exec(re, NULL, _str, (int)mir_wstrlen(_str), 0, 0, ovector, 9); if (rc < 0) { ret = -1; } else if (rc == 3) { @@ -427,7 +427,7 @@ int _notify(MCONTACT hContact, BYTE type, wchar_t *message, wchar_t *origmessage { char *tmp, *tmporig; wchar_t msg[MAX_BUFFER_LENGTH]; - mir_sntprintf(msg, message, pcli->pfnGetContactDisplayName(hContact, 0)); + mir_snwprintf(msg, message, pcli->pfnGetContactDisplayName(hContact, 0)); if (_getOptB("LogActions", defaultLogActions)) { tmp = mir_u2a(msg); diff --git a/plugins/SpellChecker/src/RichEdit.cpp b/plugins/SpellChecker/src/RichEdit.cpp index 1317f767cd..e81e679606 100644 --- a/plugins/SpellChecker/src/RichEdit.cpp +++ b/plugins/SpellChecker/src/RichEdit.cpp @@ -201,17 +201,17 @@ wchar_t* RichEdit::GetText(int start, int end) const if (m_textDocument != NULL) {
ITextRange *range;
if (m_textDocument->Range(start, end, &range) != S_OK)
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
BSTR text = NULL;
if (FAILED(range->GetText(&text))) {
if (text)
::SysFreeString(text);
range->Release();
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
- wchar_t *res = mir_u2t(text);
+ wchar_t *res = mir_wstrdup(text);
range->Release();
::SysFreeString(text);
return res;
@@ -241,7 +241,7 @@ void RichEdit::ReplaceSel(const wchar_t *new_text) SuspendUndo();
- FixSel(&m_old_sel, sel, mir_tstrlen(new_text));
+ FixSel(&m_old_sel, sel, mir_wstrlen(new_text));
SendMessage(WM_SETREDRAW, FALSE, 0);
SendMessage(EM_SETEVENTMASK, 0, m_old_mask & ~ENM_CHANGE);
@@ -257,7 +257,7 @@ int RichEdit::Replace(int start, int end, const wchar_t *new_text) ReplaceSel(new_text);
- int dif = FixSel(&sel, replace_sel, mir_tstrlen(new_text));
+ int dif = FixSel(&sel, replace_sel, mir_wstrlen(new_text));
SetSel(sel);
return dif;
}
@@ -270,7 +270,7 @@ int RichEdit::Insert(int pos, const wchar_t *text) ReplaceSel(text);
- int dif = FixSel(&sel, replace_sel, mir_tstrlen(text));
+ int dif = FixSel(&sel, replace_sel, mir_wstrlen(text));
SetSel(sel);
return dif;
}
diff --git a/plugins/SpellChecker/src/ardialog.cpp b/plugins/SpellChecker/src/ardialog.cpp index 0b1a14fa56..f74058bcab 100644 --- a/plugins/SpellChecker/src/ardialog.cpp +++ b/plugins/SpellChecker/src/ardialog.cpp @@ -215,7 +215,7 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa wchar_t find[256];
if (data->findReadOnly)
- mir_tstrncpy(find, data->find.c_str(), _countof(find));
+ mir_wstrncpy(find, data->find.c_str(), _countof(find));
else {
GetDlgItemText(hwndDlg, IDC_OLD, find, _countof(find));
lstrtrim(find);
@@ -231,7 +231,7 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa else if (replace[0] == 0)
MessageBox(hwndDlg, TranslateT("The correction can't be empty!"), TranslateT("Wrong Correction"), MB_OK | MB_ICONERROR);
- else if (mir_tstrcmp(find, replace) == 0)
+ else if (mir_wstrcmp(find, replace) == 0)
MessageBox(hwndDlg, TranslateT("The correction can't be equal to the wrong word!"), TranslateT("Wrong Correction"), MB_OK | MB_ICONERROR);
else {
diff --git a/plugins/SpellChecker/src/autoreplace.cpp b/plugins/SpellChecker/src/autoreplace.cpp index a3ad88e928..de4350eed3 100644 --- a/plugins/SpellChecker/src/autoreplace.cpp +++ b/plugins/SpellChecker/src/autoreplace.cpp @@ -33,7 +33,7 @@ AutoReplacement::AutoReplacement(const wchar_t *replace, BOOL useVariables) AutoReplaceMap::AutoReplaceMap(wchar_t *aFilename, Dictionary *dict)
{
m_dict = dict;
- mir_tstrncpy(m_filename, aFilename, _countof(m_filename));
+ mir_wstrncpy(m_filename, aFilename, _countof(m_filename));
loadAutoReplaceMap();
}
@@ -143,7 +143,7 @@ wchar_t* AutoReplaceMap::autoReplace(const wchar_t * word) to = wcsdup(ar.replace.c_str());
// Wich case to use?
- size_t len = mir_tstrlen(word);
+ size_t len = mir_wstrlen(word);
size_t i;
for (i = 0; i < len; i++)
if (IsCharLower(word[i]))
@@ -167,7 +167,7 @@ wchar_t* AutoReplaceMap::autoReplace(const wchar_t * word) wchar_t* AutoReplaceMap::filterText(const wchar_t *find)
{
wchar_t *ret = wcsdup(find);
- int len = mir_tstrlen(ret);
+ int len = mir_wstrlen(ret);
int pos = 0;
for (int i = 0; i < len; i++)
if (isWordChar(find[i]))
diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index ee491e541c..10f03b5c92 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -365,7 +365,7 @@ protected: void loadCustomDict() { wchar_t filename[1024]; - mir_sntprintf(filename, L"%s\\%s.cdic", userPath, language); + mir_snwprintf(filename, L"%s\\%s.cdic", userPath, language); FILE *file = _wfopen(filename, L"rb"); if (file != NULL) { @@ -393,7 +393,7 @@ protected: CreateDirectoryTreeT(userPath); wchar_t filename[1024]; - mir_sntprintf(filename, L"%s\\%s.cdic", userPath, language); + mir_snwprintf(filename, L"%s\\%s.cdic", userPath, language); FILE *file = _wfopen(filename, L"ab"); if (file != NULL) { @@ -441,13 +441,13 @@ protected: public: HunspellDictionary(wchar_t *aLanguage, wchar_t *aFileWithoutExtension, wchar_t *anUserPath, wchar_t *aSource) { - mir_tstrncpy(language, aLanguage, _countof(language)); - mir_tstrncpy(fileWithoutExtension, aFileWithoutExtension, _countof(fileWithoutExtension)); - mir_tstrncpy(userPath, anUserPath, _countof(userPath)); + mir_wstrncpy(language, aLanguage, _countof(language)); + mir_wstrncpy(fileWithoutExtension, aFileWithoutExtension, _countof(fileWithoutExtension)); + mir_wstrncpy(userPath, anUserPath, _countof(userPath)); if (aSource == NULL) source[0] = '\0'; else - mir_tstrncpy(source, aSource, _countof(source)); + mir_wstrncpy(source, aSource, _countof(source)); loaded = LANGUAGE_NOT_LOADED; localized_name[0] = '\0'; @@ -469,14 +469,14 @@ public: wchar_t * merge(wchar_t * s1, wchar_t *s2) { - int len1 = (s1 == NULL ? 0 : mir_tstrlen(s1)); - int len2 = (s2 == NULL ? 0 : mir_tstrlen(s2)); + int len1 = (s1 == NULL ? 0 : mir_wstrlen(s1)); + int len2 = (s2 == NULL ? 0 : mir_wstrlen(s2)); wchar_t *ret; if (len1 > 0 && len2 > 0) { ret = (wchar_t *)malloc(sizeof(wchar_t) * (len1 + len2 + 1)); - mir_tstrncpy(ret, s1, len1 + 1); - mir_tstrncpy(&ret[len1], s2, len2 + 1); + mir_wstrncpy(ret, s1, len1 + 1); + mir_wstrncpy(&ret[len1], s2, len2 + 1); FREE(s1); FREE(s2); @@ -498,7 +498,7 @@ public: } // Remove duplicated chars - int last = mir_tstrlen(ret) - 1; + int last = mir_wstrlen(ret) - 1; for (int i = 0; i <= last; i++) { wchar_t c = ret[i]; for (int j = last; j > i; j--) { @@ -734,11 +734,11 @@ BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString) GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO3166CTRYNAME, end, _countof(end)); wchar_t name[64]; - mir_sntprintf(name, L"%s_%s", ini, end); + mir_snwprintf(name, L"%s_%s", ini, end); for (int i = 0; i < tmp_dicts->getCount(); i++) { Dictionary *dict = (*tmp_dicts)[i]; - if (mir_tstrcmpi(dict->language, name) == 0) { + if (mir_wstrcmpi(dict->language, name) == 0) { GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SENGLANGUAGE, dict->english_name, _countof(dict->english_name)); GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SLANGUAGE, dict->localized_name, _countof(dict->localized_name)); @@ -752,15 +752,15 @@ BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString) wchar_t localName[1024]; if (country[0] != 0) - mir_sntprintf(localName, L"%s (%s)", dict->english_name, country); + mir_snwprintf(localName, L"%s (%s)", dict->english_name, country); else - mir_tstrncpy(localName, dict->english_name, _countof(localName)); + mir_wstrncpy(localName, dict->english_name, _countof(localName)); - mir_tstrncpy(dict->localized_name, TranslateTS(localName), _countof(dict->localized_name)); + mir_wstrncpy(dict->localized_name, TranslateTS(localName), _countof(dict->localized_name)); } if (dict->localized_name[0] != 0) { - mir_sntprintf(dict->full_name, L"%s [%s]", dict->localized_name, dict->language); + mir_snwprintf(dict->full_name, L"%s [%s]", dict->localized_name, dict->language); } break; } @@ -784,24 +784,24 @@ void GetDictsInfo(LIST<Dictionary> &dicts) char lang[128]; WideCharToMultiByte(CP_ACP, 0, dict->language, -1, lang, sizeof(lang), NULL, NULL); if (!db_get_ts(NULL, MODULE_NAME, lang, &dbv)) { - mir_tstrncpy(dict->localized_name, dbv.ptszVal, _countof(dict->localized_name)); + mir_wstrncpy(dict->localized_name, dbv.ptszVal, _countof(dict->localized_name)); db_free(&dbv); } if (dict->localized_name[0] == '\0') { for (size_t j = 0; j < _countof(aditionalLanguages); j++) { - if (!mir_tstrcmp(aditionalLanguages[j].language, dict->language)) { - mir_tstrncpy(dict->localized_name, TranslateTS(aditionalLanguages[j].localized_name), _countof(dict->localized_name)); + if (!mir_wstrcmp(aditionalLanguages[j].language, dict->language)) { + mir_wstrncpy(dict->localized_name, TranslateTS(aditionalLanguages[j].localized_name), _countof(dict->localized_name)); break; } } } if (dict->localized_name[0] != '\0') { - mir_sntprintf(dict->full_name, L"%s [%s]", dict->localized_name, dict->language); + mir_snwprintf(dict->full_name, L"%s [%s]", dict->localized_name, dict->language); } else { - mir_tstrncpy(dict->full_name, dict->language, _countof(dict->full_name)); + mir_wstrncpy(dict->full_name, dict->language, _countof(dict->full_name)); } } } @@ -812,7 +812,7 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, wchar_t *path, w { // Load the language files and create an array with then wchar_t file[1024] = { 0 }; - mir_sntprintf(file, L"%s\\*.dic", path); + mir_snwprintf(file, L"%s\\*.dic", path); BOOL found = FALSE; @@ -820,7 +820,7 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, wchar_t *path, w HANDLE hFFD = FindFirstFile(file, &ffd); if (hFFD != INVALID_HANDLE_VALUE) { do { - mir_sntprintf(file, L"%s\\%s", path, ffd.cFileName); + mir_snwprintf(file, L"%s\\%s", path, ffd.cFileName); // Check .dic DWORD attrib = GetFileAttributes(file); @@ -828,29 +828,29 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, wchar_t *path, w continue; // See if .aff exists too - mir_tstrcpy(&file[mir_tstrlen(file) - 4], L".aff"); + mir_wstrcpy(&file[mir_wstrlen(file) - 4], L".aff"); attrib = GetFileAttributes(file); if (attrib == 0xFFFFFFFF || (attrib & FILE_ATTRIBUTE_DIRECTORY)) continue; - ffd.cFileName[mir_tstrlen(ffd.cFileName) - 4] = '\0'; + ffd.cFileName[mir_wstrlen(ffd.cFileName) - 4] = '\0'; wchar_t *lang = ffd.cFileName; // Replace - for _ - for (size_t i = 0; i < mir_tstrlen(lang); i++) + for (size_t i = 0; i < mir_wstrlen(lang); i++) if (lang[i] == '-') lang[i] = '_'; // Check if dict is new bool exists = false; for (int i = 0; i < dicts.getCount() && !exists; i++) - if (mir_tstrcmp(dicts[i]->language, lang) == 0) + if (mir_wstrcmp(dicts[i]->language, lang) == 0) exists = true; if (!exists) { found = TRUE; - file[mir_tstrlen(file) - 4] = '\0'; + file[mir_wstrlen(file) - 4] = '\0'; dicts.insert(new HunspellDictionary(lang, file, user_path, source)); } } while (FindNextFile(hFFD, &ffd)); @@ -870,7 +870,7 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, wchar_t *path, wchar_t *use // Get other apps dicts for (int i = 0; i < _countof(otherHunspellApps); i++) { wchar_t key[1024]; - mir_sntprintf(key, APPPATH, otherHunspellApps[i].key); + mir_snwprintf(key, APPPATH, otherHunspellApps[i].key); HKEY hKey = 0; LONG lResult = 0; @@ -895,7 +895,7 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, wchar_t *path, wchar_t *use key[cchValue] = 0; wchar_t *pos; if (pos = wcsrchr(key, '\\')) { - if (!mir_tstrcmpi(&pos[1], otherHunspellApps[i].key)) { + if (!mir_wstrcmpi(&pos[1], otherHunspellApps[i].key)) { pos[0] = 0; lResult = ERROR_SUCCESS; break; @@ -908,7 +908,7 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, wchar_t *path, wchar_t *use if (ERROR_SUCCESS == lResult) { wchar_t folder[1024]; - mir_sntprintf(folder, L"%s\\Dictionaries", key); + mir_snwprintf(folder, L"%s\\Dictionaries", key); GetHunspellDictionariesFromFolder(languages, folder, user_path, otherHunspellApps[i].name); } @@ -923,7 +923,7 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, wchar_t *path, wchar_t *use // Sort dicts for (int i = 0; i < dicts.getCount(); i++) { for (int j = i + 1; j < dicts.getCount(); j++) { - if (mir_tstrcmp(dicts[i]->full_name, dicts[j]->full_name) > 0) { + if (mir_wstrcmp(dicts[i]->full_name, dicts[j]->full_name) > 0) { Dictionary *dict = dicts[i]; sl->items[i] = dicts[j]; sl->items[j] = dict; diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp index c0bc78ab5a..21309b391a 100644 --- a/plugins/SpellChecker/src/options.cpp +++ b/plugins/SpellChecker/src/options.cpp @@ -94,17 +94,17 @@ void LoadOptions() DBVARIANT dbv;
if (!db_get_ts(NULL, MODULE_NAME, "DefaultLanguage", &dbv)) {
- mir_tstrncpy(opts.default_language, dbv.ptszVal, _countof(opts.default_language));
+ mir_wstrncpy(opts.default_language, dbv.ptszVal, _countof(opts.default_language));
db_free(&dbv);
}
int i;
for (i = 0; i < languages.getCount(); i++)
- if (mir_tstrcmp(languages[i]->language, opts.default_language) == 0)
+ if (mir_wstrcmp(languages[i]->language, opts.default_language) == 0)
break;
if (i >= languages.getCount())
- mir_tstrcpy(opts.default_language, languages[0]->language);
+ mir_wstrcpy(opts.default_language, languages[0]->language);
}
static void DrawItem(LPDRAWITEMSTRUCT lpdis, Dictionary *dict)
@@ -179,7 +179,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_DEF_LANG, CB_ADDSTRING, 0, (LPARAM)languages[i]->full_name);
SendDlgItemMessage(hwndDlg, IDC_DEF_LANG, CB_SETITEMDATA, i, (LPARAM)languages[i]);
- if (!mir_tstrcmp(opts.default_language, languages[i]->language))
+ if (!mir_wstrcmp(opts.default_language, languages[i]->language))
sel = i;
}
SendDlgItemMessage(hwndDlg, IDC_DEF_LANG, CB_SETCURSEL, sel, 0);
@@ -214,7 +214,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP sel = 0;
db_set_ts(NULL, MODULE_NAME, "DefaultLanguage",
(wchar_t *)languages[sel]->language);
- mir_tstrcpy(opts.default_language, languages[sel]->language);
+ mir_wstrcpy(opts.default_language, languages[sel]->language);
}
}
break;
@@ -328,7 +328,7 @@ static void SaveNewReplacements(BOOL canceled, Dictionary*, AutoreplaceData *data = (AutoreplaceData *)param;
- if (mir_tstrlen(original_find) > 0)
+ if (mir_wstrlen(original_find) > 0)
data->RemoveWord(original_find);
data->AddWord(find, replace, useVariables);
@@ -351,7 +351,7 @@ static void ShowAddReplacement(HWND hwndDlg, int item = -1) else
ListView_GetItemText(GetDlgItem(hwndDlg, IDC_REPLACEMENTS), item, 0, find, _countof(find));
- if (mir_tstrlen(find) > 0) {
+ if (mir_wstrlen(find) > 0) {
AutoReplacement &ar = data->autoReplaceMap[find];
replace = ar.replace.c_str();
useVariables = ar.useVariables;
@@ -378,7 +378,7 @@ static INT_PTR CALLBACK AutoreplaceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)p->full_name);
SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_SETITEMDATA, i, (LPARAM)new AutoreplaceData(p));
- if (!mir_tstrcmp(opts.default_language, p->language))
+ if (!mir_wstrcmp(opts.default_language, p->language))
sel = i;
}
SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_SETCURSEL, sel, 0);
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index e6217118c4..f40a0a6ee3 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -80,7 +80,7 @@ static int IconsChanged(WPARAM, LPARAM) sid.dwId = i; wchar_t tmp[128]; - mir_sntprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name); + mir_snwprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name); sid.tszTooltip = tmp; HICON hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled"); @@ -134,7 +134,7 @@ static int ModulesLoaded(WPARAM, LPARAM) if (opts.use_flags) { // Load flags dll wchar_t flag_file[MAX_PATH]; - mir_sntprintf(flag_file, L"%s\\flags_icons.dll", flagsDllFolder); + mir_snwprintf(flag_file, L"%s\\flags_icons.dll", flagsDllFolder); HMODULE hFlagsDll = LoadLibraryEx(flag_file, NULL, LOAD_LIBRARY_AS_DATAFILE); wchar_t path[MAX_PATH]; @@ -184,10 +184,10 @@ static int ModulesLoaded(WPARAM, LPARAM) Dictionary *dict = languages[j]; wchar_t filename[MAX_PATH]; - mir_sntprintf(filename, L"%s\\%s.ar", customDictionariesFolder, dict->language); + mir_snwprintf(filename, L"%s\\%s.ar", customDictionariesFolder, dict->language); dict->autoReplace = new AutoReplaceMap(filename, dict); - if (mir_tstrcmp(dict->language, opts.default_language) == 0) + if (mir_wstrcmp(dict->language, opts.default_language) == 0) dict->load(); } @@ -205,7 +205,7 @@ static int ModulesLoaded(WPARAM, LPARAM) sid.dwId = i; wchar_t tmp[128]; - mir_sntprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name); + mir_snwprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name); sid.tszTooltip = tmp; sid.hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled"); Srmm_AddIcon(&sid); diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 7df9b00d14..a3cab0e333 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -276,7 +276,7 @@ int CheckTextLine(Dialog *dlg, int line, TextParser *parser, int errors = 0;
wchar_t text[1024];
dlg->re->GetLine(line, text, _countof(text));
- int len = mir_tstrlen(text);
+ int len = mir_wstrlen(text);
int first_char = dlg->re->GetFirstCharOfLine(line);
// Now lets get the words
@@ -365,7 +365,7 @@ int CheckTextLine(Dialog *dlg, int line, TextParser *parser, if (dif != 0) {
// Read line again
dlg->re->GetLine(line, text, _countof(text));
- len = mir_tstrlen(text);
+ len = mir_wstrlen(text);
int old_first_char = first_char;
first_char = dlg->re->GetFirstCharOfLine(line);
@@ -440,7 +440,7 @@ void ToLocaleID(wchar_t *szKLName, size_t size) GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO639LANGNAME, ini, _countof(ini));
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO3166CTRYNAME, end, _countof(end));
- mir_sntprintf(szKLName, size, L"%s_%s", ini, end);
+ mir_snwprintf(szKLName, size, L"%s_%s", ini, end);
}
void LoadDictFromKbdl(Dialog *dlg)
@@ -449,7 +449,7 @@ void LoadDictFromKbdl(Dialog *dlg) // Use default input language
HKL hkl = GetKeyboardLayout(0);
- mir_sntprintf(szKLName, L"%x", (int)LOWORD(hkl));
+ mir_snwprintf(szKLName, L"%x", (int)LOWORD(hkl));
ToLocaleID(szKLName, _countof(szKLName));
int d = GetClosestLanguage(szKLName);
@@ -501,7 +501,7 @@ LRESULT CALLBACK OwnerProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int errors = TimerCheck(dlg, TRUE);
if (errors > 0) {
wchar_t text[500];
- mir_sntprintf(text, TranslateT("There are %d spelling errors. Are you sure you want to send this message?"), errors);
+ mir_snwprintf(text, TranslateT("There are %d spelling errors. Are you sure you want to send this message?"), errors);
if (MessageBox(hwnd, text, TranslateT("Spell Checker"), MB_ICONQUESTION | MB_YESNO) == IDNO)
return TRUE;
}
@@ -680,12 +680,12 @@ int GetClosestLanguage(wchar_t *lang_name) // Search the language by name
for (i = 0; i < languages.getCount(); i++)
- if (mir_tstrcmpi(languages[i]->language, lang_name) == 0)
+ if (mir_wstrcmpi(languages[i]->language, lang_name) == 0)
return i;
// Try searching by the prefix only
wchar_t lang[128];
- mir_tstrncpy(lang, lang_name, _countof(lang));
+ mir_wstrncpy(lang, lang_name, _countof(lang));
{
wchar_t *p = wcschr(lang, '_');
if (p != NULL) *p = '\0';
@@ -693,11 +693,11 @@ int GetClosestLanguage(wchar_t *lang_name) // First check if there is a language that is only the prefix
for (i = 0; i < languages.getCount(); i++)
- if (mir_tstrcmpi(languages[i]->language, lang) == 0)
+ if (mir_wstrcmpi(languages[i]->language, lang) == 0)
return i;
// Now try any suffix
- size_t len = mir_tstrlen(lang);
+ size_t len = mir_wstrlen(lang);
for (i = 0; i < languages.getCount(); i++) {
wchar_t *p = wcschr(languages[i]->language, '_');
if (p == NULL)
@@ -738,10 +738,10 @@ void GetUserProtoLanguageSetting(Dialog *dlg, MCONTACT hContact, char *group, ch for (int i = 0; i < languages.getCount(); i++) {
Dictionary *dict = languages[i];
- if (mir_tstrcmpi(dict->localized_name, lang) == 0
- || mir_tstrcmpi(dict->english_name, lang) == 0
- || mir_tstrcmpi(dict->language, lang) == 0) {
- mir_tstrncpy(dlg->lang_name, dict->language, _countof(dlg->lang_name));
+ if (mir_wstrcmpi(dict->localized_name, lang) == 0
+ || mir_wstrcmpi(dict->english_name, lang) == 0
+ || mir_wstrcmpi(dict->language, lang) == 0) {
+ mir_wstrncpy(dlg->lang_name, dict->language, _countof(dlg->lang_name));
break;
}
}
@@ -782,18 +782,18 @@ void GetContactLanguage(Dialog *dlg) if (dlg->hContact == NULL) {
if (!db_get_ts(NULL, MODULE_NAME, dlg->name, &dbv)) {
- mir_tstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
}
else {
if (!db_get_ts(dlg->hContact, MODULE_NAME, "TalkLanguage", &dbv)) {
- mir_tstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
if (dlg->lang_name[0] == '\0' && !db_get_ts(dlg->hContact, "eSpeak", "TalkLanguage", &dbv)) {
- mir_tstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
@@ -802,12 +802,12 @@ void GetContactLanguage(Dialog *dlg) MCONTACT hMetaContact = db_mc_getMeta(dlg->hContact);
if (hMetaContact != NULL) {
if (!db_get_ts(hMetaContact, MODULE_NAME, "TalkLanguage", &dbv)) {
- mir_tstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
if (dlg->lang_name[0] == '\0' && !db_get_ts(hMetaContact, "eSpeak", "TalkLanguage", &dbv)) {
- mir_tstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
}
@@ -825,13 +825,13 @@ void GetContactLanguage(Dialog *dlg) // Use default lang
if (dlg->lang_name[0] == '\0')
- mir_tstrncpy(dlg->lang_name, opts.default_language, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, opts.default_language, _countof(dlg->lang_name));
}
int i = GetClosestLanguage(dlg->lang_name);
if (i < 0) {
// Lost a dict?
- mir_tstrncpy(dlg->lang_name, opts.default_language, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, opts.default_language, _countof(dlg->lang_name));
i = GetClosestLanguage(dlg->lang_name);
}
@@ -1035,7 +1035,7 @@ void AppendSubmenu(HMENU hMenu, HMENU hSubMenu, wchar_t *name) mii.fType = MFT_STRING;
mii.hSubMenu = hSubMenu;
mii.dwTypeData = name;
- mii.cch = mir_tstrlen(name);
+ mii.cch = mir_wstrlen(name);
InsertMenuItem(hMenu, 0, TRUE, &mii);
}
@@ -1053,7 +1053,7 @@ void AppendMenuItem(HMENU hMenu, int id, wchar_t *name, HICON hIcon, BOOL checke mii.hbmpChecked = iconInfo.hbmColor;
mii.hbmpUnchecked = iconInfo.hbmColor;
mii.dwTypeData = name;
- mii.cch = mir_tstrlen(name);
+ mii.cch = mir_wstrlen(name);
InsertMenuItem(hMenu, 0, TRUE, &mii);
}
@@ -1117,7 +1117,7 @@ void AddMenuForWord(Dialog *dlg, wchar_t *word, CHARRANGE &pos, HMENU hMenu, BOO InsertMenu(hMenu, 0, MF_BYPOSITION | MF_SEPARATOR, 0, 0);
wchar_t text[128];
- mir_sntprintf(text, TranslateT("Wrong word: %s"), word);
+ mir_snwprintf(text, TranslateT("Wrong word: %s"), word);
InsertMenu(hMenu, 0, MF_BYPOSITION, 0, text);
}
}
@@ -1551,7 +1551,7 @@ LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) wchar_t* lstrtrim(wchar_t *str)
{
- int len = mir_tstrlen(str);
+ int len = mir_wstrlen(str);
int i;
for (i = len - 1; i >= 0 && (str[i] == ' ' || str[i] == '\t'); --i);
@@ -1572,7 +1572,7 @@ BOOL lstreq(wchar_t *a, wchar_t *b, size_t len) {
a = CharLower(wcsdup(a));
b = CharLower(wcsdup(b));
- BOOL ret = len ? !wcsncmp(a, b, len) : !mir_tstrcmp(a, b);
+ BOOL ret = len ? !wcsncmp(a, b, len) : !mir_wstrcmp(a, b);
free(a);
free(b);
return ret;
diff --git a/plugins/SplashScreen/src/bitmap_funcs.cpp b/plugins/SplashScreen/src/bitmap_funcs.cpp index 9c89965cbe..c0d1531c17 100644 --- a/plugins/SplashScreen/src/bitmap_funcs.cpp +++ b/plugins/SplashScreen/src/bitmap_funcs.cpp @@ -120,7 +120,7 @@ void MyBitmap::restoreAlpha(int x, int y, int w, int h) void MyBitmap::DrawText(wchar_t *str, int x, int y)
{
- SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
+ SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_wstrlen(str), &sz);
RECT rc; SetRect(&rc, x, y, x + 10000, y + 10000);
this->saveAlpha(x - 2, y - 2, sz.cx + 2, sz.cy + 2);
::DrawText(this->getDC(), str, -1, &rc, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_NOPREFIX);
diff --git a/plugins/SplashScreen/src/debug.h b/plugins/SplashScreen/src/debug.h index c283bd30d9..91f45ef971 100644 --- a/plugins/SplashScreen/src/debug.h +++ b/plugins/SplashScreen/src/debug.h @@ -17,17 +17,17 @@ int inline _DebugPopup(MCONTACT hContact, wchar_t *fmt, ...) wchar_t debug[1024];
va_start(va, fmt);
- mir_sntprintf(debug, fmt, va);
+ mir_snwprintf(debug, fmt, va);
if(CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1) {
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
if(hContact != 0)
- mir_tstrncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ mir_wstrncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
else
- mir_tstrncpy(ppd.lptzContactName, _A2W(PlugName), MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lptzText, debug, MAX_SECONDLINE - 20);
+ mir_wstrncpy(ppd.lptzContactName, _A2W(PlugName), MAX_CONTACTNAME);
+ mir_wstrncpy(ppd.lptzText, debug, MAX_SECONDLINE - 20);
ppd.colorText = RGB(255,255,255);
ppd.colorBack = RGB(255,0,0);
PUAddPopupT(&ppd);
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 0a88380ac3..9fa6d0263d 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -65,13 +65,13 @@ void SplashMain() if (bstartup) {
// Retrive path to exe of current running Miranda is located
szMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
- mir_sntprintf(szhAdvaimgPath, L"%s\\plugins\\advaimg.dll", szMirDir);
+ mir_snwprintf(szhAdvaimgPath, L"%s\\plugins\\advaimg.dll", szMirDir);
CallService(MS_SYSTEM_GETVERSIONTEXT, MAX_PATH, (LPARAM)szVersion);
#ifdef _DEBUG
- mir_sntprintf(szLogFile, L"%s\\%s.log", szMirDir, _A2W(__PLUGIN_NAME));
+ mir_snwprintf(szLogFile, L"%s\\%s.log", szMirDir, _A2W(__PLUGIN_NAME));
initLog();
- wchar_t *mirandaVerString = mir_a2t(szVersion);
+ wchar_t *mirandaVerString = mir_a2u(szVersion);
logMessage(L"Miranda version", mirandaVerString);
mir_free(mirandaVerString);
logMessage(L"Dll Name", _A2W(__FILENAME));
@@ -84,45 +84,45 @@ void SplashMain() if (bstartup & (options.active == 1)) {
DBVARIANT dbv = { 0 };
if (!db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv)) {
- mir_tstrcpy(szPrefix, dbv.ptszVal);
+ mir_wstrcpy(szPrefix, dbv.ptszVal);
db_free(&dbv);
}
else
- mir_tstrcpy(szPrefix, L"");
+ mir_wstrcpy(szPrefix, L"");
if (!db_get_ts(NULL, MODNAME, "Path", &dbv)) {
- mir_tstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
- else mir_tstrcpy(inBuf, L"splash\\splash.png");
+ else mir_wstrcpy(inBuf, L"splash\\splash.png");
wchar_t szExpandedSplashFile[MAX_PATH];
ExpandEnvironmentStrings(inBuf, szExpandedSplashFile, _countof(szExpandedSplashFile));
- mir_tstrcpy(inBuf, szExpandedSplashFile);
+ mir_wstrcpy(inBuf, szExpandedSplashFile);
wchar_t *pos3 = 0;
pos3 = wcsrchr(inBuf, ':');
if (pos3 == NULL)
- mir_sntprintf(szSplashFile, L"%s\\%s", szMirDir, inBuf);
+ mir_snwprintf(szSplashFile, L"%s\\%s", szMirDir, inBuf);
else
- mir_tstrcpy(szSplashFile, inBuf);
+ mir_wstrcpy(szSplashFile, inBuf);
if (!db_get_ts(NULL, MODNAME, "Sound", &dbv)) {
- mir_tstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
- else mir_tstrcpy(inBuf, L"sounds\\startup.wav");
+ else mir_wstrcpy(inBuf, L"sounds\\startup.wav");
wchar_t szExpandedSoundFile[MAX_PATH];
ExpandEnvironmentStrings(inBuf, szExpandedSoundFile, _countof(szExpandedSoundFile));
- mir_tstrcpy(inBuf, szExpandedSoundFile);
+ mir_wstrcpy(inBuf, szExpandedSoundFile);
wchar_t *pos2;
pos2 = wcschr(inBuf, ':');
if (pos2 == NULL)
- mir_sntprintf(szSoundFile, L"%s\\%s", szMirDir, inBuf);
+ mir_snwprintf(szSoundFile, L"%s\\%s", szMirDir, inBuf);
else
- mir_tstrcpy(szSoundFile, inBuf);
+ mir_wstrcpy(szSoundFile, inBuf);
#ifdef _DEBUG
logMessage(L"SoundFilePath", szSoundFile);
@@ -137,13 +137,13 @@ void SplashMain() wchar_t *p = 0;
wchar_t files[255][50]; //TODO: make memory allocation dynamic
- mir_tstrcpy(szSplashDir, szSplashFile);
- mir_tstrcpy(szOldPath, szSplashFile);
+ mir_wstrcpy(szSplashDir, szSplashFile);
+ mir_wstrcpy(szOldPath, szSplashFile);
// find the last \ and null it out, this leaves no trailing slash
p = wcsrchr(szSplashDir, '\\');
if (p) *p = 0;
// create the search filter
- mir_sntprintf(szSearch, L"%s\\*.*", szSplashDir);
+ mir_snwprintf(szSearch, L"%s\\*.*", szSplashDir);
// FFFN will return filenames
HANDLE hFind = INVALID_HANDLE_VALUE;
WIN32_FIND_DATA ffd;
@@ -157,19 +157,19 @@ void SplashMain() //files = new char[mir_strlen(ffd.cFileName)];
//files[filescount] = new char[mir_strlen(ffd.cFileName)];
wchar_t ext[5];
- wmemcpy(ext, ffd.cFileName + (mir_tstrlen(ffd.cFileName) - 4), 5);
+ wmemcpy(ext, ffd.cFileName + (mir_wstrlen(ffd.cFileName) - 4), 5);
#ifdef _DEBUG
logMessage(L"Extention", ext);
#endif
- if (mir_tstrcmpi(ext, L".png") & mir_tstrcmpi(ext, L".bmp"))
+ if (mir_wstrcmpi(ext, L".png") & mir_wstrcmpi(ext, L".bmp"))
continue;
#ifdef _DEBUG
logMessage(L"File has valid ext", ext);
#endif
- mir_tstrcpy(files[filescount++], ffd.cFileName);
+ mir_wstrcpy(files[filescount++], ffd.cFileName);
} //if
} while (FindNextFile(hFind, &ffd));
@@ -177,7 +177,7 @@ void SplashMain() int r = 0;
if (filescount) r = (rand() % filescount) + 1;
- mir_sntprintf(szSplashFile, L"%s\\%s", szSplashDir, files[r - 1]);
+ mir_snwprintf(szSplashFile, L"%s\\%s", szSplashDir, files[r - 1]);
#ifdef _DEBUG
logMessage(L"final file", szSplashFile);
diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index f68eac44be..dce6380576 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -69,27 +69,27 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t inBuf[80];
DBVARIANT dbv = { 0 };
if (!db_get_ts(NULL, MODNAME, "Path", &dbv)) {
- mir_tstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
else
- mir_tstrcpy(inBuf, L"splash\\splash.png");
+ mir_wstrcpy(inBuf, L"splash\\splash.png");
SetDlgItemText(hwndDlg, IDC_SPLASHPATH, inBuf);
if (!db_get_ts(NULL, MODNAME, "Sound", &dbv)) {
- mir_tstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
else
- mir_tstrcpy(inBuf, L"sounds\\startup.wav");
+ mir_wstrcpy(inBuf, L"sounds\\startup.wav");
SetDlgItemText(hwndDlg, IDC_SNDPATH, inBuf);
if (!db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv)) {
- mir_tstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
else
- mir_tstrcpy(inBuf, L"");
+ mir_wstrcpy(inBuf, L"");
SetDlgItemText(hwndDlg, IDC_VERSIONPREFIX, inBuf);
if (options.active)
@@ -169,19 +169,19 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t szTempPath[MAX_PATH], initDir[MAX_PATH];
if (Exists(szSplashFile)) {
- mir_tstrcpy(initDir, szSplashFile);
+ mir_wstrcpy(initDir, szSplashFile);
wchar_t *pos = wcsrchr(initDir, '\\');
if (pos != NULL)
*pos = 0;
}
else {
szMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
- mir_tstrcpy(initDir, szMirDir);
+ mir_wstrcpy(initDir, szMirDir);
mir_free(szMirDir);
}
wchar_t tmp[MAX_PATH];
- mir_sntprintf(tmp, L"%s (*.png, *.bmp)%c*.png;*.bmp%c%c", TranslateT("Graphic files"), 0, 0, 0);
+ mir_snwprintf(tmp, L"%s (*.png, *.bmp)%c*.png;*.bmp%c%c", TranslateT("Graphic files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
@@ -195,19 +195,19 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ofn.lpstrDefExt = L"";
if (GetOpenFileName(&ofn)) {
- mir_tstrcpy(szSplashFile, szTempPath);
+ mir_wstrcpy(szSplashFile, szTempPath);
#ifdef _DEBUG
logMessage(L"Set path", szSplashFile);
#endif
// Make path relative
int result = PathToRelativeT(szTempPath, szPath2Spash);
- if (result && mir_tstrlen(szPath2Spash) > 0) {
+ if (result && mir_wstrlen(szPath2Spash) > 0) {
if (options.random) {
wchar_t *pos = wcsrchr(szPath2Spash, '\\');
if (pos != NULL) {
*pos = 0;
- mir_tstrcat(szPath2Spash, L"\\");
+ mir_wstrcat(szPath2Spash, L"\\");
}
}
@@ -226,20 +226,20 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t *pos;
if (Exists(szSoundFile)) {
- mir_tstrcpy(initDir, szSoundFile);
+ mir_wstrcpy(initDir, szSoundFile);
pos = wcsrchr(initDir, '\\');
if (pos != NULL) *pos = 0;
}
else {
szMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
- mir_tstrcpy(initDir, szMirDir);
+ mir_wstrcpy(initDir, szMirDir);
mir_free(szMirDir);
}
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
wchar_t tmp[MAX_PATH];
- mir_sntprintf(tmp, L"%s (*.wav, *.mp3)%c*.wav;*.mp3%c%c", TranslateT("Sound Files"), 0, 0, 0);
+ mir_snwprintf(tmp, L"%s (*.wav, *.mp3)%c*.wav;*.mp3%c%c", TranslateT("Sound Files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = szTempPath;
@@ -251,7 +251,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ofn.lpstrDefExt = L"";
if (GetOpenFileName(&ofn)) {
- mir_tstrcpy(szSoundFile, szTempPath);
+ mir_wstrcpy(szSoundFile, szTempPath);
#ifdef _DEBUG
logMessage(L"Set sound path", szSoundFile);
@@ -259,7 +259,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP // Make path relative
int result = PathToRelativeT(szTempPath, szSoundFilePath);
- if (result && mir_tstrlen(szSoundFile) > 0)
+ if (result && mir_wstrlen(szSoundFile) > 0)
SetDlgItemText(hwndDlg, IDC_SNDPATH, szSoundFilePath);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -295,7 +295,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP GetDlgItemText(hwndDlg, IDC_VERSIONPREFIX, tmp, _countof(tmp));
db_set_ts(NULL, MODNAME, "VersionPrefix", tmp);
- mir_tstrcpy(szPrefix, tmp);
+ mir_wstrcpy(szPrefix, tmp);
GetDlgItemText(hwndDlg, IDC_SHOWTIME, tmp, _countof(tmp));
db_set_dw(NULL, MODNAME, "TimeToShow", _wtoi(tmp));
diff --git a/plugins/SplashScreen/src/services.cpp b/plugins/SplashScreen/src/services.cpp index 7a9e35cc69..8b9f6e4caf 100644 --- a/plugins/SplashScreen/src/services.cpp +++ b/plugins/SplashScreen/src/services.cpp @@ -26,18 +26,18 @@ INT_PTR ShowSplashService(WPARAM wparam, LPARAM lparam) wchar_t *filename = (wchar_t*)wparam;
int timetoshow = (int)lparam;
- mir_tstrcpy(szOldfn, szSplashFile);
+ mir_wstrcpy(szOldfn, szSplashFile);
options.showtime = timetoshow;
wchar_t *pos = wcsrchr(filename, ':');
if (pos == NULL)
- mir_sntprintf(szSplashFile, L"%s\\%s", szMirDir, filename);
+ mir_snwprintf(szSplashFile, L"%s\\%s", szMirDir, filename);
else
- mir_tstrcpy(szSplashFile, filename);
+ mir_wstrcpy(szSplashFile, filename);
ShowSplash(false);
- mir_tstrcpy(szSplashFile, szOldfn);
+ mir_wstrcpy(szSplashFile, szOldfn);
return 0;
}
diff --git a/plugins/SplashScreen/src/splash.cpp b/plugins/SplashScreen/src/splash.cpp index c3cafffbc6..fa5f838ab2 100644 --- a/plugins/SplashScreen/src/splash.cpp +++ b/plugins/SplashScreen/src/splash.cpp @@ -42,9 +42,9 @@ LRESULT CALLBACK SplashWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM #ifdef _DEBUG
wchar_t b[40];
- mir_sntprintf(b, L"%d", wParam);
+ mir_snwprintf(b, L"%d", wParam);
logMessage(L"Timer ID", b);
- mir_sntprintf(b, L"%d", options.showtime);
+ mir_snwprintf(b, L"%d", options.showtime);
logMessage(L"ShowTime value", b);
#endif
@@ -228,16 +228,16 @@ void __cdecl SplashThread(void *arg) }
wchar_t verString[256] = { 0 };
- wchar_t *mirandaVerString = mir_a2t(szVersion);
- mir_sntprintf(verString, L"%s%s", szPrefix, mirandaVerString);
+ wchar_t *mirandaVerString = mir_a2u(szVersion);
+ mir_snwprintf(verString, L"%s%s", szPrefix, mirandaVerString);
mir_free(mirandaVerString);
LOGFONT lf = { 0 };
lf.lfHeight = 14;
- mir_tstrcpy(lf.lfFaceName, L"Verdana");
+ mir_wstrcpy(lf.lfFaceName, L"Verdana");
SelectObject(SplashBmp->getDC(), CreateFontIndirect(&lf));
if (!splashWithMarkers) {
SIZE v_sz = { 0, 0 };
- GetTextExtentPoint32(SplashBmp->getDC(), verString, (int)mir_tstrlen(verString), &v_sz);
+ GetTextExtentPoint32(SplashBmp->getDC(), verString, (int)mir_wstrlen(verString), &v_sz);
x = SplashBmp->getWidth() / 2 - (v_sz.cx / 2);
y = SplashBmp->getHeight() - (SplashBmp->getHeight()*(100 - 90) / 100);
}
@@ -327,7 +327,7 @@ BOOL ShowSplash(BOOL bpreview) timeout = options.showtime;
#ifdef _DEBUG
wchar_t b[40];
- mir_sntprintf(b, L"%d", options.showtime);
+ mir_snwprintf(b, L"%d", options.showtime);
logMessage(L"Timeout", b);
#endif
}
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index fa478010c4..2c6fd9d728 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -351,7 +351,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
LoadSettings();
- SetDlgItemText(hwndDlg, IDC_HST, mir_a2t(hostname));
+ SetDlgItemText(hwndDlg, IDC_HST, mir_a2u(hostname));
CheckDlgButton(hwndDlg, IDC_DELAY, (Enabled == 1) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_SSSPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_SSTIME), 0);
SendDlgItemMessage(hwndDlg, IDC_SSSPIN, UDM_SETRANGE32, 10, 300);
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp index 818631c5dc..1941273470 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp @@ -127,7 +127,7 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if (settings[i]->msg != NULL)
SetDlgItemTextA(hwndDlg, IDC_STATUSMSG, settings[i]->msg);
else {
- ptrT msg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, settings[i]->status, 0));
+ ptrW msg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, settings[i]->status, 0));
SetDlgItemText(hwndDlg, IDC_STATUSMSG, (msg != NULL) ? msg : L"");
}
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 413c8f0f54..54cb3028d4 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -224,7 +224,7 @@ static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, wch log_infoA("KeepStatus: assigning status %d to %s", cs->status, cs->szName); - if (szMsg != NULL && mir_tstrcmp(szMsg, cs->szMsg)) { + if (szMsg != NULL && mir_wstrcmp(szMsg, cs->szMsg)) { if (cs->szMsg != NULL) free(cs->szMsg); @@ -897,7 +897,7 @@ static int ProcessPopup(int reason, LPARAM lParam) return -1; hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - mir_sntprintf(text, TranslateT("%s connected from another location"), GetHumanName(lParam)); + mir_snwprintf(text, TranslateT("%s connected from another location"), GetHumanName(lParam)); break; case KS_CONN_STATE_LOGINERROR: // lParam = 1 proto @@ -906,9 +906,9 @@ static int ProcessPopup(int reason, LPARAM lParam) hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL) - mir_sntprintf(text, TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); + mir_snwprintf(text, TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); else if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY) - mir_sntprintf(text, TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); + mir_snwprintf(text, TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); else return -1; break; @@ -919,9 +919,9 @@ static int ProcessPopup(int reason, LPARAM lParam) if (lParam) { // Óêàçàòåëü íà èìÿ ìîäóëÿ. hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - mir_sntprintf(text, TranslateT("%s status error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, currentDelay / 1000); + mir_snwprintf(text, TranslateT("%s status error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, currentDelay / 1000); } - else mir_sntprintf(text, TranslateT("Status error (next retry (%d) in %d s)"), retryCount + 1, currentDelay / 1000); + else mir_snwprintf(text, TranslateT("Status error (next retry (%d) in %d s)"), retryCount + 1, currentDelay / 1000); break; case KS_CONN_STATE_RETRY: // lParam = PROTOCOLSETTINGEX** @@ -932,22 +932,22 @@ static int ProcessPopup(int reason, LPARAM lParam) wchar_t protoInfoLine[512], protoInfo[MAX_SECONDLINE]; memset(protoInfoLine, '\0', sizeof(protoInfoLine)); memset(protoInfo, '\0', sizeof(protoInfo)); - mir_tstrcpy(protoInfo, L"\r\n"); + mir_wstrcpy(protoInfo, L"\r\n"); for (int i = 0; i < connectionSettings.getCount(); i++) { - if (mir_tstrlen(ps[i]->tszAccName) > 0 && mir_strlen(ps[i]->szName) > 0) { + if (mir_wstrlen(ps[i]->tszAccName) > 0 && mir_strlen(ps[i]->szName) > 0) { if (db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)) { - mir_sntprintf(protoInfoLine, TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, 0)); - mir_tstrncat(protoInfo, protoInfoLine, _countof(protoInfo) - mir_tstrlen(protoInfo) - 1); + mir_snwprintf(protoInfoLine, TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, 0)); + mir_wstrncat(protoInfo, protoInfoLine, _countof(protoInfo) - mir_wstrlen(protoInfo) - 1); } } } hIcon = Skin_LoadProtoIcon(ps[0]->szName, SKINICON_STATUS_OFFLINE); - rtrimt(protoInfo); + rtrimw(protoInfo); if (retryCount == (maxRetries - 1)) - mir_sntprintf(text, TranslateT("Resetting status... (last try (%d))%s"), retryCount + 1, protoInfo); + mir_snwprintf(text, TranslateT("Resetting status... (last try (%d))%s"), retryCount + 1, protoInfo); else - mir_sntprintf(text, TranslateT("Resetting status... (next retry (%d) in %d s)%s"), retryCount + 2, currentDelay / 1000, protoInfo); + mir_snwprintf(text, TranslateT("Resetting status... (next retry (%d) in %d s)%s"), retryCount + 2, currentDelay / 1000, protoInfo); } break; @@ -956,9 +956,9 @@ static int ProcessPopup(int reason, LPARAM lParam) return -1; if (retryCount == maxRetries - 1) - mir_sntprintf(text, TranslateT("No internet connection seems available... (last try (%d))"), retryCount + 1); + mir_snwprintf(text, TranslateT("No internet connection seems available... (last try (%d))"), retryCount + 1); else - mir_sntprintf(text, TranslateT("No internet connection seems available... (next retry (%d) in %d s)"), retryCount + 2, currentDelay / 1000); + mir_snwprintf(text, TranslateT("No internet connection seems available... (next retry (%d) in %d s)"), retryCount + 2, currentDelay / 1000); break; case KS_CONN_STATE_STOPPEDCHECKING: // lParam == BOOL succes @@ -967,9 +967,9 @@ static int ProcessPopup(int reason, LPARAM lParam) if (lParam) { hIcon = Skin_LoadIcon(SKINICON_STATUS_ONLINE); - mir_sntprintf(text, TranslateT("Status was set ok")); + mir_snwprintf(text, TranslateT("Status was set ok")); } - else mir_sntprintf(text, TranslateT("Giving up")); + else mir_snwprintf(text, TranslateT("Giving up")); break; } if (hIcon == NULL) diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 389b7a4d66..31d8324e22 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -156,16 +156,16 @@ static wchar_t* GetLinkDescription(TSettingsList& protoSettings) result.Append(status);
}
- return mir_tstrndup(result, result.GetLength());
+ return mir_wstrndup(result, result.GetLength());
}
HRESULT CreateLink(TSettingsList& protoSettings)
{
wchar_t savePath[MAX_PATH];
if (SHGetSpecialFolderPath(NULL, savePath, 0x10, FALSE))
- wcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_tstrlen(savePath));
+ wcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_wstrlen(savePath));
else
- mir_sntprintf(savePath, L".\\%s", SHORTCUT_FILENAME);
+ mir_snwprintf(savePath, L".\\%s", SHORTCUT_FILENAME);
// Get a pointer to the IShellLink interface.
IShellLink *psl;
@@ -324,12 +324,12 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wPa }
else {
wchar_t text[128];
- mir_sntprintf(text, TranslateT("size: %d x %d"),
+ mir_snwprintf(text, TranslateT("size: %d x %d"),
db_get_dw(NULL, MODULE_CLIST, SETTING_WIDTH, 0),
db_get_dw(NULL, MODULE_CLIST, SETTING_HEIGHT, 0));
SetDlgItemText(hwndDlg, IDC_CURWINSIZE, text);
- mir_sntprintf(text, TranslateT("loc: %d x %d"),
+ mir_snwprintf(text, TranslateT("loc: %d x %d"),
db_get_dw(NULL, MODULE_CLIST, SETTING_XPOS, 0),
db_get_dw(NULL, MODULE_CLIST, SETTING_YPOS, 0));
SetDlgItemText(hwndDlg, IDC_CURWINLOC, text);
@@ -529,9 +529,9 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP if ( GetProfile(i, ar) == -1) {
/* create an empty profile */
if (i == defProfile)
- ppo->tszName = mir_tstrdup( TranslateT("default"));
+ ppo->tszName = mir_wstrdup( TranslateT("default"));
else
- ppo->tszName = mir_tstrdup( TranslateT("unknown"));
+ ppo->tszName = mir_wstrdup( TranslateT("unknown"));
}
else {
for (int j=0; j < ar.getCount(); j++)
@@ -541,9 +541,9 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP ppo->tszName = db_get_tsa(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME));
if (ppo->tszName == NULL) {
if (i == defProfile)
- ppo->tszName = mir_tstrdup( TranslateT("default"));
+ ppo->tszName = mir_wstrdup( TranslateT("default"));
else
- ppo->tszName = mir_tstrdup( TranslateT("unknown"));
+ ppo->tszName = mir_wstrdup( TranslateT("unknown"));
}
ppo->createTtb = db_get_b(NULL, MODULENAME, OptName(i, SETTING_CREATETTBBUTTON), 0);
ppo->showDialog = db_get_b(NULL, MODULENAME, OptName(i, SETTING_SHOWCONFIRMDIALOG), 0);
@@ -665,7 +665,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP break;
PROFILEOPTIONS* ppo = new PROFILEOPTIONS;
- ppo->tszName = mir_tstrdup(tszName);
+ ppo->tszName = mir_wstrdup(tszName);
ppo->ps = GetCurrentProtoSettings();
arProfiles.insert(ppo);
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index d370e53999..6cb631e3cb 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -139,9 +139,9 @@ wchar_t *GetStatusMessage(int profile, char *szProto) if ((pce[i].profile == profile) && (!mir_strcmp(pce[i].szProto, szProto))) { mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db - pce[i].msg = (wchar_t*)realloc(pce[i].msg, sizeof(wchar_t)*(mir_tstrlen(dbv.ptszVal) + 1)); + pce[i].msg = (wchar_t*)realloc(pce[i].msg, sizeof(wchar_t)*(mir_wstrlen(dbv.ptszVal) + 1)); if (pce[i].msg != NULL) { - mir_tstrcpy(pce[i].msg, dbv.ptszVal); + mir_wstrcpy(pce[i].msg, dbv.ptszVal); } db_free(&dbv); } diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index 19411d9938..c04f8ab085 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -117,7 +117,7 @@ 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);
+ return mir_wstrdup(ps->szMsg);
}
wchar_t *tMsg = (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, newstatus, (LPARAM)ps->szName);
@@ -184,10 +184,10 @@ static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus) else
continue;
- if (mir_tstrlen(substituteStr) > 6)
- 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));
+ if (mir_wstrlen(substituteStr) > 6)
+ tszMsg = (wchar_t*)mir_realloc(tszMsg, sizeof(wchar_t)*(mir_wstrlen(tszMsg) + 1 + mir_wstrlen(substituteStr) - 6));
+ memmove(tszMsg + j + mir_wstrlen(substituteStr), tszMsg + j + 6, sizeof(wchar_t)*(mir_wstrlen(tszMsg) - j - 5));
+ memcpy(tszMsg + j, substituteStr, sizeof(wchar_t)*mir_wstrlen(substituteStr));
}
wchar_t *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL);
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp index 34b82714a8..e19b1d0a55 100644 --- a/plugins/StatusPlugins/confirmdialog.cpp +++ b/plugins/StatusPlugins/confirmdialog.cpp @@ -69,7 +69,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar {
wchar_t desc[512];
- mir_sntprintf(desc, TranslateT("Set %s message for %s."),
+ mir_snwprintf(desc, TranslateT("Set %s message for %s."),
pcli->pfnGetStatusModeDescription(GetActualStatus(protoSetting), 0), protoSetting->tszAccName);
SetDlgItemText(hwndDlg, IDC_DESCRIPTION, desc);
}
@@ -127,11 +127,11 @@ static int SetStatusList(HWND hwndDlg) wchar_t* status = pcli->pfnGetStatusModeDescription(actualStatus, 0);
switch ((*confirmSettings)[i].status) {
case ID_STATUS_LAST:
- mir_sntprintf(buf, L"%s (%s)", TranslateT("<last>"), status);
+ mir_snwprintf(buf, L"%s (%s)", TranslateT("<last>"), status);
ListView_SetItemText(hList, lvItem.iItem, 1, buf);
break;
case ID_STATUS_CURRENT:
- mir_sntprintf(buf, L"%s (%s)", TranslateT("<current>"), status);
+ mir_snwprintf(buf, L"%s (%s)", TranslateT("<current>"), status);
ListView_SetItemText(hList, lvItem.iItem, 1, buf);
break;
default:
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // start timer
if (timeOut > 0) {
wchar_t text[32];
- mir_sntprintf(text, TranslateT("Closing in %d"), timeOut);
+ mir_snwprintf(text, TranslateT("Closing in %d"), timeOut);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
SetTimer(hwndDlg, TIMER_ID, 1000, NULL);
}
@@ -219,7 +219,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_TIMER:
{
wchar_t text[32];
- mir_sntprintf(text, TranslateT("Closing in %d"), timeOut - 1);
+ mir_snwprintf(text, TranslateT("Closing in %d"), timeOut - 1);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
if (timeOut <= 0) {
KillTimer(hwndDlg, TIMER_ID);
@@ -269,7 +269,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // LAST STATUS
if (proto->status == ID_STATUS_LAST) {
wchar_t last[80];
- mir_sntprintf(last, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
+ mir_snwprintf(last, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, last);
actualStatus = proto->lastStatus;
}
@@ -278,7 +278,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP else if (proto->status == ID_STATUS_CURRENT) {
int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0);
wchar_t current[80];
- mir_sntprintf(current, L"%s (%s)", TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
+ mir_snwprintf(current, L"%s (%s)", TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, current);
actualStatus = currentStatus;
}
@@ -344,7 +344,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // last
wchar_t buf[100];
- mir_sntprintf(buf, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
+ mir_snwprintf(buf, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf);
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_LAST);
if (proto->status == ID_STATUS_LAST) {
@@ -354,7 +354,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // current
int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0);
- mir_sntprintf(buf, L"%s (%s)", TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
+ mir_snwprintf(buf, L"%s (%s)", TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf);
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_CURRENT);
if (proto->status == ID_STATUS_CURRENT) {
diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index c5cc135954..3f5311b9ad 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -143,7 +143,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) } } else if (!gbRegexMatch) - answered = gbCaseInsensitive ? (!Stricmp(message.c_str(), (variables_parse(gbAnswer, hContact).c_str()))) : (!mir_tstrcmp(message.c_str(), (variables_parse(gbAnswer, hContact).c_str()))); + answered = gbCaseInsensitive ? (!Stricmp(message.c_str(), (variables_parse(gbAnswer, hContact).c_str()))) : (!mir_wstrcmp(message.c_str(), (variables_parse(gbAnswer, hContact).c_str()))); else { if (gbCaseInsensitive) { std::string check(toUTF8(variables_parse(gbAnswer, hContact))), msg(toUTF8(message)); diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index e2fa1253d1..bb2086b078 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -109,9 +109,9 @@ wstring variables_parse(wstring const &tstrFormat, MCONTACT hContact) return tstrFormat;
}
-// case-insensitive mir_tstrcmp
+// case-insensitive mir_wstrcmp
//by nullbie as i remember...
-#define NEWTSTR_MALLOC(A) (A==NULL) ? NULL : mir_tstrcpy((wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_tstrlen(A)+1)),A)
+#define NEWTSTR_MALLOC(A) (A==NULL) ? NULL : mir_wstrcpy((wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_wstrlen(A)+1)),A)
const int Stricmp(const wchar_t *str, const wchar_t *substr)
{
int i = 0;
@@ -119,10 +119,10 @@ const int Stricmp(const wchar_t *str, const wchar_t *substr) wchar_t *str_up = NEWTSTR_MALLOC(str);
wchar_t *substr_up = NEWTSTR_MALLOC(substr);
- CharUpperBuff(str_up, (int)mir_tstrlen(str_up));
- CharUpperBuff(substr_up, (int)mir_tstrlen(substr_up));
+ CharUpperBuff(str_up, (int)mir_wstrlen(str_up));
+ CharUpperBuff(substr_up, (int)mir_wstrlen(substr_up));
- i = mir_tstrcmp(str_up, substr_up);
+ i = mir_wstrcmp(str_up, substr_up);
mir_free(str_up);
mir_free(substr_up);
@@ -175,9 +175,9 @@ BOOL IsUrlContains(wchar_t * Str) L".tv"
};
- if (Str && mir_tstrlen(Str) > 0) {
+ if (Str && mir_wstrlen(Str) > 0) {
wchar_t *StrLower = NEWTSTR_MALLOC(Str);
- CharLowerBuff(StrLower, (int)mir_tstrlen(StrLower));
+ CharLowerBuff(StrLower, (int)mir_wstrlen(StrLower));
for (int i = 0; i < CountUrl; i++)
if (wcsstr(StrLower, URL[i])) {
mir_free(StrLower);
@@ -191,7 +191,7 @@ BOOL IsUrlContains(wchar_t * Str) wstring GetContactUid(MCONTACT hContact, wstring Protocol)
{
char *szProto = mir_utf8encodeW(Protocol.c_str());
- ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, hContact, szProto));
+ ptrW uid(Contact_GetInfo(CNF_DISPLAYUID, hContact, szProto));
return (uid) ? uid : L"";
}
@@ -206,7 +206,7 @@ void LogSpamToFile(MCONTACT hContact, wstring message) if (hStopSpamLogDirH)
FoldersGetCustomPathT(hStopSpamLogDirH, pszName, MAX_PATH, L"");
else
- mir_tstrncpy(pszName, VARST(L"%miranda_logpath%"), _countof(pszName));
+ mir_wstrncpy(pszName, VARST(L"%miranda_logpath%"), _countof(pszName));
wstring filename = pszName;
filename += L"\\stopspam_mod.log";
diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index a4996d034a..d7965d04db 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -107,7 +107,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) // if answer not empty
if (answer.length() > 0) {
// if message equal right answer...
- if (plSets->AnswNotCaseSens.Get() ? !mir_tstrcmpi(message.c_str(), answer.c_str()) : !mir_tstrcmp(message.c_str(), answer.c_str())) {
+ if (plSets->AnswNotCaseSens.Get() ? !mir_wstrcmpi(message.c_str(), answer.c_str()) : !mir_wstrcmp(message.c_str(), answer.c_str())) {
// unhide contact
db_unset(hContact, "CList", "Hidden");
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index 5026af7098..3d022a2ba8 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -25,7 +25,7 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam) {
for (MCONTACT hContact = db_find_first(); hContact;) {
MCONTACT hNext = db_find_next(hContact);
- ptrT szGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW szGroup(db_get_tsa(hContact, "CList", "Group"));
if (db_get_b(hContact, "CList", "NotOnList", 0) || (szGroup != NULL && (wcsstr(szGroup, L"Not In List") || wcsstr(szGroup, TranslateT("Not In List"))))) {
char *szProto = GetContactProto(hContact);
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index 673ad7d5a2..443039eba6 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -291,7 +291,7 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint) }
SIZE sz;
- GetTextExtentPoint32(hdcMem, szText, (int)mir_tstrlen(szText), &sz);
+ GetTextExtentPoint32(hdcMem, szText, (int)mir_wstrlen(szText), &sz);
if (ctl->cHot) {
SIZE szHot;
GetTextExtentPoint32A(hdcMem, "&", 1, &szHot);
@@ -300,7 +300,7 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint) if (ctl->arrow)
DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right - rcClient.left - 5 - PluginConfig.m_smcxicon + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), (rcClient.bottom - rcClient.top) / 2 - PluginConfig.m_smcyicon / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, IsWindowEnabled(ctl->hwnd) ? DST_ICON : DST_ICON | DSS_DISABLED);
SelectObject(hdcMem, ctl->hFont);
- DrawState(hdcMem, NULL, NULL, (LPARAM)szText, mir_tstrlen(szText), (rcText.right - rcText.left - sz.cx) / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - sz.cy) / 2 : (rcText.bottom - rcText.top - sz.cy) / 2 - (ctl->stateId == PBS_PRESSED ? 0 : 1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)szText, mir_wstrlen(szText), (rcText.right - rcText.left - sz.cx) / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - sz.cy) / 2 : (rcText.bottom - rcText.top - sz.cy) / 2 - (ctl->stateId == PBS_PRESSED ? 0 : 1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
SelectObject(hdcMem, hOldFont);
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 2e2561c2c2..b7116265d1 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -121,7 +121,7 @@ static INT_PTR CB_AddButton(WPARAM, LPARAM lParam) if (bbdi->bbbFlags & BBBF_ANSITOOLTIP) cbd->m_ptszTooltip = mir_a2u(bbdi->pszTooltip); else - cbd->m_ptszTooltip = mir_tstrdup(bbdi->ptszTooltip); + cbd->m_ptszTooltip = mir_wstrdup(bbdi->ptszTooltip); } else cbd->m_ptszTooltip = NULL; @@ -314,7 +314,7 @@ static INT_PTR CB_ModifyButton(WPARAM, LPARAM lParam) if (bbdi->bbbFlags & BBBF_ANSITOOLTIP) cbd->m_ptszTooltip = mir_a2u(bbdi->pszTooltip); else - cbd->m_ptszTooltip = mir_tstrdup(bbdi->ptszTooltip); + cbd->m_ptszTooltip = mir_wstrdup(bbdi->ptszTooltip); } if (bbdi->hIcon) cbd->m_hIcon = bbdi->hIcon; @@ -369,7 +369,7 @@ static int SaveTree(HWND hToolBarTree) while (tvi.hItem != NULL) { TreeView_GetItem(hToolBarTree, &tvi); - if (mir_tstrcmp(tvi.pszText, MIDDLE_SEPARATOR) == 0) { + if (mir_wstrcmp(tvi.pszText, MIDDLE_SEPARATOR) == 0) { RSide = true; count = TreeView_GetCount(hToolBarTree) * 10 - count; tvi.hItem = TreeView_GetNextSibling(hToolBarTree, tvi.hItem); @@ -708,7 +708,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l tvi.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_PARAM; TreeView_GetItem(hToolBarTree, &tvi); - if (tvi.lParam == 0 || !TreeView_GetCheckState(hToolBarTree, tvi.hItem) || !mir_tstrcmp(tvi.pszText, MIDDLE_SEPARATOR)) + if (tvi.lParam == 0 || !TreeView_GetCheckState(hToolBarTree, tvi.hItem) || !mir_wstrcmp(tvi.pszText, MIDDLE_SEPARATOR)) break; CustomButtonData *cbd = (CustomButtonData*)tvi.lParam; @@ -736,7 +736,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l tvi.hItem = hItem; TreeView_GetItem(hToolBarTree, &tvi); - if (!TreeView_GetCheckState(hToolBarTree, tvi.hItem) || !mir_tstrcmp(tvi.pszText, MIDDLE_SEPARATOR)) { + if (!TreeView_GetCheckState(hToolBarTree, tvi.hItem) || !mir_wstrcmp(tvi.pszText, MIDDLE_SEPARATOR)) { Utils::enableDlgControl(hwndDlg, IDC_IMCHECK, false); Utils::enableDlgControl(hwndDlg, IDC_CHATCHECK, false); Utils::enableDlgControl(hwndDlg, IDC_CANBEHIDDEN, false); diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 09b240c6aa..3cec3e01bb 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -81,7 +81,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, wchar_t MODULEINFO *mi = pci->MM_FindModule(streamData->si->pszModule);
va_start(va, fmt);
- lineLen = mir_vsntprintf(line, 8000, fmt, va);
+ lineLen = mir_vsnwprintf(line, 8000, fmt, va);
if (lineLen < 0)
return 0;
line[lineLen] = 0;
@@ -115,7 +115,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, wchar_t szTemp3[1] = line[2];
szTemp3[2] = '\0';
col = _wtoi(szTemp3);
- mir_sntprintf(szTemp, L"%%%c#%02X%02X%02X", c, GetRValue(mi->crColors[col]), GetGValue(mi->crColors[col]), GetBValue(mi->crColors[col]));
+ mir_snwprintf(szTemp, L"%%%c#%02X%02X%02X", c, GetRValue(mi->crColors[col]), GetGValue(mi->crColors[col]), GetBValue(mi->crColors[col]));
}
}
line += 2;
@@ -123,7 +123,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, wchar_t case 'C':
case 'F':
if (!g_Settings.bStripFormat && !streamData->bStripFormat) {
- mir_sntprintf(szTemp, L"%%%c", *line);
+ mir_snwprintf(szTemp, L"%%%c", *line);
}
break;
case 'b':
@@ -134,13 +134,13 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, wchar_t case 'I':
case 'r':
if (!streamData->bStripFormat) {
- mir_sntprintf(szTemp, L"%%%c", *line);
+ mir_snwprintf(szTemp, L"%%%c", *line);
}
break;
}
if (szTemp[0]) {
- size_t iLen = mir_tstrlen(szTemp);
+ size_t iLen = mir_wstrlen(szTemp);
memcpy(d, szTemp, iLen * sizeof(wchar_t));
d += iLen;
}
@@ -429,7 +429,7 @@ static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA va_list va;
va_start(va, fmt);
- int lineLen = mir_vsntprintf(line, 8000, fmt, va);
+ int lineLen = mir_vsnwprintf(line, 8000, fmt, va);
if (lineLen < 0)
lineLen = 8000;
line[lineLen] = 0;
@@ -530,19 +530,19 @@ static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData) return;
if (streamData->lin->ptszNick) {
- if (g_Settings.bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) {
+ if (g_Settings.bLogLimitNames && mir_wstrlen(streamData->lin->ptszNick) > 20) {
wcsncpy_s(szTemp, 20, streamData->lin->ptszNick, _TRUNCATE);
wcsncpy_s(szTemp + 20, 4, L"...", _TRUNCATE);
}
else wcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE);
if (g_Settings.bClickableNicks)
- mir_sntprintf(szTemp2, L"~~++#%s#++~~", szTemp);
+ mir_snwprintf(szTemp2, L"~~++#%s#++~~", szTemp);
else
wcsncpy_s(szTemp2, szTemp, _TRUNCATE);
if (streamData->lin->ptszUserInfo && streamData->lin->iType != GC_EVENT_TOPIC)
- mir_sntprintf(szTemp, L"%s (%s)", szTemp2, streamData->lin->ptszUserInfo);
+ mir_snwprintf(szTemp, L"%s (%s)", szTemp2, streamData->lin->ptszUserInfo);
else
wcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
@@ -774,7 +774,7 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) wcsncpy_s(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), _TRUNCATE);
wcsncpy_s(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), _TRUNCATE);
- if (!g_Settings.bShowTimeIfChanged || streamData->si->LastTime == 0 || mir_tstrcmp(szTimeStamp, szOldTimeStamp)) {
+ if (!g_Settings.bShowTimeIfChanged || streamData->si->LastTime == 0 || mir_wstrcmp(szTimeStamp, szOldTimeStamp)) {
streamData->si->LastTime = lin->time;
Log_AppendRTF(streamData, TRUE, str, L"%s", szTimeStamp);
}
@@ -985,7 +985,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedra // this uses hidden marks in the rich text to find the events which should be deleted
if (si->bTrimmed) {
wchar_t szPattern[50];
- mir_sntprintf(szPattern, L"~-+%d+-~", si->pLogEnd);
+ mir_snwprintf(szPattern, L"~-+%d+-~", si->pLogEnd);
FINDTEXTEX fi;
fi.lpstrText = szPattern;
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index 61859eab96..0694e9f815 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -156,7 +156,7 @@ static void OnLoadSettings() g_Settings.bNewLineAfterNames = M.GetBool(CHAT_MODULE, "NewlineAfterNames", false);
g_Settings.bUseCommaAsColon = M.GetBool(CHAT_MODULE, "UseCommaAsColon", false);
- replaceStrT(g_Settings.pszLogDir, M.getChatLogPath());
+ replaceStrW(g_Settings.pszLogDir, M.getChatLogPath());
g_Settings.LogIconSize = (g_Settings.bScaleIcons) ? 12 : 16;
diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp index 014b238b05..2b5143465c 100644 --- a/plugins/TabSRMM/src/chat/manager.cpp +++ b/plugins/TabSRMM/src/chat/manager.cpp @@ -41,7 +41,7 @@ static int sttCompareNicknames(const wchar_t *s1, const wchar_t *s2) if (*s1 && !*s2) return -1;
// compare tails
- return mir_tstrcmpi(s1, s2);
+ return mir_wstrcmpi(s1, s2);
}
int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus)
@@ -58,7 +58,7 @@ int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus) if (g_Settings.bAlternativeSorting)
return sttCompareNicknames(u1->pszNick, pszNick);
else
- return mir_tstrcmp(u1->pszNick, pszNick);
+ return mir_wstrcmp(u1->pszNick, pszNick);
}
dw1 = dw1 >> 1;
dw2 = dw2 >> 1;
@@ -66,7 +66,7 @@ int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus) if (g_Settings.bAlternativeSorting)
return sttCompareNicknames(u1->pszNick, pszNick);
- return mir_tstrcmp(u1->pszNick, pszNick);
+ return mir_wstrcmp(u1->pszNick, pszNick);
}
//---------------------------------------------------
@@ -121,7 +121,7 @@ SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* cu for (SESSION_INFO *si = pci->wndList; si; si = si->next)
if (si != currSession && !mir_strcmpi(pszModule, si->pszModule))
if (my_strstri(si->ptszName, pszOriginal) == si->ptszName)
- if (prevSession != si && mir_tstrcmpi(si->ptszName, pszCurrent) > 0 && (!pszName || mir_tstrcmpi(si->ptszName, pszName) < 0)) {
+ if (prevSession != si && mir_wstrcmpi(si->ptszName, pszCurrent) > 0 && (!pszName || mir_wstrcmpi(si->ptszName, pszName) < 0)) {
pResult = si;
pszName = si->ptszName;
}
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp index 0ec60454ff..e6a00d5784 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.cpp +++ b/plugins/TabSRMM/src/chat/muchighlight.cpp @@ -151,7 +151,7 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF p1 = 0;
for (UINT i = 0; i < m_iTextPatterns && !result; i++)
- result = wildcmpt(p, m_TextPatterns[i]) ? MATCH_TEXT : 0;
+ result = wildcmpw(p, m_TextPatterns[i]) ? MATCH_TEXT : 0;
if (p1) {
*p1 = ' ';
@@ -167,9 +167,9 @@ skip_textpatterns: if ((m_dwFlags & MATCH_NICKNAME) && (dwFlags & MATCH_NICKNAME) && pgce->ptszNick && m_iNickPatterns > 0) {
for (UINT i = 0; i < m_iNickPatterns && !nResult; i++) {
if (pgce->ptszNick)
- nResult = wildcmpt(pgce->ptszNick, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
+ nResult = wildcmpw(pgce->ptszNick, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
if ((m_dwFlags & MATCH_UIN) && pgce->ptszUserInfo)
- nResult = wildcmpt(pgce->ptszUserInfo, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
+ nResult = wildcmpw(pgce->ptszUserInfo, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
}
}
@@ -300,7 +300,7 @@ INT_PTR CALLBACK CMUCHighlight::dlgProcAdd(HWND hwndDlg, UINT msg, WPARAM wParam Utils::showDlgControl(hwndDlg, IDC_ADDHIGHLIGHTEDITLIST, SW_HIDE);
::SetDlgItemText(hwndDlg, IDC_ADDHIGHLIGHTTITLE, TranslateT("Add user to highlight list"));
::SendDlgItemMessage(hwndDlg, IDC_ADDHIGHLIGHTNAME, CB_INSERTSTRING, -1, (LPARAM)the->ui->pszNick);
- if (mir_tstrcmp(the->ui->pszNick, the->ui->pszUID))
+ if (mir_wstrcmp(the->ui->pszNick, the->ui->pszUID))
::SendDlgItemMessage(hwndDlg, IDC_ADDHIGHLIGHTNAME, CB_INSERTSTRING, -1, (LPARAM)the->ui->pszUID);
::SendDlgItemMessage(hwndDlg, IDC_ADDHIGHLIGHTNAME, CB_SETCURSEL, 0, 0);
}
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 79bfc11d83..65ee0a3dee 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -225,7 +225,7 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM wcsncpy_s(lf->lfFaceName, L"Webdings", _TRUNCATE);
}
else {
- ptrT tszDefFace(db_get_tsa(NULL, szMod, str));
+ ptrW tszDefFace(db_get_tsa(NULL, szMod, str));
if (tszDefFace == NULL)
wcsncpy_s(lf->lfFaceName, fol[j].szDefFace, _TRUNCATE);
else
@@ -356,8 +356,8 @@ HICON LoadIconEx(char *pszIcoLibName) static void InitSetting(wchar_t* &ppPointer, const char *pszSetting, const wchar_t *pszDefault)
{
- ptrT val(db_get_tsa(NULL, CHAT_MODULE, pszSetting));
- replaceStrT(ppPointer, (val != NULL) ? val : pszDefault);
+ ptrW val(db_get_tsa(NULL, CHAT_MODULE, pszSetting));
+ replaceStrW(ppPointer, (val != NULL) ? val : pszDefault);
}
#define OPT_FIXHEADINGS (WM_USER+1)
@@ -691,7 +691,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM wchar_t tszTooltipText[2048];
- mir_sntprintf(tszTooltipText,
+ mir_snwprintf(tszTooltipText,
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n"
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n"
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
@@ -757,12 +757,12 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM *p1 = 0;
wchar_t tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10];
- mir_sntprintf(tszInitialDir, L"%s%s", M.getChatLogPath(), p);
+ mir_snwprintf(tszInitialDir, L"%s%s", M.getChatLogPath(), p);
if (!PathFileExists(tszInitialDir))
wcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE);
wchar_t tszReturnName[MAX_PATH]; tszReturnName[0] = 0;
- mir_sntprintf(tszTemp, L"%s%c*.*%c%c", TranslateT("All files"), 0, 0, 0);
+ mir_snwprintf(tszTemp, L"%s%c*.*%c%c", TranslateT("All files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lpstrInitialDir = tszInitialDir;
@@ -795,11 +795,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM if (idList) {
const wchar_t *szUserDir = M.getUserDir();
SHGetPathFromIDList(idList, tszDirectory);
- mir_tstrcat(tszDirectory, L"\\");
+ mir_wstrcat(tszDirectory, L"\\");
wchar_t tszTemp[MAX_PATH];
PathToRelativeT(tszDirectory, tszTemp, szUserDir);
- SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
+ SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, mir_wstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
psMalloc->Free(idList);
psMalloc->Release();
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index 4fd40eb4d2..6f318e40f6 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -37,7 +37,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT if (hContact != 0 && M.GetByte("limittabs", 0) && !wcsncmp(pContainer->szName, L"default", 6)) {
if ((pContainer = FindMatchingContainer(L"default")) == NULL) {
wchar_t szName[CONTAINER_NAMELEN + 1];
- mir_sntprintf(szName, L"default");
+ mir_snwprintf(szName, L"default");
if ((pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact)) == NULL)
return 0;
}
@@ -53,7 +53,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT // cut nickname if larger than x chars...
wchar_t newcontactname[128];
- if (mir_tstrlen(contactName) > 0) {
+ if (mir_wstrlen(contactName) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, _countof(newcontactname));
else
@@ -167,7 +167,7 @@ void ShowRoom(SESSION_INFO *si, WPARAM, BOOL) TContainerData *pContainer = si->pContainer;
if (pContainer == NULL) {
GetContainerNameForContact(si->hContact, szName, CONTAINER_NAMELEN);
- if (!g_Settings.bOpenInDefault && !mir_tstrcmp(szName, L"default"))
+ if (!g_Settings.bOpenInDefault && !mir_wstrcmp(szName, L"default"))
wcsncpy(szName, L"Chat Rooms", CONTAINER_NAMELEN);
szName[CONTAINER_NAMELEN] = 0;
pContainer = FindContainerByName(szName);
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 274e4ab8a0..63f7f8134a 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -98,11 +98,11 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa va_list marker;
static wchar_t szBuf[4 * 1024];
- if (!fmt || mir_tstrlen(fmt) == 0 || mir_tstrlen(fmt) > 2000)
+ if (!fmt || mir_wstrlen(fmt) == 0 || mir_wstrlen(fmt) > 2000)
return 0;
va_start(marker, fmt);
- mir_vsntprintf(szBuf, _countof(szBuf), fmt, marker);
+ mir_vsnwprintf(szBuf, _countof(szBuf), fmt, marker);
va_end(marker);
pd.lchContact = hContact;
@@ -113,7 +113,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa pd.lchIcon = LoadIconEx("window");
PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
- mir_sntprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0));
wcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE);
pd.iSeconds = g_Settings.iPopupTimeout;
@@ -532,7 +532,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO if (pszWordText && pszWordText[0]) {
wchar_t szMenuText[4096];
- mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
+ mir_snwprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
}
else ModifyMenu(*hMenu, 4, MF_STRING | MF_GRAYED | MF_BYPOSITION, 4, TranslateT("No word to look up"));
@@ -541,11 +541,11 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO else if (iIndex == 0) {
wchar_t szTemp[50];
if (pszWordText)
- mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
+ mir_snwprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
wcsncpy_s(szTemp, TranslateT("&Message"), _TRUNCATE);
- if (mir_tstrlen(szTemp) > 40)
+ if (mir_wstrlen(szTemp) > 40)
wcsncpy_s(szTemp + 40, 4, L"...", _TRUNCATE);
ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp);
gcmi.Type = MENU_ON_NICKLIST;
@@ -658,7 +658,7 @@ char GetIndicator(SESSION_INFO *si, LPCTSTR ptszNick, int *iNickIndex) *iNickIndex = 0;
for (USERINFO *ui = si->pUsers; ui; ui = ui->next) {
- if (!mir_tstrcmp(ui->pszNick, ptszNick)) {
+ if (!mir_wstrcmp(ui->pszNick, ptszNick)) {
STATUSINFO *ti = pci->TM_FindStatus(si->pStatuses, pci->TM_WordToString(si->pStatuses, ui->Status));
if (ti && (INT_PTR)ti->hIcon < si->iStatusCount) {
if (iNickIndex)
@@ -685,10 +685,10 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce) if (gce->ptszNick != NULL) {
dwMask |= CMUCHighlight::MATCH_NICKNAME;
if (si && g_Settings.bLogClassicIndicators) {
- size_t len = mir_tstrlen(gce->ptszNick) + 1;
+ size_t len = mir_wstrlen(gce->ptszNick) + 1;
wchar_t *tmp = (wchar_t*)_alloca(sizeof(wchar_t)*(len + 1));
*tmp = GetIndicator(si, gce->ptszNick, 0);
- mir_tstrcpy(tmp + 1, gce->ptszNick);
+ mir_wstrcpy(tmp + 1, gce->ptszNick);
evTmp.ptszNick = tmp;
}
}
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index cde016a19e..a38dfc6291 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -135,7 +135,7 @@ bool IsStringValidLink(wchar_t *pszText) if (pszText == NULL) return false; - if (mir_tstrlen(pszText) < 5 || wcschr(pszText, '"')) + if (mir_wstrlen(pszText) < 5 || wcschr(pszText, '"')) return false; if (towlower(pszText[0]) == 'w' && towlower(pszText[1]) == 'w' && towlower(pszText[2]) == 'w' && pszText[3] == '.' && iswalnum(pszText[4])) @@ -451,7 +451,7 @@ static bool TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si) start -= 2; if (dat->szSearchResult != NULL) { - int cbResult = (int)mir_tstrlen(dat->szSearchResult); + int cbResult = (int)mir_wstrlen(dat->szSearchResult); if (start >= cbResult && !wcsnicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) { start -= cbResult; goto LBL_SkipEnd; @@ -475,8 +475,8 @@ LBL_SkipEnd: isTopic = TRUE; } if (dat->szSearchQuery == NULL) { - dat->szSearchQuery = mir_tstrndup(pszText + start, end - start); - dat->szSearchResult = mir_tstrdup(dat->szSearchQuery); + dat->szSearchQuery = mir_wstrndup(pszText + start, end - start); + dat->szSearchResult = mir_wstrdup(dat->szSearchQuery); dat->lastSession = NULL; } if (isTopic) @@ -488,12 +488,12 @@ LBL_SkipEnd: } else pszName = pci->UM_FindUserAutoComplete(si->pUsers, dat->szSearchQuery, dat->szSearchResult); - replaceStrT(dat->szSearchResult, NULL); + replaceStrW(dat->szSearchResult, NULL); if (pszName != NULL) { - dat->szSearchResult = mir_tstrdup(pszName); + dat->szSearchResult = mir_wstrdup(pszName); if (end != start) { - ptrT szReplace; + ptrW szReplace; if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) { szReplace = (wchar_t*)mir_alloc((mir_wstrlen(pszName) + 4) * sizeof(wchar_t)); mir_wstrcpy(szReplace, pszName); @@ -510,7 +510,7 @@ LBL_SkipEnd: SendMessage(hwnd, EM_SETSEL, start, end); SendMessage(hwnd, EM_REPLACESEL, TRUE, (LPARAM)dat->szSearchQuery); } - replaceStrT(dat->szSearchQuery, NULL); + replaceStrW(dat->szSearchQuery, NULL); return false; } @@ -1321,7 +1321,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *pa } if (tszBuf[0] == 0) - mir_sntprintf(tszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s", + mir_snwprintf(tszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s", TranslateT("Nickname"), ui1->pszNick, TranslateT("Unique ID"), ui1->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status)); @@ -1452,18 +1452,18 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break; } if (wParam == '\b' && si->szSearch[0]) // backspace - si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0'; + si->szSearch[mir_wstrlen(si->szSearch) - 1] = '\0'; else if (wParam < ' ') break; else { - if (mir_tstrlen(si->szSearch) >= _countof(si->szSearch) - 2) { + if (mir_wstrlen(si->szSearch) >= _countof(si->szSearch) - 2) { MessageBeep(MB_OK); break; } wchar_t szNew[2]; szNew[0] = (wchar_t)wParam; szNew[1] = '\0'; - mir_tstrcat(si->szSearch, szNew); + mir_wstrcat(si->szSearch, szNew); } if (si->szSearch[0]) { // iterate over the (sorted) list of nicknames and search for the @@ -1472,7 +1472,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, for (i = 0; i < iItems; i++) { USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i); if (ui) { - if (!wcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) { + if (!wcsnicmp(ui->pszNick, si->szSearch, mir_wstrlen(si->szSearch))) { SendMessage(hwnd, LB_SETSEL, FALSE, -1); SendMessage(hwnd, LB_SETSEL, TRUE, i); si->iSearchItem = i; @@ -1483,7 +1483,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, } if (i == iItems) { MessageBeep(MB_OK); - si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0'; + si->szSearch[mir_wstrlen(si->szSearch) - 1] = '\0'; return 0; } } @@ -1671,7 +1671,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, } } if (tszBuf[0] == 0) - mir_sntprintf(tszBuf, L"<b>%s:</b>\t%s\n<b>%s:</b>\t%s\n<b>%s:</b>\t%s", + mir_snwprintf(tszBuf, L"<b>%s:</b>\t%s\n<b>%s:</b>\t%s\n<b>%s:</b>\t%s", TranslateT("Nick"), ui1->pszNick, TranslateT("Unique ID"), ui1->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status)); @@ -1890,7 +1890,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar dat->wStatus = si->wStatus; const wchar_t *szNick = dat->cache->getNick(); - if (mir_tstrlen(szNick) > 0) { + if (mir_wstrlen(szNick) > 0) { if (M.GetByte("cuttitle", 0)) CutContactName(szNick, dat->newtitle, _countof(dat->newtitle)); else @@ -1903,19 +1903,19 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar switch (si->iType) { case GCW_CHATROOM: hIcon = Skin_LoadProtoIcon(si->pszModule, (dat->wStatus <= ID_STATUS_OFFLINE) ? ID_STATUS_OFFLINE : dat->wStatus); - mir_sntprintf(szTemp, + mir_snwprintf(szTemp, (si->nUsersInNicklist == 1) ? TranslateT("%s: chat room (%u user%s)") : TranslateT("%s: chat room (%u users%s)"), szNick, si->nUsersInNicklist, si->bFilterEnabled ? TranslateT(", event filter active") : L""); break; case GCW_PRIVMESS: hIcon = Skin_LoadProtoIcon(si->pszModule, (dat->wStatus <= ID_STATUS_OFFLINE) ? ID_STATUS_OFFLINE : dat->wStatus); if (si->nUsersInNicklist == 1) - mir_sntprintf(szTemp, TranslateT("%s: message session"), szNick); + mir_snwprintf(szTemp, TranslateT("%s: message session"), szNick); else - mir_sntprintf(szTemp, TranslateT("%s: message session (%u users)"), szNick, si->nUsersInNicklist); + mir_snwprintf(szTemp, TranslateT("%s: message session (%u users)"), szNick, si->nUsersInNicklist); break; case GCW_SERVER: - mir_sntprintf(szTemp, L"%s: Server", szNick); + mir_snwprintf(szTemp, L"%s: Server", szNick); hIcon = LoadIconEx("window"); break; } @@ -1978,17 +1978,17 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar else if (diff > 59) { DWORD hours = diff / 60; DWORD minutes = diff % 60; - mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ? + mir_snwprintf(mi->tszIdleMsg, TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ? TranslateT("hours") : TranslateT("hour"), minutes, minutes > 1 ? TranslateT("minutes") : TranslateT("minute")); } - else mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute")); + else mir_snwprintf(mi->tszIdleMsg, TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute")); } - mir_sntprintf(szFinalStatusBarText, TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg); + mir_snwprintf(szFinalStatusBarText, TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg); } else { if (si->ptszStatusbarText) - mir_sntprintf(szFinalStatusBarText, L"%s %s", mi->ptszModDispName, si->ptszStatusbarText); + mir_snwprintf(szFinalStatusBarText, L"%s %s", mi->ptszModDispName, si->ptszStatusbarText); else wcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE); } @@ -2213,16 +2213,16 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SIZE sz; if (si->iSearchItem != -1 && si->iSearchItem == index && si->szSearch[0]) { COLORREF clr_orig = GetTextColor(dis->hDC); - GetTextExtentPoint32(dis->hDC, ui->pszNick, (int)mir_tstrlen(si->szSearch), &sz); + GetTextExtentPoint32(dis->hDC, ui->pszNick, (int)mir_wstrlen(si->szSearch), &sz); SetTextColor(dis->hDC, RGB(250, 250, 0)); - TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, (int)mir_tstrlen(si->szSearch)); + TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, (int)mir_wstrlen(si->szSearch)); SetTextColor(dis->hDC, clr_orig); x_offset += sz.cx; - TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick + mir_tstrlen(si->szSearch), int(mir_tstrlen(ui->pszNick) - mir_tstrlen(si->szSearch))); + TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick + mir_wstrlen(si->szSearch), int(mir_wstrlen(ui->pszNick) - mir_wstrlen(si->szSearch))); } else { - GetTextExtentPoint32(dis->hDC, ui->pszNick, (int)mir_tstrlen(ui->pszNick), &sz); - TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, (int)mir_tstrlen(ui->pszNick)); + GetTextExtentPoint32(dis->hDC, ui->pszNick, (int)mir_wstrlen(ui->pszNick), &sz); + TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, (int)mir_wstrlen(ui->pszNick)); SelectObject(dis->hDC, hOldFont); } return TRUE; @@ -2535,7 +2535,7 @@ LABEL_SHOWWINDOW: int iRes = SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (iRes > 0) { - size_t iLen = mir_tstrlen(pszWord) - 1; + size_t iLen = mir_wstrlen(pszWord) - 1; while (strchr(szTrimString, pszWord[iLen])) { pszWord[iLen] = '\0'; iLen--; @@ -2655,7 +2655,7 @@ LABEL_SHOWWINDOW: HMENU hMenu = 0; USERINFO uiNew; for (USERINFO *ui = si->pUsers; ui; ui = ui->next) { - if (mir_tstrcmp(ui->pszNick, tr.lpstrText)) + if (mir_wstrcmp(ui->pszNick, tr.lpstrText)) continue; pt.x = (short)LOWORD(((ENLINK*)lParam)->lParam); @@ -2685,7 +2685,7 @@ LABEL_SHOWWINDOW: SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_EXGETSEL, 0, (LPARAM)&chr); wchar_t tszAplTmpl[] = L"%s:"; - size_t bufSize = mir_tstrlen(tr.lpstrText) + mir_tstrlen(tszAplTmpl) + 3; + size_t bufSize = mir_wstrlen(tr.lpstrText) + mir_wstrlen(tszAplTmpl) + 3; wchar_t *tszTmp = (wchar_t*)mir_alloc(bufSize * sizeof(wchar_t)), *tszAppeal = tszTmp; TEXTRANGE tr2; @@ -2697,12 +2697,12 @@ LABEL_SHOWWINDOW: SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2); if (!iswspace(*tr2.lpstrText)) *tszTmp++ = ' '; - mir_tstrcpy(tszTmp, tr.lpstrText); + mir_wstrcpy(tszTmp, tr.lpstrText); } else // in the beginning of the message window - mir_sntprintf(tszAppeal, bufSize, tszAplTmpl, tr.lpstrText); + mir_snwprintf(tszAppeal, bufSize, tszAplTmpl, tr.lpstrText); - size_t st = mir_tstrlen(tszAppeal); + size_t st = mir_wstrlen(tszAppeal); if (chr.cpMax != -1) { tr2.chrg.cpMin = chr.cpMax; tr2.chrg.cpMax = chr.cpMax + 1; @@ -2824,7 +2824,7 @@ LABEL_SHOWWINDOW: ptrA pszRtf(Message_GetFromStream(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE))); pci->SM_AddCommand(si->ptszID, si->pszModule, pszRtf); - CMString ptszText(ptrT(mir_utf8decodeT(pszRtf))); + CMString ptszText(ptrW(mir_utf8decodeW(pszRtf))); if (ptszText.IsEmpty()) break; @@ -3203,7 +3203,7 @@ LABEL_SHOWWINDOW: case DM_CONTAINERSELECTED: { wchar_t *szNewName = (wchar_t*)lParam; - if (!mir_tstrcmp(szNewName, TranslateT("Default container"))) + if (!mir_wstrcmp(szNewName, TranslateT("Default container"))) szNewName = CGlobals::m_default_container_name; int iOldItems = TabCtrl_GetItemCount(hwndTab); if (!wcsncmp(dat->pContainer->szName, szNewName, CONTAINER_NAMELEN)) diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index b955bd2cb8..e9923d78b2 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -118,7 +118,7 @@ bool CContactCache::updateNick() bool fChanged = false; if (m_Valid) { wchar_t *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0); - if (tszNick && mir_tstrcmp(m_szNick, tszNick)) + if (tszNick && mir_wstrcmp(m_szNick, tszNick)) fChanged = true; wcsncpy_s(m_szNick, (tszNick ? tszNick : L"<undef>"), _TRUNCATE); } @@ -178,7 +178,7 @@ bool CContactCache::updateUIN() m_szUIN[0] = 0; if (m_Valid) { - ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, getActiveContact(), getActiveProto())); + ptrW uid(Contact_GetInfo(CNF_DISPLAYUID, getActiveContact(), getActiveProto())); if (uid != NULL) wcsncpy_s(m_szUIN, uid, _TRUNCATE); } @@ -446,15 +446,15 @@ void CContactCache::updateStatusMsg(const char *szKey) if (m_szStatusMsg) mir_free(m_szStatusMsg); m_szStatusMsg = 0; - ptrT szStatus(db_get_tsa(hContact, "CList", "StatusMsg")); + ptrW szStatus(db_get_tsa(hContact, "CList", "StatusMsg")); if (szStatus != 0) - m_szStatusMsg = (mir_tstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : 0); + m_szStatusMsg = (mir_wstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : 0); } if (szKey == 0 || (szKey && !mir_strcmp("ListeningTo", szKey))) { if (m_ListeningInfo) mir_free(m_ListeningInfo); m_ListeningInfo = 0; - ptrT szListeningTo(db_get_tsa(hContact, cc->szProto, "ListeningTo")); + ptrW szListeningTo(db_get_tsa(hContact, cc->szProto, "ListeningTo")); if (szListeningTo != 0 && *szListeningTo) m_ListeningInfo = szListeningTo.detach(); } @@ -462,7 +462,7 @@ void CContactCache::updateStatusMsg(const char *szKey) if (m_xStatusMsg) mir_free(m_xStatusMsg); m_xStatusMsg = 0; - ptrT szXStatusMsg(db_get_tsa(hContact, cc->szProto, "XStatusMsg")); + ptrW szXStatusMsg(db_get_tsa(hContact, cc->szProto, "XStatusMsg")); if (szXStatusMsg != 0 && *szXStatusMsg) m_xStatusMsg = szXStatusMsg.detach(); } @@ -523,7 +523,7 @@ int CContactCache::cacheUpdateMetaChanged(WPARAM bMetaEnabled, LPARAM) */ wchar_t* CContactCache::getNormalizedStatusMsg(const wchar_t *src, bool fStripAll) { - if (src == 0 || mir_tstrlen(src) < 2) + if (src == 0 || mir_wstrlen(src) < 2) return 0; CMString dest; @@ -542,7 +542,7 @@ wchar_t* CContactCache::getNormalizedStatusMsg(const wchar_t *src, bool fStripAl dest.AppendChar(src[i]); } - return mir_tstrndup(dest, dest.GetLength()); + return mir_wstrndup(dest, dest.GetLength()); } /** diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 02851f893c..06d188730a 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -803,7 +803,7 @@ panel_found: char szIndex[10];
itoa(iSelection - IDM_CONTAINERMENU, szIndex, 10);
if (iSelection - IDM_CONTAINERMENU >= 0) {
- ptrT tszName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
+ ptrW tszName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
if (tszName != NULL)
SendMessage((HWND)tci.lParam, DM_CONTAINERSELECTED, 0, tszName);
}
@@ -1719,7 +1719,7 @@ panel_found: char szCName[40];
mir_snprintf(szCName, "%s_theme", CONTAINER_PREFIX);
- if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
+ if (mir_wstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
db_set_ts(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile);
@@ -1759,7 +1759,7 @@ TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT h wcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1);
AppendToContainerList(pContainer);
- if (M.GetByte("limittabs", 0) && !mir_tstrcmp(name, L"default"))
+ if (M.GetByte("limittabs", 0) && !mir_wstrcmp(name, L"default"))
iTemp |= CNT_CREATEFLAG_CLONED;
// save container name to the db
@@ -1768,7 +1768,7 @@ TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT h do {
char szCounter[10];
itoa(i, szCounter, 10);
- ptrT tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter));
+ ptrW tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter));
if (tszName == NULL) {
if (iFirstFree != -1) {
pContainer->iContainerIndex = iFirstFree;
@@ -1876,12 +1876,12 @@ void TSAPI CloseOtherTabs(HWND hwndTab, TWindowData &dat) int TSAPI CutContactName(const wchar_t *oldname, wchar_t *newname, size_t size)
{
- if (mir_tstrlen(oldname) <= PluginConfig.m_iTabNameLimit)
+ if (mir_wstrlen(oldname) <= PluginConfig.m_iTabNameLimit)
wcsncpy_s(newname, size, oldname, _TRUNCATE);
else {
wchar_t fmt[30];
- mir_sntprintf(fmt, L"%%%d.%ds...", PluginConfig.m_iTabNameLimit, PluginConfig.m_iTabNameLimit);
- mir_sntprintf(newname, size, fmt, oldname);
+ mir_snwprintf(fmt, L"%%%d.%ds...", PluginConfig.m_iTabNameLimit, PluginConfig.m_iTabNameLimit);
+ mir_snwprintf(newname, size, fmt, oldname);
}
return 0;
}
@@ -1906,7 +1906,7 @@ static TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer) TContainerData* TSAPI FindContainerByName(const wchar_t *name)
{
- if (name == NULL || mir_tstrlen(name) == 0)
+ if (name == NULL || mir_wstrlen(name) == 0)
return 0;
if (M.GetByte("singlewinmode", 0)) // single window mode - always return 0 and force a new container
@@ -2016,7 +2016,7 @@ int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNa // use clist group names for containers...
if (M.GetByte("useclistgroups", 0)) {
- ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup == NULL) {
wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
return 0;
@@ -2026,7 +2026,7 @@ int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNa return 1;
}
- ptrT tszContainerName(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
+ ptrW tszContainerName(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
if (tszContainerName == NULL) {
wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
return 0;
@@ -2040,15 +2040,15 @@ void TSAPI DeleteContainer(int iIndex) {
char szIndex[10];
itoa(iIndex, szIndex, 10);
- ptrT tszContainerName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
+ ptrW tszContainerName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
if (tszContainerName == NULL)
return;
db_set_ts(NULL, CONTAINER_KEY, szIndex, L"**mir_free**");
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- ptrT tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
- if (!mir_tstrcmp(tszValue, tszContainerName))
+ ptrW tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
+ if (!mir_wstrcmp(tszValue, tszContainerName))
db_unset(hContact, SRMSGMOD_T, CONTAINER_SUBKEY);
}
@@ -2069,20 +2069,20 @@ void TSAPI DeleteContainer(int iIndex) void TSAPI RenameContainer(int iIndex, const wchar_t *szNew)
{
- if (mir_tstrlen(szNew) == 0)
+ if (mir_wstrlen(szNew) == 0)
return;
char szIndex[10];
itoa(iIndex, szIndex, 10);
- ptrT tszContainerName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
+ ptrW tszContainerName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
if (tszContainerName == NULL)
return;
db_set_ts(NULL, CONTAINER_KEY, szIndex, szNew);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- ptrT tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
- if (!mir_tstrcmp(tszValue, tszContainerName))
+ ptrW tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
+ if (!mir_wstrcmp(tszValue, tszContainerName))
db_set_ts(hContact, SRMSGMOD_T, CONTAINER_SUBKEY, szNew);
}
}
@@ -2105,12 +2105,12 @@ HMENU TSAPI BuildContainerMenu() while (true) {
char szCounter[10];
itoa(i, szCounter, 10);
- ptrT tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter));
+ ptrW tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter));
if (tszName == NULL)
break;
if (wcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN))
- AppendMenu(hMenu, MF_STRING, IDM_CONTAINERMENU + i, !mir_tstrcmp(tszName, L"default") ? TranslateT("Default container") : tszName);
+ AppendMenu(hMenu, MF_STRING, IDM_CONTAINERMENU + i, !mir_wstrcmp(tszName, L"default") ? TranslateT("Default container") : tszName);
i++;
}
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp index 33f27f8b7c..9dbc431c96 100644 --- a/plugins/TabSRMM/src/containeroptions.cpp +++ b/plugins/TabSRMM/src/containeroptions.cpp @@ -153,7 +153,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, pContainer->hWndOptions = hwndDlg;
SetWindowText(hwndDlg, TranslateT("Container options"));
wchar_t szNewTitle[128];
- mir_sntprintf(szNewTitle, L"%s", !mir_tstrcmp(pContainer->szName, L"default") ?
+ mir_snwprintf(szNewTitle, L"%s", !mir_wstrcmp(pContainer->szName, L"default") ?
TranslateT("Default container") : pContainer->szName);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, szNewTitle);
Utils::enableDlgControl(hwndDlg, IDC_O_HIDETITLE, !CSkin::m_frameSkins);
@@ -338,7 +338,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, szFilename[MAX_PATH - 1] = 0;
PathToAbsoluteT(szFilename, szFinalThemeFile, M.getDataPath());
- if (mir_tstrcmp(szFilename, pContainer->szRelThemeFile))
+ if (mir_wstrcmp(szFilename, pContainer->szRelThemeFile))
pContainer->fPrivateThemeChanged = TRUE;
if (PathFileExists(szFinalThemeFile))
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index a60bf718a8..5d69e24d89 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -966,12 +966,12 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if (!mir_strcmp(sid->szModule, MSG_ICON_MODULE)) {
if (sid->dwId == MSG_ICON_SOUND)
- mir_sntprintf(wBuf, TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"),
+ mir_snwprintf(wBuf, TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"),
pContainer->dwFlags & CNT_NOSOUND ? TranslateT("disabled") : TranslateT("enabled"));
else if (sid->dwId == MSG_ICON_UTN && (dat->bType == SESSIONTYPE_IM || dat->si->iType == GCW_PRIVMESS)) {
int mtnStatus = db_get_b(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M.GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
- mir_sntprintf(wBuf, TranslateT("Sending typing notifications is %s."),
+ mir_snwprintf(wBuf, TranslateT("Sending typing notifications is %s."),
mtnStatus ? TranslateT("enabled") : TranslateT("disabled"));
}
else if (sid->dwId == MSG_ICON_SESSION)
@@ -997,7 +997,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR const wchar_t *szFormat = TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery");
- mir_sntprintf(wBuf, szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
+ mir_snwprintf(wBuf, szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti);
}
@@ -1010,7 +1010,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if (PtInRect(&rc, pt) && ((rc.right - rc.left) < size.cx)) {
if (dat->bType == SESSIONTYPE_CHAT) {
- ptrT tszTopic(db_get_tsa(dat->hContact, dat->szProto, "Topic"));
+ ptrW tszTopic(db_get_tsa(dat->hContact, dat->szProto, "Topic"));
if (tszTopic != NULL) {
tooltip_active = TRUE;
CallService("mToolTip/ShowTipW", tszTopic, (LPARAM)&ti);
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 0680d86d3a..24f0fe2898 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -422,7 +422,7 @@ static wchar_t* ShortenPreview(DBEVENTINFO* dbe) iPreviewLimit = 500;
wchar_t *buf = DbGetEventTextT(dbe, CP_ACP);
- if (mir_tstrlen(buf) > iPreviewLimit) {
+ if (mir_wstrlen(buf) > iPreviewLimit) {
fAddEllipsis = true;
size_t iIndex = iPreviewLimit;
size_t iWordThreshold = 20;
@@ -432,8 +432,8 @@ static wchar_t* ShortenPreview(DBEVENTINFO* dbe) buf[iIndex] = 0;
}
if (fAddEllipsis) {
- buf = (wchar_t*)mir_realloc(buf, (mir_tstrlen(buf) + 5) * sizeof(wchar_t));
- mir_tstrcat(buf, L"...");
+ buf = (wchar_t*)mir_realloc(buf, (mir_wstrlen(buf) + 5) * sizeof(wchar_t));
+ mir_wstrcat(buf, L"...");
}
return buf;
}
@@ -447,12 +447,12 @@ static wchar_t* GetPreviewT(WORD eventType, DBEVENTINFO* dbe) if (pBlob && nen_options.bPreview)
return ShortenPreview(dbe);
- return mir_tstrdup(TranslateT("Message"));
+ return mir_wstrdup(TranslateT("Message"));
case EVENTTYPE_FILE:
if (pBlob) {
if (!nen_options.bPreview)
- return mir_tstrdup(TranslateT("Incoming file"));
+ return mir_wstrdup(TranslateT("Incoming file"));
if (dbe->cbBlob > 5) { // min valid size = (sizeof(DWORD) + 1 character file name + terminating 0)
char* szFileName = (char *)dbe->pBlob + sizeof(DWORD);
@@ -462,30 +462,30 @@ static wchar_t* GetPreviewT(WORD eventType, DBEVENTINFO* dbe) if (dbe->cbBlob > (sizeof(DWORD) + namelength + 1))
szDescr = szFileName + namelength + 1;
- ptrT tszFileName(DbGetEventStringT(dbe, szFileName));
+ ptrW tszFileName(DbGetEventStringT(dbe, szFileName));
wchar_t buf[1024];
if (szDescr && Utils::safe_strlen(szDescr, dbe->cbBlob - sizeof(DWORD) - namelength - 1) > 0) {
- ptrT tszDescr(DbGetEventStringT(dbe, szDescr));
+ ptrW tszDescr(DbGetEventStringT(dbe, szDescr));
if (tszFileName && tszDescr) {
- mir_sntprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName, tszDescr);
- return mir_tstrdup(buf);
+ mir_snwprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName, tszDescr);
+ return mir_wstrdup(buf);
}
}
if (tszFileName) {
- mir_sntprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName, TranslateT("No description given"));
- return mir_tstrdup(buf);
+ mir_snwprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName, TranslateT("No description given"));
+ return mir_wstrdup(buf);
}
}
}
- return mir_tstrdup(TranslateT("Incoming file (invalid format)"));
+ return mir_wstrdup(TranslateT("Incoming file (invalid format)"));
default:
if (nen_options.bPreview)
return ShortenPreview(dbe);
- return mir_tstrdup(TranslateT("Unknown event"));
+ return mir_wstrdup(TranslateT("Unknown event"));
}
}
@@ -500,7 +500,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) wchar_t szHeader[256];
if (pdata->pluginOptions->bShowHeaders)
- mir_sntprintf(szHeader, L"%s %d\n", TranslateT("New messages: "), pdata->nrMerged + 1);
+ mir_snwprintf(szHeader, L"%s %d\n", TranslateT("New messages: "), pdata->nrMerged + 1);
else
szHeader[0] = 0;
@@ -513,14 +513,14 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) wchar_t timestamp[MAX_DATASIZE];
wcsftime(timestamp, MAX_DATASIZE, L"%Y.%m.%d %H:%M", _localtime32((__time32_t *)&dbe.timestamp));
- mir_sntprintf(pdata->eventData[pdata->nrMerged].tszText, L"\n\n%s\n", timestamp);
+ mir_snwprintf(pdata->eventData[pdata->nrMerged].tszText, L"\n\n%s\n", timestamp);
wchar_t *szPreview = GetPreviewT(dbe.eventType, &dbe);
if (szPreview) {
- mir_tstrncat(pdata->eventData[pdata->nrMerged].tszText, szPreview, _countof(pdata->eventData[pdata->nrMerged].tszText) - mir_tstrlen(pdata->eventData[pdata->nrMerged].tszText));
+ mir_wstrncat(pdata->eventData[pdata->nrMerged].tszText, szPreview, _countof(pdata->eventData[pdata->nrMerged].tszText) - mir_wstrlen(pdata->eventData[pdata->nrMerged].tszText));
mir_free(szPreview);
}
- else mir_tstrncat(pdata->eventData[pdata->nrMerged].tszText, L" ", _countof(pdata->eventData[pdata->nrMerged].tszText) - mir_tstrlen(pdata->eventData[pdata->nrMerged].tszText));
+ else mir_wstrncat(pdata->eventData[pdata->nrMerged].tszText, L" ", _countof(pdata->eventData[pdata->nrMerged].tszText) - mir_wstrlen(pdata->eventData[pdata->nrMerged].tszText));
pdata->eventData[pdata->nrMerged].tszText[MAX_SECONDLINE - 1] = 0;
@@ -533,18 +533,18 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) int i, available = MAX_SECONDLINE - 1;
if (pdata->pluginOptions->bShowHeaders) {
wcsncpy(lpzText, szHeader, MAX_SECONDLINE);
- available -= (int)mir_tstrlen(szHeader);
+ available -= (int)mir_wstrlen(szHeader);
}
else lpzText[0] = 0;
for (i = pdata->nrMerged; i >= 0; i--) {
- available -= (int)mir_tstrlen(pdata->eventData[i].tszText);
+ available -= (int)mir_wstrlen(pdata->eventData[i].tszText);
if (available <= 0)
break;
}
i = (available > 0) ? i + 1 : i + 2;
for (; i <= pdata->nrMerged; i++)
- mir_tstrncat(lpzText, pdata->eventData[i].tszText, _countof(lpzText) - mir_tstrlen(lpzText));
+ mir_wstrncat(lpzText, pdata->eventData[i].tszText, _countof(lpzText) - mir_wstrlen(lpzText));
pdata->eventData[pdata->nrMerged].hEvent = hEvent;
pdata->eventData[pdata->nrMerged].timestamp = dbe.timestamp;
@@ -670,14 +670,14 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced) PluginConfig.m_UnreadInTray -= (mii.dwItemData & 0x0000ffff);
if (mii.dwItemData > 0 || bForced) {
wchar_t szMenuEntry[80];
- mir_sntprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszProto,
+ mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszProto,
dat->cache->getNick(), dat->szStatus[0] ? dat->szStatus : L"(undef)", mii.dwItemData & 0x0000ffff);
if (!bForced)
mii.dwItemData = 0;
mii.fMask |= MIIM_STRING;
mii.dwTypeData = (LPTSTR)szMenuEntry;
- mii.cch = (int)mir_tstrlen(szMenuEntry) + 1;
+ mii.cch = (int)mir_wstrlen(szMenuEntry) + 1;
}
mii.hbmpItem = HBMMENU_CALLBACK;
SetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)dat->hContact, FALSE, &mii);
@@ -712,7 +712,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro if (fromEvent == 2) // from chat...
mii.dwItemData |= 0x10000000;
DeleteMenu(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND);
- mir_sntprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
+ mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry);
PluginConfig.m_UnreadInTray++;
if (PluginConfig.m_UnreadInTray)
@@ -722,7 +722,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro else {
szNick = pcli->pfnGetContactDisplayName(hContact, 0);
if (CheckMenuItem(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == -1) {
- mir_sntprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0);
+ mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0);
AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry);
mii.dwItemData = fromEvent ? 1 : 0;
PluginConfig.m_UnreadInTray += (mii.dwItemData & 0x0000ffff);
@@ -740,8 +740,8 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro mii.fMask |= MIIM_STRING;
if (fromEvent == 2)
mii.dwItemData |= 0x10000000;
- mir_sntprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
- mii.cch = (int)mir_tstrlen(szMenuEntry) + 1;
+ mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
+ mii.cch = (int)mir_wstrlen(szMenuEntry) + 1;
mii.dwTypeData = (LPTSTR)szMenuEntry;
}
SetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, FALSE, &mii);
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 03317d8d5b..365fe0a812 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -44,13 +44,13 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData *dat) } else if (dat) { wchar_t szFilter[MAX_PATH], szFilename[MAX_PATH]; - mir_sntprintf(szFilter, L"%s%c*.rtf%c%c", TranslateT("Rich Edit file"), 0, 0, 0); - mir_sntprintf(szFilename, L"%s.rtf", dat->cache->getNick()); + mir_snwprintf(szFilter, L"%s%c*.rtf%c%c", TranslateT("Rich Edit file"), 0, 0, 0); + mir_snwprintf(szFilename, L"%s.rtf", dat->cache->getNick()); Utils::sanitizeFilename(szFilename); wchar_t szInitialDir[MAX_PATH + 2]; - mir_sntprintf(szInitialDir, L"%s%s\\", M.getDataPath(), L"\\Saved message logs"); + mir_snwprintf(szInitialDir, L"%s%s\\", M.getDataPath(), L"\\Saved message logs"); CreateDirectoryTreeT(szInitialDir); OPENFILENAME ofn = { 0 }; @@ -613,7 +613,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v); wchar_t tStr[80]; - mir_sntprintf(tStr, L"%s %d.%d.%d.%d [build %d]", + mir_snwprintf(tStr, L"%s %d.%d.%d.%d [build %d]", TranslateT("Version"), __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM, v[3]); SetDlgItemText(hwndDlg, IDC_HEADERBAR, tStr); } @@ -1004,7 +1004,7 @@ void TSAPI DM_LoadLocale(TWindowData *dat) if (!PluginConfig.m_bDontUseDefaultKbd) { wchar_t szBuf[20]; GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20); - mir_sntprintf(szKLName, L"0000%s", szBuf); + mir_snwprintf(szKLName, L"0000%s", szBuf); db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName); } else { @@ -1042,7 +1042,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) wchar_t szBuf[100]; if (dat->bShowTyping) { SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]); - mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), dat->cache->getNick()); + mir_snwprintf(szBuf, TranslateT("%s is typing a message..."), dat->cache->getNick()); } else if (dat->sbCustom) { SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)dat->sbCustom->hIcon); @@ -1053,14 +1053,14 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, 0); if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR) - mir_sntprintf(szBuf, L"UID: %s", dat->cache->getUIN()); + mir_snwprintf(szBuf, L"UID: %s", dat->cache->getUIN()); else if (dat->lastMessage) { wchar_t date[64], time[64]; TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0); - if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_tstrlen(date) > 6) - date[mir_tstrlen(date) - 5] = 0; + if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_wstrlen(date) > 6) + date[mir_wstrlen(date) - 5] = 0; TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"t", time, _countof(time), 0); - mir_sntprintf(szBuf, TranslateT("Last received: %s at %s"), date, time); + mir_snwprintf(szBuf, TranslateT("Last received: %s at %s"), date, time); } else szBuf[0] = 0; } @@ -1374,7 +1374,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) dat->bShowTyping = 2; dat->nTypeSecs = 86400; - mir_sntprintf(dat->szStatusBar, TranslateT("%s has entered text."), dat->cache->getNick()); + mir_snwprintf(dat->szStatusBar, TranslateT("%s has entered text."), dat->cache->getNick()); if (hwndStatus && dat->pContainer->hwndActive == hwndDlg) SendMessage(hwndStatus, SB_SETTEXT, 0, (LPARAM)dat->szStatusBar); } @@ -1399,7 +1399,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) UpdateStatusBar(dat); } else if (dat->nTypeSecs > 0) { - mir_sntprintf(dat->szStatusBar, TranslateT("%s is typing a message"), dat->cache->getNick()); + mir_snwprintf(dat->szStatusBar, TranslateT("%s is typing a message"), dat->cache->getNick()); dat->nTypeSecs--; if (hwndStatus && dat->pContainer->hwndActive == hwndDlg) { @@ -1592,7 +1592,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent; wchar_t szBuf[100]; - mir_sntprintf(szBuf, TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"), + mir_snwprintf(szBuf, TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"), dat->iNextQueuedEvent); SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf); RedrawWindow(GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), NULL, NULL, RDW_INVALIDATE); @@ -1742,9 +1742,9 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) Utils::DoubleAmpersands(newcontactname, _countof(newcontactname)); - if (mir_tstrlen(newcontactname) != 0) { + if (mir_wstrlen(newcontactname) != 0) { if (PluginConfig.m_bStatusOnTabs) - mir_sntprintf(newtitle, L"%s (%s)", newcontactname, dat->szStatus); + mir_snwprintf(newtitle, L"%s (%s)", newcontactname, dat->szStatus); else wcsncpy_s(newtitle, newcontactname, _TRUNCATE); } @@ -1756,11 +1756,11 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) wchar_t fulluin[256]; if (dat->bIsMeta) - mir_sntprintf(fulluin, + mir_snwprintf(fulluin, TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."), bHasName ? dat->cache->getUIN() : TranslateT("No UID")); else - mir_sntprintf(fulluin, + mir_snwprintf(fulluin, TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nClick dropdown to change this contact's favorite status."), bHasName ? dat->cache->getUIN() : TranslateT("No UID")); diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 9bb015b8bf..d901380ae2 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -568,7 +568,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) for (int i = 0; i < arEvents.getCount(); i++) {
MSavedEvent &e = arEvents[i];
- mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0));
+ mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0));
cle.hContact = e.hContact;
cle.hDbEvent = e.hEvent;
pcli->pfnAddEvent(&cle);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 00b3abf2fe..f2888d3f99 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -421,9 +421,9 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem) if (szStatusMsg) {
SIZE sStatusMsg, sMask;
- ::GetTextExtentPoint32(hdc, szTextToShow, (int)mir_tstrlen(szTextToShow), &m_szNick);
+ ::GetTextExtentPoint32(hdc, szTextToShow, (int)mir_wstrlen(szTextToShow), &m_szNick);
::GetTextExtentPoint32(hdc, L"A", 1, &sMask);
- ::GetTextExtentPoint32(hdc, szStatusMsg, (int)mir_tstrlen(szStatusMsg), &sStatusMsg);
+ ::GetTextExtentPoint32(hdc, szStatusMsg, (int)mir_wstrlen(szStatusMsg), &sStatusMsg);
DWORD dtFlagsNick = DT_SINGLELINE | DT_WORD_ELLIPSIS | DT_NOPREFIX;
if ((m_szNick.cx + sStatusMsg.cx + 6) < (rcItem.right - rcItem.left) || (rcItem.bottom - rcItem.top) < (2 * sMask.cy)) {
@@ -456,7 +456,7 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem) CSkin::RenderText(hdc, m_dat->hThemeIP, szStatusMsg, &rcItem, dtFlags, CSkin::m_glowSize, clr);
}
else {
- GetTextExtentPoint32(hdc, szTextToShow, (int)mir_tstrlen(szTextToShow), &m_szNick);
+ GetTextExtentPoint32(hdc, szTextToShow, (int)mir_wstrlen(szTextToShow), &m_szNick);
mapRealRect(rcItem, m_rcNick, m_szNick);
if (m_hoverFlags & HOVER_NICK)
setUnderlinedFont(hdc, fShowUin ? m_ipConfig.hFonts[IPFONTID_UIN] : m_ipConfig.hFonts[IPFONTID_NICK]);
@@ -496,22 +496,22 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) time_t diff = time(NULL) - m_dat->idle;
int i_hrs = diff / 3600;
int i_mins = (diff - i_hrs * 3600) / 60;
- mir_sntprintf(szBuf, TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
+ mir_snwprintf(szBuf, TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
}
else wcscpy_s(szBuf, 256, tszUin);
if (M.GetByte("ShowClientDescription", 1)) {
wchar_t temp[256];
- ptrT szVersion(db_get_tsa(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer"));
+ ptrW szVersion(db_get_tsa(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer"));
if (szVersion)
- mir_sntprintf(temp, TranslateT(" Client: %s"), szVersion);
+ mir_snwprintf(temp, TranslateT(" Client: %s"), szVersion);
else
- mir_sntprintf(temp, TranslateT(" Client not cached yet"));
+ mir_snwprintf(temp, TranslateT(" Client not cached yet"));
wcscat_s(szBuf, 256, temp);
}
SIZE sUIN;
- ::GetTextExtentPoint32(hdc, szBuf, (int)mir_tstrlen(szBuf), &sUIN);
+ ::GetTextExtentPoint32(hdc, szBuf, (int)mir_wstrlen(szBuf), &sUIN);
mapRealRect(rcItem, m_rcUIN, sUIN);
CSkin::RenderText(hdc, m_dat->hThemeIP, szBuf, &rcItem, DT_SINGLELINE | DT_VCENTER, CSkin::m_glowSize, clr);
}
@@ -532,19 +532,19 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem) DWORD oldPanelStatusCX = m_dat->panelStatusCX;
if (m_dat->szStatus[0])
- GetTextExtentPoint32(hdc, m_dat->szStatus, (int)mir_tstrlen(m_dat->szStatus), &sStatus);
+ GetTextExtentPoint32(hdc, m_dat->szStatus, (int)mir_wstrlen(m_dat->szStatus), &sStatus);
// figure out final account name
const wchar_t *szFinalProto = m_dat->cache->getRealAccount();
if (szFinalProto) {
SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_PROTO]);
- GetTextExtentPoint32(hdc, szFinalProto, (int)mir_tstrlen(szFinalProto), &sProto);
+ GetTextExtentPoint32(hdc, szFinalProto, (int)mir_wstrlen(szFinalProto), &sProto);
}
wchar_t szResult[80]; szResult[0] = 0;
if (m_dat->hTimeZone) {
TimeZone_PrintDateTime(m_dat->hTimeZone, L"t", szResult, _countof(szResult), 0);
- GetTextExtentPoint32(hdc, szResult, (int)mir_tstrlen(szResult), &sTime);
+ GetTextExtentPoint32(hdc, szResult, (int)mir_wstrlen(szResult), &sTime);
}
m_dat->panelStatusCX = 3 + sStatus.cx + sProto.cx + 14 + (m_dat->hClientIcon ? 20 : 0) + sTime.cx + 13;
@@ -613,7 +613,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) if (m_height < DEGRADE_THRESHOLD) {
wchar_t tszText[2048];
- mir_sntprintf(tszText, TranslateT("Topic is: %s"),
+ mir_snwprintf(tszText, TranslateT("Topic is: %s"),
si->ptszTopic ? si->ptszTopic : TranslateT("no topic set."));
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
@@ -624,7 +624,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) const wchar_t *tszNick = m_dat->cache->getNick();
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_NICK]));
- ::GetTextExtentPoint32(hdc, tszNick, (int)mir_tstrlen(tszNick), &m_szNick);
+ ::GetTextExtentPoint32(hdc, tszNick, (int)mir_wstrlen(tszNick), &m_szNick);
mapRealRect(rcItem, m_rcNick, m_szNick);
if (m_hoverFlags & HOVER_NICK)
@@ -670,8 +670,8 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) SIZE szTitle;
wchar_t szPrefix[100];
- mir_sntprintf(szPrefix, TranslateT("Topic is: %s"), L"");
- ::GetTextExtentPoint32(hdc, szPrefix, (int)mir_tstrlen(szPrefix), &szTitle);
+ mir_snwprintf(szPrefix, TranslateT("Topic is: %s"), L"");
+ ::GetTextExtentPoint32(hdc, szPrefix, (int)mir_wstrlen(szPrefix), &szTitle);
mapRealRect(rcItem, m_rcUIN, szTitle);
if (m_hoverFlags & HOVER_UIN)
setUnderlinedFont(hdc, m_ipConfig.hFonts[IPFONTID_UIN]);
@@ -680,7 +680,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) rcItem.left += (szTitle.cx + 4);
if (m_hoverFlags & HOVER_UIN)
::DeleteObject(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
- if (si->ptszTopic && mir_tstrlen(si->ptszTopic) > 1)
+ if (si->ptszTopic && mir_wstrlen(si->ptszTopic) > 1)
CSkin::RenderText(hdc, m_dat->hThemeIP, si->ptszTopic, &rcItem, DT_WORDBREAK | DT_END_ELLIPSIS | DT_NOPREFIX | DT_TOP, CSkin::m_glowSize, clr);
else
CSkin::RenderText(hdc, m_dat->hThemeIP, TranslateT("no topic set."), &rcItem, DT_TOP | DT_SINGLELINE | DT_NOPREFIX, CSkin::m_glowSize, clr);
@@ -1061,11 +1061,11 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L case WM_INITDIALOG:
{
wchar_t tszTitle[100];
- mir_sntprintf(tszTitle, TranslateT("Set panel visibility for this %s"),
+ mir_snwprintf(tszTitle, TranslateT("Set panel visibility for this %s"),
m_isChat ? TranslateT("chat room") : TranslateT("contact"));
::SetDlgItemText(hwnd, IDC_STATIC_VISIBILTY, tszTitle);
- mir_sntprintf(tszTitle, m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") :
+ mir_snwprintf(tszTitle, m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") :
TranslateT("Do not synchronize the panel height with group chat windows"));
::SetDlgItemText(hwnd, IDC_NOSYNC, tszTitle);
@@ -1322,7 +1322,7 @@ CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const wchar_t *pszTex ::SendMessage(m_hRich, WM_SETFONT, (WPARAM)CInfoPanel::m_ipConfig.hFonts[IPFONTID_STATUS], 0);
m_hContact = hContact;
- m_pszText = mir_utf8encodeT(pszText);
+ m_pszText = mir_utf8encodeW(pszText);
m_panel = panel;
m_hwndParent = hwndParent;
mir_subclassWindow(m_hRich, RichEditProc);
@@ -1503,7 +1503,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam LONG cy = rc.bottom;
HANDLE hTheme = 0;
- mir_sntprintf(szTitle, m_szTitle ? L"%s (%s)" : L"%s%s", c->getNick(), m_szTitle ? m_szTitle : L"");
+ mir_snwprintf(szTitle, m_szTitle ? L"%s (%s)" : L"%s%s", c->getNick(), m_szTitle ? m_szTitle : L"");
if (m_panel) {
HDC hdcMem = ::CreateCompatibleDC(hdc);
@@ -1568,7 +1568,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam switch (((ENLINK*)lParam)->msg) {
case WM_LBUTTONUP:
ENLINK *e = reinterpret_cast<ENLINK *>(lParam);
- ptrT tszUrl(Utils::extractURLFromRichEdit(e, m_hRich));
+ ptrW tszUrl(Utils::extractURLFromRichEdit(e, m_hRich));
if (tszUrl)
Utils_OpenUrlT(tszUrl);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index d79da9851b..73d017a64c 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -149,7 +149,7 @@ void CMimAPI::InitPaths() { const wchar_t *szUserdataDir = getUserDir(); - mir_sntprintf(m_szProfilePath, L"%stabSRMM", szUserdataDir); + mir_snwprintf(m_szProfilePath, L"%stabSRMM", szUserdataDir); if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) { wcsncpy_s(m_szChatLogsPath, L"%miranda_logpath%", _TRUNCATE); wcsncpy_s(m_szSkinsPath, L"%miranda_path%\\Skins\\TabSRMM", _TRUNCATE); @@ -160,11 +160,11 @@ void CMimAPI::InitPaths() } Utils::ensureTralingBackslash(m_szChatLogsPath); - replaceStrT(g_Settings.pszLogDir, m_szChatLogsPath); + replaceStrW(g_Settings.pszLogDir, m_szChatLogsPath); Utils::ensureTralingBackslash(m_szSkinsPath); - mir_sntprintf(m_szSavedAvatarsPath, L"%s\\Saved Contact Pictures", m_szProfilePath); + mir_snwprintf(m_szSavedAvatarsPath, L"%s\\Saved Contact Pictures", m_szProfilePath); } bool CMimAPI::getAeroState() @@ -299,7 +299,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) if (mode) { wchar_t szTip[256]; - mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_snwprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); if (fShowOnClist && ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && M.GetByte(SRMSGMOD, "ShowTypingBalloon", 0)) { MIRANDASYSTRAYNOTIFY tn; tn.szProto = NULL; @@ -551,7 +551,7 @@ nowindowcreate: cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); cle.pszService = "SRMsg/ReadMessage"; contactName = pcli->pfnGetContactDisplayName(hContact, 0); - mir_sntprintf(toolTip, TranslateT("Message from %s"), contactName); + mir_snwprintf(toolTip, TranslateT("Message from %s"), contactName); cle.ptszTooltip = toolTip; pcli->pfnAddEvent(&cle); } diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index 1fc829c606..333da241f8 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -117,9 +117,9 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) if (res == 0)
break;
- bufSize = textlenght + mir_tstrlen(pszMenu[res - 1]) + 2;
+ bufSize = textlenght + mir_wstrlen(pszMenu[res - 1]) + 2;
pszFormatedText = (wchar_t*)_alloca(bufSize*sizeof(wchar_t));
- mir_sntprintf(pszFormatedText, bufSize, pszMenu[res - 1], pszText);
+ mir_snwprintf(pszFormatedText, bufSize, pszMenu[res - 1], pszText);
}
break;
@@ -128,7 +128,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) bufSize = textlenght + 12;
pszFormatedText = (wchar_t*)_alloca(bufSize*sizeof(wchar_t));
- mir_sntprintf(pszFormatedText, bufSize, L"[img]%s[/img]", pszText);
+ mir_snwprintf(pszFormatedText, bufSize, L"[img]%s[/img]", pszText);
bbd.ptszTooltip = 0;
bbd.hIcon = 0;
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 529dac6ce1..d43e5bb62e 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -589,9 +589,9 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar if ((int)mir_strlen((char*)hClip) > mwdat->nMax) {
wchar_t szBuffer[512];
if (M.GetByte("autosplit", 0))
- mir_sntprintf(szBuffer, TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10);
+ mir_snwprintf(szBuffer, TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10);
else
- mir_sntprintf(szBuffer, TranslateT("The message you are trying to paste exceeds the message size limit for the active protocol. Only the first %d characters will be sent."), mwdat->nMax);
+ mir_snwprintf(szBuffer, TranslateT("The message you are trying to paste exceeds the message size limit for the active protocol. Only the first %d characters will be sent."), mwdat->nMax);
SendMessage(hwndParent, DM_ACTIVATETOOLTIP, IDC_MESSAGE, (LPARAM)szBuffer);
}
}
@@ -1342,7 +1342,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l // restore saved msg if any...
if (dat->hContact) {
- ptrT tszSavedMsg(db_get_tsa(dat->hContact, SRMSGMOD, "SavedMsg"));
+ ptrW tszSavedMsg(db_get_tsa(dat->hContact, SRMSGMOD, "SavedMsg"));
if (tszSavedMsg != 0) {
SETTEXTEX stx = { ST_DEFAULT, 1200 };
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, tszSavedMsg);
@@ -2017,7 +2017,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case WM_RBUTTONDOWN:
case WM_LBUTTONUP:
- ptrT tszUrl(Utils::extractURLFromRichEdit((ENLINK*)lParam, GetDlgItem(hwndDlg, IDC_LOG)));
+ ptrW tszUrl(Utils::extractURLFromRichEdit((ENLINK*)lParam, GetDlgItem(hwndDlg, IDC_LOG)));
if (!IsStringValidLink(tszUrl))
break;
@@ -2326,7 +2326,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (iIndex < SendQueue::NR_SENDJOBS) { // single sendjob timer
SendJob *job = sendQueue->getJobByIndex(iIndex);
KillTimer(hwndDlg, wParam);
- mir_sntprintf(job->szErrorMsg, TranslateT("Delivery failure: %s"), TranslateT("The message send timed out"));
+ mir_snwprintf(job->szErrorMsg, TranslateT("Delivery failure: %s"), TranslateT("The message send timed out"));
job->iStatus = SendQueue::SQ_ERROR;
if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND))
SkinPlaySound("SendError");
@@ -2545,7 +2545,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU);
if (iSelection - IDM_CONTAINERMENU >= 0) {
- ptrT val(db_get_tsa(NULL, szKey, szIndex));
+ ptrW val(db_get_tsa(NULL, szKey, szIndex));
if (val)
SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)val);
}
@@ -2623,7 +2623,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (streamOut == NULL)
break;
- CMString decoded(ptrT(mir_utf8decodeT(streamOut)));
+ CMString decoded(ptrW(mir_utf8decodeW(streamOut)));
if (decoded.IsEmpty())
break;
@@ -2723,7 +2723,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l }
if (selected != NULL) {
- ptrT szQuoted(QuoteText(selected));
+ ptrW szQuoted(QuoteText(selected));
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)szQuoted);
break;
}
@@ -2773,7 +2773,7 @@ quote_from_last: bNeedsFree = true;
}
if (szConverted != NULL) {
- ptrT szQuoted(QuoteText(szConverted));
+ ptrW szQuoted(QuoteText(szConverted));
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)szQuoted);
}
mir_free(szText);
@@ -2784,7 +2784,7 @@ quote_from_last: ptrA szFromStream(Message_GetFromStream(GetDlgItem(hwndDlg, IDC_LOG), SF_TEXT | SFF_SELECTION));
ptrW converted(mir_utf8decodeW(szFromStream));
Utils::FilterEventMarkers(converted);
- ptrT szQuoted(QuoteText(converted));
+ ptrW szQuoted(QuoteText(converted));
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)szQuoted);
}
SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
@@ -2875,7 +2875,7 @@ quote_from_last: case DM_CONTAINERSELECTED:
{
wchar_t *szNewName = (wchar_t*)lParam;
- if (!mir_tstrcmp(szNewName, TranslateT("Default container")))
+ if (!mir_wstrcmp(szNewName, TranslateT("Default container")))
szNewName = CGlobals::m_default_container_name;
int iOldItems = TabCtrl_GetItemCount(hwndTab);
@@ -3055,7 +3055,7 @@ quote_from_last: else {
if (ServiceExists(MS_HTTPSERVER_ADDFILENAME)) {
for (i = 0; i < totalCount; i++) {
- char* szFileName = mir_t2a(ppFiles[i]);
+ char* szFileName = mir_u2a(ppFiles[i]);
CallService(MS_HTTPSERVER_ADDFILENAME, (WPARAM)szFileName, 0);
mir_free(szFileName);
}
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index f68dd7c692..06c130e036 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -135,12 +135,12 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) DWORD setView = 1;
wchar_t szTimestamp[100];
- mir_sntprintf(szTimestamp, L"%04u %02u %02u_%02u%02u", lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
+ mir_snwprintf(szTimestamp, L"%04u %02u %02u_%02u%02u", lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
- wchar_t *szProto = mir_a2t(dat->cache->getActiveProto());
+ wchar_t *szProto = mir_a2u(dat->cache->getActiveProto());
wchar_t szFinalPath[MAX_PATH];
- mir_sntprintf(szFinalPath, L"%s\\%s", M.getSavedAvatarPath(), szProto);
+ mir_snwprintf(szFinalPath, L"%s\\%s", M.getSavedAvatarPath(), szProto);
mir_free(szProto);
if (CreateDirectory(szFinalPath, 0) == 0) {
@@ -153,17 +153,17 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) wchar_t szBaseName[MAX_PATH];
if (isOwnPic)
- mir_sntprintf(szBaseName, L"My Avatar_%s", szTimestamp);
+ mir_snwprintf(szBaseName, L"My Avatar_%s", szTimestamp);
else
- mir_sntprintf(szBaseName, L"%s_%s", dat->cache->getNick(), szTimestamp);
+ mir_snwprintf(szBaseName, L"%s_%s", dat->cache->getNick(), szTimestamp);
- mir_sntprintf(szFinalFilename, L"%s.png", szBaseName);
+ mir_snwprintf(szFinalFilename, L"%s.png", szBaseName);
// do not allow / or \ or % in the filename
Utils::sanitizeFilename(szFinalFilename);
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s%c*.bmp;*.png;*.jpg;*.gif%c%c", TranslateT("Image files"), 0, 0, 0);
+ mir_snwprintf(filter, L"%s%c*.bmp;*.png;*.jpg;*.gif%c%c", TranslateT("Image files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lpstrDefExt = L"png";
@@ -286,7 +286,7 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID) szText = TranslateT("Set your avatar...");
}
mii.dwTypeData = szText;
- mii.cch = (int)mir_tstrlen(szText) + 1;
+ mii.cch = (int)mir_wstrlen(szText) + 1;
SetMenuItemInfo(submenu, ID_PICMENU_SETTINGS, FALSE, &mii);
}
else if (menuID == MENU_PANELPICMENU) {
@@ -443,15 +443,15 @@ void TSAPI UpdateReadChars(const TWindowData *dat) wchar_t szBuf[20]; szBuf[0] = 0;
if (dat->fInsertMode)
- mir_tstrcat(szBuf, L"O");
+ mir_wstrcat(szBuf, L"O");
if (fCaps)
- mir_tstrcat(szBuf, L"C");
+ mir_wstrcat(szBuf, L"C");
if (fNum)
- mir_tstrcat(szBuf, L"N");
+ mir_wstrcat(szBuf, L"N");
if (dat->fInsertMode || fCaps || fNum)
- mir_tstrcat(szBuf, L" | ");
+ mir_wstrcat(szBuf, L" | ");
- mir_sntprintf(buf, L"%s%s %d/%d", szBuf, dat->lcID, dat->iOpenJobs, len);
+ mir_snwprintf(buf, L"%s%s %d/%d", szBuf, dat->lcID, dat->iOpenJobs, len);
SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 1, (LPARAM)buf);
if (PluginConfig.m_visualMessageSizeIndicator)
InvalidateRect(dat->pContainer->hwndStatus, NULL, FALSE);
@@ -931,7 +931,7 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors else if (!wcsncmp(p, L"\\highlight", 10)) { //background color
wchar_t szTemp[20];
int iCol = _wtoi(p + 10);
- mir_sntprintf(szTemp, L"%d", iCol);
+ mir_snwprintf(szTemp, L"%d", iCol);
}
else if (!wcsncmp(p, L"\\line", 5)) { // soft line break;
res.AppendChar('\n');
@@ -1037,7 +1037,7 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors void TSAPI GetMYUIN(TWindowData *dat)
{
- ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, NULL, dat->cache->getActiveProto()));
+ ptrW uid(Contact_GetInfo(CNF_DISPLAYUID, NULL, dat->cache->getActiveProto()));
if (uid != NULL)
wcsncpy_s(dat->myUin, uid, _TRUNCATE);
else
@@ -1271,7 +1271,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const wchar_t *szKLName) wchar_t szKey[20];
DWORD dwLID = wcstoul(szKLName, &stopped, 16);
- mir_sntprintf(szKey, L"%04.04x", LOWORD(dwLID));
+ mir_snwprintf(szKey, L"%04.04x", LOWORD(dwLID));
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, L"MIME\\Database\\Rfc1766", 0, KEY_READ, &hKey)) {
DWORD dwLength = 255;
if (ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, 0, 0, (unsigned char *)szLI, &dwLength)) {
@@ -1291,7 +1291,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const wchar_t *szKLName) wcsupr(szLI);
}
fLocaleNotSet = (dat->lcID[0] == 0 && dat->lcID[1] == 0);
- mir_sntprintf(dat->lcID, szLI);
+ mir_snwprintf(dat->lcID, szLI);
GetStringTypeA(dat->lcid, CT_CTYPE2, (char*)szTest, 3, wCtype2);
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_RTLPARA;
@@ -1625,7 +1625,7 @@ void TSAPI LoadThemeDefaults(TContainerData *pContainer) void TSAPI LoadOverrideTheme(TContainerData *pContainer)
{
memset(&pContainer->theme, 0, sizeof(TLogTheme));
- if (mir_tstrlen(pContainer->szAbsThemeFile) > 1) {
+ if (mir_wstrlen(pContainer->szAbsThemeFile) > 1) {
if (PathFileExists(pContainer->szAbsThemeFile)) {
if (CheckThemeVersion(pContainer->szAbsThemeFile) == 0) {
LoadThemeDefaults(pContainer);
@@ -1726,7 +1726,7 @@ void TSAPI GetClientIcon(TWindowData *dat) dat->hClientIcon = 0;
if (ServiceExists(MS_FP_GETCLIENTICONT)) {
- ptrT tszMirver(db_get_tsa(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer"));
+ ptrW tszMirver(db_get_tsa(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer"));
if (tszMirver)
dat->hClientIcon = Finger_GetClientIcon(tszMirver, 1);
}
@@ -1734,9 +1734,9 @@ void TSAPI GetClientIcon(TWindowData *dat) void TSAPI GetMyNick(TWindowData *dat)
{
- ptrT tszNick(Contact_GetInfo(CNF_NICK, NULL, dat->cache->getActiveProto()));
+ ptrW tszNick(Contact_GetInfo(CNF_NICK, NULL, dat->cache->getActiveProto()));
if (tszNick != NULL) {
- if (mir_tstrlen(tszNick) == 0 || !mir_tstrcmp(tszNick, TranslateT("'(Unknown contact)'")))
+ if (mir_wstrlen(tszNick) == 0 || !mir_wstrcmp(tszNick, TranslateT("'(Unknown contact)'")))
wcsncpy_s(dat->szMyNickname, (dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown contact)'")), _TRUNCATE);
else
wcsncpy_s(dat->szMyNickname, tszNick, _TRUNCATE);
@@ -1886,14 +1886,14 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) return;
}
- if (tempdirlen <= 0 || tempdirlen >= MAX_PATH - mir_tstrlen(mirandatempdir) - mir_tstrlen(filenametemplate) - 2) // -2 is because %Y takes 4 symbols
+ if (tempdirlen <= 0 || tempdirlen >= MAX_PATH - mir_wstrlen(mirandatempdir) - mir_wstrlen(filenametemplate) - 2) // -2 is because %Y takes 4 symbols
filename[0] = 0; // prompt for a new name
else {
- mir_tstrcpy(filename + tempdirlen, mirandatempdir);
+ mir_wstrcpy(filename + tempdirlen, mirandatempdir);
if ((GetFileAttributes(filename) == INVALID_FILE_ATTRIBUTES || ((GetFileAttributes(filename) & FILE_ATTRIBUTE_DIRECTORY) == 0)) && CreateDirectory(filename, NULL) == 0)
filename[0] = 0;
else {
- tempdirlen = mir_tstrlen(filename);
+ tempdirlen = mir_wstrlen(filename);
time_t rawtime;
time(&rawtime);
@@ -1917,7 +1917,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) if (filename[0] == 0) { // prompting to save
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s%c*.jpg%c%c", TranslateT("JPEG-compressed images"), 0, 0, 0);
+ mir_snwprintf(filter, L"%s%c*.jpg%c%c", TranslateT("JPEG-compressed images"), 0, 0, 0);
OPENFILENAME dlg;
dlg.lStructSize = sizeof(dlg);
@@ -1943,7 +1943,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) wchar_t **ppFiles = NULL;
Utils::AddToFileList(&ppFiles, &totalCount, filename);
- wchar_t* _t = mir_tstrdup(filename);
+ wchar_t* _t = mir_wstrdup(filename);
vTempFilenames.insert(_t);
CallService(MS_FILE_SENDSPECIFICFILEST, (WPARAM)dat->cache->getActiveContact(), (LPARAM)ppFiles);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 8abd3a071b..088a42847b 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -109,7 +109,7 @@ __forceinline char *GetRTFFont(DWORD dwIndex) */
static void TrimMessage(wchar_t *msg)
{
- size_t iLen = mir_tstrlen(msg) - 1;
+ size_t iLen = mir_wstrlen(msg) - 1;
size_t i = iLen;
while (i && (msg[i] == '\r' || msg[i] == '\n')) {
@@ -353,9 +353,9 @@ static wchar_t* Template_MakeRelativeDate(HANDLE hTimeZone, time_t check, wchar_ const wchar_t *szFormat;
if ((code == (wchar_t)'R' || code == (wchar_t)'r') && check >= today)
- mir_tstrcpy(szResult, szToday);
+ mir_wstrcpy(szResult, szToday);
else if ((code == (wchar_t)'R' || code == (wchar_t)'r') && check > (today - 86400))
- mir_tstrcpy(szResult, szYesterday);
+ mir_wstrcpy(szResult, szYesterday);
else {
if (code == 'D' || code == 'R')
szFormat = L"D";
@@ -514,7 +514,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, szTemplate = isSent ? this_templateset->szTemplates[TMPL_MSGOUT] : this_templateset->szTemplates[TMPL_MSGIN];
}
- size_t iTemplateLen = mir_tstrlen(szTemplate);
+ size_t iTemplateLen = mir_wstrlen(szTemplate);
BOOL showTime = dwEffectiveFlags & MWF_LOG_SHOWTIME;
BOOL showDate = dwEffectiveFlags & MWF_LOG_SHOWDATES;
@@ -824,14 +824,14 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, }
{
char *szFileName = (char *)dbei.pBlob + sizeof(DWORD);
- ptrT tszFileName(DbGetEventStringT(&dbei, szFileName));
+ ptrW tszFileName(DbGetEventStringT(&dbei, szFileName));
char *szDescr = szFileName + mir_strlen(szFileName) + 1;
if (*szDescr != 0) {
- ptrT tszDescr(DbGetEventStringT(&dbei, szDescr));
+ ptrW tszDescr(DbGetEventStringT(&dbei, szDescr));
wchar_t buf[1000];
- mir_sntprintf(buf, L"%s (%s)", tszFileName, tszDescr);
+ mir_snwprintf(buf, L"%s (%s)", tszFileName, tszDescr);
AppendUnicodeToBuffer(str, buf, 0);
}
else AppendUnicodeToBuffer(str, tszFileName, 0);
@@ -844,7 +844,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, str.AppendChar(' ');
}
- ptrT tszText(DbGetEventTextT(&dbei, CP_ACP));
+ ptrW tszText(DbGetEventTextT(&dbei, CP_ACP));
AppendUnicodeToBuffer(str, tszText, 0);
}
break;
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index 4928636933..0be5543c4d 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -97,12 +97,12 @@ static int TSAPI ScanSkinDir(const wchar_t* tszFolder, HWND hwndCombobox) {
bool fValid = false;
wchar_t tszMask[MAX_PATH];
- mir_sntprintf(tszMask, L"%s*.*", tszFolder);
+ mir_snwprintf(tszMask, L"%s*.*", tszFolder);
WIN32_FIND_DATA fd = { 0 };
HANDLE h = FindFirstFile(tszMask, &fd);
while (h != INVALID_HANDLE_VALUE) {
- if (mir_tstrlen(fd.cFileName) >= 5 && !wcsnicmp(fd.cFileName + mir_tstrlen(fd.cFileName) - 4, L".tsk", 4)) {
+ if (mir_wstrlen(fd.cFileName) >= 5 && !wcsnicmp(fd.cFileName + mir_wstrlen(fd.cFileName) - 4, L".tsk", 4)) {
fValid = true;
break;
}
@@ -117,19 +117,19 @@ static int TSAPI ScanSkinDir(const wchar_t* tszFolder, HWND hwndCombobox) LRESULT lr;
wchar_t szBuf[255];
- mir_sntprintf(tszFinalName, L"%s%s", tszFolder, fd.cFileName);
+ mir_snwprintf(tszFinalName, L"%s%s", tszFolder, fd.cFileName);
GetPrivateProfileString(L"Global", L"Name", L"None", szBuf, _countof(szBuf), tszFinalName);
- if (!mir_tstrcmp(szBuf, L"None")) {
- fd.cFileName[mir_tstrlen(fd.cFileName) - 4] = 0;
+ if (!mir_wstrcmp(szBuf, L"None")) {
+ fd.cFileName[mir_wstrlen(fd.cFileName) - 4] = 0;
wcsncpy_s(szBuf, fd.cFileName, _TRUNCATE);
}
PathToRelativeT(tszFinalName, tszRel, M.getSkinPath());
if ((lr = SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)szBuf)) != CB_ERR) {
- wchar_t *idata = (wchar_t*)mir_alloc((mir_tstrlen(tszRel) + 1) * sizeof(wchar_t));
+ wchar_t *idata = (wchar_t*)mir_alloc((mir_wstrlen(tszRel) + 1) * sizeof(wchar_t));
- mir_tstrcpy(idata, tszRel);
+ mir_wstrcpy(idata, tszRel);
SendMessage(hwndCombobox, CB_SETITEMDATA, lr, (LPARAM)idata);
}
}
@@ -153,7 +153,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) wcsncpy_s(tszSkinRoot, M.getSkinPath(), _TRUNCATE);
SetDlgItemText(GetParent(hwndCombobox), IDC_SKINROOTFOLDER, tszSkinRoot);
- mir_sntprintf(tszFindMask, L"%s*.*", tszSkinRoot);
+ mir_snwprintf(tszFindMask, L"%s*.*", tszSkinRoot);
SendMessage(hwndCombobox, CB_RESETCONTENT, 0, 0);
SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)TranslateT("<no skin>"));
@@ -163,7 +163,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) while (h != INVALID_HANDLE_VALUE) {
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && fd.cFileName[0] != '.') {
wchar_t tszSubDir[MAX_PATH];
- mir_sntprintf(tszSubDir, L"%s%s\\", tszSkinRoot, fd.cFileName);
+ mir_snwprintf(tszSubDir, L"%s%s\\", tszSkinRoot, fd.cFileName);
ScanSkinDir(tszSubDir, hwndCombobox);
}
if (FindNextFile(h, &fd) == 0)
@@ -178,7 +178,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) for (int i = 1; i < lr; i++) {
wchar_t *idata = (wchar_t*)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
if (idata && idata != (wchar_t*)CB_ERR) {
- if (!mir_tstrcmpi(dbv.ptszVal, idata)) {
+ if (!mir_wstrcmpi(dbv.ptszVal, idata)) {
SendMessage(hwndCombobox, CB_SETCURSEL, i, 0);
break;
}
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 1301f3af80..57be74dd2b 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -491,7 +491,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, // cut nickname if larger than x chars...
wchar_t newcontactname[128], tabtitle[128];
- if (contactName && mir_tstrlen(contactName) > 0) {
+ if (contactName && mir_wstrlen(contactName) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, _countof(newcontactname));
else
@@ -504,9 +504,9 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, wchar_t *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
if (M.GetByte("tabstatus", 1))
- mir_sntprintf(tabtitle, L"%s (%s) ", newcontactname, szStatus);
+ mir_snwprintf(tabtitle, L"%s (%s) ", newcontactname, szStatus);
else
- mir_sntprintf(tabtitle, L"%s ", newcontactname);
+ mir_snwprintf(tabtitle, L"%s ", newcontactname);
newData.item.pszText = tabtitle;
newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
@@ -1069,7 +1069,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
wchar_t sztName[64];
- mir_sntprintf(sztName, L"s%u", nextStgId++);
+ mir_snwprintf(sztName, L"s%u", nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
return pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index d52a25f738..6529bfaabf 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -47,7 +47,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (lParam) {
TWindowData *dat = (TWindowData*)GetWindowLongPtr((HWND)lParam, GWLP_USERDATA);
if (dat) {
- mir_sntprintf(szNewTitle, TranslateT("Select container for %s"), dat->cache->getNick());
+ mir_snwprintf(szNewTitle, TranslateT("Select container for %s"), dat->cache->getNick());
SetWindowText(hwndDlg, szNewTitle);
}
}
@@ -112,7 +112,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (iItem != LB_ERR) {
wchar_t szOldName[CONTAINER_NAMELEN + 1];
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szOldName);
- if (mir_tstrlen(szOldName) == mir_tstrlen(szNewName)) {
+ if (mir_wstrlen(szOldName) == mir_wstrlen(szNewName)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
break;
@@ -127,7 +127,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L RenameContainer(iIndex, szNewName);
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_RESETCONTENT, 0, 0);
for (TContainerData *p = pFirstContainer; p; p = p->pNext) {
- if (!wcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_tstrlen(p->szName) == mir_tstrlen(szName)) {
+ if (!wcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_wstrlen(p->szName) == mir_wstrlen(szName)) {
wcsncpy(p->szName, szNewName, CONTAINER_NAMELEN);
SendMessage(p->hwnd, DM_CONFIGURECONTAINER, 0, 0);
}
@@ -148,7 +148,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L int iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)szNewName);
if (iItem != LB_ERR || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
- if (mir_tstrlen(szName) == mir_tstrlen(szNewName) || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
+ if (mir_wstrlen(szName) == mir_wstrlen(szNewName) || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
break;
@@ -183,7 +183,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L break; // end of list
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
if (wcsncmp(dbv.ptszVal, L"**mir_free**", CONTAINER_NAMELEN)) {
- iItemNew = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_ADDSTRING, 0, (LPARAM)(!mir_tstrcmp(dbv.ptszVal, L"default") ?
+ iItemNew = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_ADDSTRING, 0, (LPARAM)(!mir_wstrcmp(dbv.ptszVal, L"default") ?
TranslateT("Default container") : dbv.ptszVal));
if (iItemNew != LB_ERR)
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_SETITEMDATA, (WPARAM)iItemNew, (LPARAM)iCounter);
@@ -200,7 +200,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (pContainer) {
LRESULT iItem;
- iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)(!mir_tstrcmp(pContainer->szName, L"default") ?
+ iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)(!mir_wstrcmp(pContainer->szName, L"default") ?
TranslateT("Default container") : pContainer->szName));
if (iItem != LB_ERR)
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_SETCURSEL, (WPARAM)iItem, 0);
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index e52fb5adb0..e717c1817b 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -123,12 +123,12 @@ CSendLaterJob::~CSendLaterJob() wcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE);
wchar_t *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<wchar_t *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
if (fSuccess) {
- mir_sntprintf(ppd.lptzText, TranslateT("A send later job completed successfully.\nThe original message: %s"),
+ mir_snwprintf(ppd.lptzText, TranslateT("A send later job completed successfully.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
else if (fFailed) {
- mir_sntprintf(ppd.lptzText, TranslateT("A send later job failed to complete.\nThe original message: %s"),
+ mir_snwprintf(ppd.lptzText, TranslateT("A send later job failed to complete.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
@@ -523,7 +523,7 @@ void CSendLater::qMgrFillList(bool fClear) lvItem.mask = LVIF_TEXT | LVIF_PARAM;
wchar_t tszBuf[255];
- mir_sntprintf(tszBuf, L"%s [%s]", tszNick, c->getRealAccount());
+ mir_snwprintf(tszBuf, L"%s [%s]", tszNick, c->getRealAccount());
lvItem.pszText = tszBuf;
lvItem.cchTextMax = _countof(tszBuf);
lvItem.iItem = uIndex++;
@@ -540,7 +540,7 @@ void CSendLater::qMgrFillList(bool fClear) lvItem.iSubItem = 1;
::SendMessage(m_hwndList, LVM_SETITEM, 0, LPARAM(&lvItem));
- wchar_t *msg = mir_utf8decodeT(p->sendBuffer);
+ wchar_t *msg = mir_utf8decodeW(p->sendBuffer);
wchar_t *preview = Utils::GetPreviewWithEllipsis(msg, 255);
lvItem.pszText = preview;
lvItem.iSubItem = 2;
@@ -575,7 +575,7 @@ void CSendLater::qMgrFillList(bool fClear) bCode = p->bCode;
wchar_t tszStatus[20];
- mir_sntprintf(tszStatus, L"X/%s[%c] (%d)", tszStatusText, bCode, p->iSendCount);
+ mir_snwprintf(tszStatus, L"X/%s[%c] (%d)", tszStatusText, bCode, p->iSendCount);
tszStatus[0] = p->szId[0];
lvItem.pszText = tszStatus;
lvItem.iSubItem = 3;
@@ -807,7 +807,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM job->writeFlags();
break;
case ID_QUEUEMANAGER_COPYMESSAGETOCLIPBOARD:
- Utils::CopyToClipBoard((wchar_t*)ptrT(mir_utf8decodeT(job->sendBuffer)), m_hwndDlg);
+ Utils::CopyToClipBoard((wchar_t*)ptrW(mir_utf8decodeW(job->sendBuffer)), m_hwndDlg);
break;
case ID_QUEUEMANAGER_RESETSELECTED:
if (job->bCode == CSendLaterJob::JOB_DEFERRED) {
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index b7a6f80f5a..aed683997e 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -219,7 +219,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) if (iSendLength >= iMinLength) { wchar_t tszError[256]; - mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength); + mir_snwprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength); ::SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError)); sendQueue->clearJob(iEntry); return 0; @@ -274,7 +274,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) size_t iSendLength = getSendLength(iEntry); if (iSendLength >= dat->nMax) { - mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->nMax); + mir_snwprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->nMax); SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError)); clearJob(iEntry); return 0; @@ -543,8 +543,8 @@ int SendQueue::ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam) if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND)) SkinPlaySound("SendError"); - wchar_t *szAckMsg = mir_a2t((char *)ack->lParam); - mir_sntprintf(job.szErrorMsg, TranslateT("Delivery failure: %s"), szAckMsg); + wchar_t *szAckMsg = mir_a2u((char *)ack->lParam); + mir_snwprintf(job.szErrorMsg, TranslateT("Delivery failure: %s"), szAckMsg); job.iStatus = SQ_ERROR; mir_free(szAckMsg); KillTimer(dat->hwnd, TIMERID_MSGSEND + iFound); @@ -684,9 +684,9 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b wchar_t tszTimestamp[30]; wcsftime(tszTimestamp, _countof(tszTimestamp), L"%Y.%m.%d - %H:%M", _localtime32((__time32_t *)&now)); mir_snprintf(szKeyName, "S%d", now); - mir_sntprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp); + mir_snwprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp); } - else mir_sntprintf(tszHeader, L"M%d|", time(0)); + else mir_snwprintf(tszHeader, L"M%d|", time(0)); T2Utf utf_header(tszHeader); size_t required = mir_strlen(utf_header) + mir_strlen(job->szSendBuffer) + 10; diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index 908b4b59d0..ccaf889ee2 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -145,7 +145,7 @@ const SIZE& CSideBarButton::measureItem() HFONT oldFont = reinterpret_cast<HFONT>(::SelectObject(dc, ::GetStockObject(DEFAULT_GUI_FONT)));
wcsncpy_s(tszLabel, m_dat->newtitle, _TRUNCATE);
- ::GetTextExtentPoint32(dc, tszLabel, (int)mir_tstrlen(tszLabel), &sz);
+ ::GetTextExtentPoint32(dc, tszLabel, (int)mir_wstrlen(tszLabel), &sz);
sz.cx += 28;
if (m_dat->pContainer->dwFlagsEx & TCF_CLOSEBUTTON)
@@ -1158,9 +1158,9 @@ const SIZE& __fastcall CSideBar::m_measureAdvancedVertical(CSideBarButton* item) HDC dc = ::GetDC(dat->hwnd);
HFONT hOldFont = reinterpret_cast<HFONT>(::SelectObject(dc, CInfoPanel::m_ipConfig.hFonts[IPFONTID_NICK]));
- ::GetTextExtentPoint32(dc, dat->cache->getNick(), (int)mir_tstrlen(dat->cache->getNick()), &szFirstLine);
+ ::GetTextExtentPoint32(dc, dat->cache->getNick(), (int)mir_wstrlen(dat->cache->getNick()), &szFirstLine);
::SelectObject(dc, CInfoPanel::m_ipConfig.hFonts[IPFONTID_STATUS]);
- ::GetTextExtentPoint32(dc, dat->szStatus, (int)mir_tstrlen(dat->szStatus), &szSecondLine);
+ ::GetTextExtentPoint32(dc, dat->szStatus, (int)mir_wstrlen(dat->szStatus), &szSecondLine);
::SelectObject(dc, hOldFont);
ReleaseDC(dat->hwnd, dc);
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 78ec8e47da..2b6de13dfd 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -111,7 +111,7 @@ int _DebugTraceW(const wchar_t *fmt, ...) mir_snprintf(tszTime, "%02d.%02d.%04d - %02d:%02d:%02d.%04d: ", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); - mir_vsntprintf(debug, ibsize - 10, fmt, va); + mir_vsnwprintf(debug, ibsize - 10, fmt, va); //#ifdef _DEBUG OutputDebugStringW(debug); //#else @@ -148,12 +148,12 @@ int _DebugPopup(MCONTACT hContact, const wchar_t *fmt, ...) int ibsize = 1023; va_start(va, fmt); - mir_vsntprintf(debug, ibsize, fmt, va); + mir_vsnwprintf(debug, ibsize, fmt, va); if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) { MIRANDASYSTRAYNOTIFY tn; wchar_t szTitle[128]; - mir_sntprintf(szTitle, TranslateT("TabSRMM message (%s)"), + mir_snwprintf(szTitle, TranslateT("TabSRMM message (%s)"), (hContact != 0) ? pcli->pfnGetContactDisplayName(hContact, 0) : TranslateT("Global")); tn.szProto = NULL; diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp index 224053c4c8..1e319a6c96 100644 --- a/plugins/TabSRMM/src/taskbar.cpp +++ b/plugins/TabSRMM/src/taskbar.cpp @@ -686,7 +686,7 @@ void CThumbBase::renderBase() wchar_t tszTemp[30];
m_rcIcon.top += m_sz.cy;
- mir_sntprintf(tszTemp, TranslateT("%d unread"), m_dat->dwUnread);
+ mir_snwprintf(tszTemp, TranslateT("%d unread"), m_dat->dwUnread);
CSkin::RenderText(m_hdc, m_dat->hTheme, tszTemp, &m_rcIcon, m_dtFlags | DT_CENTER | DT_WORD_ELLIPSIS, 10, 0, true);
}
m_rcIcon = m_rcTop;
@@ -862,7 +862,7 @@ void CThumbMUC::renderContent() if (mi) {
if (m_dat->dwUnread) {
- mir_sntprintf(szTemp, TranslateT("%d unread"), m_dat->dwUnread);
+ mir_snwprintf(szTemp, TranslateT("%d unread"), m_dat->dwUnread);
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
m_rcIcon.top += m_sz.cy;
}
@@ -874,20 +874,20 @@ void CThumbMUC::renderContent() _p++;
wchar_t _t = *_p;
*_p = 0;
- mir_sntprintf(szTemp, TranslateT("Chat room %s"), m_dat->si->ptszStatusbarText);
+ mir_snwprintf(szTemp, TranslateT("Chat room %s"), m_dat->si->ptszStatusbarText);
*_p = _t;
}
else
- mir_sntprintf(szTemp, TranslateT("Chat room %s"), L"");
+ mir_snwprintf(szTemp, TranslateT("Chat room %s"), L"");
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
m_rcIcon.top += m_sz.cy;
- mir_sntprintf(szTemp, TranslateT("%d user(s)"), m_dat->si->nUsersInNicklist);
+ mir_snwprintf(szTemp, TranslateT("%d user(s)"), m_dat->si->nUsersInNicklist);
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
}
else {
- mir_sntprintf(szTemp, TranslateT("Server window"));
+ mir_snwprintf(szTemp, TranslateT("Server window"));
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
- if (mi->tszIdleMsg[0] && mir_tstrlen(mi->tszIdleMsg) > 2) {
+ if (mi->tszIdleMsg[0] && mir_wstrlen(mi->tszIdleMsg) > 2) {
m_rcIcon.top += m_sz.cy;
CSkin::RenderText(m_hdc, m_dat->hTheme, &mi->tszIdleMsg[2], &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
}
@@ -904,7 +904,7 @@ void CThumbMUC::renderContent() szStatusMsg = TranslateT("no topic set.");
}
else if (mi) {
- mir_sntprintf(szTemp, TranslateT("%s on %s%s"), m_dat->szMyNickname, mi->ptszModDispName, L"");
+ mir_snwprintf(szTemp, TranslateT("%s on %s%s"), m_dat->szMyNickname, mi->ptszModDispName, L"");
szStatusMsg = szTemp;
}
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 9ad2b93557..48c8168a55 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -357,7 +357,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->dwFlags = MWF_LOG_ALL; dat->dwFlags = (teInfo->rtl ? dat->dwFlags | MWF_LOG_RTL : dat->dwFlags & ~MWF_LOG_RTL); dat->dwFlags = (iIndex == 0 || iIndex == 1) ? dat->dwFlags & ~MWF_LOG_GROUPMODE : dat->dwFlags | MWF_LOG_GROUPMODE; - mir_sntprintf(dat->szMyNickname, L"My Nickname"); + mir_snwprintf(dat->szMyNickname, L"My Nickname"); StreamInEvents(hwndDlg, 0, 1, 0, &dbei); SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_SETSEL, -1, -1); if (teInfo->changed) diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index 96cbe340d7..92a6571fe3 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -425,7 +425,7 @@ const wchar_t* TSAPI GetThemeFileName(int iMode) szFilename[0] = 0;
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s%c*.tabsrmm%c%c", TranslateT("TabSRMM themes"), 0, 0, 0);
+ mir_snwprintf(filter, L"%s%c*.tabsrmm%c%c", TranslateT("TabSRMM themes"), 0, 0, 0);
ofn.lpstrFilter = filter;
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = 0;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 740f69c74b..d2ba2c8e3c 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -802,7 +802,7 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename) wchar_t *szFinalName = 0;
GetPrivateProfileString(m_szName, L"Glyph", L"None", buffer, 500, szFilename);
- if (mir_tstrcmp(buffer, L"None")) {
+ if (mir_wstrcmp(buffer, L"None")) {
swscanf(buffer, L"%d,%d,%d,%d", &m_glyphMetrics[0], &m_glyphMetrics[1],
&m_glyphMetrics[2], &m_glyphMetrics[3]);
if (m_glyphMetrics[2] > m_glyphMetrics[0] && m_glyphMetrics[3] > m_glyphMetrics[1]) {
@@ -813,12 +813,12 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename) }
GetPrivateProfileString(m_szName, L"Image", L"None", buffer, 500, szFilename);
- if (mir_tstrcmp(buffer, L"None") || m_dwFlags & IMAGE_GLYPH) {
+ if (mir_wstrcmp(buffer, L"None") || m_dwFlags & IMAGE_GLYPH) {
szFinalName = new wchar_t[MAX_PATH];
//strncpy(m_szName, &m_szName[1], sizeof(m_szName));
//m_szName[sizeof(m_szName) - 1] = 0;
_wsplitpath(szFilename, szDrive, szPath, NULL, NULL);
- mir_sntprintf(szFinalName, MAX_PATH, L"%s\\%s%s", szDrive, szPath, buffer);
+ mir_snwprintf(szFinalName, MAX_PATH, L"%s\\%s%s", szDrive, szPath, buffer);
if (!PathFileExists(szFinalName)) {
delete[] szFinalName;
szFinalName = 0;
@@ -852,7 +852,7 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename) }
}
GetPrivateProfileString(m_szName, L"Fillcolor", L"None", buffer, 500, szFilename);
- if (mir_tstrcmp(buffer, L"None")) {
+ if (mir_wstrcmp(buffer, L"None")) {
COLORREF fillColor = CSkin::HexStringToLong(buffer);
m_fillBrush = CreateSolidBrush(fillColor);
m_dwFlags |= IMAGE_FILLSOLID;
@@ -860,7 +860,7 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename) else
m_fillBrush = 0;
GetPrivateProfileString(m_szName, L"Colorkey", L"None", buffer, 500, szFilename);
- if (mir_tstrcmp(buffer, L"None")) {
+ if (mir_wstrcmp(buffer, L"None")) {
CSkin::m_ContainerColorKey = CSkin::HexStringToLong(buffer);
if (CSkin::m_ContainerColorKeyBrush)
DeleteObject(CSkin::m_ContainerColorKeyBrush);
@@ -1204,11 +1204,11 @@ void CSkin::LoadIcon(const wchar_t *szSection, const wchar_t *name, HICON &hIcon GetPrivateProfileString(szSection, name, L"none", buffer, 250, m_tszFileName);
buffer[500] = 0;
- if (mir_tstrcmpi(buffer, L"none")) {
+ if (mir_wstrcmpi(buffer, L"none")) {
wchar_t szDrive[MAX_PATH], szDir[MAX_PATH], szImagePath[MAX_PATH];
_wsplitpath(m_tszFileName, szDrive, szDir, NULL, NULL);
- mir_sntprintf(szImagePath, L"%s\\%s\\%s", szDrive, szDir, buffer);
+ mir_snwprintf(szImagePath, L"%s\\%s\\%s", szDrive, szDir, buffer);
hIcon = (HICON)LoadImage(0, szImagePath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
}
else hIcon = NULL;
@@ -1237,12 +1237,12 @@ void CSkin::ReadItem(const int id, const wchar_t *szItem) this_item->ALPHA = min(this_item->ALPHA, 100);
clr = RGB(GetBValue(defaults->COLOR), GetGValue(defaults->COLOR), GetRValue(defaults->COLOR));
- mir_sntprintf(def_color, L"%6.6x", clr);
+ mir_snwprintf(def_color, L"%6.6x", clr);
GetPrivateProfileString(szItem, L"Color1", def_color, buffer, 400, m_tszFileName);
this_item->COLOR = HexStringToLong(buffer);
clr = RGB(GetBValue(defaults->COLOR2), GetGValue(defaults->COLOR2), GetRValue(defaults->COLOR2));
- mir_sntprintf(def_color, L"%6.6x", clr);
+ mir_snwprintf(def_color, L"%6.6x", clr);
GetPrivateProfileString(szItem, L"Color2", def_color, buffer, 400, m_tszFileName);
this_item->COLOR2 = HexStringToLong(buffer);
@@ -1299,7 +1299,7 @@ void CSkin::ReadImageItem(const wchar_t *itemname) wchar_t *szImageFileName = tmpItem.Read(m_tszFileName);
- if (!mir_tstrcmpi(itemname, L"$glyphs") && szImageFileName != 0) { // the glyph item MUST have a valid image
+ if (!mir_wstrcmpi(itemname, L"$glyphs") && szImageFileName != 0) { // the glyph item MUST have a valid image
tmpItem.Create(szImageFileName);
if (tmpItem.getHbm()) {
m_glyphItem = tmpItem;
@@ -1312,12 +1312,12 @@ void CSkin::ReadImageItem(const wchar_t *itemname) // handle the assignments of image items to skin items
for (int n = 0;; n++) {
- mir_sntprintf(szItemNr, L"Item%d", n);
+ mir_snwprintf(szItemNr, L"Item%d", n);
GetPrivateProfileString(itemname, szItemNr, L"None", buffer, 500, m_tszFileName);
- if (!mir_tstrcmp(buffer, L"None"))
+ if (!mir_wstrcmp(buffer, L"None"))
break;
for (int i = 0; i <= ID_EXTBK_LAST; i++) {
- if (!mir_tstrcmpi(SkinItems[i].szName[0] == '{' ? &SkinItems[i].szName[3] : SkinItems[i].szName, buffer)) {
+ if (!mir_wstrcmpi(SkinItems[i].szName[0] == '{' ? &SkinItems[i].szName[3] : SkinItems[i].szName, buffer)) {
if (!(tmpItem.getFlags() & IMAGE_GLYPH)) {
if (szImageFileName)
tmpItem.Create(szImageFileName);
@@ -1406,18 +1406,18 @@ void CSkin::Load(void) GetPrivateProfileSectionNames(szSections, 3000, m_tszFileName);
szSections[3001] = szSections[3000] = 0;
wchar_t *p = szSections;
- while (mir_tstrlen(p) > 1) {
+ while (mir_wstrlen(p) > 1) {
if (p[0] != '%') {
- p += (mir_tstrlen(p) + 1);
+ p += (mir_wstrlen(p) + 1);
continue;
}
for (i = 0; i <= ID_EXTBK_LAST; i++) {
- if (!mir_tstrcmpi(&p[1], SkinItems[i].szName[0] == '{' ? &SkinItems[i].szName[3] : SkinItems[i].szName)) {
+ if (!mir_wstrcmpi(&p[1], SkinItems[i].szName[0] == '{' ? &SkinItems[i].szName[3] : SkinItems[i].szName)) {
ReadItem(i, p);
break;
}
}
- p += (mir_tstrlen(p) + 1);
+ p += (mir_wstrlen(p) + 1);
j++;
}
@@ -1430,7 +1430,7 @@ void CSkin::Load(void) m_avatarBorderClr = (COLORREF)HexStringToLong(buffer);
GetPrivateProfileString(L"Global", L"SideBarBG", L"None", buffer, 20, m_tszFileName);
- if (mir_tstrcmp(buffer, L"None"))
+ if (mir_wstrcmp(buffer, L"None"))
m_sideBarContainerBG = (COLORREF)HexStringToLong(buffer);
else
m_sideBarContainerBG = SkinItems[ID_EXTBKSIDEBARBG].COLOR;
@@ -1477,7 +1477,7 @@ void CSkin::Load(void) GetPrivateProfileString(L"Theme", L"File", L"None", buffer, MAX_PATH, m_tszFileName);
_wsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL);
- mir_sntprintf(szFinalName, L"%s\\%s\\%s", szDrive, szPath, buffer);
+ mir_snwprintf(szFinalName, L"%s\\%s\\%s", szDrive, szPath, buffer);
if (PathFileExists(szFinalName)) {
ReadThemeFromINI(szFinalName, 0, FALSE, m_fLoadOnStartup ? 0 : M.GetByte("skin_loadmode", 0));
CacheLogFonts();
@@ -1490,7 +1490,7 @@ void CSkin::Load(void) DeleteObject(m_MenuBGBrush);
m_MenuBGBrush = 0;
}
- if (mir_tstrcmp(buffer, L"None"))
+ if (mir_wstrcmp(buffer, L"None"))
m_MenuBGBrush = CreateSolidBrush(data);
GetPrivateProfileString(L"Global", L"LightShadow", L"000000", buffer, 20, m_tszFileName);
@@ -1503,7 +1503,7 @@ void CSkin::Load(void) SkinCalcFrameWidth();
GetPrivateProfileString(L"Global", L"FontColor", L"None", buffer, 20, m_tszFileName);
- if (mir_tstrcmp(buffer, L"None"))
+ if (mir_wstrcmp(buffer, L"None"))
CSkin::m_DefaultFontColor = HexStringToLong(buffer);
else
CSkin::m_DefaultFontColor = GetSysColor(COLOR_BTNTEXT);
@@ -1539,7 +1539,7 @@ void CSkin::LoadItems() szSections[SECT_BUFFER_SIZE] = 0;
p = szSections;
- while (mir_tstrlen(p) > 1) {
+ while (mir_wstrlen(p) > 1) {
p1 = wcschr(p, (int)'=');
if (p1)
*p1 = 0;
@@ -1549,14 +1549,14 @@ void CSkin::LoadItems() memset(&m_skinIcons[m_nrSkinIcons], 0, sizeof(TIconDesc));
m_skinIcons[m_nrSkinIcons].uId = tmpIconDesc.uId;
m_skinIcons[m_nrSkinIcons].phIcon = (HICON *)(&m_skinIcons[m_nrSkinIcons].uId);
- m_skinIcons[m_nrSkinIcons].szName = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(p) + 1));
- mir_tstrcpy(m_skinIcons[m_nrSkinIcons].szName, p);
+ m_skinIcons[m_nrSkinIcons].szName = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_wstrlen(p) + 1));
+ mir_wstrcpy(m_skinIcons[m_nrSkinIcons].szName, p);
m_nrSkinIcons++;
}
}
if (p1)
*p1 = '=';
- p += (mir_tstrlen(p) + 1);
+ p += (mir_wstrlen(p) + 1);
}
memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(wchar_t)));
@@ -1564,10 +1564,10 @@ void CSkin::LoadItems() szSections[SECT_BUFFER_SIZE] = 0;
p = szSections;
- while (mir_tstrlen(p) > 1) {
+ while (mir_wstrlen(p) > 1) {
if (p[0] == '$')
ReadImageItem(p);
- p += (mir_tstrlen(p) + 1);
+ p += (mir_wstrlen(p) + 1);
}
nextButtonID = IDC_TBFIRSTUID;
@@ -1668,14 +1668,14 @@ void CSkin::setupAeroSkins() wchar_t tszFilename[MAX_PATH], tszBasePath[MAX_PATH];
wcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
- if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
- mir_tstrcat(tszBasePath, L"\\");
+ if (tszBasePath[mir_wstrlen(tszBasePath) - 1] != '\\')
+ mir_wstrcat(tszBasePath, L"\\");
// load unknown avatar..
if (0 == PluginConfig.g_hbmUnknown) {
- mir_sntprintf(tszFilename, L"%scustom_unknown.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%scustom_unknown.png", tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, L"%sunknown.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%sunknown.png", tszBasePath);
PluginConfig.g_hbmUnknown = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR);
if (PluginConfig.g_hbmUnknown == 0) {
HDC dc = GetDC(0);
@@ -1684,9 +1684,9 @@ void CSkin::setupAeroSkins() }
}
- mir_sntprintf(tszFilename, L"%scustom_tabskin_aero.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%scustom_tabskin_aero.png", tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, L"%stabskin_aero.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%stabskin_aero.png", tszBasePath);
BOOL isOpaque = false;
if (CMimAPI::m_pfnDwmGetColorizationColor && M.isAero())
@@ -1771,9 +1771,9 @@ void CSkin::setupAeroSkins() m_tabBottom->setMetrics(bm.bmWidth, bm.bmHeight);
- mir_sntprintf(tszFilename, L"%scustom_tabskin_aero_glow.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%scustom_tabskin_aero_glow.png", tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, L"%stabskin_aero_glow.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%stabskin_aero_glow.png", tszBasePath);
fib = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR | IMGL_RETURNDIB);
@@ -1804,9 +1804,9 @@ void CSkin::setupAeroSkins() m_tabGlowBottom->setMetrics(bm.bmWidth, bm.bmHeight);
// background item for the button switch bar
- mir_sntprintf(tszFilename, L"%scustom_tabskin_aero_button.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%scustom_tabskin_aero_button.png", tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, L"%stabskin_aero_button.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%stabskin_aero_button.png", tszBasePath);
hbm = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR);
@@ -2439,8 +2439,8 @@ void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const {
wchar_t tszBasePath[MAX_PATH];
wcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
- if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
- mir_tstrcat(tszBasePath, L"\\");
+ if (tszBasePath[mir_wstrlen(tszBasePath) - 1] != '\\')
+ mir_wstrcat(tszBasePath, L"\\");
CreateDirectoryTreeT(tszBasePath);
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h index 32d3ac2d2d..4b35e4b366 100644 --- a/plugins/TabSRMM/src/themes.h +++ b/plugins/TabSRMM/src/themes.h @@ -151,7 +151,7 @@ public: CImageItem(const wchar_t *szName)
{
memset(this, 0, sizeof(CImageItem));
- mir_sntprintf(m_szName, szName);
+ mir_snwprintf(m_szName, szName);
m_szName[39] = 0;
}
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index f13c5195c5..f9d01f7c87 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -92,7 +92,7 @@ static void TrayAnimThread(LPVOID) void TSAPI CreateTrayMenus(int mode)
{
if (mode) {
- mir_sntprintf(g_eventName, L"tsr_evt_%d", GetCurrentThreadId());
+ mir_snwprintf(g_eventName, L"tsr_evt_%d", GetCurrentThreadId());
g_hEvent = CreateEvent(NULL, FALSE, FALSE, g_eventName);
isAnimThreadRunning = TRUE;
hTrayAnimThread = mir_forkthread(TrayAnimThread, NULL);
@@ -217,7 +217,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, c if (acc && acc->tszAccountName) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
- mir_sntprintf(szMenuEntry, L"%s: %s (%s)", acc->tszAccountName, szFinalNick, szStatus);
+ mir_snwprintf(szMenuEntry, L"%s: %s (%s)", acc->tszAccountName, szFinalNick, szStatus);
if (mode) {
if (hMenu == PluginConfig.g_hMenuRecent) {
if (CheckMenuItem(hMenu, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == 0) {
@@ -264,7 +264,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, c if (!mode) {
mii.fMask |= MIIM_STRING;
mii.dwTypeData = (LPTSTR)szMenuEntry;
- mii.cch = (int)mir_tstrlen(szMenuEntry) + 1;
+ mii.cch = (int)mir_wstrlen(szMenuEntry) + 1;
}
mii.hbmpItem = HBMMENU_CALLBACK;
mii.dwItemData = (ULONG_PTR)hIcon;
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index a9a06b6611..0c05c1ba27 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -528,8 +528,8 @@ int TN_ModuleInit() for (i = 0; i < _countof(colorPicker); i++)
colorPicker[i].color = M.GetDword(Module, colorPicker[i].desc, 0);
- mir_sntprintf(szStart, TranslateT("...is typing a message."));
- mir_sntprintf(szStop, TranslateT("...has stopped typing."));
+ mir_snwprintf(szStart, TranslateT("...is typing a message."));
+ mir_snwprintf(szStop, TranslateT("...has stopped typing."));
if (PluginConfig.g_bPopupAvail && ShowMenu) {
hTypingNotify = CreateServiceFunction("TypingNotify/EnableDisableMenuCommand", EnableDisableMenuCommand);
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index 39f367e2c1..cd4653b191 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -416,7 +416,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetClientRect(hwndDlg, &rcClient);
wchar_t szBuffer[180];
- mir_sntprintf(szBuffer, TranslateT("Set messaging options for %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szBuffer, TranslateT("Set messaging options for %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hwndDlg, szBuffer);
memset(&tci, 0, sizeof(tci));
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 82918649a4..5ce367b1a0 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -103,8 +103,8 @@ const wchar_t* Utils::FormatRaw(TWindowData *dat, const wchar_t *msg, int flags, search_again:
bool clr_found = false;
for (int ii = 0; ii < rtf_ctable_size; ii++) {
- if (!wcsnicmp((wchar_t*)colorname.c_str(), rtf_ctable[ii].szName, mir_tstrlen(rtf_ctable[ii].szName))) {
- closing = beginmark + 7 + mir_tstrlen(rtf_ctable[ii].szName);
+ if (!wcsnicmp((wchar_t*)colorname.c_str(), rtf_ctable[ii].szName, mir_wstrlen(rtf_ctable[ii].szName))) {
+ closing = beginmark + 7 + mir_wstrlen(rtf_ctable[ii].szName);
if (endmark != message.npos) {
message.erase(endmark, 4);
message.replace(endmark, 4, L"c0 ");
@@ -113,13 +113,13 @@ search_again: wchar_t szTemp[5];
message.insert(beginmark, L"cxxx ");
- mir_sntprintf(szTemp, L"%02d", MSGDLGFONTCOUNT + 13 + ii);
+ mir_snwprintf(szTemp, L"%02d", MSGDLGFONTCOUNT + 13 + ii);
message[beginmark + 3] = szTemp[0];
message[beginmark + 4] = szTemp[1];
clr_found = true;
if (was_added) {
wchar_t wszTemp[100];
- mir_sntprintf(wszTemp, L"##col##%06u:%04u", endmark - closing, ii);
+ mir_snwprintf(wszTemp, L"##col##%06u:%04u", endmark - closing, ii);
wszTemp[99] = 0;
message.insert(beginmark, wszTemp);
}
@@ -236,7 +236,7 @@ ok: static wchar_t* Trunc500(wchar_t *str)
{
- if (mir_tstrlen(str) > 500)
+ if (mir_wstrlen(str) > 500)
str[500] = 0;
return str;
}
@@ -271,7 +271,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt break;
case 'c':
- dest.Append(!mir_tstrcmp(dat->pContainer->szName, L"default") ? TranslateT("Default container") : dat->pContainer->szName);
+ dest.Append(!mir_wstrcmp(dat->pContainer->szName, L"default") ? TranslateT("Default container") : dat->pContainer->szName);
break;
case 'o':
@@ -286,7 +286,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt {
BYTE xStatus = dat->cache->getXStatusId();
if (dat->wStatus != ID_STATUS_OFFLINE && xStatus > 0 && xStatus <= 31) {
- ptrT szXStatus(db_get_tsa(dat->hContact, dat->szProto, "XStatusName"));
+ ptrW szXStatus(db_get_tsa(dat->hContact, dat->szProto, "XStatusName"));
dest.Append((szXStatus != NULL) ? Trunc500(szXStatus) : xStatusDescr[xStatus - 1]);
}
}
@@ -296,7 +296,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt {
BYTE xStatus = dat->cache->getXStatusId();
if (dat->wStatus != ID_STATUS_OFFLINE && xStatus > 0 && xStatus <= 31) {
- ptrT szXStatus(db_get_tsa(dat->hContact, dat->szProto, "XStatusName"));
+ ptrW szXStatus(db_get_tsa(dat->hContact, dat->szProto, "XStatusName"));
dest.Append((szXStatus != NULL) ? Trunc500(szXStatus) : xStatusDescr[xStatus - 1]);
}
else dest.Append(dat->szStatus && dat->szStatus[0] ? dat->szStatus : L"(undef)");
@@ -307,7 +307,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt case 't':
case 'T':
{
- ptrT tszStatus(dat->cache->getNormalizedStatusMsg(dat->cache->getStatusMsg(), true));
+ ptrW tszStatus(dat->cache->getNormalizedStatusMsg(dat->cache->getStatusMsg(), true));
if (tszStatus)
dest.Append(tszStatus);
else if (*src == 't')
@@ -317,7 +317,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt case 'g':
{
- ptrT tszGroup(db_get_tsa(dat->hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_tsa(dat->hContact, "CList", "Group"));
if (tszGroup != NULL)
dest.Append(tszGroup);
}
@@ -365,7 +365,7 @@ void Utils::DoubleAmpersands(wchar_t *pszText, size_t len) {
CMString text(pszText);
text.Replace(L"&", L"&&");
- mir_tstrncpy(pszText, text.c_str(), len);
+ mir_wstrncpy(pszText, text.c_str(), len);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -381,8 +381,8 @@ wchar_t* Utils::GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen) wchar_t *p = 0, cSaved;
bool fEllipsis = false;
- if (mir_tstrlen(szText) <= iMaxLen) {
- uRequired = mir_tstrlen(szText) + 4;
+ if (mir_wstrlen(szText) <= iMaxLen) {
+ uRequired = mir_wstrlen(szText) + 4;
cSaved = 0;
}
else {
@@ -399,7 +399,7 @@ wchar_t* Utils::GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen) uRequired = (p - szText) + 6;
}
wchar_t *szResult = reinterpret_cast<wchar_t *>(mir_alloc((uRequired + 1) * sizeof(wchar_t)));
- mir_sntprintf(szResult, (uRequired + 1), fEllipsis ? L"%s..." : L"%s", szText);
+ mir_snwprintf(szResult, (uRequired + 1), fEllipsis ? L"%s..." : L"%s", szText);
if (p)
*p = cSaved;
@@ -457,7 +457,7 @@ void Utils::RTF_ColorAdd(const wchar_t *tszColname, size_t length) rtf_ctable_size++;
rtf_ctable = (TRTFColorTable *)mir_realloc(rtf_ctable, sizeof(TRTFColorTable) * rtf_ctable_size);
COLORREF clr = wcstol(tszColname, &stopped, 16);
- mir_sntprintf(rtf_ctable[rtf_ctable_size - 1].szName, length + 1, L"%06x", clr);
+ mir_snwprintf(rtf_ctable[rtf_ctable_size - 1].szName, length + 1, L"%06x", clr);
rtf_ctable[rtf_ctable_size - 1].menuid = 0;
clr = wcstol(tszColname, &stopped, 16);
@@ -570,7 +570,7 @@ void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSett WriteContainerSettingsToDB(0, pContainer->settings, szCName);
}
mir_snprintf(szCName, "%s%d_theme", szSetting, pContainer->iContainerIndex);
- if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
+ if (mir_wstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
db_set_ts(NULL, SRMSGMOD_T, szCName, pContainer->szAbsThemeFile);
@@ -715,7 +715,7 @@ void Utils::addMenuItem(const HMENU& m, MENUITEMINFO &mii, HICON hIcon, const wc mii.wID = uID;
mii.dwItemData = (ULONG_PTR)hIcon;
mii.dwTypeData = const_cast<wchar_t *>(szText);
- mii.cch = (int)mir_tstrlen(mii.dwTypeData) + 1;
+ mii.cch = (int)mir_wstrlen(mii.dwTypeData) + 1;
::InsertMenuItem(m, pos, TRUE, &mii);
}
@@ -800,7 +800,7 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const wchar_t *tszN DWORD dwSize = SizeofResource(g_hInst, hRes), written = 0;
wchar_t szFilename[MAX_PATH];
- mir_sntprintf(szFilename, L"%s%s", tszPath, tszFilename);
+ mir_snwprintf(szFilename, L"%s%s", tszPath, tszFilename);
if (!fForceOverwrite)
if (PathFileExists(szFilename))
return true;
@@ -834,8 +834,8 @@ wchar_t* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich) tr.lpstrText = (wchar_t*)mir_alloc(sizeof(wchar_t) * (tr.chrg.cpMax - tr.chrg.cpMin + 8));
::SendMessage(hwndRich, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
- mir_tstrncpy(tr.lpstrText, L"mailto:", 7);
- mir_tstrncpy(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1);
+ mir_wstrncpy(tr.lpstrText, L"mailto:", 7);
+ mir_wstrncpy(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1);
}
return tr.lpstrText;
}
@@ -935,7 +935,7 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner) if (!OpenClipboard(hwndOwner) || str == 0)
return 0;
- size_t i = sizeof(wchar_t) * (mir_tstrlen(str) + 1);
+ size_t i = sizeof(wchar_t) * (mir_wstrlen(str) + 1);
EmptyClipboard();
HGLOBAL hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, i);
@@ -954,21 +954,21 @@ void Utils::AddToFileList(wchar_t ***pppFiles, int *totalCount, LPCTSTR szFilena {
*pppFiles = (wchar_t**)mir_realloc(*pppFiles, (++*totalCount + 1) * sizeof(wchar_t*));
(*pppFiles)[*totalCount] = NULL;
- (*pppFiles)[*totalCount - 1] = mir_tstrdup(szFilename);
+ (*pppFiles)[*totalCount - 1] = mir_wstrdup(szFilename);
if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) {
WIN32_FIND_DATA fd;
wchar_t szPath[MAX_PATH];
- mir_tstrcpy(szPath, szFilename);
- mir_tstrcat(szPath, L"\\*");
+ mir_wstrcpy(szPath, szFilename);
+ mir_wstrcat(szPath, L"\\*");
HANDLE hFind = FindFirstFile(szPath, &fd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
- if (!mir_tstrcmp(fd.cFileName, L".") || !mir_tstrcmp(fd.cFileName, L".."))
+ if (!mir_wstrcmp(fd.cFileName, L".") || !mir_wstrcmp(fd.cFileName, L".."))
continue;
- mir_tstrcpy(szPath, szFilename);
- mir_tstrcat(szPath, L"\\");
- mir_tstrcat(szPath, fd.cFileName);
+ mir_wstrcpy(szPath, szFilename);
+ mir_wstrcat(szPath, L"\\");
+ mir_wstrcat(szPath, fd.cFileName);
AddToFileList(pppFiles, totalCount, szPath);
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
@@ -1179,7 +1179,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP ::SendDlgItemMessage(hwnd, IDC_WARNTEXT, EM_AUTOURLDETECT, TRUE, 0);
::SendDlgItemMessage(hwnd, IDC_WARNTEXT, EM_SETEVENTMASK, 0, ENM_LINK);
- mir_sntprintf(temp, RTF_DEFAULT_HEADER, 0, 0, 0, 30 * 15);
+ mir_snwprintf(temp, RTF_DEFAULT_HEADER, 0, 0, 0, 30 * 15);
tstring *str = new tstring(temp);
str->append(m_szText);
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h index 245db9db97..cd6ca460a8 100644 --- a/plugins/TabSRMM/src/utils.h +++ b/plugins/TabSRMM/src/utils.h @@ -167,7 +167,7 @@ public: LRESULT ShowDialog() const;
private:
- ptrT m_szTitle, m_szText;
+ ptrW m_szTitle, m_szText;
UINT m_uId;
HFONT m_hFontCaption;
DWORD m_dwFlags;
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index d19096e067..558faed14f 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -284,7 +284,7 @@ INT_PTR ShowTipW(WPARAM wParam, LPARAM lParam) if (wParam) // wParam is char pointer containing text - e.g. status bar tooltip
{
- clcit2->swzText = mir_tstrdup((wchar_t *)wParam);
+ clcit2->swzText = mir_wstrdup((wchar_t *)wParam);
GetCursorPos(&clcit2->ptCursor);
}
@@ -316,8 +316,8 @@ int ProtoAck(WPARAM, LPARAM lParam) if (ack->type == ACKTYPE_AWAYMSG) {
wchar_t *tszMsg = (wchar_t*)ack->lParam;
- if (mir_tstrlen(tszMsg))
- PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)mir_tstrdup(tszMsg));
+ if (mir_wstrlen(tszMsg))
+ PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)mir_wstrdup(tszMsg));
}
else if (ack->type == ICQACKTYPE_XSTATUS_RESPONSE)
PostMPMessage(MUM_GOTXSTATUS, (WPARAM)ack->hContact, 0);
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp index 5e8c62b8c9..ed8ad1a0b4 100644 --- a/plugins/TipperYM/src/mir_smileys.cpp +++ b/plugins/TipperYM/src/mir_smileys.cpp @@ -42,7 +42,7 @@ SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *proto return NULL;
if (nCount == -1)
- nCount = (int)mir_tstrlen(lpString);
+ nCount = (int)mir_wstrlen(lpString);
SMILEYPARSEINFO info = (SMILEYPARSEINFO)mir_calloc(sizeof(tagSMILEYPARSEINFO));
info->pieces = ReplaceSmileys(lpString, nCount, protocol, &info->max_height);
@@ -71,7 +71,7 @@ void Smileys_FreeParse(SMILEYPARSEINFO parseInfo) int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, SMILEYPARSEINFO parseInfo)
{
if (nCount == -1)
- nCount = (int)mir_tstrlen(lpString);
+ nCount = (int)mir_wstrlen(lpString);
if (uFormat & DT_CALCRECT) {
SIZE text_size = GetTextSize(hDC, lpString, parseInfo, uFormat, (lpRect->right - lpRect->left));
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index d083f1bc98..ae1b3e931b 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -308,7 +308,7 @@ void LoadObsoleteSkinSetting() opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULE, setting, 0);
mir_snprintf(setting, "SImgFile%d", i);
if (!db_get_ts(NULL, MODULE, setting, &dbv)) {
- opt.szImgFile[i] = mir_tstrdup(dbv.ptszVal);
+ opt.szImgFile[i] = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -587,7 +587,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
for (int i = 0; presetItems[i].szID; i++) {
- if (mir_tstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
+ if (mir_wstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
if (presetItems[i].szNeededSubst[0])
EndDialog(hwndDlg, IDPRESETITEM + i);
else
@@ -623,7 +623,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
for (int i = 0; presetItems[i].szID; i++) {
- if (mir_tstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
+ if (mir_wstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
SetDlgItemText(hwndDlg, IDC_ED_LABEL, TranslateTS(presetItems[i].swzLabel));
SetDlgItemText(hwndDlg, IDC_ED_VALUE, presetItems[i].swzValue);
break;
@@ -2038,8 +2038,8 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA while (item.hItem != NULL) {
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), &item);
if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2) {
- mir_tstrcat(swzProtos, buff);
- mir_tstrcat(swzProtos, L" ");
+ mir_wstrcat(swzProtos, buff);
+ mir_wstrcat(swzProtos, L" ");
}
item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), item.hItem);
@@ -2053,8 +2053,8 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA while (item.hItem != NULL) {
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), &item);
if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2) {
- mir_tstrcat(swzProtos, buff);
- mir_tstrcat(swzProtos, L" ");
+ mir_wstrcat(swzProtos, buff);
+ mir_wstrcat(swzProtos, L" ");
}
item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), item.hItem);
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 2b0cbebb6b..117758d058 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -26,9 +26,9 @@ __inline void AddRow(PopupWindowData *pwd, wchar_t *swzLabel, wchar_t *swzValue, if (pRows == NULL) return; pwd->rows = pRows; - pwd->rows[pwd->iRowCount].swzLabel = swzLabel ? mir_tstrdup(swzLabel) : NULL; - pwd->rows[pwd->iRowCount].swzValue = swzValue ? mir_tstrdup(swzValue) : NULL; - pwd->rows[pwd->iRowCount].spi = bParseSmileys ? Smileys_PreParse(swzValue, (int)mir_tstrlen(swzValue), szProto) : NULL; + pwd->rows[pwd->iRowCount].swzLabel = swzLabel ? mir_wstrdup(swzLabel) : NULL; + pwd->rows[pwd->iRowCount].swzValue = swzValue ? mir_wstrdup(swzValue) : NULL; + pwd->rows[pwd->iRowCount].spi = bParseSmileys ? Smileys_PreParse(swzValue, (int)mir_wstrlen(swzValue), szProto) : NULL; pwd->rows[pwd->iRowCount].bValueNewline = bNewline; pwd->rows[pwd->iRowCount].bLineAbove = bLineAbove; pwd->rows[pwd->iRowCount].bIsTitle = bIsTitle; @@ -73,13 +73,13 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa PROTOACCOUNT *pa = Proto_GetAccount(pwd->clcit.szProto); if (pa) - mir_tstrcpy(pwd->swzTitle, pa->tszAccountName); + mir_wstrcpy(pwd->swzTitle, pa->tszAccountName); - if (mir_tstrlen(pwd->swzTitle) == 0) + if (mir_wstrlen(pwd->swzTitle) == 0) a2t(pwd->clcit.szProto, pwd->swzTitle, TITLE_TEXT_LEN); if (Proto_IsAccountLocked(pa)) - mir_sntprintf(pwd->swzTitle, TranslateT("%s (locked)"), pwd->swzTitle); + mir_snwprintf(pwd->swzTitle, TranslateT("%s (locked)"), pwd->swzTitle); // protocol status WORD wStatus = (WORD)CallProtoService(pwd->clcit.szProto, PS_GETSTATUS, 0, 0); @@ -99,7 +99,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa // uid info wchar_t swzUid[256], swzUidName[256]; if (Uid(0, pwd->clcit.szProto, swzUid, 256) && UidName(pwd->clcit.szProto, swzUidName, 253)) { - mir_tstrcat(swzUidName, L": "); + mir_wstrcat(swzUidName, L": "); AddRow(pwd, swzUidName, swzUid, NULL, false, false, false); } @@ -107,7 +107,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa wchar_t swzLogon[64]; if (TimestampToTimeDifference(NULL, pwd->clcit.szProto, "LogonTS", swzLogon, 59)) { wchar_t ago[96]; - mir_sntprintf(ago, TranslateT("%s ago"), swzLogon); + mir_snwprintf(ago, TranslateT("%s ago"), swzLogon); AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false); } @@ -127,7 +127,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (wStatus >= ID_STATUS_ONLINE && wStatus <= ID_STATUS_OUTTOLUNCH) { // status message - ptrT ptszStatus(GetProtoStatusMessage(pwd->clcit.szProto, wStatus)); + ptrW ptszStatus(GetProtoStatusMessage(pwd->clcit.szProto, wStatus)); if (ptszStatus) { StripBBCodesInPlace(ptszStatus); AddRow(pwd, TranslateT("Status message:"), ptszStatus, pwd->clcit.szProto, true, true, true); @@ -139,7 +139,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa StripBBCodesInPlace(swzAdvTitle); AddRow(pwd, TranslateT("Mood:"), swzAdvTitle, pwd->clcit.szProto, true, false, true); - ptrT swzAdvText(GetJabberAdvStatusText(pwd->clcit.szProto, "mood", "text")); + ptrW swzAdvText(GetJabberAdvStatusText(pwd->clcit.szProto, "mood", "text")); if (swzAdvText) { StripBBCodesInPlace(swzAdvText); AddRow(pwd, L"", swzAdvText, pwd->clcit.szProto, true, true, false); @@ -155,7 +155,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } // xstatus message - ptrT swzAdvText(GetProtoExtraStatusMessage(pwd->clcit.szProto)); + ptrW swzAdvText(GetProtoExtraStatusMessage(pwd->clcit.szProto)); if (swzAdvText) { StripBBCodesInPlace(swzAdvText); AddRow(pwd, L"", swzAdvText, pwd->clcit.szProto, true, true, false); @@ -173,20 +173,20 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } // jabber activity - ptrT swzActTitle(GetJabberAdvStatusText(pwd->clcit.szProto, "activity", "title")); + ptrW swzActTitle(GetJabberAdvStatusText(pwd->clcit.szProto, "activity", "title")); if (swzActTitle) { StripBBCodesInPlace(swzActTitle); AddRow(pwd, TranslateT("Activity:"), swzActTitle, pwd->clcit.szProto, true, false, true); } - ptrT swzActText(GetJabberAdvStatusText(pwd->clcit.szProto, "activity", "text")); + ptrW swzActText(GetJabberAdvStatusText(pwd->clcit.szProto, "activity", "text")); if (swzActText) { StripBBCodesInPlace(swzActText); AddRow(pwd, L"", swzActText, pwd->clcit.szProto, true, true, false); } // listening to - ptrT swzListening(GetListeningTo(pwd->clcit.szProto)); + ptrW swzListening(GetListeningTo(pwd->clcit.szProto)); if (swzListening) { StripBBCodesInPlace(swzListening); AddRow(pwd, TranslateT("Listening to:"), swzListening, NULL, false, true, true); @@ -218,7 +218,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } else { wchar_t buff[2048], *swzText = pwd->clcit.swzText; - size_t iBuffPos, i = 0, iSize = mir_tstrlen(pwd->clcit.swzText); + size_t iBuffPos, i = 0, iSize = mir_wstrlen(pwd->clcit.swzText); bool bTopMessage = false; while (i < iSize && swzText[i] != '<') { @@ -262,7 +262,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (iBuffPos) { pwd->rows = (RowData *)mir_realloc(pwd->rows, sizeof(RowData)* (pwd->iRowCount + 1)); pwd->rows[pwd->iRowCount].bValueNewline = false; - pwd->rows[pwd->iRowCount].swzLabel = mir_tstrdup(buff); + pwd->rows[pwd->iRowCount].swzLabel = mir_wstrdup(buff); if (pwd->iRowCount == 1 && bTopMessage) pwd->rows[pwd->iRowCount].bLineAbove = true; else @@ -276,7 +276,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } buff[iBuffPos] = 0; - pwd->rows[pwd->iRowCount].swzValue = mir_tstrdup(buff); + pwd->rows[pwd->iRowCount].swzValue = mir_wstrdup(buff); pwd->rows[pwd->iRowCount].spi = NULL; pwd->iRowCount++; } @@ -382,7 +382,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (pwd->bIsIconVisible[5]) { for (i = 0; opt.exIconsOrder[i] != 5; i++); if (ServiceExists(MS_FP_GETCLIENTICONT)) { - ptrT tszVersion(db_get_tsa(pwd->hContact, szProto, "MirVer")); + ptrW tszVersion(db_get_tsa(pwd->hContact, szProto, "MirVer")); if (tszVersion != NULL) { pwd->extraIcons[i].hIcon = Finger_GetClientIcon(tszVersion, 0); pwd->extraIcons[i].bDestroy = true; @@ -766,14 +766,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa for (int i = 0; i < pwd->iRowCount; i++) { if (pwd->rows[i].swzValue) { wchar_t buff[128]; - int iLen = (int)mir_tstrlen(pwd->rows[i].swzValue); + int iLen = (int)mir_wstrlen(pwd->rows[i].swzValue); if (iLen) { if (iLen > MAX_VALUE_LEN) { wcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN); buff[MAX_VALUE_LEN] = 0; - mir_tstrcat(buff, L"..."); + mir_wstrcat(buff, L"..."); } - else mir_tstrcpy(buff, pwd->rows[i].swzValue); + else mir_wstrcpy(buff, pwd->rows[i].swzValue); AppendMenu(hMenu, MF_STRING, i + 1, buff); // first id = 1, because no select have id = 0 SetMenuItemBitmaps(hMenu, i + 1, MF_BYCOMMAND, hbmpItem, hbmpItem); @@ -822,30 +822,30 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa for (int i = 0; i < pwd->iRowCount; i++) { if ((pwd->rows[i].swzLabel && pwd->rows[i].swzLabel[0]) || (pwd->rows[i].swzValue && pwd->rows[i].swzValue[0])) { if (pwd->rows[i].swzLabel && pwd->rows[i].swzLabel[0]) { - mir_tstrcat(pchData, pwd->rows[i].swzLabel); - mir_tstrcat(pchData, L" "); + mir_wstrcat(pchData, pwd->rows[i].swzLabel); + mir_wstrcat(pchData, L" "); } - else mir_tstrcat(pchData, TranslateT("<No Label>: ")); + else mir_wstrcat(pchData, TranslateT("<No Label>: ")); if (pwd->rows[i].swzValue && pwd->rows[i].swzValue[0]) - mir_tstrcat(pchData, pwd->rows[i].swzValue); + mir_wstrcat(pchData, pwd->rows[i].swzValue); else - mir_tstrcat(pchData, TranslateT("<No Value>")); + mir_wstrcat(pchData, TranslateT("<No Value>")); - mir_tstrcat(pchData, L"\r\n"); + mir_wstrcat(pchData, L"\r\n"); } } } else if (iSelItem == COPYMENU_ALLITEMS) { // copy all items for (int i = 0; i < pwd->iRowCount; i++) { if (pwd->rows[i].swzValue && pwd->rows[i].swzValue[0]) { - mir_tstrcat(pchData, pwd->rows[i].swzValue); - mir_tstrcat(pchData, L"\r\n"); + mir_wstrcat(pchData, pwd->rows[i].swzValue); + mir_wstrcat(pchData, L"\r\n"); } } } // single row - else mir_tstrcpy(pchData, pwd->rows[iSelItem - 1].swzValue); + else mir_wstrcpy(pchData, pwd->rows[iSelItem - 1].swzValue); GlobalUnlock(hClipboardData); SetClipboardData(CF_UNICODETEXT, hClipboardData); @@ -1055,9 +1055,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa char *szProto = GetContactProto(pwd->hContact); - pwd->rows[pwd->iRowCount].swzLabel = mir_tstrdup(buff_label); - pwd->rows[pwd->iRowCount].swzValue = mir_tstrdup(buff); - pwd->rows[pwd->iRowCount].spi = Smileys_PreParse(buff, (int)mir_tstrlen(buff), szProto); + pwd->rows[pwd->iRowCount].swzLabel = mir_wstrdup(buff_label); + pwd->rows[pwd->iRowCount].swzValue = mir_wstrdup(buff); + pwd->rows[pwd->iRowCount].spi = Smileys_PreParse(buff, (int)mir_wstrlen(buff), szProto); pwd->rows[pwd->iRowCount].bValueNewline = node->di.bValueNewline; pwd->rows[pwd->iRowCount].bLineAbove = node->di.bLineAbove; pwd->iRowCount++; @@ -1174,7 +1174,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa else if (hFontLabels) SelectObject(hdc, (HGDIOBJ)hFontLabels); - GetTextExtentPoint32(hdc, pwd->rows[i].swzLabel, (int)mir_tstrlen(pwd->rows[i].swzLabel), &sz); + GetTextExtentPoint32(hdc, pwd->rows[i].swzLabel, (int)mir_wstrlen(pwd->rows[i].swzLabel), &sz); if (sz.cx > pwd->iLabelWidth) pwd->iLabelWidth = sz.cx; } @@ -1189,7 +1189,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa SelectObject(hdc, (HGDIOBJ)hFontLabels); if (pwd->rows[i].swzLabel && pwd->rows[i].swzLabel[0]) - GetTextExtentPoint32(hdc, pwd->rows[i].swzLabel, (int)mir_tstrlen(pwd->rows[i].swzLabel), &sz); + GetTextExtentPoint32(hdc, pwd->rows[i].swzLabel, (int)mir_wstrlen(pwd->rows[i].swzLabel), &sz); else sz.cy = sz.cx = 0; @@ -1210,7 +1210,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (pwd->rows[i].swzValue && pwd->rows[i].swzValue[0]) { if (!bStatusMsg && opt.bGetNewStatusMsg) { - if (!mir_tstrcmp(pwd->rows[i].swzValue, L"%sys:status_msg%")) + if (!mir_wstrcmp(pwd->rows[i].swzValue, L"%sys:status_msg%")) bStatusMsg = true; } @@ -1484,15 +1484,15 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa iCountOnline++; iCount++; } - mir_sntprintf(buff, L"(%d/%d)", iCountOnline, iCount); + mir_snwprintf(buff, L"(%d/%d)", iCountOnline, iCount); } else buff[0] = 0; wchar_t swzProto[256]; - mir_tstrcpy(swzProto, pa->tszAccountName); + mir_wstrcpy(swzProto, pa->tszAccountName); if (dwItems & TRAYTIP_LOCKSTATUS) if (Proto_IsAccountLocked(pa)) - mir_sntprintf(swzProto, TranslateT("%s (locked)"), pa->tszAccountName); + mir_snwprintf(swzProto, TranslateT("%s (locked)"), pa->tszAccountName); AddRow(pwd, swzProto, buff, NULL, false, false, !bFirstItem, true, Skin_LoadProtoIcon(pa->szModuleName, wStatus)); bFirstItem = false; @@ -1500,7 +1500,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (dwItems & TRAYTIP_LOGON) { if (TimestampToTimeDifference(NULL, pa->szModuleName, "LogonTS", buff, 59)) { wchar_t ago[96]; - mir_sntprintf(ago, TranslateT("%s ago"), buff); + mir_snwprintf(ago, TranslateT("%s ago"), buff); AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false); } } @@ -1621,10 +1621,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa wchar_t *swzNick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0); if (opt.iFavoriteContFlags & FAVCONT_APPEND_PROTO) { wchar_t *swzProto = a2t(proto); - mir_sntprintf(swzName, L"%s (%s)", swzNick, swzProto); + mir_snwprintf(swzName, L"%s (%s)", swzNick, swzProto); mir_free(swzProto); } - else mir_tstrcpy(swzName, swzNick); + else mir_wstrcpy(swzName, swzNick); AddRow(pwd, swzName, swzStatus, NULL, false, false, false); } @@ -1638,8 +1638,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa index -= iCount; if (index >= 0 && (dwItems & TRAYTIP_NUMCONTACTS) && !((opt.iFavoriteContFlags & FAVCONT_HIDE_OFFLINE) && iCountOnline == 0)) { - mir_sntprintf(buff, L"(%d/%d)", iCountOnline, iCount); - pwd->rows[index].swzValue = mir_tstrdup(buff); + mir_snwprintf(buff, L"(%d/%d)", iCountOnline, iCount); + pwd->rows[index].swzValue = mir_wstrdup(buff); } } } @@ -1657,7 +1657,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (!pchBold || pchBold != pwd->clcit.swzText) { wchar_t swzText[256]; - mir_tstrcpy(swzText, pwd->clcit.swzText); + mir_wstrcpy(swzText, pwd->clcit.swzText); if (pchBr) swzText[pchBr - pwd->clcit.swzText] = 0; AddRow(pwd, swzText, L"", NULL, false, true, false, true, Skin_LoadIcon(SKINICON_OTHER_FILLEDBLOB)); } diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp index 8bcb23daca..c115fd6643 100644 --- a/plugins/TipperYM/src/skin_parser.cpp +++ b/plugins/TipperYM/src/skin_parser.cpp @@ -34,7 +34,7 @@ int RefreshSkinList(HWND hwndDlg) HANDLE hFind = FindFirstFile(L"*.*", &ffd);
while (hFind != INVALID_HANDLE_VALUE)
{
- if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && mir_tstrcmp(L".", ffd.cFileName) && mir_tstrcmp(L"..", ffd.cFileName))
+ if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && mir_wstrcmp(L".", ffd.cFileName) && mir_wstrcmp(L"..", ffd.cFileName))
{
SetCurrentDirectory(ffd.cFileName);
WIN32_FIND_DATA ffd2;
@@ -88,9 +88,9 @@ void ParseAboutPart(FILE *fp, wchar_t *buff, wchar_t *szSkinName) else if (wcsstr(buff, L"preview"))
{
wchar_t szImgPath[1024];
- mir_sntprintf(szImgPath, L"%s\\%s\\%s", SKIN_FOLDER, szSkinName, pch);
+ mir_snwprintf(szImgPath, L"%s\\%s\\%s", SKIN_FOLDER, szSkinName, pch);
if (FileExists(szImgPath))
- mir_tstrcpy(opt.szPreviewFile, szImgPath);
+ mir_wstrcpy(opt.szPreviewFile, szImgPath);
}
}
}
@@ -126,26 +126,26 @@ void ParseImagePart(FILE *fp, wchar_t *buff, int iPart) if (wcsstr(buff, L"image"))
{
wchar_t szImgPath[1024];
- mir_sntprintf(szImgPath, L"%s\\%s\\%s", SKIN_FOLDER, opt.szSkinName, pch);
- opt.szImgFile[iPart] = mir_tstrdup(szImgPath);
+ mir_snwprintf(szImgPath, L"%s\\%s\\%s", SKIN_FOLDER, opt.szSkinName, pch);
+ opt.szImgFile[iPart] = mir_wstrdup(szImgPath);
}
else if (wcsstr(buff, L"tm"))
{
- if (!mir_tstrcmpi(pch, L"TM_NONE"))
+ if (!mir_wstrcmpi(pch, L"TM_NONE"))
opt.transfMode[iPart] = TM_NONE;
- else if (!mir_tstrcmpi(pch, L"TM_CENTRE"))
+ else if (!mir_wstrcmpi(pch, L"TM_CENTRE"))
opt.transfMode[iPart] = TM_CENTRE;
- else if (!mir_tstrcmpi(pch, L"TM_STRECH_ALL"))
+ else if (!mir_wstrcmpi(pch, L"TM_STRECH_ALL"))
opt.transfMode[iPart] = TM_STRECH_ALL;
- else if (!mir_tstrcmpi(pch, L"TM_STRECH_HORIZONTAL"))
+ else if (!mir_wstrcmpi(pch, L"TM_STRECH_HORIZONTAL"))
opt.transfMode[iPart] = TM_STRECH_HORIZONTAL;
- else if (!mir_tstrcmpi(pch, L"TM_STRECH_VERTICAL"))
+ else if (!mir_wstrcmpi(pch, L"TM_STRECH_VERTICAL"))
opt.transfMode[iPart] = TM_STRECH_VERTICAL;
- else if (!mir_tstrcmpi(pch, L"TM_TILE_ALL"))
+ else if (!mir_wstrcmpi(pch, L"TM_TILE_ALL"))
opt.transfMode[iPart] = TM_TILE_ALL;
- else if (!mir_tstrcmpi(pch, L"TM_TILE_HORIZONTAL"))
+ else if (!mir_wstrcmpi(pch, L"TM_TILE_HORIZONTAL"))
opt.transfMode[iPart] = TM_TILE_HORIZONTAL;
- else if (!mir_tstrcmpi(pch, L"TM_TILE_VERTICAL"))
+ else if (!mir_wstrcmpi(pch, L"TM_TILE_VERTICAL"))
opt.transfMode[iPart] = TM_TILE_VERTICAL;
else
opt.transfMode[iPart] = TM_NONE;
@@ -206,7 +206,7 @@ void ParseFontPart(FILE *fp, wchar_t *buff) {
if (GetSettingName(buff, "", szSetting, sizeof(szSetting) - 1))
{
- if (mir_tstrlen(pch) > 32)
+ if (mir_wstrlen(pch) > 32)
pch[32] = 0;
db_set_ts(0, MODULE, szSetting, pch);
@@ -362,34 +362,34 @@ void ParseSkinFile(wchar_t *szSkinName, bool bStartup, bool bOnlyPreview) {
if (buff[0] == '[')
{
- if (!mir_tstrcmp(L"[about]", buff))
+ if (!mir_wstrcmp(L"[about]", buff))
{
ParseAboutPart(fp, buff, szSkinName);
continue;
}
- else if (!mir_tstrcmp(L"[other]", buff))
+ else if (!mir_wstrcmp(L"[other]", buff))
{
ParseOtherPart(fp, buff);
continue;
}
else if (!bOnlyPreview)
{
- if (!mir_tstrcmp(L"[background]", buff))
+ if (!mir_wstrcmp(L"[background]", buff))
{
ParseImagePart(fp, buff, SKIN_ITEM_BG);
continue;
}
- else if (!mir_tstrcmp(L"[sidebar]", buff))
+ else if (!mir_wstrcmp(L"[sidebar]", buff))
{
ParseImagePart(fp, buff, SKIN_ITEM_SIDEBAR);
continue;
}
- else if (!bStartup && opt.bLoadFonts && !mir_tstrcmp(L"[fonts]", buff))
+ else if (!bStartup && opt.bLoadFonts && !mir_wstrcmp(L"[fonts]", buff))
{
ParseFontPart(fp, buff);
continue;
}
- else if (!bStartup && opt.bLoadProportions && !mir_tstrcmp(L"[appearance]", buff))
+ else if (!bStartup && opt.bLoadProportions && !mir_wstrcmp(L"[appearance]", buff))
{
ParseAppearancePart(fp, buff);
continue;
diff --git a/plugins/TipperYM/src/str_utils.cpp b/plugins/TipperYM/src/str_utils.cpp index ccc537581a..4d77c38c19 100644 --- a/plugins/TipperYM/src/str_utils.cpp +++ b/plugins/TipperYM/src/str_utils.cpp @@ -168,7 +168,7 @@ wchar_t *w2t(const wchar_t *ws) wchar_t *t2w(const wchar_t *ts)
{
- return mir_tstrdup(ts);
+ return mir_wstrdup(ts);
}
@@ -195,7 +195,7 @@ char *t2utf(const wchar_t *ts) wchar_t *myfgets(wchar_t *Buf, int MaxCount, FILE *File)
{
fgetws(Buf, MaxCount, File);
- for (size_t i = mir_tstrlen(Buf) - 1; ; i--)
+ for (size_t i = mir_wstrlen(Buf) - 1; ; i--)
{
if (Buf[i] == '\n' || Buf[i] == ' ')
Buf[i] = 0;
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 071e73c212..bbcce4b4e7 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -85,7 +85,7 @@ void StripBBCodesInPlace(wchar_t *ptszText) return; size_t iRead = 0, iWrite = 0; - size_t iLen = mir_tstrlen(ptszText); + size_t iLen = mir_wstrlen(ptszText); while(iRead <= iLen) { // copy terminating null too while (iRead <= iLen && ptszText[iRead] != '[') { @@ -174,7 +174,7 @@ wchar_t* GetLastMessageText(MCONTACT hContact, bool received) return 0; wchar_t *buff = DbGetEventTextT( &dbei, CP_ACP ); - wchar_t *swzMsg = mir_tstrdup(buff); + wchar_t *swzMsg = mir_wstrdup(buff); mir_free(buff); StripBBCodesInPlace(swzMsg); @@ -221,8 +221,8 @@ wchar_t* GetStatusMessageText(MCONTACT hContact) return NULL; if (!db_get_ts(hContact, MODULE, "TempStatusMsg", &dbv)) { - if (mir_tstrlen(dbv.ptszVal) != 0) - swzMsg = mir_tstrdup(dbv.ptszVal); + if (mir_wstrlen(dbv.ptszVal) != 0) + swzMsg = mir_wstrdup(dbv.ptszVal); db_free(&dbv); } } @@ -233,8 +233,8 @@ wchar_t* GetStatusMessageText(MCONTACT hContact) return NULL; if (!db_get_ts(hContact, "CList", "StatusMsg", &dbv)) { - if (mir_tstrlen(dbv.ptszVal) != 0) - swzMsg = mir_tstrdup(dbv.ptszVal); + if (mir_wstrlen(dbv.ptszVal) != 0) + swzMsg = mir_wstrdup(dbv.ptszVal); db_free(&dbv); } } @@ -250,17 +250,17 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int { bool recv = false; - if (!mir_tstrcmp(swzRawSpec, L"uid")) + if (!mir_wstrcmp(swzRawSpec, L"uid")) return Uid(hContact, 0, buff, bufflen); - if (!mir_tstrcmp(swzRawSpec, L"proto")) { + if (!mir_wstrcmp(swzRawSpec, L"proto")) { char *szProto = GetContactProto(hContact); if (szProto) { a2t(szProto, buff, bufflen); return true; } } - else if (!mir_tstrcmp(swzRawSpec, L"account")) { + else if (!mir_wstrcmp(swzRawSpec, L"account")) { char *szProto = Proto_GetBaseAccountName(hContact); if ((INT_PTR)szProto == CALLSERVICE_NOTFOUND) { return GetSysSubstText(hContact, L"proto", buff, bufflen); @@ -275,15 +275,15 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int return GetSysSubstText(hContact, L"proto", buff, bufflen); } } - else if (!mir_tstrcmp(swzRawSpec, L"time")) { + else if (!mir_wstrcmp(swzRawSpec, L"time")) { if (!printDateTimeByContact(hContact, L"t", buff, bufflen, TZF_KNOWNONLY)) return true; } - else if (!mir_tstrcmp(swzRawSpec, L"uidname")) { + else if (!mir_wstrcmp(swzRawSpec, L"uidname")) { char *szProto = GetContactProto(hContact); return UidName(szProto, buff, bufflen); } - else if (!mir_tstrcmp(swzRawSpec, L"status_msg")) { + else if (!mir_wstrcmp(swzRawSpec, L"status_msg")) { wchar_t *swzMsg = GetStatusMessageText(hContact); if (swzMsg) { wcsncpy(buff, swzMsg, bufflen); @@ -291,7 +291,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int return true; } } - else if ((recv = !mir_tstrcmp(swzRawSpec, L"last_msg")) || !mir_tstrcmp(swzRawSpec, L"last_msg_out")) { + else if ((recv = !mir_wstrcmp(swzRawSpec, L"last_msg")) || !mir_wstrcmp(swzRawSpec, L"last_msg_out")) { wchar_t *swzMsg = GetLastMessageText(hContact, recv); if (swzMsg) { wcsncpy(buff, swzMsg, bufflen); @@ -299,7 +299,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int return true; } } - else if (!mir_tstrcmp(swzRawSpec, L"meta_subname")) { + else if (!mir_wstrcmp(swzRawSpec, L"meta_subname")) { // get contact list name of active subcontact MCONTACT hSubContact = db_mc_getMostOnline(hContact); if (!hSubContact) @@ -310,32 +310,32 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int wcsncpy(buff, swzNick, bufflen); return true; } - else if (!mir_tstrcmp(swzRawSpec, L"meta_subuid")) { + else if (!mir_wstrcmp(swzRawSpec, L"meta_subuid")) { MCONTACT hSubContact = db_mc_getMostOnline(hContact); if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND) return false; return Uid(hSubContact, 0, buff, bufflen); } - else if (!mir_tstrcmp(swzRawSpec, L"meta_subproto")) { + else if (!mir_wstrcmp(swzRawSpec, L"meta_subproto")) { // get protocol of active subcontact MCONTACT hSubContact = db_mc_getMostOnline(hContact); if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND) return false; return GetSysSubstText(hSubContact, L"account", buff, bufflen); } - else if ((recv = !mir_tstrcmp(swzRawSpec, L"last_msg_time")) || !mir_tstrcmp(swzRawSpec, L"last_msg_out_time")) { + else if ((recv = !mir_wstrcmp(swzRawSpec, L"last_msg_time")) || !mir_wstrcmp(swzRawSpec, L"last_msg_out_time")) { DWORD ts = LastMessageTimestamp(hContact, recv); if (ts == 0) return false; FormatTimestamp(ts, "t", buff, bufflen); return true; } - else if ((recv = !mir_tstrcmp(swzRawSpec, L"last_msg_date")) || !mir_tstrcmp(swzRawSpec, L"last_msg_out_date")) { + else if ((recv = !mir_wstrcmp(swzRawSpec, L"last_msg_date")) || !mir_wstrcmp(swzRawSpec, L"last_msg_out_date")) { DWORD ts = LastMessageTimestamp(hContact, recv); if (ts == 0) return false; FormatTimestamp(ts, "d", buff, bufflen); return true; } - else if ((recv = !mir_tstrcmp(swzRawSpec, L"last_msg_reltime")) || !mir_tstrcmp(swzRawSpec, L"last_msg_out_reltime")) { + else if ((recv = !mir_wstrcmp(swzRawSpec, L"last_msg_reltime")) || !mir_wstrcmp(swzRawSpec, L"last_msg_out_reltime")) { DWORD ts = LastMessageTimestamp(hContact, recv); if (ts == 0) return false; DWORD t = (DWORD)time(0); @@ -343,12 +343,12 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int int d = (diff / 60 / 60 / 24); int h = (diff - d * 60 * 60 * 24) / 60 / 60; int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60; - if (d > 0) mir_sntprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m); - else if (h > 0) mir_sntprintf(buff, bufflen, TranslateT("%dh %dm"), h, m); - else mir_sntprintf(buff, bufflen, TranslateT("%dm"), m); + if (d > 0) mir_snwprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m); + else if (h > 0) mir_snwprintf(buff, bufflen, TranslateT("%dh %dm"), h, m); + else mir_snwprintf(buff, bufflen, TranslateT("%dm"), m); return true; } - else if (!mir_tstrcmp(swzRawSpec, L"msg_count_all") || !mir_tstrcmp(swzRawSpec, L"msg_count_out") || !mir_tstrcmp(swzRawSpec, L"msg_count_in")) { + else if (!mir_wstrcmp(swzRawSpec, L"msg_count_all") || !mir_wstrcmp(swzRawSpec, L"msg_count_out") || !mir_wstrcmp(swzRawSpec, L"msg_count_in")) { DWORD dwCountOut, dwCountIn; DWORD dwMetaCountOut = 0, dwMetaCountIn = 0; DWORD dwLastTs, dwNewTs, dwRecountTs; @@ -406,12 +406,12 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int dwMetaCountIn += dwCountIn; } - if (!mir_tstrcmp(swzRawSpec, L"msg_count_out")) - mir_sntprintf(buff, bufflen, L"%d", dwMetaCountOut); - else if (!mir_tstrcmp(swzRawSpec, L"msg_count_in")) - mir_sntprintf(buff, bufflen, L"%d", dwMetaCountIn); + if (!mir_wstrcmp(swzRawSpec, L"msg_count_out")) + mir_snwprintf(buff, bufflen, L"%d", dwMetaCountOut); + else if (!mir_wstrcmp(swzRawSpec, L"msg_count_in")) + mir_snwprintf(buff, bufflen, L"%d", dwMetaCountIn); else - mir_sntprintf(buff, bufflen, L"%d", dwMetaCountOut + dwMetaCountIn); + mir_snwprintf(buff, bufflen, L"%d", dwMetaCountOut + dwMetaCountIn); return true; } @@ -475,9 +475,9 @@ bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVar } // pass to variables plugin if available - wchar_t *swzVarSrc = (parseTipperVarsFirst ? mir_tstrdup(swzSource) : variables_parsedup((wchar_t *)swzSource, 0, hContact)); + wchar_t *swzVarSrc = (parseTipperVarsFirst ? mir_wstrdup(swzSource) : variables_parsedup((wchar_t *)swzSource, 0, hContact)); - size_t iSourceLen = mir_tstrlen(swzVarSrc); + size_t iSourceLen = mir_wstrlen(swzVarSrc); size_t si = 0, di = 0, v = 0; wchar_t swzVName[LABEL_LEN], swzRep[VALUE_LEN], swzAlt[VALUE_LEN]; @@ -555,13 +555,13 @@ bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVar if (p) { *p = 0; // clip swzAlt from swzVName p++; - if (mir_tstrlen(p) > 4 && wcsncmp(p, L"raw:", 4) == 0) { // raw db substitution + if (mir_wstrlen(p) > 4 && wcsncmp(p, L"raw:", 4) == 0) { // raw db substitution char raw_spec[LABEL_LEN]; p += 4; t2a(p, raw_spec, LABEL_LEN); GetRawSubstText(hContact, raw_spec, swzAlt, VALUE_LEN); } - else if (mir_tstrlen(p) > 4 && wcsncmp(p, L"sys:", 4) == 0) { // 'system' substitution + else if (mir_wstrlen(p) > 4 && wcsncmp(p, L"sys:", 4) == 0) { // 'system' substitution p += 4; GetSysSubstText(hContact, p, swzAlt, VALUE_LEN); } @@ -569,7 +569,7 @@ bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVar // see if we can find the bSubst DSListNode *ds_node = opt.dsList; while (ds_node) { - if (mir_tstrcmp(ds_node->ds.swzName, p) == 0) + if (mir_wstrcmp(ds_node->ds.swzName, p) == 0) break; ds_node = ds_node->next; @@ -583,7 +583,7 @@ bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVar } } swzAlt[VALUE_LEN - 1] = 0; - if (mir_tstrlen(swzAlt) != 0) + if (mir_wstrlen(swzAlt) != 0) bAltSubst = true; } @@ -602,7 +602,7 @@ bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVar // see if we can find the bSubst DSListNode *ds_node = opt.dsList; while (ds_node) { - if (mir_tstrcmp(ds_node->ds.swzName, swzVName) == 0) + if (mir_wstrcmp(ds_node->ds.swzName, swzVName) == 0) break; ds_node = ds_node->next; @@ -615,12 +615,12 @@ bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVar } if (bSubst) { - size_t rep_len = mir_tstrlen(swzRep); + size_t rep_len = mir_wstrlen(swzRep); wcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di)); di += rep_len - 1; // -1 because we inc at bottom of loop } else if (bAltSubst) { - size_t alt_len = mir_tstrlen(swzAlt); + size_t alt_len = mir_wstrlen(swzAlt); wcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di)); di += alt_len - 1; // -1 because we inc at bottom of loop } @@ -677,9 +677,9 @@ bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_ void TruncateString(wchar_t *ptszText) { if (ptszText && opt.iLimitCharCount > 3) { - if ((int)mir_tstrlen(ptszText) > opt.iLimitCharCount) { + if ((int)mir_wstrlen(ptszText) > opt.iLimitCharCount) { ptszText[opt.iLimitCharCount - 3] = 0; - mir_tstrcat(ptszText, L"..."); + mir_wstrcat(ptszText, L"..."); } } } @@ -702,7 +702,7 @@ wchar_t* GetProtoStatusMessage(char *szProto, WORD wStatus) // try to use service without SGMA_TCHAR char *tmpMsg = (char *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, 0); if (tmpMsg && (INT_PTR)tmpMsg != CALLSERVICE_NOTFOUND) { - ptszText = mir_a2t(tmpMsg); + ptszText = mir_a2u(tmpMsg); mir_free(tmpMsg); } } @@ -728,7 +728,7 @@ wchar_t* GetProtoExtraStatusTitle(char *szProto) if (!ptszText) { wchar_t buff[256]; if (EmptyXStatusToDefaultName(0, szProto, 0, buff, 256)) - ptszText = mir_tstrdup(buff); + ptszText = mir_wstrdup(buff); } if (opt.bLimitMsg) diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 770d1348ce..4442d56285 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -124,8 +124,8 @@ int ReloadSkinFolder(WPARAM, LPARAM) void InitFonts()
{
colourBg.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourBg.group, LPGENW("Tooltips"));
- mir_tstrcpy(colourBg.name, LPGENW("Background"));
+ mir_wstrcpy(colourBg.group, LPGENW("Tooltips"));
+ mir_wstrcpy(colourBg.name, LPGENW("Background"));
mir_strcpy(colourBg.dbSettingsGroup, MODULE);
mir_strcpy(colourBg.setting, "ColourBg");
colourBg.defcolour = RGB(219, 219, 219);
@@ -133,8 +133,8 @@ void InitFonts() ColourRegisterT(&colourBg);
colourBorder.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourBorder.group, LPGENW("Tooltips"));
- mir_tstrcpy(colourBorder.name, LPGENW("Border"));
+ mir_wstrcpy(colourBorder.group, LPGENW("Tooltips"));
+ mir_wstrcpy(colourBorder.name, LPGENW("Border"));
mir_strcpy(colourBorder.dbSettingsGroup, MODULE);
mir_strcpy(colourBorder.setting, "BorderCol");
colourBorder.defcolour = 0;
@@ -142,8 +142,8 @@ void InitFonts() ColourRegisterT(&colourBorder);
colourAvatarBorder.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourAvatarBorder.group, LPGENW("Tooltips"));
- mir_tstrcpy(colourAvatarBorder.name, LPGENW("Avatar border"));
+ mir_wstrcpy(colourAvatarBorder.group, LPGENW("Tooltips"));
+ mir_wstrcpy(colourAvatarBorder.name, LPGENW("Avatar border"));
mir_strcpy(colourAvatarBorder.dbSettingsGroup, MODULE);
mir_strcpy(colourAvatarBorder.setting, "AvBorderCol");
colourAvatarBorder.defcolour = 0;
@@ -151,8 +151,8 @@ void InitFonts() ColourRegisterT(&colourAvatarBorder);
colourDivider.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourDivider.group, LPGENW("Tooltips"));
- mir_tstrcpy(colourDivider.name, LPGENW("Dividers"));
+ mir_wstrcpy(colourDivider.group, LPGENW("Tooltips"));
+ mir_wstrcpy(colourDivider.name, LPGENW("Dividers"));
mir_strcpy(colourDivider.dbSettingsGroup, MODULE);
mir_strcpy(colourDivider.setting, "DividerCol");
colourDivider.defcolour = 0;
@@ -160,8 +160,8 @@ void InitFonts() ColourRegisterT(&colourDivider);
colourSidebar.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourSidebar.group, LPGENW("Tooltips"));
- mir_tstrcpy(colourSidebar.name, LPGENW("Sidebar"));
+ mir_wstrcpy(colourSidebar.group, LPGENW("Tooltips"));
+ mir_wstrcpy(colourSidebar.name, LPGENW("Sidebar"));
mir_strcpy(colourSidebar.dbSettingsGroup, MODULE);
mir_strcpy(colourSidebar.setting, "SidebarCol");
colourSidebar.defcolour = RGB(192, 192, 192);
@@ -170,12 +170,12 @@ void InitFonts() fontTitle.cbSize = sizeof(FontIDT);
fontTitle.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontTitle.group, LPGENW("Tooltips"));
- mir_tstrcpy(fontTitle.name, LPGENW("Title"));
+ mir_wstrcpy(fontTitle.group, LPGENW("Tooltips"));
+ mir_wstrcpy(fontTitle.name, LPGENW("Title"));
mir_strcpy(fontTitle.dbSettingsGroup, MODULE);
mir_strcpy(fontTitle.prefix, "FontFirst");
- mir_tstrcpy(fontTitle.backgroundGroup, LPGENW("Tooltips"));
- mir_tstrcpy(fontTitle.backgroundName, LPGENW("Background"));
+ mir_wstrcpy(fontTitle.backgroundGroup, LPGENW("Tooltips"));
+ mir_wstrcpy(fontTitle.backgroundName, LPGENW("Background"));
fontTitle.order = 0;
fontTitle.deffontsettings.charset = DEFAULT_CHARSET;
@@ -186,12 +186,12 @@ void InitFonts() fontLabels.cbSize = sizeof(FontIDT);
fontLabels.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontLabels.group, LPGENW("Tooltips"));
- mir_tstrcpy(fontLabels.name, LPGENW("Labels"));
+ mir_wstrcpy(fontLabels.group, LPGENW("Tooltips"));
+ mir_wstrcpy(fontLabels.name, LPGENW("Labels"));
mir_strcpy(fontLabels.dbSettingsGroup, MODULE);
mir_strcpy(fontLabels.prefix, "FontLabels");
- mir_tstrcpy(fontLabels.backgroundGroup, LPGENW("Tooltips"));
- mir_tstrcpy(fontLabels.backgroundName, LPGENW("Background"));
+ mir_wstrcpy(fontLabels.backgroundGroup, LPGENW("Tooltips"));
+ mir_wstrcpy(fontLabels.backgroundName, LPGENW("Background"));
fontLabels.order = 1;
fontLabels.deffontsettings.charset = DEFAULT_CHARSET;
@@ -202,12 +202,12 @@ void InitFonts() fontValues.cbSize = sizeof(FontIDT);
fontValues.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontValues.group, LPGENW("Tooltips"));
- mir_tstrcpy(fontValues.name, LPGENW("Values"));
+ mir_wstrcpy(fontValues.group, LPGENW("Tooltips"));
+ mir_wstrcpy(fontValues.name, LPGENW("Values"));
mir_strcpy(fontValues.dbSettingsGroup, MODULE);
mir_strcpy(fontValues.prefix, "FontValues");
- mir_tstrcpy(fontValues.backgroundGroup, LPGENW("Tooltips"));
- mir_tstrcpy(fontValues.backgroundName, LPGENW("Background"));
+ mir_wstrcpy(fontValues.backgroundGroup, LPGENW("Tooltips"));
+ mir_wstrcpy(fontValues.backgroundName, LPGENW("Background"));
fontValues.order = 2;
fontValues.deffontsettings.charset = DEFAULT_CHARSET;
@@ -218,12 +218,12 @@ void InitFonts() fontTrayTitle.cbSize = sizeof(FontIDT);
fontTrayTitle.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontTrayTitle.group, LPGENW("Tooltips"));
- mir_tstrcpy(fontTrayTitle.name, LPGENW("Tray title"));
+ mir_wstrcpy(fontTrayTitle.group, LPGENW("Tooltips"));
+ mir_wstrcpy(fontTrayTitle.name, LPGENW("Tray title"));
mir_strcpy(fontTrayTitle.dbSettingsGroup, MODULE);
mir_strcpy(fontTrayTitle.prefix, "FontTrayTitle");
- mir_tstrcpy(fontTrayTitle.backgroundGroup, LPGENW("Tooltips"));
- mir_tstrcpy(fontTrayTitle.backgroundName, LPGENW("Background"));
+ mir_wstrcpy(fontTrayTitle.backgroundGroup, LPGENW("Tooltips"));
+ mir_wstrcpy(fontTrayTitle.backgroundName, LPGENW("Background"));
fontTrayTitle.order = 0;
fontTrayTitle.deffontsettings.charset = DEFAULT_CHARSET;
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 87679f08a7..879f100f5d 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -35,11 +35,11 @@ void AddTranslation(DBVTranslation *newTrans) iTransFuncsCount++;
translations[iTransFuncsCount - 1] = *newTrans;
- char *szName = mir_t2a(newTrans->swzName);
+ char *szName = mir_u2a(newTrans->swzName);
char szSetting[256];
mir_snprintf(szSetting, sizeof(szSetting),"Trans_%s",szName);
- if (mir_tstrcmp(newTrans->swzName, L"[No translation]") == 0)
+ if (mir_wstrcmp(newTrans->swzName, L"[No translation]") == 0)
{
translations[iTransFuncsCount - 1].id = 0;
}
@@ -117,11 +117,11 @@ wchar_t* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, int h = (diff - d * 60 * 60 * 24) / 60 / 60;
int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60;
if (d > 0)
- mir_sntprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m);
+ mir_snwprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m);
else if (h > 0)
- mir_sntprintf(buff, bufflen, TranslateT("%dh %dm"), h, m);
+ mir_snwprintf(buff, bufflen, TranslateT("%dh %dm"), h, m);
else
- mir_sntprintf(buff, bufflen, TranslateT("%dm"), m);
+ mir_snwprintf(buff, bufflen, TranslateT("%dm"), m);
return buff;
}
@@ -133,11 +133,11 @@ wchar_t *SecondsToTimeDifference(MCONTACT hContact, const char *szModuleName, co int h = (diff - d * 60 * 60 * 24) / 60 / 60;
int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60;
if (d > 0)
- mir_sntprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m);
+ mir_snwprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m);
else if (h > 0)
- mir_sntprintf(buff, bufflen, TranslateT("%dh %dm"), h, m);
+ mir_snwprintf(buff, bufflen, TranslateT("%dh %dm"), h, m);
else
- mir_sntprintf(buff, bufflen, TranslateT("%dm"), m);
+ mir_snwprintf(buff, bufflen, TranslateT("%dm"), m);
return buff;
}
@@ -204,7 +204,7 @@ wchar_t *DwordToIp(MCONTACT hContact, const char *szModuleName, const char *szSe DWORD ip = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ip) {
unsigned char *ipc = (unsigned char*)&ip;
- mir_sntprintf(buff, bufflen, L"%u.%u.%u.%u", ipc[3], ipc[2], ipc[1], ipc[0]);
+ mir_snwprintf(buff, bufflen, L"%u.%u.%u.%u", ipc[3], ipc[2], ipc[1], ipc[0]);
return buff;
}
return 0;
@@ -306,7 +306,7 @@ wchar_t *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const ch int age = now.wYear - year;
if (now.wMonth < month || (now.wMonth == month && now.wDay < day))
age--;
- mir_sntprintf(buff, bufflen, L"%d", age);
+ mir_snwprintf(buff, bufflen, L"%d", age);
return buff;
}
else
@@ -473,13 +473,13 @@ wchar_t *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const int h = (diff - y * 60 * 60 * 24 * 365 - d * 60 * 60 * 24) / 60 / 60;
int m = (diff - y * 60 * 60 * 24 * 365 - d * 60 * 60 * 24 - h * 60 * 60) / 60;
if (y != 0)
- mir_sntprintf(buff, bufflen, TranslateT("%dy %dd %dh %dm"), y, d, h, m);
+ mir_snwprintf(buff, bufflen, TranslateT("%dy %dd %dh %dm"), y, d, h, m);
else if (d != 0)
- mir_sntprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m);
+ mir_snwprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m);
else if (h != 0)
- mir_sntprintf(buff, bufflen, TranslateT("%dh %dm"), h, m);
+ mir_snwprintf(buff, bufflen, TranslateT("%dh %dm"), h, m);
else
- mir_sntprintf(buff, bufflen, TranslateT("%dm"), m);
+ mir_snwprintf(buff, bufflen, TranslateT("%dm"), m);
return buff;
}
@@ -539,7 +539,7 @@ wchar_t *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleNam }
int diff = yday_birth - yday_now;
- mir_sntprintf(buff, bufflen, TranslateT("%dd"), diff);
+ mir_snwprintf(buff, bufflen, TranslateT("%dd"), diff);
return buff;
}
diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp index 1b921690dc..95bfc49a8b 100644 --- a/plugins/Toaster/src/services.cpp +++ b/plugins/Toaster/src/services.cpp @@ -12,7 +12,7 @@ void __stdcall ShowToastNotification(void* p) if (!db_get_b(0, "Popup", "ModuleIsEnabled", 1))
return;
- ptrT imagePath;
+ ptrW imagePath;
if (td->hContact != NULL && td->hContact != INVALID_CONTACT_ID)
{
const char* szProto = GetContactProto(td->hContact);
@@ -21,7 +21,7 @@ void __stdcall ShowToastNotification(void* p) PROTO_AVATAR_INFORMATION pai = { td->hContact };
if (CallProtoService(szProto, PS_GETAVATARINFO, 0, (LPARAM)&pai) == GAIR_SUCCESS)
{
- imagePath = mir_tstrdup(pai.filename);
+ imagePath = mir_wstrdup(pai.filename);
}
}
@@ -140,7 +140,7 @@ static INT_PTR CreateClassPopup(WPARAM, LPARAM lParam) }
else
{
- td = new ToastData(ppc->hContact, ptrT(mir_utf8decodeT(ppc->pszTitle)), ptrT(mir_utf8decodeT(ppc->pszText)), it->second->hIcon);
+ td = new ToastData(ppc->hContact, ptrW(mir_utf8decodeW(ppc->pszTitle)), ptrW(mir_utf8decodeW(ppc->pszText)), it->second->hIcon);
}
td->vPopupData = ppc->PluginData;
diff --git a/plugins/Toaster/src/structs.h b/plugins/Toaster/src/structs.h index fe8a658850..96900ce785 100644 --- a/plugins/Toaster/src/structs.h +++ b/plugins/Toaster/src/structs.h @@ -17,8 +17,8 @@ struct ToastData : public MZeroedObject ToastData(MCONTACT _hContact, const wchar_t *_tszTitle, const wchar_t *_tszText, HICON _hIcon = NULL) :
hContact(_hContact),
- tszTitle(mir_tstrdup(_tszTitle)),
- tszText(mir_tstrdup(_tszText)),
+ tszTitle(mir_wstrdup(_tszTitle)),
+ tszText(mir_wstrdup(_tszText)),
hIcon(_hIcon),
iType(_hIcon ? 2 : 0) ,
pPopupProc(NULL),
@@ -26,8 +26,8 @@ struct ToastData : public MZeroedObject {}
ToastData(MCONTACT _hContact, const wchar_t *_tszTitle, const wchar_t *_tszText, HBITMAP bmp = NULL) :
hContact(_hContact),
- tszTitle(mir_tstrdup(_tszTitle)),
- tszText(mir_tstrdup(_tszText)),
+ tszTitle(mir_wstrdup(_tszTitle)),
+ tszText(mir_wstrdup(_tszText)),
hBitmap(bmp),
iType(bmp ? 1 : 0),
pPopupProc(NULL),
diff --git a/plugins/Toaster/src/toast_notification.cpp b/plugins/Toaster/src/toast_notification.cpp index 2df72af9ad..0ade7ce217 100644 --- a/plugins/Toaster/src/toast_notification.cpp +++ b/plugins/Toaster/src/toast_notification.cpp @@ -64,7 +64,7 @@ HRESULT ToastNotification::CreateXml(_Outptr_ ABI::Windows::Data::Xml::Dom::IXml }
int nLength;
- ptrT xtmp(xmlToString(xmlToast, &nLength));
+ ptrW xtmp(xmlToString(xmlToast, &nLength));
xmlDestroyNode(xmlToast);
CHECKHR(xmlDocument->LoadXml(StringReferenceWrapper(xtmp, nLength).Get()));
diff --git a/plugins/Toaster/src/utils.h b/plugins/Toaster/src/utils.h index 85547164ab..fe9e5998bd 100644 --- a/plugins/Toaster/src/utils.h +++ b/plugins/Toaster/src/utils.h @@ -8,7 +8,7 @@ extern wchar_t wszTempDir[]; class ToasterImage
{
HBITMAP _hBitmap;
- ptrT tszId;
+ ptrW tszId;
public:
__inline explicit ToasterImage(HICON hIcon) : _hBitmap(NULL), tszId(CMString(FORMAT, L"%p", hIcon).Detach())
@@ -25,7 +25,7 @@ public: {
}
- __inline explicit ToasterImage(const char *szProto) : _hBitmap(NULL), tszId(mir_a2t(szProto))
+ __inline explicit ToasterImage(const char *szProto) : _hBitmap(NULL), tszId(mir_a2u(szProto))
{
ICONINFO icon = { 0 };
if (GetIconInfo(Skin_LoadProtoIcon(szProto, ID_STATUS_ONLINE, 1), &icon))
diff --git a/plugins/TooltipNotify/src/Tooltip.cpp b/plugins/TooltipNotify/src/Tooltip.cpp index 9f9edc03e4..9289c34824 100644 --- a/plugins/TooltipNotify/src/Tooltip.cpp +++ b/plugins/TooltipNotify/src/Tooltip.cpp @@ -147,7 +147,7 @@ void CTooltip::Validate() SIZE Size;
HDC hDC = GetDC(m_hWnd);
SelectObject(hDC, m_hFont);
- GetTextExtentPoint32(hDC, m_szText, (int)mir_tstrlen(m_szText), &Size);
+ GetTextExtentPoint32(hDC, m_szText, (int)mir_wstrlen(m_szText), &Size);
SetWindowPos(m_hWnd, 0, 0, 0, Size.cx+6, Size.cy+4,
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOREDRAW);
ReleaseDC(m_hWnd, hDC);
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 3bb08f45ad..2d7988e339 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -537,7 +537,7 @@ BOOL CTooltipNotify::OptionsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l case WM_VSCROLL:
case WM_HSCROLL:
wchar_t str[10];
- mir_sntprintf(str, L"%d%%", 100 * SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0) / 255);
+ mir_snwprintf(str, L"%d%%", 100 * SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0) / 255);
SetDlgItemText(hDlg, IDC_TRANSPERC, str);
if (wParam != 0x12345678)
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
@@ -679,7 +679,7 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM) ListView_GetItemText(GetDlgItem(hDlg, IDC_PROTOS), i, 0, szProto, _countof(szProto));
char szMultiByteProto[128];
- long lLen = WideCharToMultiByte(CP_ACP, 0, szProto, (int)mir_tstrlen(szProto),
+ long lLen = WideCharToMultiByte(CP_ACP, 0, szProto, (int)mir_wstrlen(szProto),
szMultiByteProto, sizeof(szMultiByteProto), NULL, NULL);
szMultiByteProto[lLen] = '\0';
@@ -799,23 +799,23 @@ BOOL CTooltipNotify::ContactsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM) wchar_t* CTooltipNotify::StatusToString(int iStatus, wchar_t *szStatus, int iBufSize)
{
if (iStatus >= ID_STATUS_OFFLINE && iStatus <= ID_STATUS_OUTTOLUNCH)
- mir_tstrncpy(szStatus, pcli->pfnGetStatusModeDescription(iStatus, 0), iBufSize);
+ mir_wstrncpy(szStatus, pcli->pfnGetStatusModeDescription(iStatus, 0), iBufSize);
else {
switch (iStatus) {
case ID_TTNTF_STATUS_TYPING:
- mir_tstrncpy(szStatus, TranslateT("Typing"), iBufSize);
+ mir_wstrncpy(szStatus, TranslateT("Typing"), iBufSize);
break;
case ID_TTNTF_STATUS_IDLE:
- mir_tstrncpy(szStatus, TranslateT("Idle"), iBufSize);
+ mir_wstrncpy(szStatus, TranslateT("Idle"), iBufSize);
break;
case ID_TTNTF_STATUS_NOT_IDLE:
- mir_tstrncpy(szStatus, TranslateT("Not Idle"), iBufSize);
+ mir_wstrncpy(szStatus, TranslateT("Not Idle"), iBufSize);
break;
default:
- mir_tstrncpy(szStatus, TranslateT("Unknown"), iBufSize);
+ mir_wstrncpy(szStatus, TranslateT("Unknown"), iBufSize);
break;
}
}
@@ -841,11 +841,11 @@ wchar_t* CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, wchar long lLen = MultiByteToWideChar(CP_ACP, 0, szProto, (int)mir_strlen(szProto), wszProto, _countof(wszProto));
wszProto[lLen] = '\0';
- mir_sntprintf(szString, iBufSize - 1, szFormatString, wszProto, L": ", szContactName);
+ mir_snwprintf(szString, iBufSize - 1, szFormatString, wszProto, L": ", szContactName);
- TruncateWithDots(szString, iBufSize - 1 - mir_tstrlen(szStatus) - mir_tstrlen(szIs) - 2); // 2 spaces around szIs
- mir_sntprintf(szString + mir_tstrlen(szString), iBufSize - 1 - mir_tstrlen(szString), L" %s %s", szIs, szStatus);
+ TruncateWithDots(szString, iBufSize - 1 - mir_wstrlen(szStatus) - mir_wstrlen(szIs) - 2); // 2 spaces around szIs
+ mir_snwprintf(szString + mir_wstrlen(szString), iBufSize - 1 - mir_wstrlen(szString), L" %s %s", szIs, szStatus);
return szString;
}
diff --git a/plugins/TooltipNotify/src/Utils.cpp b/plugins/TooltipNotify/src/Utils.cpp index 4d102f9822..9338efebbe 100644 --- a/plugins/TooltipNotify/src/Utils.cpp +++ b/plugins/TooltipNotify/src/Utils.cpp @@ -13,7 +13,7 @@ BOOL IsNt50() void TruncateWithDots(wchar_t* szString, size_t iNewLen)
{
- size_t iOrigLen = mir_tstrlen(szString);
+ size_t iOrigLen = mir_wstrlen(szString);
if (iNewLen < iOrigLen) {
wchar_t* p = szString+iNewLen;
*p = '\0';
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index 9b6f9721f0..d02ab8240a 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -177,7 +177,7 @@ TopButtonInt *CreateButton(TTBButton *but) b->bPushed = (but->dwFlags & TTBBF_PUSHED) ? TRUE : FALSE;
if (but->dwFlags & TTBBF_ISLBUTTON) {
- b->ptszProgram = mir_tstrdup(but->program);
+ b->ptszProgram = mir_wstrdup(but->program);
b->pszService = mir_strdup(TTB_LAUNCHSERVICE);
}
else {
@@ -190,8 +190,8 @@ TopButtonInt *CreateButton(TTBButton *but) Icon2button(but, b->hIconHandleUp, b->hIconUp, true);
Icon2button(but, b->hIconHandleDn, b->hIconDn, false);
- b->ptszTooltipUp = mir_a2t(but->pszTooltipUp);
- b->ptszTooltipDn = mir_a2t(but->pszTooltipDn);
+ b->ptszTooltipUp = mir_a2u(but->pszTooltipUp);
+ b->ptszTooltipDn = mir_a2u(but->pszTooltipDn);
}
return b;
}
@@ -399,7 +399,7 @@ INT_PTR TTBGetOptions(WPARAM wParam, LPARAM lParam) lpTTB->wParamDown = b->wParamDown;
if (b->dwFlags & TTBBF_ISLBUTTON)
- replaceStrT(lpTTB->program, b->ptszProgram);
+ replaceStrW(lpTTB->program, b->ptszProgram);
else
replaceStr(lpTTB->pszService, b->pszService);
@@ -440,7 +440,7 @@ INT_PTR TTBSetOptions(WPARAM wParam, LPARAM lParam) if (lParam == 0)
return -1;
- replaceStrT(b->ptszTooltip, TranslateTS(_A2T((LPCSTR)lParam)));
+ replaceStrW(b->ptszTooltip, TranslateTS(_A2T((LPCSTR)lParam)));
SendMessage(b->hwnd, BUTTONADDTOOLTIP, (WPARAM)b->ptszTooltip, BATF_UNICODE);
return 1;
@@ -467,7 +467,7 @@ INT_PTR TTBSetOptions(WPARAM wParam, LPARAM lParam) }
if (b->dwFlags & TTBBF_ISLBUTTON)
- replaceStrT(b->ptszProgram, lpTTB->program);
+ replaceStrW(b->ptszProgram, lpTTB->program);
else
replaceStr(b->pszService, lpTTB->pszService);
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index 73661085dd..90f3199b24 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -299,7 +299,7 @@ int LoadBackgroundOptions() }
if (db_get_b(NULL, TTB_OPTDIR, "UseBitmap", TTBDEFAULT_USEBITMAP)) {
- ptrT tszBitmapName(db_get_tsa(NULL, TTB_OPTDIR, "BkBitmap"));
+ ptrW tszBitmapName(db_get_tsa(NULL, TTB_OPTDIR, "BkBitmap"));
if (tszBitmapName != NULL)
hBmpBackground = Bitmap_Load(tszBitmapName);
}
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp index b78101a566..e4a2edd8e5 100644 --- a/plugins/TopToolBar/src/ttbopt.cpp +++ b/plugins/TopToolBar/src/ttbopt.cpp @@ -33,7 +33,7 @@ static HTREEITEM AddLine(HWND hTree,TopButtonInt *b, HTREEITEM hItem, HIMAGELIST }
else index = ImageList_AddIcon(il, b->hIconUp);
- tmp = mir_a2t( b->pszName );
+ tmp = mir_a2u( b->pszName );
tvis.item.pszText = TranslateTS(tmp);
}
tvis.item.iImage = tvis.item.iSelectedImage = index;
@@ -298,7 +298,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR TreeView_SetItem(hTree, &tvi);
GetDlgItemText(hwndDlg, IDC_EPATH, buf, _countof(buf));
- replaceStrT(btn->ptszProgram, buf);
+ replaceStrW(btn->ptszProgram, buf);
}
break;
}
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index d54155159e..2366819516 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -216,26 +216,26 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM) // Ôîðìàò ñ÷¸ò÷èêà äëÿ êàæäîãî àêòèâíîãî ïðîòîêîëà
if (db_get_ts(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_COUNTER_FORMAT, &dbv) == 0) {
- if (mir_tstrlen(dbv.ptszVal) > 0)
- mir_tstrncpy(Traffic_CounterFormat, dbv.ptszVal, _countof(Traffic_CounterFormat));
+ if (mir_wstrlen(dbv.ptszVal) > 0)
+ mir_wstrncpy(Traffic_CounterFormat, dbv.ptszVal, _countof(Traffic_CounterFormat));
//
db_free(&dbv);
}
else //defaults here
{
- mir_tstrcpy(Traffic_CounterFormat, tszFormat);
+ mir_wstrcpy(Traffic_CounterFormat, tszFormat);
}
// Ôîðìàò âñïëûâàþùèõ ïîäñêàçîê
if (db_get_ts(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_TOOLTIP_FORMAT, &dbv) == 0) {
- if (mir_tstrlen(dbv.ptszVal) > 0)
- mir_tstrncpy(Traffic_TooltipFormat, dbv.ptszVal, _countof(Traffic_TooltipFormat));
+ if (mir_wstrlen(dbv.ptszVal) > 0)
+ mir_wstrncpy(Traffic_TooltipFormat, dbv.ptszVal, _countof(Traffic_TooltipFormat));
//
db_free(&dbv);
}
else //defaults here
{
- mir_tstrcpy(Traffic_TooltipFormat, L"Traffic Counter");
+ mir_wstrcpy(Traffic_TooltipFormat, L"Traffic Counter");
}
Traffic_AdditionSpace = db_get_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_ADDITION_SPACE, 0);
@@ -245,8 +245,8 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM) //register traffic font
TrafficFontID.cbSize = sizeof(FontIDT);
- mir_tstrcpy(TrafficFontID.group, LPGENW("Traffic counter"));
- mir_tstrcpy(TrafficFontID.name, LPGENW("Font"));
+ mir_wstrcpy(TrafficFontID.group, LPGENW("Traffic counter"));
+ mir_wstrcpy(TrafficFontID.name, LPGENW("Font"));
mir_strcpy(TrafficFontID.dbSettingsGroup, TRAFFIC_SETTINGS_GROUP);
mir_strcpy(TrafficFontID.prefix, "Font");
TrafficFontID.flags = FIDF_DEFAULTVALID | FIDF_SAVEPOINTSIZE;
@@ -254,14 +254,14 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM) TrafficFontID.deffontsettings.colour = GetSysColor(COLOR_BTNTEXT);
TrafficFontID.deffontsettings.size = 12;
TrafficFontID.deffontsettings.style = 0;
- mir_tstrcpy(TrafficFontID.deffontsettings.szFace, L"Arial");
+ mir_wstrcpy(TrafficFontID.deffontsettings.szFace, L"Arial");
TrafficFontID.order = 0;
FontRegisterT(&TrafficFontID);
// Ðåãèñòðèðóåì öâåò ôîíà
TrafficBackgroundColorID.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(TrafficBackgroundColorID.group, LPGENW("Traffic counter"));
- mir_tstrcpy(TrafficBackgroundColorID.name, LPGENW("Font"));
+ mir_wstrcpy(TrafficBackgroundColorID.group, LPGENW("Traffic counter"));
+ mir_wstrcpy(TrafficBackgroundColorID.name, LPGENW("Font"));
mir_strcpy(TrafficBackgroundColorID.dbSettingsGroup, TRAFFIC_SETTINGS_GROUP);
mir_strcpy(TrafficBackgroundColorID.setting, "FontBkColor");
TrafficBackgroundColorID.defcolour = GetSysColor(COLOR_BTNFACE);
@@ -385,7 +385,7 @@ int TrafficCounter_Draw(HWND hwnd, HDC hDC) static void TC_AlphaText(HDC hDC, LPCTSTR lpString, RECT* lpRect, UINT format, BYTE ClistModernPresent)
{
- int nCount = (int)mir_tstrlen(lpString);
+ int nCount = (int)mir_wstrlen(lpString);
if (ClistModernPresent)
AlphaText(hDC, lpString, nCount, lpRect, format, Traffic_FontColor);
@@ -539,7 +539,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) // Âûâîäèì òåêñò
// Èçîáðàæàåì èìÿ
if (unOptions.DrawProtoName) {
- wchar_t *bu = mir_a2t("Summary");
+ wchar_t *bu = mir_a2u("Summary");
rect.left += dx;
TC_AlphaText(hdc, bu, &rect, DT_SINGLELINE | DT_LEFT | DT_TOP, ClistModernPresent);
@@ -594,7 +594,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) // Âûâîäèì òåêñò
// Èçîáðàæàåì èìÿ
if (unOptions.DrawProtoName) {
- wchar_t *bu = mir_a2t("Overall");
+ wchar_t *bu = mir_a2u("Overall");
rect.left += dx;
TC_AlphaText(hdc, bu, &rect, DT_SINGLELINE | DT_LEFT | DT_TOP, ClistModernPresent);
@@ -639,7 +639,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) ExtraText = (wchar_t**)mir_realloc(ExtraText, sizeof(wchar_t*) * (RowsNumber + 1));
ahIcon = (HICON*)mir_realloc(ahIcon, sizeof(HICON) * (RowsNumber + 1));
- ExtraText[RowsNumber] = mir_a2t(ProtoList[i].name);
+ ExtraText[RowsNumber] = mir_a2u(ProtoList[i].name);
ahIcon[RowsNumber++] = Skin_LoadProtoIcon(ProtoList[i].name, CallProtoService(ProtoList[i].name, PS_GETSTATUS, 0, 0));
}
}
@@ -648,14 +648,14 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) ExtraText = (wchar_t**)mir_realloc(ExtraText, sizeof(wchar_t*) * (RowsNumber + 1));
ahIcon = (HICON*)mir_realloc(ahIcon, sizeof(HICON) * (RowsNumber + 1));
- ExtraText[RowsNumber] = mir_a2t("summary");
+ ExtraText[RowsNumber] = mir_a2u("summary");
ahIcon[RowsNumber++] = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
}
if (unOptions.ShowOverall) {
ExtraText = (wchar_t**)mir_realloc(ExtraText, sizeof(wchar_t*) * (RowsNumber + 1));
ahIcon = (HICON*)mir_realloc(ahIcon, sizeof(HICON) * (RowsNumber + 1));
- ExtraText[RowsNumber] = mir_a2t("overall");
+ ExtraText[RowsNumber] = mir_a2u("overall");
ahIcon[RowsNumber++] = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
}
@@ -1065,7 +1065,7 @@ void NotifyOnSend(void) ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
wcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
- mir_sntprintf(ppd.lptzText, TranslateT("%d kilobytes sent"), notify_send_size = OverallInfo.CurrentSentTraffic >> 10);
+ mir_snwprintf(ppd.lptzText, TranslateT("%d kilobytes sent"), notify_send_size = OverallInfo.CurrentSentTraffic >> 10);
ppd.colorBack = Traffic_PopupBkColor;
ppd.colorText = Traffic_PopupFontColor;
ppd.PluginWindowProc = NULL;
@@ -1081,7 +1081,7 @@ void NotifyOnRecv(void) ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
wcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
- mir_sntprintf(ppd.lptzText, TranslateT("%d kilobytes received"), notify_recv_size = OverallInfo.CurrentRecvTraffic >> 10);
+ mir_snwprintf(ppd.lptzText, TranslateT("%d kilobytes received"), notify_recv_size = OverallInfo.CurrentRecvTraffic >> 10);
ppd.colorBack = Traffic_PopupBkColor;
ppd.colorText = Traffic_PopupFontColor;
ppd.PluginWindowProc = NULL;
@@ -1100,7 +1100,7 @@ void CreateProtocolList(void) //
for (i = 0; i < NumberOfAccounts; i++) {
ProtoList[i].name = mir_strdup(acc[i]->szModuleName);
- ProtoList[i].tszAccountName = mir_tstrdup(acc[i]->tszAccountName);
+ ProtoList[i].tszAccountName = mir_wstrdup(acc[i]->tszAccountName);
ProtoList[i].Flags = db_get_b(NULL, ProtoList[i].name, SETTINGS_PROTO_FLAGS, 3);
ProtoList[i].CurrentRecvTraffic =
diff --git a/plugins/TrafficCounter/src/misc.cpp b/plugins/TrafficCounter/src/misc.cpp index 398feaab96..240ba55aa1 100644 --- a/plugins/TrafficCounter/src/misc.cpp +++ b/plugins/TrafficCounter/src/misc.cpp @@ -63,9 +63,9 @@ WORD GetRowItems(wchar_t *InputString, RowItemInfo **RowItemsList) }
else {
// Âûäåëÿåì ïàìÿòü ïîä ñòðîêó.
- (*RowItemsList)[c].String = (wchar_t*)mir_alloc(sizeof(wchar_t) * mir_tstrlen(end));
+ (*RowItemsList)[c].String = (wchar_t*)mir_alloc(sizeof(wchar_t) * mir_wstrlen(end));
// Êîïèðóåì ñòðîêó.
- wcsncpy((*RowItemsList)[c].String, end + 1, mir_tstrlen(end));
+ wcsncpy((*RowItemsList)[c].String, end + 1, mir_wstrlen(end));
}
c++;
@@ -148,20 +148,20 @@ size_t GetFormattedTraffic(DWORD Value, BYTE Unit, wchar_t *Buffer, size_t Size) return 0;
}
- mir_sntprintf(Str1, L"%d.%d", Value / Divider, Value % Divider);
+ mir_snwprintf(Str1, L"%d.%d", Value / Divider, Value % Divider);
size_t l = GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, NULL, 0);
if (!l) return 0;
- l += mir_tstrlen(szUnit) + 1;
+ l += mir_wstrlen(szUnit) + 1;
Res = (wchar_t*)malloc(l * sizeof(wchar_t));
if (!Res) return 0;
GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, Res, (int)l);
- mir_tstrcat(Res, szUnit);
+ mir_wstrcat(Res, szUnit);
if (Size && Buffer) {
- mir_tstrcpy(Buffer, Res);
- l = mir_tstrlen(Buffer);
+ mir_wstrcpy(Buffer, Res);
+ l = mir_wstrlen(Buffer);
}
- else l = mir_tstrlen(Res) + 1;
+ else l = mir_wstrlen(Res) + 1;
free(Res);
return l;
@@ -197,53 +197,53 @@ size_t GetDurationFormatM(DWORD Duration, wchar_t *Format, wchar_t *Buffer, size Token[TokenIndex] = 0;
// ×òî ïîëó÷èëè â àêêóìóëÿòîðå?
- if (!mir_tstrcmp(Token, L"d")) {
+ if (!mir_wstrcmp(Token, L"d")) {
q = Duration / (60 * 60 * 24);
- mir_sntprintf(Token, L"%d", q);
+ mir_snwprintf(Token, L"%d", q);
Duration -= q * 60 * 60 * 24;
}
- else if (!mir_tstrcmp(Token, L"h")) {
+ else if (!mir_wstrcmp(Token, L"h")) {
q = Duration / (60 * 60);
- mir_sntprintf(Token, L"%d", q);
+ mir_snwprintf(Token, L"%d", q);
Duration -= q * 60 * 60;
}
- else if (!mir_tstrcmp(Token, L"hh")) {
+ else if (!mir_wstrcmp(Token, L"hh")) {
q = Duration / (60 * 60);
- mir_sntprintf(Token, L"%02d", q);
+ mir_snwprintf(Token, L"%02d", q);
Duration -= q * 60 * 60;
}
- else if (!mir_tstrcmp(Token, L"m")) {
+ else if (!mir_wstrcmp(Token, L"m")) {
q = Duration / 60;
- mir_sntprintf(Token, L"%d", q);
+ mir_snwprintf(Token, L"%d", q);
Duration -= q * 60;
}
- else if (!mir_tstrcmp(Token, L"mm")) {
+ else if (!mir_wstrcmp(Token, L"mm")) {
q = Duration / 60;
- mir_sntprintf(Token, L"%02d", q);
+ mir_snwprintf(Token, L"%02d", q);
Duration -= q * 60;
}
- else if (!mir_tstrcmp(Token, L"s")) {
+ else if (!mir_wstrcmp(Token, L"s")) {
q = Duration;
- mir_sntprintf(Token, L"%d", q);
+ mir_snwprintf(Token, L"%d", q);
Duration -= q;
}
- else if (!mir_tstrcmp(Token, L"ss")) {
+ else if (!mir_wstrcmp(Token, L"ss")) {
q = Duration;
- mir_sntprintf(Token, L"%02d", q);
+ mir_snwprintf(Token, L"%02d", q);
Duration -= q;
}
// Äîáàâèì ïàìÿòè, åñëè íóæíî.
- Length = mir_tstrlen(Res) + mir_tstrlen(Token) + 1;
+ Length = mir_wstrlen(Res) + mir_wstrlen(Token) + 1;
Res = (wchar_t*)realloc(Res, Length * sizeof(wchar_t));
- mir_tstrcat(Res, Token);
+ mir_wstrcat(Res, Token);
}
if (Size && Buffer) {
wcsncpy(Buffer, Res, Size);
- Length = mir_tstrlen(Buffer);
+ Length = mir_wstrlen(Buffer);
}
- else Length = mir_tstrlen(Res) + 1;
+ else Length = mir_wstrlen(Res) + 1;
free(Res);
return Length;
diff --git a/plugins/TrafficCounter/src/options.cpp b/plugins/TrafficCounter/src/options.cpp index 02bfd9d5d5..db0e0c3c28 100644 --- a/plugins/TrafficCounter/src/options.cpp +++ b/plugins/TrafficCounter/src/options.cpp @@ -194,9 +194,9 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, {
options[i].szSettingName = (char*)mir_alloc(1 + mir_strlen(ProtoList[j].name));
mir_strcpy(options[i].szSettingName, ProtoList[j].name);
- size_t l = 20 + mir_tstrlen(ProtoList[j].tszAccountName);
+ size_t l = 20 + mir_wstrlen(ProtoList[j].tszAccountName);
options[i].szOptionName = (wchar_t*)mir_alloc(sizeof(wchar_t) * l);
- mir_sntprintf(options[i].szOptionName, l, L"Visible accounts/%s", ProtoList[j].tszAccountName);
+ mir_snwprintf(options[i].szOptionName, l, L"Visible accounts/%s", ProtoList[j].tszAccountName);
options[i].dwFlag = (ProtoList[j++].Enabled ? 1 : OPTTREE_INVISIBLE) | OPTTREE_NOTRANSLATE;
}
Initialized = 1;
diff --git a/plugins/TrafficCounter/src/opttree.cpp b/plugins/TrafficCounter/src/opttree.cpp index 337fca2806..b75de3cca5 100644 --- a/plugins/TrafficCounter/src/opttree.cpp +++ b/plugins/TrafficCounter/src/opttree.cpp @@ -93,7 +93,7 @@ HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wcha {
TreeView_GetItem(hwndTree, &tvi);
- if (!mir_tstrcmp(tvi.pszText, name))
+ if (!mir_wstrcmp(tvi.pszText, name))
return tvi.hItem;
tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
@@ -109,7 +109,7 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, wchar_t *name, LPARAM lParam, int iconI int sectionLevel = 0;
HTREEITEM hSection = NULL, result = NULL;
- mir_tstrcpy(itemName, name);
+ mir_wstrcpy(itemName, name);
sectionName = itemName;
while (sectionName)
@@ -193,7 +193,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, BOOL*, HTREEITEM hSection = NULL;
if (options[indx].szOptionName)
- mir_tstrcpy(itemName, options[indx].szOptionName);
+ mir_wstrcpy(itemName, options[indx].szOptionName);
else
itemName[0] = 0;
diff --git a/plugins/TrafficCounter/src/statistics.cpp b/plugins/TrafficCounter/src/statistics.cpp index cb0f7e3f6d..1815f8544c 100644 --- a/plugins/TrafficCounter/src/statistics.cpp +++ b/plugins/TrafficCounter/src/statistics.cpp @@ -187,7 +187,7 @@ INT_PTR CALLBACK DlgProcOptStatistics(HWND hwndDlg, UINT msg, WPARAM wParam, LPA switch (unOptions.Stat_Tab) {
case 0: // Hourly
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, szBufW, 32);
- mir_sntprintf(pdi->item.pszText, 32, L"%s %02d:00 - %02d:59",
+ mir_snwprintf(pdi->item.pszText, 32, L"%s %02d:00 - %02d:59",
szBufW,
ProtoList[EldestAcc].AllStatistics[Index].Hour,
ProtoList[EldestAcc].AllStatistics[Index].Hour);
@@ -206,13 +206,13 @@ INT_PTR CALLBACK DlgProcOptStatistics(HWND hwndDlg, UINT msg, WPARAM wParam, LPA vartime += 6;
VariantTimeToSystemTime(vartime, &st);
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, szBufW, 32);
- mir_sntprintf(pdi->item.pszText, 32, L"%s - %s", pdi->item.pszText, szBufW);
+ mir_snwprintf(pdi->item.pszText, 32, L"%s - %s", pdi->item.pszText, szBufW);
break;
case 3: // Monthly
GetDateFormat(LOCALE_USER_DEFAULT, DATE_YEARMONTH, &st, NULL, pdi->item.pszText, 32);
break;
case 4: // Yearly
- mir_sntprintf(pdi->item.pszText, 32, L"%d", st.wYear);
+ mir_snwprintf(pdi->item.pszText, 32, L"%d", st.wYear);
break;
}
return 0;
@@ -302,7 +302,7 @@ void Stat_ReadFile(BYTE n) pszPath = Utils_ReplaceVarsT(L"%miranda_userdata%\\statistics");
CreateDirectoryTreeT(pszPath);
- mir_sntprintf(FileName, L"%s\\%S.stat", pszPath, ProtoList[n].name);
+ mir_snwprintf(FileName, L"%s\\%S.stat", pszPath, ProtoList[n].name);
mir_free(pszPath);
GetLocalTime(&stNow);
ProtoList[n].hFile = CreateFile(FileName, GENERIC_READ | GENERIC_WRITE,
diff --git a/plugins/TrafficCounter/src/vars.cpp b/plugins/TrafficCounter/src/vars.cpp index 64a71c71b5..989df08b21 100644 --- a/plugins/TrafficCounter/src/vars.cpp +++ b/plugins/TrafficCounter/src/vars.cpp @@ -30,7 +30,7 @@ static wchar_t* GetTraffic(ARGUMENTSINFO *ai) if (ai->argc != 5) return NULL;
- if (!mir_tstrcmp(ai->targv[1], L"overall"))
+ if (!mir_wstrcmp(ai->targv[1], L"overall"))
{
tmpsn = OverallInfo.CurrentSentTraffic;
tmprn = OverallInfo.CurrentRecvTraffic;
@@ -38,7 +38,7 @@ static wchar_t* GetTraffic(ARGUMENTSINFO *ai) tmprt = OverallInfo.TotalRecvTraffic;
}
else
- if (!mir_tstrcmp(ai->targv[1], L"summary"))
+ if (!mir_wstrcmp(ai->targv[1], L"summary"))
{
for (ed = 0; ed < NumberOfAccounts; ed++)
if (ProtoList[ed].Visible)
@@ -54,8 +54,8 @@ static wchar_t* GetTraffic(ARGUMENTSINFO *ai) for (tmp = ed = 0; ed < NumberOfAccounts; ed++)
{
if (!ProtoList[ed].name) continue;
- wchar_t *buf = mir_a2t(ProtoList[ed].name);
- if (!mir_tstrcmp(buf, ai->targv[1]))
+ wchar_t *buf = mir_a2u(ProtoList[ed].name);
+ if (!mir_wstrcmp(buf, ai->targv[1]))
{
tmpsn = ProtoList[ed].CurrentSentTraffic;
tmprn = ProtoList[ed].CurrentRecvTraffic;
@@ -68,34 +68,34 @@ static wchar_t* GetTraffic(ARGUMENTSINFO *ai) if (tmp != 0xAA) return NULL;
}
- if (!mir_tstrcmp(ai->targv[2], L"now"))
+ if (!mir_wstrcmp(ai->targv[2], L"now"))
{
- if (!mir_tstrcmp(ai->targv[3], L"sent")) tmp = tmpsn;
+ if (!mir_wstrcmp(ai->targv[3], L"sent")) tmp = tmpsn;
else
- if (!mir_tstrcmp(ai->targv[3], L"received")) tmp = tmprn;
+ if (!mir_wstrcmp(ai->targv[3], L"received")) tmp = tmprn;
else
- if (!mir_tstrcmp(ai->targv[3], L"both")) tmp = tmprn + tmpsn;
+ if (!mir_wstrcmp(ai->targv[3], L"both")) tmp = tmprn + tmpsn;
else return NULL;
}
else
- if (!mir_tstrcmp(ai->targv[2], L"total"))
+ if (!mir_wstrcmp(ai->targv[2], L"total"))
{
- if (!mir_tstrcmp(ai->targv[3], L"sent")) tmp = tmpst;
+ if (!mir_wstrcmp(ai->targv[3], L"sent")) tmp = tmpst;
else
- if (!mir_tstrcmp(ai->targv[3], L"received")) tmp = tmprt;
+ if (!mir_wstrcmp(ai->targv[3], L"received")) tmp = tmprt;
else
- if (!mir_tstrcmp(ai->targv[3], L"both")) tmp = tmprt + tmpst;
+ if (!mir_wstrcmp(ai->targv[3], L"both")) tmp = tmprt + tmpst;
else return NULL;
}
else return NULL;
- if (!mir_tstrcmp(ai->targv[4], L"b")) ed = 0;
+ if (!mir_wstrcmp(ai->targv[4], L"b")) ed = 0;
else
- if (!mir_tstrcmp(ai->targv[4], L"k")) ed = 1;
+ if (!mir_wstrcmp(ai->targv[4], L"k")) ed = 1;
else
- if (!mir_tstrcmp(ai->targv[4], L"m")) ed = 2;
+ if (!mir_wstrcmp(ai->targv[4], L"m")) ed = 2;
else
- if (!mir_tstrcmp(ai->targv[4], L"d")) ed = 3;
+ if (!mir_wstrcmp(ai->targv[4], L"d")) ed = 3;
else return NULL;
// Ïîëó÷àåì ôîðìàòèðîâàííóþ ñòðîêó è âîçâðàùàåì óêàçàòåëü íà íå¸.
@@ -122,25 +122,25 @@ static wchar_t* GetTime(ARGUMENTSINFO *ai) {
wchar_t *buf;
if (!ProtoList[ed].name) continue;
- buf = mir_a2t(ProtoList[ed].name);
- if (!mir_tstrcmp(buf, ai->targv[1]))
+ buf = mir_a2u(ProtoList[ed].name);
+ if (!mir_wstrcmp(buf, ai->targv[1]))
{
flag = 0xAA;
- if (!mir_tstrcmp(ai->targv[2], L"now"))
+ if (!mir_wstrcmp(ai->targv[2], L"now"))
Duration = ProtoList[ed].Session.Timer;
- else if (!mir_tstrcmp(ai->targv[2], L"total"))
+ else if (!mir_wstrcmp(ai->targv[2], L"total"))
Duration = ProtoList[ed].Total.Timer;
else flag = 0;
break;
}
mir_free(buf);
}
- if ( (flag != 0xAA) && !mir_tstrcmp(ai->targv[1], L"summary") )
+ if ( (flag != 0xAA) && !mir_wstrcmp(ai->targv[1], L"summary") )
{
flag = 0xAA;
- if (!mir_tstrcmp(ai->targv[2], L"now"))
+ if (!mir_wstrcmp(ai->targv[2], L"now"))
Duration = OverallInfo.Session.Timer;
- else if (!mir_tstrcmp(ai->targv[2], L"total"))
+ else if (!mir_wstrcmp(ai->targv[2], L"total"))
Duration = OverallInfo.Total.Timer;
else flag = 0;
}
diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp index e0c08bb045..0f75d9f64b 100644 --- a/plugins/TranslitSwitcher/src/Layoutproc.cpp +++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp @@ -40,7 +40,7 @@ bool isItSmiley(unsigned int position) static DWORD CALLBACK StreamOutCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
wchar_t **ppText = (wchar_t**)dwCookie;
- *ppText = mir_tstrndup((wchar_t*)pbBuff, cb / sizeof(wchar_t));
+ *ppText = mir_wstrndup((wchar_t*)pbBuff, cb / sizeof(wchar_t));
*pcb = cb;
return 0;
}
@@ -60,292 +60,292 @@ wchar_t* Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags) void Transliterate(wchar_t *&str)
{
- wchar_t *newStr = (wchar_t*)mir_alloc(sizeof(wchar_t) * mir_tstrlen(str) * 3 + 1);
+ wchar_t *newStr = (wchar_t*)mir_alloc(sizeof(wchar_t) * mir_wstrlen(str) * 3 + 1);
newStr[0] = 0;
for (; *str != 0; str++) {
switch (str[0]) {
- case 'à': mir_tstrcat(newStr, L"a"); break;
- case 'á': mir_tstrcat(newStr, L"b"); break;
- case 'â': mir_tstrcat(newStr, L"v"); break;
- case 'ã': mir_tstrcat(newStr, L"g"); break;
- case 'ä': mir_tstrcat(newStr, L"d"); break;
- case 'å': mir_tstrcat(newStr, L"e"); break;
- case '¸': mir_tstrcat(newStr, L"ye"); break;
- case 'æ': mir_tstrcat(newStr, L"zh"); break;
- case 'ç': mir_tstrcat(newStr, L"z"); break;
- case 'è': mir_tstrcat(newStr, L"i"); break;
- case 'é': mir_tstrcat(newStr, L"y"); break;
- case 'ê': mir_tstrcat(newStr, L"k"); break;
- case 'ë': mir_tstrcat(newStr, L"l"); break;
- case 'ì': mir_tstrcat(newStr, L"m"); break;
- case 'í': mir_tstrcat(newStr, L"n"); break;
- case 'î': mir_tstrcat(newStr, L"o"); break;
- case 'ï': mir_tstrcat(newStr, L"p"); break;
- case 'ð': mir_tstrcat(newStr, L"r"); break;
- case 'ñ': mir_tstrcat(newStr, L"s"); break;
- case 'ò': mir_tstrcat(newStr, L"t"); break;
- case 'ó': mir_tstrcat(newStr, L"u"); break;
- case 'ô': mir_tstrcat(newStr, L"f"); break;
- case 'õ': mir_tstrcat(newStr, L"kh"); break;
- case 'ö': mir_tstrcat(newStr, L"ts"); break;
- case '÷': mir_tstrcat(newStr, L"ch"); break;
- case 'ø': mir_tstrcat(newStr, L"sh"); break;
- case 'ù': mir_tstrcat(newStr, L"sch"); break;
- case 'ú': mir_tstrcat(newStr, L"'"); break;
- case 'û': mir_tstrcat(newStr, L"yi"); break;
- case 'ü': mir_tstrcat(newStr, L""); break;
- case 'ý': mir_tstrcat(newStr, L"e"); break;
- case 'þ': mir_tstrcat(newStr, L"yu"); break;
- case 'ÿ': mir_tstrcat(newStr, L"ya"); break;
- case 'À': mir_tstrcat(newStr, L"A"); break;
- case 'Á': mir_tstrcat(newStr, L"B"); break;
- case 'Â': mir_tstrcat(newStr, L"V"); break;
- case 'Ã': mir_tstrcat(newStr, L"G"); break;
- case 'Ä': mir_tstrcat(newStr, L"D"); break;
- case 'Å': mir_tstrcat(newStr, L"E"); break;
- case '¨': mir_tstrcat(newStr, L"Ye"); break;
- case 'Æ': mir_tstrcat(newStr, L"Zh"); break;
- case 'Ç': mir_tstrcat(newStr, L"Z"); break;
- case 'È': mir_tstrcat(newStr, L"I"); break;
- case 'É': mir_tstrcat(newStr, L"Y"); break;
- case 'Ê': mir_tstrcat(newStr, L"K"); break;
- case 'Ë': mir_tstrcat(newStr, L"L"); break;
- case 'Ì': mir_tstrcat(newStr, L"M"); break;
- case 'Í': mir_tstrcat(newStr, L"N"); break;
- case 'Î': mir_tstrcat(newStr, L"O"); break;
- case 'Ï': mir_tstrcat(newStr, L"P"); break;
- case 'Ð': mir_tstrcat(newStr, L"R"); break;
- case 'Ñ': mir_tstrcat(newStr, L"S"); break;
- case 'Ò': mir_tstrcat(newStr, L"T"); break;
- case 'Ó': mir_tstrcat(newStr, L"U"); break;
- case 'Ô': mir_tstrcat(newStr, L"F"); break;
- case 'Õ': mir_tstrcat(newStr, L"Kh"); break;
- case 'Ö': mir_tstrcat(newStr, L"Ts"); break;
- case '×': mir_tstrcat(newStr, L"Ch"); break;
- case 'Ø': mir_tstrcat(newStr, L"Sh"); break;
- case 'Ù': mir_tstrcat(newStr, L"Sch"); break;
- case 'Ú': mir_tstrcat(newStr, L"'"); break;
- case 'Û': mir_tstrcat(newStr, L"Yi"); break;
- case 'Ü': mir_tstrcat(newStr, L""); break;
- case 'Ý': mir_tstrcat(newStr, L"E"); break;
- case 'Þ': mir_tstrcat(newStr, L"Yu"); break;
- case 'ß': mir_tstrcat(newStr, L"Ya"); break;
-
- case 'a': mir_tstrcat(newStr, L"à"); break;
- case 'b': mir_tstrcat(newStr, L"á"); break;
- case 'v': mir_tstrcat(newStr, L"â"); break;
- case 'g': mir_tstrcat(newStr, L"ã"); break;
- case 'd': mir_tstrcat(newStr, L"ä"); break;
- case 'e': mir_tstrcat(newStr, L"å"); break;
+ case 'à': mir_wstrcat(newStr, L"a"); break;
+ case 'á': mir_wstrcat(newStr, L"b"); break;
+ case 'â': mir_wstrcat(newStr, L"v"); break;
+ case 'ã': mir_wstrcat(newStr, L"g"); break;
+ case 'ä': mir_wstrcat(newStr, L"d"); break;
+ case 'å': mir_wstrcat(newStr, L"e"); break;
+ case '¸': mir_wstrcat(newStr, L"ye"); break;
+ case 'æ': mir_wstrcat(newStr, L"zh"); break;
+ case 'ç': mir_wstrcat(newStr, L"z"); break;
+ case 'è': mir_wstrcat(newStr, L"i"); break;
+ case 'é': mir_wstrcat(newStr, L"y"); break;
+ case 'ê': mir_wstrcat(newStr, L"k"); break;
+ case 'ë': mir_wstrcat(newStr, L"l"); break;
+ case 'ì': mir_wstrcat(newStr, L"m"); break;
+ case 'í': mir_wstrcat(newStr, L"n"); break;
+ case 'î': mir_wstrcat(newStr, L"o"); break;
+ case 'ï': mir_wstrcat(newStr, L"p"); break;
+ case 'ð': mir_wstrcat(newStr, L"r"); break;
+ case 'ñ': mir_wstrcat(newStr, L"s"); break;
+ case 'ò': mir_wstrcat(newStr, L"t"); break;
+ case 'ó': mir_wstrcat(newStr, L"u"); break;
+ case 'ô': mir_wstrcat(newStr, L"f"); break;
+ case 'õ': mir_wstrcat(newStr, L"kh"); break;
+ case 'ö': mir_wstrcat(newStr, L"ts"); break;
+ case '÷': mir_wstrcat(newStr, L"ch"); break;
+ case 'ø': mir_wstrcat(newStr, L"sh"); break;
+ case 'ù': mir_wstrcat(newStr, L"sch"); break;
+ case 'ú': mir_wstrcat(newStr, L"'"); break;
+ case 'û': mir_wstrcat(newStr, L"yi"); break;
+ case 'ü': mir_wstrcat(newStr, L""); break;
+ case 'ý': mir_wstrcat(newStr, L"e"); break;
+ case 'þ': mir_wstrcat(newStr, L"yu"); break;
+ case 'ÿ': mir_wstrcat(newStr, L"ya"); break;
+ case 'À': mir_wstrcat(newStr, L"A"); break;
+ case 'Á': mir_wstrcat(newStr, L"B"); break;
+ case 'Â': mir_wstrcat(newStr, L"V"); break;
+ case 'Ã': mir_wstrcat(newStr, L"G"); break;
+ case 'Ä': mir_wstrcat(newStr, L"D"); break;
+ case 'Å': mir_wstrcat(newStr, L"E"); break;
+ case '¨': mir_wstrcat(newStr, L"Ye"); break;
+ case 'Æ': mir_wstrcat(newStr, L"Zh"); break;
+ case 'Ç': mir_wstrcat(newStr, L"Z"); break;
+ case 'È': mir_wstrcat(newStr, L"I"); break;
+ case 'É': mir_wstrcat(newStr, L"Y"); break;
+ case 'Ê': mir_wstrcat(newStr, L"K"); break;
+ case 'Ë': mir_wstrcat(newStr, L"L"); break;
+ case 'Ì': mir_wstrcat(newStr, L"M"); break;
+ case 'Í': mir_wstrcat(newStr, L"N"); break;
+ case 'Î': mir_wstrcat(newStr, L"O"); break;
+ case 'Ï': mir_wstrcat(newStr, L"P"); break;
+ case 'Ð': mir_wstrcat(newStr, L"R"); break;
+ case 'Ñ': mir_wstrcat(newStr, L"S"); break;
+ case 'Ò': mir_wstrcat(newStr, L"T"); break;
+ case 'Ó': mir_wstrcat(newStr, L"U"); break;
+ case 'Ô': mir_wstrcat(newStr, L"F"); break;
+ case 'Õ': mir_wstrcat(newStr, L"Kh"); break;
+ case 'Ö': mir_wstrcat(newStr, L"Ts"); break;
+ case '×': mir_wstrcat(newStr, L"Ch"); break;
+ case 'Ø': mir_wstrcat(newStr, L"Sh"); break;
+ case 'Ù': mir_wstrcat(newStr, L"Sch"); break;
+ case 'Ú': mir_wstrcat(newStr, L"'"); break;
+ case 'Û': mir_wstrcat(newStr, L"Yi"); break;
+ case 'Ü': mir_wstrcat(newStr, L""); break;
+ case 'Ý': mir_wstrcat(newStr, L"E"); break;
+ case 'Þ': mir_wstrcat(newStr, L"Yu"); break;
+ case 'ß': mir_wstrcat(newStr, L"Ya"); break;
+
+ case 'a': mir_wstrcat(newStr, L"à"); break;
+ case 'b': mir_wstrcat(newStr, L"á"); break;
+ case 'v': mir_wstrcat(newStr, L"â"); break;
+ case 'g': mir_wstrcat(newStr, L"ã"); break;
+ case 'd': mir_wstrcat(newStr, L"ä"); break;
+ case 'e': mir_wstrcat(newStr, L"å"); break;
case 'z':
{
if (str[1] == 'h') {
- mir_tstrcat(newStr, L"æ");
+ mir_wstrcat(newStr, L"æ");
str++;
break;
}
else {
- mir_tstrcat(newStr, L"ç");
+ mir_wstrcat(newStr, L"ç");
break;
}
}
- case 'i': mir_tstrcat(newStr, L"è"); break;
+ case 'i': mir_wstrcat(newStr, L"è"); break;
case 'y':
{
if (str[1] == 'a') {
- mir_tstrcat(newStr, L"ÿ");
+ mir_wstrcat(newStr, L"ÿ");
str++;
break;
}
else if (str[1] == 'e') {
- mir_tstrcat(newStr, L"¸");
+ mir_wstrcat(newStr, L"¸");
str++;
break;
}
else if (str[1] == 'u') {
- mir_tstrcat(newStr, L"þ");
+ mir_wstrcat(newStr, L"þ");
str++;
break;
}
else if (str[1] == 'i') {
- mir_tstrcat(newStr, L"û");
+ mir_wstrcat(newStr, L"û");
str++;
break;
}
else {
- mir_tstrcat(newStr, L"é");
+ mir_wstrcat(newStr, L"é");
break;
}
}
case 'k':
{
if (str[1] == 'h') {
- mir_tstrcat(newStr, L"õ");
+ mir_wstrcat(newStr, L"õ");
str++;
break;
}
else {
- mir_tstrcat(newStr, L"ê");
+ mir_wstrcat(newStr, L"ê");
break;
}
}
- case 'l': mir_tstrcat(newStr, L"ë"); break;
- case 'm': mir_tstrcat(newStr, L"ì"); break;
- case 'n': mir_tstrcat(newStr, L"í"); break;
- case 'o': mir_tstrcat(newStr, L"î"); break;
- case 'p': mir_tstrcat(newStr, L"ï"); break;
- case 'r': mir_tstrcat(newStr, L"ð"); break;
+ case 'l': mir_wstrcat(newStr, L"ë"); break;
+ case 'm': mir_wstrcat(newStr, L"ì"); break;
+ case 'n': mir_wstrcat(newStr, L"í"); break;
+ case 'o': mir_wstrcat(newStr, L"î"); break;
+ case 'p': mir_wstrcat(newStr, L"ï"); break;
+ case 'r': mir_wstrcat(newStr, L"ð"); break;
case 's':
{
if (str[1] == 'h') {
- mir_tstrcat(newStr, L"ø");
+ mir_wstrcat(newStr, L"ø");
str++;
break;
}
else if (str[1] == 'c' && str[2] == 'h') {
- mir_tstrcat(newStr, L"ù");
+ mir_wstrcat(newStr, L"ù");
str += 2;
break;
}
else {
- mir_tstrcat(newStr, L"ñ");
+ mir_wstrcat(newStr, L"ñ");
break;
}
}
case 't':
{
if (str[1] == 's') {
- mir_tstrcat(newStr, L"ö");
+ mir_wstrcat(newStr, L"ö");
str++;
break;
}
else {
- mir_tstrcat(newStr, L"ò");
+ mir_wstrcat(newStr, L"ò");
break;
}
}
- case 'u': mir_tstrcat(newStr, L"ó"); break;
- case 'f': mir_tstrcat(newStr, L"ô"); break;
+ case 'u': mir_wstrcat(newStr, L"ó"); break;
+ case 'f': mir_wstrcat(newStr, L"ô"); break;
case 'c':
{
if (str[1] == 'h') {
- mir_tstrcat(newStr, L"÷");
+ mir_wstrcat(newStr, L"÷");
str++;
break;
}
}
- case 'A': mir_tstrcat(newStr, L"À"); break;
- case 'B': mir_tstrcat(newStr, L"Á"); break;
- case 'V': mir_tstrcat(newStr, L"Â"); break;
- case 'G': mir_tstrcat(newStr, L"Ã"); break;
- case 'D': mir_tstrcat(newStr, L"Ä"); break;
- case 'E': mir_tstrcat(newStr, L"Å"); break;
+ case 'A': mir_wstrcat(newStr, L"À"); break;
+ case 'B': mir_wstrcat(newStr, L"Á"); break;
+ case 'V': mir_wstrcat(newStr, L"Â"); break;
+ case 'G': mir_wstrcat(newStr, L"Ã"); break;
+ case 'D': mir_wstrcat(newStr, L"Ä"); break;
+ case 'E': mir_wstrcat(newStr, L"Å"); break;
case 'Y':
{
if (str[1] == 'a') {
- mir_tstrcat(newStr, L"ß");
+ mir_wstrcat(newStr, L"ß");
str++;
break;
}
else if (str[1] == 'e') {
- mir_tstrcat(newStr, L"¨");
+ mir_wstrcat(newStr, L"¨");
str++;
break;
}
else if (str[1] == 'u') {
- mir_tstrcat(newStr, L"Þ");
+ mir_wstrcat(newStr, L"Þ");
str++;
break;
}
else if (str[1] == 'i') {
- mir_tstrcat(newStr, L"Û");
+ mir_wstrcat(newStr, L"Û");
str++;
break;
}
else {
- mir_tstrcat(newStr, L"É");
+ mir_wstrcat(newStr, L"É");
break;
}
}
case 'Z':
{
if (str[1] == 'h') {
- mir_tstrcat(newStr, L"Æ");
+ mir_wstrcat(newStr, L"Æ");
str++;
break;
}
else {
- mir_tstrcat(newStr, L"Ç");
+ mir_wstrcat(newStr, L"Ç");
break;
}
}
- case 'I': mir_tstrcat(newStr, L"È"); break;
+ case 'I': mir_wstrcat(newStr, L"È"); break;
case 'K':
{
if (str[1] == 'h') {
- mir_tstrcat(newStr, L"Õ");
+ mir_wstrcat(newStr, L"Õ");
str++;
break;
}
else {
- mir_tstrcat(newStr, L"Ê");
+ mir_wstrcat(newStr, L"Ê");
break;
}
}
- case 'L': mir_tstrcat(newStr, L"Ë"); break;
- case 'M': mir_tstrcat(newStr, L"Ì"); break;
- case 'N': mir_tstrcat(newStr, L"Í"); break;
- case 'O': mir_tstrcat(newStr, L"Î"); break;
- case 'P': mir_tstrcat(newStr, L"Ï"); break;
- case 'R': mir_tstrcat(newStr, L"Ð"); break;
+ case 'L': mir_wstrcat(newStr, L"Ë"); break;
+ case 'M': mir_wstrcat(newStr, L"Ì"); break;
+ case 'N': mir_wstrcat(newStr, L"Í"); break;
+ case 'O': mir_wstrcat(newStr, L"Î"); break;
+ case 'P': mir_wstrcat(newStr, L"Ï"); break;
+ case 'R': mir_wstrcat(newStr, L"Ð"); break;
case 'S':
{
if (str[1] == 'h') {
- mir_tstrcat(newStr, L"Ø");
+ mir_wstrcat(newStr, L"Ø");
str++;
break;
}
else if (str[1] == 'c' && str[2] == 'h') {
- mir_tstrcat(newStr, L"Ù");
+ mir_wstrcat(newStr, L"Ù");
str += 2;
break;
}
else {
- mir_tstrcat(newStr, L"Ñ");
+ mir_wstrcat(newStr, L"Ñ");
break;
}
}
case 'T':
{
if (str[1] == 's') {
- mir_tstrcat(newStr, L"Ö");
+ mir_wstrcat(newStr, L"Ö");
str++;
break;
}
else {
- mir_tstrcat(newStr, L"Ò");
+ mir_wstrcat(newStr, L"Ò");
break;
}
}
- case 'U': mir_tstrcat(newStr, L"Ó"); break;
- case 'F': mir_tstrcat(newStr, L"Ô"); break;
+ case 'U': mir_wstrcat(newStr, L"Ó"); break;
+ case 'F': mir_wstrcat(newStr, L"Ô"); break;
case 'C':
{
if (str[1] == 'h') {
- mir_tstrcat(newStr, L"×");
+ mir_wstrcat(newStr, L"×");
str++;
break;
}
}
- case '\'': mir_tstrcat(newStr, L"ú"); break;
+ case '\'': mir_wstrcat(newStr, L"ú"); break;
- default: { wchar_t Temp[2] = { str[0], 0 }; mir_tstrcat(newStr, &Temp[0]); }
+ default: { wchar_t Temp[2] = { str[0], 0 }; mir_wstrcat(newStr, &Temp[0]); }
}
}
- size_t len = mir_tstrlen(newStr);
+ size_t len = mir_wstrlen(newStr);
str = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
str[0] = 0;
- mir_tstrcpy(str, newStr);
+ mir_wstrcpy(str, newStr);
mir_free(newStr);
}
@@ -376,9 +376,9 @@ void SwitchLayout(bool lastword) wchar_t szClassName[MAX_PATH];
GetClassName(hwnd2, szClassName, _countof(szClassName));
- if ((mir_tstrcmp(szClassName, L"THppRichEdit.UnicodeClass") == 0 || mir_tstrcmp(szClassName, L"THistoryGrid.UnicodeClass") == 0 || mir_tstrcmp(szClassName, L"TExtHistoryGrid.UnicodeClass") == 0 || mir_tstrcmp(szClassName, L"Internet Explorer_Server") == 0) && ServiceExists(MS_POPUP_SHOWMESSAGE)) { // make popup here
+ if ((mir_wstrcmp(szClassName, L"THppRichEdit.UnicodeClass") == 0 || mir_wstrcmp(szClassName, L"THistoryGrid.UnicodeClass") == 0 || mir_wstrcmp(szClassName, L"TExtHistoryGrid.UnicodeClass") == 0 || mir_wstrcmp(szClassName, L"Internet Explorer_Server") == 0) && ServiceExists(MS_POPUP_SHOWMESSAGE)) { // make popup here
wchar_t buf[2048];
- if (mir_tstrcmp(szClassName, L"Internet Explorer_Server") == 0) {
+ if (mir_wstrcmp(szClassName, L"Internet Explorer_Server") == 0) {
IEVIEWEVENT event;
HWND hwnd3 = GetParent(GetParent(hwnd2));
memset(&event, 0, sizeof(event));
@@ -388,11 +388,11 @@ void SwitchLayout(bool lastword) event.iType = IEE_GET_SELECTION;
event.hwnd = hwnd3;
wchar_t *selected = (wchar_t *)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
- mir_tstrncpy(buf, selected, _countof(buf));
+ mir_wstrncpy(buf, selected, _countof(buf));
}
else GetWindowText(hwnd2, buf, _countof(buf)); // gimme, gimme, gimme...
- size_t slen = mir_tstrlen(buf);
+ size_t slen = mir_wstrlen(buf);
if (slen != 0) {
HKL hkl;
ActivateKeyboardLayout((HKL)HKL_NEXT, KLF_ACTIVATE); // go to next layout before....
@@ -429,12 +429,12 @@ void SwitchLayout(bool lastword) POPUPDATAT pd = { 0 };
pd.lchIcon = IcoLib_GetIcon("Switch Layout and Send");
- mir_tstrncpy(pd.lptzText, buf, _countof(pd.lptzText));
- mir_tstrncpy(pd.lptzContactName, TranslateT("TranslitSwitcher"), _countof(pd.lptzContactName));
+ mir_wstrncpy(pd.lptzText, buf, _countof(pd.lptzText));
+ mir_wstrncpy(pd.lptzContactName, TranslateT("TranslitSwitcher"), _countof(pd.lptzContactName));
PUAddPopupT(&pd);
}
}
- else if (mir_tstrcmpi(szClassName, L"RichEdit50W") == 0) {
+ else if (mir_wstrcmpi(szClassName, L"RichEdit50W") == 0) {
size_t i, start = 0, end = 0;
SHORT vks;
BYTE keys[256] = { 0 };
@@ -447,7 +447,7 @@ void SwitchLayout(bool lastword) dwFlags += SFF_SELECTION;
wchar_t *sel = Message_GetFromStream(hwnd2, dwFlags);
- size_t slen = mir_tstrlen(sel);
+ size_t slen = mir_wstrlen(sel);
if (slen != 0) {
if (ServiceExists(MS_SMILEYADD_BATCHPARSE)) {
memset(&smgp, 0, sizeof(smgp));
@@ -515,7 +515,7 @@ void TranslitLayout(bool lastword) wchar_t szClassName[16];
GetClassName(hwnd2, szClassName, _countof(szClassName));
- if (mir_tstrcmpi(szClassName, L"RichEdit50W") != 0)
+ if (mir_wstrcmpi(szClassName, L"RichEdit50W") != 0)
return;
DWORD dwStart, dwEnd, dwFlags = SF_TEXT | SF_UNICODE;
@@ -525,7 +525,7 @@ void TranslitLayout(bool lastword) dwFlags += SFF_SELECTION;
wchar_t *boo, *sel = Message_GetFromStream(hwnd2, dwFlags);
- size_t slen = mir_tstrlen(sel), start = 0, end = 0;
+ size_t slen = mir_wstrlen(sel), start = 0, end = 0;
if (slen != 0) {
end = slen;
if (lastword && !somethingIsSelected) {
@@ -542,12 +542,12 @@ void TranslitLayout(bool lastword) start--;
}
boo = (wchar_t*)mir_alloc((end - start + 1) * sizeof(wchar_t));
- mir_tstrncpy(boo, sel + start, end - start);
+ mir_wstrncpy(boo, sel + start, end - start);
boo[end - start] = 0;
}
else {
boo = (wchar_t*)mir_alloc((slen + 1) * sizeof(wchar_t));
- mir_tstrcpy(boo, sel);
+ mir_wstrcpy(boo, sel);
}
Transliterate(boo);
@@ -555,11 +555,11 @@ void TranslitLayout(bool lastword) if (somethingIsSelected)
SendMessage(hwnd2, EM_REPLACESEL, false, (LPARAM)boo);
else {
- wchar_t *NewText = (wchar_t*)mir_alloc((start + mir_tstrlen(boo) + (slen - start) + 1) * sizeof(wchar_t));
+ wchar_t *NewText = (wchar_t*)mir_alloc((start + mir_wstrlen(boo) + (slen - start) + 1) * sizeof(wchar_t));
NewText[0] = 0;
- mir_tstrncat(NewText, sel, start);
- mir_tstrcat(NewText, boo);
- mir_tstrncat(NewText, sel + end, slen - end);
+ mir_wstrncat(NewText, sel, start);
+ mir_wstrcat(NewText, boo);
+ mir_wstrncat(NewText, sel + end, slen - end);
SetWindowText(hwnd2, NewText);
mir_free(NewText);
}
@@ -583,7 +583,7 @@ void InvertCase(bool lastword) wchar_t szClassName[16];
GetClassName(hwnd2, szClassName, _countof(szClassName));
- if (mir_tstrcmpi(szClassName, L"RichEdit50W") != 0)
+ if (mir_wstrcmpi(szClassName, L"RichEdit50W") != 0)
return;
DWORD dwStart, dwEnd, dwFlags = SF_TEXT | SF_UNICODE;
@@ -593,7 +593,7 @@ void InvertCase(bool lastword) dwFlags += SFF_SELECTION;
wchar_t *boo, *sel = Message_GetFromStream(hwnd2, dwFlags);
- size_t slen = mir_tstrlen(sel), start = 0, end = 0;
+ size_t slen = mir_wstrlen(sel), start = 0, end = 0;
if (slen != 0) {
end = slen;
if (lastword && !somethingIsSelected) {
@@ -610,12 +610,12 @@ void InvertCase(bool lastword) start--;
}
boo = (wchar_t*)mir_alloc((end - start + 1) * sizeof(wchar_t));
- mir_tstrncpy(boo, sel + start, end - start);
+ mir_wstrncpy(boo, sel + start, end - start);
boo[end - start] = 0;
}
else {
boo = (wchar_t*)mir_alloc((slen + 1) * sizeof(wchar_t));
- mir_tstrcpy(boo, sel);
+ mir_wstrcpy(boo, sel);
}
Invert(boo);
@@ -623,11 +623,11 @@ void InvertCase(bool lastword) if (somethingIsSelected)
SendMessage(hwnd2, EM_REPLACESEL, false, (LPARAM)boo);
else {
- wchar_t *NewText = (wchar_t*)mir_alloc((start + mir_tstrlen(boo) + (slen - start) + 1) * sizeof(wchar_t));
+ wchar_t *NewText = (wchar_t*)mir_alloc((start + mir_wstrlen(boo) + (slen - start) + 1) * sizeof(wchar_t));
NewText[0] = 0;
- mir_tstrncat(NewText, sel, start);
- mir_tstrcat(NewText, boo);
- mir_tstrncat(NewText, sel + end, slen - end);
+ mir_wstrncat(NewText, sel, start);
+ mir_wstrcat(NewText, boo);
+ mir_wstrncat(NewText, sel + end, slen - end);
SetWindowText(hwnd2, NewText);
mir_free(NewText);
}
@@ -665,7 +665,7 @@ int OnButtonPressed(WPARAM, LPARAM lParam) SetKeyboardState(byKeybState);
wchar_t *sel = Message_GetFromStream(hEdit, SF_TEXT | SF_UNICODE);
- size_t slen = mir_tstrlen(sel);
+ size_t slen = mir_wstrlen(sel);
if (slen != 0) {
switch (iType) {
case 3: Invert(sel); break;
@@ -705,13 +705,13 @@ int OnButtonPressed(WPARAM, LPARAM lParam) }
}
- ptrT tszSymbol(db_get_tsa(NULL, "TranslitSwitcher", "ResendSymbol"));
+ ptrW tszSymbol(db_get_tsa(NULL, "TranslitSwitcher", "ResendSymbol"));
if (!tszSymbol && sel) {
SetWindowText(hEdit, sel);
SendMessage(hEdit, EM_SETSEL, 0, (LPARAM)slen);
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
}
- else if (sel && !mir_tstrncmp(sel, tszSymbol, mir_tstrlen(tszSymbol))) {
+ else if (sel && !mir_wstrncmp(sel, tszSymbol, mir_wstrlen(tszSymbol))) {
SetWindowText(hEdit, sel);
SendMessage(hEdit, EM_SETSEL, 0, (LPARAM)slen);
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp index 2d591663ba..3f37ede40b 100644 --- a/plugins/UserGuide/src/main.cpp +++ b/plugins/UserGuide/src/main.cpp @@ -28,28 +28,28 @@ static INT_PTR ShowGuideFile(WPARAM, LPARAM) if (ptszHelpFile==0)
{
- mir_tstrcpy(pszDirName, L"%miranda_path%\\Plugins");
- mir_tstrcpy(pszFileName, L"UserGuide.chm");
+ mir_wstrcpy(pszDirName, L"%miranda_path%\\Plugins");
+ mir_wstrcpy(pszFileName, L"UserGuide.chm");
}
else
{
- if(!mir_tstrcmp(ptszHelpFile, L""))
+ if(!mir_wstrcmp(ptszHelpFile, L""))
{
- mir_tstrcpy(pszDirName, L"%miranda_path%\\Plugins");
- mir_tstrcpy(pszFileName, L"UserGuide.chm");
+ mir_wstrcpy(pszDirName, L"%miranda_path%\\Plugins");
+ mir_wstrcpy(pszFileName, L"UserGuide.chm");
}
else
{
LPTSTR pszDivider = wcsrchr(ptszHelpFile, '\\');
if (pszDivider == NULL)
{
- mir_tstrcpy(pszDirName, L"");
- wcsncpy(pszFileName, ptszHelpFile, mir_tstrlen(ptszHelpFile));
+ mir_wstrcpy(pszDirName, L"");
+ wcsncpy(pszFileName, ptszHelpFile, mir_wstrlen(ptszHelpFile));
}
else
{
- wcsncpy(pszFileName, pszDivider + 1, mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1);
- pszFileName[mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1] = 0;
+ wcsncpy(pszFileName, pszDivider + 1, mir_wstrlen(ptszHelpFile) - mir_wstrlen(pszDivider) - 1);
+ pszFileName[mir_wstrlen(ptszHelpFile) - mir_wstrlen(pszDivider) - 1] = 0;
wcsncpy(pszDirName, ptszHelpFile, pszDivider - ptszHelpFile);
pszDirName[pszDivider - ptszHelpFile] = 0;
}
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index 445928a641..2eb24aff20 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -347,7 +347,7 @@ void InitIcons() sid.flags = SIDF_SORTED | SIDF_TCHAR;
for (int i=0; i < nCountriesCount; i++) {
- sid.description.w = mir_a2t(LPGEN(countries[i].szName));
+ sid.description.w = mir_a2u(LPGEN(countries[i].szName));
/* create identifier */
mir_snprintf(szId, (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */
int index = CountryNumberToBitmapIndex(countries[i].id);
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 2bf0c62670..b4f9ed84fd 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -687,7 +687,7 @@ static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *p pOldCustomDate->DateFormat(szoldDate, _countof(szoldDate));
pNewProtoDate->DateFormat(szDate, _countof(szDate));
- mir_sntprintf(szMsg,
+ mir_snwprintf(szMsg,
TranslateT("%s provides a new birthday via protocol.\nIt is %s. The old one was %s.\n\nDo you want to use this as the new birthday for this contact?"),
DB::Contact::DisplayName(hContact), szDate, szoldDate);
diff --git a/plugins/UserInfoEx/src/classMTime.cpp b/plugins/UserInfoEx/src/classMTime.cpp index 03cc310118..cb3a485fad 100644 --- a/plugins/UserInfoEx/src/classMTime.cpp +++ b/plugins/UserInfoEx/src/classMTime.cpp @@ -367,8 +367,8 @@ WORD MTime::DateFormatAlt(LPTSTR ptszTimeFormat, WORD cchTimeFormat) _itow(mtNow.Year(), tszText, 10);
wchar_t * tszYear = wcsstr(ptszTimeFormat, tszText);
- if (tszYear && mir_tstrlen(tszYear) == 4)
- mir_tstrcpy(tszYear, L"????");
+ if (tszYear && mir_wstrlen(tszYear) == 4)
+ mir_wstrcpy(tszYear, L"????");
else {
*ptszTimeFormat = 0;
return 0;
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index ba83d12e61..8108f38d2d 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -130,7 +130,7 @@ int CPsTree::AddDummyItem(LPCSTR pszGroup) OPTIONSDIALOGPAGE odp = { 0 }; odp.hInstance = ghInst; odp.flags = ODPF_TCHAR; - odp.pwszTitle = mir_utf8decodeT(pszGroup); + odp.pwszTitle = mir_utf8decodeW(pszGroup); INT_PTR rc = UserInfo_AddPage((WPARAM)&psh, &odp); mir_free(odp.pwszTitle); diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 2035874a55..22d6872017 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -31,7 +31,7 @@ BOOL CALLBACK BoldGroupTitlesEnumChildren(HWND hWnd, LPARAM lParam) {
wchar_t szClass[64];
GetClassName(hWnd, szClass, 64);
- if (!mir_tstrcmp(szClass, L"Button") && (GetWindowLongPtr(hWnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX)
+ if (!mir_wstrcmp(szClass, L"Button") && (GetWindowLongPtr(hWnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX)
SendMessage(hWnd, WM_SETFONT, lParam, NULL);
return TRUE;
}
@@ -211,7 +211,7 @@ BYTE CPsTreeItem::HasName(const LPCSTR pszName) const void CPsTreeItem::Rename(const LPTSTR pszLabel)
{
if (pszLabel && *pszLabel) {
- LPTSTR pszDup = mir_tstrdup(pszLabel);
+ LPTSTR pszDup = mir_wstrdup(pszLabel);
if (pszDup) {
if (_ptszLabel)
mir_free(_ptszLabel);
@@ -253,9 +253,9 @@ int CPsTreeItem::ItemLabel(const BYTE bReadDBValue) else
pszName = _pszName;
- LPTSTR ptszLabel = mir_utf8decodeT(pszName);
+ LPTSTR ptszLabel = mir_utf8decodeW(pszName);
if (ptszLabel) {
- _ptszLabel = mir_tstrdup(TranslateTS(ptszLabel));
+ _ptszLabel = mir_wstrdup(TranslateTS(ptszLabel));
mir_free(ptszLabel);
}
}
@@ -279,7 +279,7 @@ HICON CPsTreeItem::ProtoIcon() int ProtoCount;
Proto_EnumAccounts(&ProtoCount, &pa);
for (int i = 0; i < ProtoCount; i++) {
- if (!mir_tstrncmpi(pa[i]->tszAccountName, _A2T(_pszName), mir_tstrlen(pa[i]->tszAccountName))) {
+ if (!mir_wstrncmpi(pa[i]->tszAccountName, _A2T(_pszName), mir_wstrlen(pa[i]->tszAccountName))) {
CHAR szIconID[MAX_PATH];
mir_snprintf(szIconID, "core_status_%s1", pa[i]->szModuleName);
HICON hIco = IcoLib_GetIcon(szIconID);
@@ -403,15 +403,15 @@ int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp) if (pPsh->_dwFlags & PSF_PROTOPAGESONLY) {
if (_dwFlags & ODPF_USERINFOTAB)
- mir_sntprintf(szTitle, L"%s %d\\%s", odp->pwszTitle, pPsh->_nSubContact+1, odp->pwszTab);
+ mir_snwprintf(szTitle, L"%s %d\\%s", odp->pwszTitle, pPsh->_nSubContact+1, odp->pwszTab);
else
- mir_sntprintf(szTitle, L"%s %d", odp->pwszTitle, pPsh->_nSubContact+1);
+ mir_snwprintf(szTitle, L"%s %d", odp->pwszTitle, pPsh->_nSubContact+1);
}
else {
if (_dwFlags & ODPF_USERINFOTAB)
- mir_sntprintf(szTitle, L"%s\\%s", odp->pwszTitle, odp->pwszTab);
+ mir_snwprintf(szTitle, L"%s\\%s", odp->pwszTitle, odp->pwszTab);
else
- mir_tstrcpy(szTitle, odp->pwszTitle);
+ mir_wstrcpy(szTitle, odp->pwszTitle);
}
// set the unique utf8 encoded name for the item
if (err = Name(szTitle, (_dwFlags & ODPF_UNICODE) == ODPF_UNICODE))
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index a8fcf14a4d..3755643b45 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -404,7 +404,7 @@ INT_PTR CAnnivEditCtrl::SetCurSel(WORD wIndex) }
else {
wchar_t szText[MAX_DESC];
- mir_sntprintf(szText, L"'%s'", TranslateT("Unspecified"));
+ mir_snwprintf(szText, L"'%s'", TranslateT("Unspecified"));
DateTime_SetSystemtime(_hwndDate, GDT_NONE, NULL);
DateTime_SetFormat(_hwndDate, szText);
}
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index ae37e6eaac..1e882cdfa9 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -65,7 +65,7 @@ typedef struct TComboEx static int compareProc(LPCVOID cbi1, LPCVOID cbi2)
{
- return mir_tstrcmp(((LPCBEXITEMINTERN)cbi1)->szCat, ((LPCBEXITEMINTERN)cbi2)->szCat);
+ return mir_wstrcmp(((LPCBEXITEMINTERN)cbi1)->szCat, ((LPCBEXITEMINTERN)cbi2)->szCat);
}
static int CheckPhoneSyntax(LPTSTR pszSrc, LPTSTR szNumber, WORD cchNumber, int& errorPos)
@@ -211,7 +211,7 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM *(pszAdd + 1) != '.' &&
(pszDot = wcschr(pszAdd, '.')) &&
*(pszDot + 1) &&
- mir_tstrcmp(szText, cbi->pszVal)));
+ mir_wstrcmp(szText, cbi->pszVal)));
}
}
break;
@@ -328,7 +328,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam GetDlgItemText(hDlg, EDIT_AREA, szArea, _countof(szArea));
GetDlgItemText(hDlg, EDIT_NUMBER, szData, _countof(szData));
- mir_sntprintf(szPhone, L"+%u (%s) %s", nCountry, szArea, szData);
+ mir_snwprintf(szPhone, L"+%u (%s) %s", nCountry, szArea, szData);
noRecursion = 1;
SetDlgItemText(hDlg, EDIT_PHONE, szPhone);
noRecursion = 0;
@@ -780,7 +780,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L !cbex->pItems ||
cbex->iSelectedItem < 0 ||
cbex->iSelectedItem >= cbex->numItems ||
- FAILED(mir_sntprintf(szMsg, TranslateT("Do you really want to delete the current selected item?\n\t%s\n\t%s"),
+ FAILED(mir_snwprintf(szMsg, TranslateT("Do you really want to delete the current selected item?\n\t%s\n\t%s"),
cbex->pItems[cbex->iSelectedItem].szCat, cbex->pItems[cbex->iSelectedItem].pszVal))
)
{
@@ -866,7 +866,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L SendMessage(hDlgDetails, PSM_GETCONTACT, NULL, (LPARAM)&hContact);
if ((cbex->pItems[cbex->iSelectedItem].wFlags & CTRLF_CHANGED) && !(hContact && (cbex->pItems[cbex->iSelectedItem].wFlags & CTRLF_HASCUSTOM))) return 0;
- if (*szVal == 0 || !cbex->pItems[cbex->iSelectedItem].pszVal || mir_tstrcmp(szVal, cbex->pItems[cbex->iSelectedItem].pszVal)) {
+ if (*szVal == 0 || !cbex->pItems[cbex->iSelectedItem].pszVal || mir_wstrcmp(szVal, cbex->pItems[cbex->iSelectedItem].pszVal)) {
cbex->pItems[cbex->iSelectedItem].wFlags |= CTRLF_CHANGED;
cbex->pItems[cbex->iSelectedItem].wFlags |= (hContact ? CTRLF_HASCUSTOM : CTRLF_HASPROTO);
cbex->bIsChanged = TRUE;
@@ -945,13 +945,13 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L cbex->pItems[cbex->numItems].dwID = (pItem->wMask & CBEXIM_ID) ? pItem->dwID : 0;
// set category string
- if (!pItem->pszCat || !pItem->pszCat[0] || !mir_tstrncpy(cbex->pItems[cbex->numItems].szCat, pItem->pszCat, MAX_CAT)) {
- mir_sntprintf(cbex->pItems[cbex->numItems].szCat, L"%s %d", TranslateT("Other"), ++cbex->numOther);
+ if (!pItem->pszCat || !pItem->pszCat[0] || !mir_wstrncpy(cbex->pItems[cbex->numItems].szCat, pItem->pszCat, MAX_CAT)) {
+ mir_snwprintf(cbex->pItems[cbex->numItems].szCat, L"%s %d", TranslateT("Other"), ++cbex->numOther);
}
// set value string
if ((pItem->wMask & CBEXIM_VAL) && pItem->pszVal && pItem->pszVal[0])
- cbex->pItems[cbex->numItems].pszVal = mir_tstrdup(pItem->pszVal);
+ cbex->pItems[cbex->numItems].pszVal = mir_wstrdup(pItem->pszVal);
else
cbex->pItems[cbex->numItems].pszVal = NULL;
// set icon
@@ -985,8 +985,8 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L // set new category string
if (pItem->wMask & CBEXIM_CAT) {
// set category string
- if (!pItem->pszCat || !pItem->pszCat[0] || !mir_tstrncpy(cbex->pItems[pItem->iItem].szCat, pItem->pszCat, _countof(cbex->pItems[pItem->iItem].szCat)))
- mir_sntprintf(cbex->pItems[pItem->iItem].szCat, L"%s %d", TranslateT("Other"), ++cbex->numOther);
+ if (!pItem->pszCat || !pItem->pszCat[0] || !mir_wstrncpy(cbex->pItems[pItem->iItem].szCat, pItem->pszCat, _countof(cbex->pItems[pItem->iItem].szCat)))
+ mir_snwprintf(cbex->pItems[pItem->iItem].szCat, L"%s %d", TranslateT("Other"), ++cbex->numOther);
if (pItem->iItem == cbex->iSelectedItem)
SetWindowText(cbex->hBtnEdit, cbex->pItems[pItem->iItem].szCat);
}
@@ -994,7 +994,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (pItem->wMask & CBEXIM_VAL) {
MIR_FREE(cbex->pItems[pItem->iItem].pszVal);
if (pItem->pszVal && pItem->pszVal[0])
- cbex->pItems[pItem->iItem].pszVal = mir_tstrdup(pItem->pszVal);
+ cbex->pItems[pItem->iItem].pszVal = mir_wstrdup(pItem->pszVal);
if (pItem->iItem == cbex->iSelectedItem)
SetWindowText(cbex->hEdit, cbex->pItems[pItem->iItem].pszVal ? cbex->pItems[pItem->iItem].pszVal : L"");
}
@@ -1049,14 +1049,14 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L // return category string
if ((pItem->wMask & CBEXIM_CAT) && pItem->pszCat) {
if (*cbex->pItems[pItem->iItem].szCat != 0)
- mir_tstrncpy(pItem->pszCat, cbex->pItems[pItem->iItem].szCat, pItem->ccCat - 1);
+ mir_wstrncpy(pItem->pszCat, cbex->pItems[pItem->iItem].szCat, pItem->ccCat - 1);
else
*pItem->pszCat = 0;
}
// return value string
if ((pItem->wMask & CBEXIM_VAL) && pItem->pszVal) {
if (cbex->pItems[pItem->iItem].pszVal)
- mir_tstrncpy(pItem->pszVal, cbex->pItems[pItem->iItem].pszVal, pItem->ccVal - 1);
+ mir_wstrncpy(pItem->pszVal, cbex->pItems[pItem->iItem].pszVal, pItem->ccVal - 1);
else
*pItem->pszVal = 0;
}
@@ -1428,7 +1428,7 @@ int CtrlContactWriteItemToDB( db_unset(hContact, pszModule, pszSetting);
else {
if (cbi.wFlags & CBEXIF_SMS)
- mir_tstrncat(szVal, L" SMS", _countof(szVal) - mir_tstrlen(szVal));
+ mir_wstrncat(szVal, L" SMS", _countof(szVal) - mir_wstrlen(szVal));
if (db_set_ts(hContact, pszModule, pszSetting, szVal)) return 1;
}
@@ -1466,7 +1466,7 @@ int CtrlContactWriteMyItemsToDB( if (!hContact && !(pszModule = pszProto)) return 1;
pszOther = TranslateT("Other");
- ccOther = mir_tstrlen(pszOther);
+ ccOther = mir_wstrlen(pszOther);
cbi.wMask = CBEXIM_CAT|CBEXIM_VAL|CBEXIM_FLAGS;
cbi.pszCat = szCat;
cbi.ccCat = MAX_CAT;
@@ -1478,7 +1478,7 @@ int CtrlContactWriteMyItemsToDB( while (CtrlContactWndProc(hCtrl, CBEXM_GETITEM, NULL, (LPARAM)&cbi) && cbi.iItem < 50) {
if (!(cbi.wFlags & CBEXIF_DELETED) && *szVal) {
if (cbi.wFlags & CBEXIF_SMS) {
- mir_tstrncat(szVal, L" SMS", _countof(szVal) - mir_tstrlen(szVal));
+ mir_wstrncat(szVal, L" SMS", _countof(szVal) - mir_wstrlen(szVal));
}
mir_snprintf(pszSetting, szFormatCat, i);
if (*szCat && wcsncmp(szCat, pszOther, ccOther)) {
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp index cc08d5f408..874b6846dd 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.cpp +++ b/plugins/UserInfoEx/src/ctrl_edit.cpp @@ -121,19 +121,19 @@ BOOL CEditCtrl::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto) case DBVT_BYTE: _itow_s(dbv.bVal, szText, _countof(szText), 10); SetWindowText(_hwnd, szText); - _pszValue = mir_tstrdup(szText); + _pszValue = mir_wstrdup(szText); break; case DBVT_WORD: _itow_s(dbv.wVal, szText, _countof(szText), 10); SetWindowText(_hwnd, szText); - _pszValue = mir_tstrdup(szText); + _pszValue = mir_wstrdup(szText); break; case DBVT_DWORD: _itow_s(dbv.dVal, szText, _countof(szText), 10); SetWindowText(_hwnd, szText); - _pszValue = mir_tstrdup(szText); + _pszValue = mir_wstrdup(szText); break; case DBVT_TCHAR: @@ -237,7 +237,7 @@ void CEditCtrl::OnChangedByUser(WORD wChangedMsg) if ((wChangedMsg == EN_UPDATE) || (wChangedMsg == EN_CHANGE)) { DWORD cch = GetWindowTextLength(_hwnd); - _Flags.B.hasChanged = mir_tstrlen(_pszValue) != cch; + _Flags.B.hasChanged = mir_wstrlen(_pszValue) != cch; _Flags.B.hasCustom = (cch > 0); if (!_Flags.B.hasChanged && _Flags.B.hasCustom) { @@ -255,7 +255,7 @@ void CEditCtrl::OnChangedByUser(WORD wChangedMsg) if (szText != NULL) { GetWindowText(_hwnd, szText, cch + 1); - _Flags.B.hasChanged = mir_tstrcmp(_pszValue, szText) != 0; + _Flags.B.hasChanged = mir_wstrcmp(_pszValue, szText) != 0; if (need_free) MIR_FREE(szText); } diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index ede54b4d37..73e8018d72 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -244,7 +244,7 @@ class CAnnivList case COLUMN_DESC:
ListView_GetItemText(pDlg->_hList, iItem1, pDlg->_sortHeader, szText1, _countof(szText1));
ListView_GetItemText(pDlg->_hList, iItem2, pDlg->_sortHeader, szText2, _countof(szText2));
- result = pDlg->_sortOrder * mir_tstrcmp(szText1, szText2);
+ result = pDlg->_sortOrder * mir_wstrcmp(szText1, szText2);
break;
case COLUMN_AGE:
@@ -698,7 +698,7 @@ class CAnnivList AddSubItem(iItem, COLUMN_CONTACT, DB::Contact::DisplayName(hContact));
// third column: protocol
- wchar_t *ptszProto = mir_a2t(pszProto);
+ wchar_t *ptszProto = mir_a2u(pszProto);
AddSubItem(iItem, COLUMN_PROTO, ptszProto);
mir_free(ptszProto);
@@ -768,7 +768,7 @@ class CAnnivList // add anniversaries
if (_filter.bFilterIndex != FILTER_BIRTHDAY && (!_filter.pszProto || !_strcmpi(pszProto, _filter.pszProto)))
for (i = 0; !ad.DBGetAnniversaryDate(hContact, i); i++)
- if (!_filter.pszAnniv || !mir_tstrcmpi(_filter.pszAnniv, ad.Description()))
+ if (!_filter.pszAnniv || !mir_wstrcmpi(_filter.pszAnniv, ad.Description()))
AddRow(hContact, pszProto, ad, mtNow, wDaysBefore);
}
}
diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp index a3b3444e43..68aacb64fa 100644 --- a/plugins/UserInfoEx/src/dlg_msgbox.cpp +++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp @@ -495,8 +495,8 @@ static INT_PTR CALLBACK MsgBoxPop(HWND hDlg, UINT uMsg, WPARAM, LPARAM lParam) pd.lchContact = NULL; //(HANDLE)wParam;
// icon
pd.lchIcon = MsgLoadIcon(pMsgBox);
- mir_tstrncpy(pd.lptzContactName, pMsgBox->ptszTitle, _countof(pd.lptzContactName));
- mir_tstrncpy(pd.lptzText, pMsgBox->ptszMsg, _countof(pd.lptzText));
+ mir_wstrncpy(pd.lptzContactName, pMsgBox->ptszTitle, _countof(pd.lptzContactName));
+ mir_wstrncpy(pd.lptzText, pMsgBox->ptszMsg, _countof(pd.lptzText));
// CALLBAC Proc
pd.PluginWindowProc = PopupProc;
@@ -664,7 +664,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI va_list vl;
va_start(vl, pszFormat);
- mir_vsntprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl);
+ mir_vsnwprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl);
va_end(vl);
MSGBOX mb = { 0 };
@@ -687,11 +687,11 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...)
{
wchar_t tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE];
- mir_sntprintf(tszTitle, L"%s - %s", _T(MODNAME), TranslateT("Error"));
+ mir_snwprintf(tszTitle, L"%s - %s", _T(MODNAME), TranslateT("Error"));
va_list vl;
va_start(vl, pszFormat);
- mir_vsntprintf(tszMsg, TranslateTS(pszFormat), vl);
+ mir_vsnwprintf(tszMsg, TranslateTS(pszFormat), vl);
va_end(vl);
MSGBOX mb = {0};
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index c4c9cc2d17..71f4fef8d7 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -356,7 +356,7 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam) if (pPsh->_dwFlags & (PSF_PROTOPAGESONLY | PSF_PROTOPAGESONLY_INIT)) {
BYTE bIsUnicode = (odp->flags & ODPF_UNICODE) == ODPF_UNICODE;
- wchar_t *ptszTitle = bIsUnicode ? mir_tstrdup(odp->pwszTitle) : mir_a2t(odp->pszTitle);
+ wchar_t *ptszTitle = bIsUnicode ? mir_wstrdup(odp->pwszTitle) : mir_a2u(odp->pszTitle);
// avoid adding pages for a meta subcontact, which have been added for a metacontact.
if (pPsh->_dwFlags & PSF_PROTOPAGESONLY) {
@@ -367,7 +367,7 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam) }
// init ignore list with pages added by metacontact
else if (pPsh->_dwFlags & PSF_PROTOPAGESONLY_INIT)
- pPsh->_ignore.insert(mir_tstrdup(ptszTitle));
+ pPsh->_ignore.insert(mir_wstrdup(ptszTitle));
mir_free(ptszTitle);
}
@@ -429,7 +429,7 @@ static int OnShutdown(WPARAM, LPARAM) static int AddProtocolPages(OPTIONSDIALOGPAGE& odp, WPARAM wParam, LPSTR pszProto = NULL)
{
wchar_t szTitle[MAX_PATH];
- const BYTE ofs = (pszProto) ? mir_sntprintf(szTitle, L"%S\\", pszProto) : 0;
+ const BYTE ofs = (pszProto) ? mir_snwprintf(szTitle, L"%S\\", pszProto) : 0;
odp.pwszTitle = szTitle;
@@ -437,56 +437,56 @@ static int AddProtocolPages(OPTIONSDIALOGPAGE& odp, WPARAM wParam, LPSTR pszProt odp.position = 0x8000000;
odp.pfnDlgProc = PSPProcGeneral;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_GENERAL);
- mir_tstrncpy(szTitle + ofs, LPGENW("General"), _countof(szTitle) - ofs);
+ mir_wstrncpy(szTitle + ofs, LPGENW("General"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ADDRESS);
odp.position = 0x8000001;
odp.pfnDlgProc = PSPProcContactHome;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ADDRESS);
- mir_tstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Contact (private)"), _countof(szTitle) - ofs);
+ mir_wstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Contact (private)"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ORIGIN);
odp.position = 0x8000002;
odp.pfnDlgProc = PSPProcOrigin;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ADVANCED);
- mir_tstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Origin"), _countof(szTitle) - ofs);
+ mir_wstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Origin"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ANNIVERSARY);
odp.position = 0x8000003;
odp.pfnDlgProc = PSPProcAnniversary;
odp.hIcon = (HICON)ICONINDEX(IDI_BIRTHDAY);
- mir_tstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Anniversaries"), _countof(szTitle) - ofs);
+ mir_wstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Anniversaries"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_COMPANY);
odp.position = 0x8000004;
odp.pfnDlgProc = PSPProcCompany;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_COMPANY);
- mir_tstrncpy(szTitle + ofs, LPGENW("Work"), _countof(szTitle) - ofs);
+ mir_wstrncpy(szTitle + ofs, LPGENW("Work"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ADDRESS);
odp.position = 0x8000005;
odp.pfnDlgProc = PSPProcContactWork;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ADDRESS);
- mir_tstrncpy(szTitle + ofs, LPGENW("Work") L"\\" LPGENW("Contact (work)"), _countof(szTitle) - ofs);
+ mir_wstrncpy(szTitle + ofs, LPGENW("Work") L"\\" LPGENW("Contact (work)"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ABOUT);
odp.position = 0x8000006;
odp.pfnDlgProc = PSPProcAbout;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ABOUT);
- mir_tstrncpy(szTitle + ofs, LPGENW("About"), _countof(szTitle) - ofs);
+ mir_wstrncpy(szTitle + ofs, LPGENW("About"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_PROFILE);
odp.position = 0x8000007;
odp.pfnDlgProc = PSPProcContactProfile;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_PROFILE);
- mir_tstrncpy(szTitle + ofs, LPGENW("About") L"\\" LPGENW("Profile"), _countof(szTitle) - ofs);
+ mir_wstrncpy(szTitle + ofs, LPGENW("About") L"\\" LPGENW("Profile"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
return 0;
}
@@ -735,7 +735,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar GetObject(hNormalFont, sizeof(lf), &lf);
lf.lfHeight = 22;
- mir_tstrcpy(lf.lfFaceName, L"Segoe UI");
+ mir_wstrcpy(lf.lfFaceName, L"Segoe UI");
pPs->hCaptionFont = CreateFontIndirect(&lf);
SendDlgItemMessage(hDlg, IDC_PAGETITLE, WM_SETFONT, (WPARAM)pPs->hCaptionFont, 0);
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index 96cd972f8c..74f2a84c49 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -256,7 +256,7 @@ MCONTACT CExImContactBase::toDB() // add group if (_pszGroup) { - ptrT ptszGroup(mir_utf8decodeT(_pszGroup)); + ptrW ptszGroup(mir_utf8decodeW(_pszGroup)); db_set_ts(_hContact, MOD_CLIST, "Group", ptszGroup); Clist_GroupCreate(NULL, ptszGroup); } @@ -291,7 +291,7 @@ void CExImContactBase::toIni(FILE* file, int modCount) } else { // Proto loaded - GetContactName(hContact,pszProto,0) - ptrT pszCI(Contact_GetInfo(CNF_DISPLAY, _hContact, _pszProto)); + ptrW pszCI(Contact_GetInfo(CNF_DISPLAY, _hContact, _pszProto)); ptrA pszUID(uid2String(FALSE)); if (_pszUIDKey && pszUID) mir_snprintf(name, "%S *(%s)*<%s>*{%s}*", pszCI, _pszProto, _pszUIDKey, pszUID); @@ -475,8 +475,8 @@ BYTE CExImContactBase::isHandle(MCONTACT hContact) // compare nicknames if no UID else if (!DB::Setting::GetUString(hContact, _pszProto, SET_CONTACT_NICK, &dbv)) { if (dbv.type == DBVT_UTF8 && dbv.pszVal && !mir_strcmpi(dbv.pszVal,_pszNick)) { - LPTSTR ptszNick = mir_utf8decodeT(_pszNick); - LPTSTR ptszProto = mir_a2t(_pszProto); + LPTSTR ptszNick = mir_utf8decodeW(_pszNick); + LPTSTR ptszProto = mir_a2u(_pszProto); int ans = MsgBox(NULL, MB_ICONQUESTION|MB_YESNO, LPGENW("Question"), LPGENW("contact identification"), LPGENW("The contact %s(%s) has no unique ID in the vCard,\nbut there is a contact in your contact list with the same nick and protocol.\nDo you wish to use this contact?"), ptszNick, ptszProto); diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index e75750654f..4a9b06f82e 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -688,7 +688,7 @@ int CExImContactXML::Import(BYTE keepMetaSubContact) do {
// update progressbar and abort if user clicked cancel
int result = _pXmlFile->_progress.UpdateContact(L"Sub Contact: %s (%S)",
- ptrT(mir_utf8decodeT(xContact->Attribute("nick"))), xContact->Attribute("proto"));
+ ptrW(mir_utf8decodeW(xContact->Attribute("nick"))), xContact->Attribute("proto"));
// user clicked abort button
if (!result) break;
@@ -739,8 +739,8 @@ int CExImContactXML::ImportMetaSubContact(CExImContactXML * pMetaContact) if (err == FALSE) {
// ask to delete new contact
if (_isNewContact && _hContact != NULL) {
- LPTSTR ptszNick = mir_utf8decodeT(_pszNick);
- LPTSTR ptszMetaNick = mir_utf8decodeT(pMetaContact->_pszNick);
+ LPTSTR ptszNick = mir_utf8decodeW(_pszNick);
+ LPTSTR ptszMetaNick = mir_utf8decodeW(pMetaContact->_pszNick);
int result = MsgBox(NULL, MB_YESNO|MB_ICONWARNING,
LPGENW("Question"),
LPGENW("Importing a new meta subcontact failed!"),
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 10c51971b4..13d8558ec7 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -221,7 +221,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar }
TranslateDialogDefault(hDlg); //to translate oldTitle
GetWindowText(hDlg, oldTitle, _countof(oldTitle));
- mir_sntprintf(newTitle, L"%s - %s", name, oldTitle);
+ mir_snwprintf(newTitle, L"%s - %s", name, oldTitle);
SetWindowText(hDlg, newTitle);
}
@@ -301,7 +301,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar case EXIM_GROUP:
break;
case EXIM_SUBGROUP:
- if (mir_tstrncmp(pDat->ExImContact->ptszName, DB::Setting::GetTString(hContact, "CList", "Group"), mir_tstrlen(pDat->ExImContact->ptszName))) {
+ if (mir_wstrncmp(pDat->ExImContact->ptszName, DB::Setting::GetTString(hContact, "CList", "Group"), mir_wstrlen(pDat->ExImContact->ptszName))) {
continue;
}
break;
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp index 380e238788..36886e384f 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp @@ -114,7 +114,7 @@ static LRESULT CALLBACK PlacesBarSubclassProc(HWND hWnd, UINT uMsg, WPARAM wPara // miranda button
switch (tbb->idCommand) {
case 41063:
- mir_tstrncpy(szBtnText, TranslateT("Miranda NG"), _countof(szBtnText));
+ mir_wstrncpy(szBtnText, TranslateT("Miranda NG"), _countof(szBtnText));
iString = SendMessage(hWnd, TB_ADDSTRING, NULL, (LPARAM)szBtnText);
if (iString != -1) tbb->iString = iString;
// set tooltip
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp index 92981e12d7..ea71cc0d20 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp @@ -191,7 +191,7 @@ BYTE CProgress::UpdateContact(LPCTSTR pszFormat, ...) va_list vl;
va_start(vl, pszFormat);
- mir_vsntprintf(buf, _countof(buf), TranslateTS(pszFormat), vl);
+ mir_vsnwprintf(buf, _countof(buf), TranslateTS(pszFormat), vl);
va_end(vl);
SetDlgItemText(_hDlg, TXT_CONTACT, buf);
}
@@ -218,10 +218,10 @@ BYTE CProgress::UpdateSetting(LPCTSTR pszFormat, ...) va_list vl;
va_start(vl, pszFormat);
- mir_vsntprintf(buf, _countof(buf), TranslateTS(pszFormat), vl);
+ mir_vsnwprintf(buf, _countof(buf), TranslateTS(pszFormat), vl);
va_end(vl);
GetDlgItemText(_hDlg, TXT_SETTING, tmp, _countof(tmp));
- if (mir_tstrcmpi(tmp,buf))
+ if (mir_wstrcmpi(tmp,buf))
SetDlgItemText(_hDlg, TXT_SETTING, buf);
}
SendMessage(hProg, PBM_SETPOS, (int)SendMessage(hProg, PBM_GETPOS, 0, 0) + 1, 0);
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index 30f7151067..2ac2aaa37d 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -164,7 +164,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName) // dont export meta subcontacts by default and
// export only contact with selectet group name
if (!db_mc_isSub(hContact) &&
- mir_tstrncmp(ExImContact->ptszName, DB::Setting::GetTString(hContact, "CList", "Group"), mir_tstrlen(ExImContact->ptszName))== 0)
+ mir_wstrncmp(ExImContact->ptszName, DB::Setting::GetTString(hContact, "CList", "Group"), mir_wstrlen(ExImContact->ptszName))== 0)
{
if (vContact.fromDB(hContact)) {
vContact.Export(xmlfile, &Modules);
@@ -253,7 +253,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent) for (TiXmlElement *xContact = xmlParent->FirstChildElement(); xContact != NULL; xContact = xContact->NextSiblingElement()) {
if (!mir_strcmpi(xContact->Value(), XKEY_CONTACT)) {
// update progressbar and abort if user clicked cancel
- LPTSTR pszNick = mir_utf8decodeT(xContact->Attribute("nick"));
+ LPTSTR pszNick = mir_utf8decodeW(xContact->Attribute("nick"));
// user clicked abort button
if (_progress.UpdateContact(LPGENW("Contact: %s (%S)"), pszNick, xContact->Attribute("proto"))) {
int result = vContact.LoadXmlElemnt(xContact);
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index 864129010c..078f0ee27d 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -53,17 +53,17 @@ static void DisplayNameToFileName(lpExImParam ExImContact, LPSTR pszFileName, WO return;
}
- disp = temp = mir_t2a(pcli->pfnGetContactDisplayName(ExImContact->hContact, NULL));
+ disp = temp = mir_u2a(pcli->pfnGetContactDisplayName(ExImContact->hContact, NULL));
break;
case EXIM_SUBGROUP:
- temp = mir_t2a(ExImContact->ptszName);
+ temp = mir_u2a(ExImContact->ptszName);
disp = temp;
break;
case EXIM_ACCOUNT:
PROTOACCOUNT* acc = Proto_GetAccount(ExImContact->pszName);
- disp = temp = mir_t2a(acc->tszAccountName);
+ disp = temp = mir_u2a(acc->tszAccountName);
break;
}
@@ -280,8 +280,8 @@ INT_PTR svcExIm_Group_Service(WPARAM wParam, LPARAM) while (hItem) {
if (SendMessage(hClist,CLM_GETITEMTYPE, (WPARAM)hItem, 0) == CLCIT_GROUP) {
SendMessage(hClist,CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)ptszItem);
- LPTSTR temp = mir_tstrdup(ptszGroup);
- mir_sntprintf(tszGroup, L"%s%s%s", ptszItem, mir_tstrlen(temp)? L"\\":L"", temp);
+ LPTSTR temp = mir_wstrdup(ptszGroup);
+ mir_snwprintf(tszGroup, L"%s%s%s", ptszItem, mir_wstrlen(temp)? L"\\":L"", temp);
mir_free (temp);
}
hParent = SendMessage(hClist,CLM_GETNEXTITEM, (WPARAM)CLGN_PARENT, (LPARAM)hItem);
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index 6cb53675a8..33c1a84934 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -229,8 +229,8 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L SKINICONDESC sid = { 0 };
sid.flags = SIDF_ALL_TCHAR;
sid.pszName = szIconID;
- sid.description.w = mir_a2t(szDescription);
- sid.section.w = mir_a2t(szSection);
+ sid.description.w = mir_a2u(szDescription);
+ sid.section.w = mir_a2u(szSection);
if (sid.description.w && sid.section.w) {
switch (Size) {
diff --git a/plugins/UserInfoEx/src/psp_anniversary.cpp b/plugins/UserInfoEx/src/psp_anniversary.cpp index b1c7514edc..5ce0033301 100644 --- a/plugins/UserInfoEx/src/psp_anniversary.cpp +++ b/plugins/UserInfoEx/src/psp_anniversary.cpp @@ -85,7 +85,7 @@ static INT_PTR CALLBACK DlgProc_AnniversaryEditor(HWND hDlg, UINT uMsg, WPARAM w break;
}
- if (mir_tstrcmpi(pszText, pDlgEditAnniv->Description())) {
+ if (mir_wstrcmpi(pszText, pDlgEditAnniv->Description())) {
pDlgEditAnniv->Description(pszText);
pDlgEditAnniv->SetFlags(MAnnivDate::MADF_HASCUSTOM | MAnnivDate::MADF_CHANGED);
}
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp index 2f0f6a9fa0..afb2061c38 100644 --- a/plugins/UserInfoEx/src/psp_contact.cpp +++ b/plugins/UserInfoEx/src/psp_contact.cpp @@ -46,7 +46,7 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM PSGetBoldFont(hDlg, hBoldFont);
SendDlgItemMessage(hDlg, IDC_PAGETITLE, WM_SETFONT, (WPARAM)hBoldFont, 0);
- mir_sntprintf(szAddr, L"%s (%s)", TranslateT("Address"), TranslateT("home"));
+ mir_snwprintf(szAddr, L"%s (%s)", TranslateT("Address"), TranslateT("home"));
SetDlgItemText(hDlg, IDC_PAGETITLE, szAddr);
SendDlgItemMessage(hDlg, BTN_GOTO, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open in browser"), MBBF_TCHAR);
TranslateDialogDefault(hDlg);
@@ -192,7 +192,7 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM PSGetBoldFont(hDlg, hBoldFont);
SendDlgItemMessage(hDlg, IDC_PAGETITLE, WM_SETFONT, (WPARAM)hBoldFont, 0);
- mir_sntprintf(szAddr, L"%s (%s)", TranslateT("Address and contact"), TranslateT("company"));
+ mir_snwprintf(szAddr, L"%s (%s)", TranslateT("Address and contact"), TranslateT("company"));
SetDlgItemText(hDlg, IDC_PAGETITLE, szAddr);
SendDlgItemMessage(hDlg, BTN_GOTO, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open in browser"), MBBF_TCHAR);
TranslateDialogDefault(hDlg);
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index fa6a41a010..1c93297951 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -883,10 +883,10 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR {
POPUPDATAT ppd = { 0 };
ppd.iSeconds = (int)db_get_b(NULL, MODNAME, SET_POPUP_DELAY, 0);
- mir_tstrncpy(ppd.lptzText, TranslateT("This is the reminder message"), MAX_SECONDLINE);
+ mir_wstrncpy(ppd.lptzText, TranslateT("This is the reminder message"), MAX_SECONDLINE);
// Birthday
- mir_tstrncpy(ppd.lptzContactName, TranslateT("Birthday"), _countof(ppd.lptzContactName));
+ mir_wstrncpy(ppd.lptzContactName, TranslateT("Birthday"), _countof(ppd.lptzContactName));
ppd.lchIcon = IcoLib_GetIcon(ICO_RMD_DTB0);
if (IsDlgButtonChecked(hDlg, CHECK_OPT_POPUP_WINCLR)) {
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
@@ -899,7 +899,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR PUAddPopupT(&ppd);
// Anniversary
- mir_tstrncpy(ppd.lptzContactName, TranslateT("Anniversary"), _countof(ppd.lptzContactName));
+ mir_wstrncpy(ppd.lptzContactName, TranslateT("Anniversary"), _countof(ppd.lptzContactName));
ppd.lchIcon = IcoLib_GetIcon(ICO_RMD_DTAX);
if (IsDlgButtonChecked(hDlg, CHECK_OPT_POPUP_WINCLR)) {
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
diff --git a/plugins/UserInfoEx/src/psp_origin.cpp b/plugins/UserInfoEx/src/psp_origin.cpp index 7dd0f8cc53..b9d50cec7f 100644 --- a/plugins/UserInfoEx/src/psp_origin.cpp +++ b/plugins/UserInfoEx/src/psp_origin.cpp @@ -92,8 +92,8 @@ INT_PTR CALLBACK PSPProcOrigin(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara mt.UTCToLocal();
mt.DateFormatLong(szTime, _countof(szTime));
- mir_tstrcat(szTime, L" - ");
- ptr = szTime + mir_tstrlen(szTime);
+ mir_wstrcat(szTime, L" - ");
+ ptr = szTime + mir_wstrlen(szTime);
mt.TimeFormat(ptr, _countof(szTime) - (ptr - szTime));
SetDlgItemText(hDlg, TXT_DATEADDED, szTime);
}
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index ead5c48503..651054eb5c 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -231,7 +231,7 @@ static int ProfileList_EndLabelEdit(LPLISTCTRL pList, BYTE bSave) pList->labelEdit.pItem->pszText[pList->labelEdit.iSubItem] = szEdit;
bChanged = TRUE;
}
- else if (mir_tstrcmp(pList->labelEdit.pItem->pszText[pList->labelEdit.iSubItem], szEdit)) {
+ else if (mir_wstrcmp(pList->labelEdit.pItem->pszText[pList->labelEdit.iSubItem], szEdit)) {
mir_free(pList->labelEdit.pItem->pszText[pList->labelEdit.iSubItem]);
pList->labelEdit.pItem->pszText[pList->labelEdit.iSubItem] = szEdit;
bChanged = TRUE;
@@ -537,7 +537,7 @@ static int ProfileList_AddItemlistFromDB( }
// item not found in the predefined category list?
if ((idList == NULL || j == nList) && dbvCat.type == DBVT_ASCIIZ) {
- pItem->pszText[0] = mir_a2t(dbvCat.pszVal);
+ pItem->pszText[0] = mir_a2u(dbvCat.pszVal);
db_free(&dbvCat);
}
if ((lvi.iItem = ListView_InsertItem(pList->hList, &lvi)) < 0) {
@@ -826,7 +826,7 @@ static LRESULT CALLBACK ProfileList_SubclassProc(HWND hwnd, UINT msg, WPARAM wPa HDC hDC = GetDC(GetParent(hwnd));
if (hDC != NULL) {
SelectObject(hDC, (HFONT)SendMessage(GetParent(hwnd), WM_GETFONT, NULL, NULL));
- GetTextExtentPoint32(hDC, pItem->pszText[hi.iSubItem], (int)mir_tstrlen(pItem->pszText[hi.iSubItem]), &textSize);
+ GetTextExtentPoint32(hDC, pItem->pszText[hi.iSubItem], (int)mir_wstrlen(pItem->pszText[hi.iSubItem]), &textSize);
ReleaseDC(GetParent(hwnd), hDC);
}
else textSize.cx = textSize.cy = 0;
@@ -948,7 +948,7 @@ static LRESULT CALLBACK ProfileList_SubclassProc(HWND hwnd, UINT msg, WPARAM wPa for (i = 0; i < pList->labelEdit.pItem->idstrListCount; i++) {
add = ListBox_AddString(pList->labelEdit.dropDown.hDrop, pList->labelEdit.pItem->idstrList[i].ptszTranslated);
ListBox_SetItemData(pList->labelEdit.dropDown.hDrop, add, pList->labelEdit.pItem->idstrList + i);
- if (!mir_tstrcmp(szEdit, pList->labelEdit.pItem->idstrList[i].ptszTranslated))
+ if (!mir_wstrcmp(szEdit, pList->labelEdit.pItem->idstrList[i].ptszTranslated))
ListBox_SetCurSel(pList->labelEdit.dropDown.hDrop, add);
}
}
@@ -957,7 +957,7 @@ static LRESULT CALLBACK ProfileList_SubclassProc(HWND hwnd, UINT msg, WPARAM wPa i = 0;
while (PtrIsValid(lpidList = (LPIDSTRLIST)ListBox_GetItemData(pList->labelEdit.dropDown.hDrop, i))) {
- if (!mir_tstrcmp(szEdit, lpidList->ptszTranslated)) {
+ if (!mir_wstrcmp(szEdit, lpidList->ptszTranslated)) {
ListBox_SetCurSel(pList->labelEdit.dropDown.hDrop, i);
break;
}
@@ -1203,7 +1203,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR }
// find information about the group
for (iFmt = 0; iFmt < _countof(pFmt); iFmt++) {
- if (!mir_tstrcmp(szGroup, pFmt[iFmt].szGroup))
+ if (!mir_wstrcmp(szGroup, pFmt[iFmt].szGroup))
break;
}
// indicate, no group was found. should not happen!!
diff --git a/plugins/UserInfoEx/src/svc_constants.cpp b/plugins/UserInfoEx/src/svc_constants.cpp index 899d944700..4deefca9b4 100644 --- a/plugins/UserInfoEx/src/svc_constants.cpp +++ b/plugins/UserInfoEx/src/svc_constants.cpp @@ -252,12 +252,12 @@ static UINT MyCountriesCount = 0; * @param p1 - (LPIDSTRLIST) first item to compare
* @param p2 - (LPIDSTRLIST) second item to compare
*
-* returns -1, 0, 1 according to the comparison result of mir_tstrcmp.
+* returns -1, 0, 1 according to the comparison result of mir_wstrcmp.
**/
static int __cdecl ListSortProc(const LPIDSTRLIST p1, const LPIDSTRLIST p2)
{
- return mir_tstrcmpi(p1->ptszTranslated, p2->ptszTranslated);
+ return mir_wstrcmpi(p1->ptszTranslated, p2->ptszTranslated);
}
/**
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index b844322721..f9b4da5021 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -119,7 +119,7 @@ public: va_list vl;
va_start(vl, szText);
- if (mir_vsntprintf(buf, _countof(buf), szText, vl) != -1)
+ if (mir_vsnwprintf(buf, _countof(buf), szText, vl) != -1)
{
SetTitle(buf);
}
@@ -143,7 +143,7 @@ public: {
if (szText)
{
- INT_PTR cch = mir_tstrlen(szText);
+ INT_PTR cch = mir_wstrlen(szText);
LPTSTR fmt = (LPTSTR) mir_alloc((cch + 1) * sizeof(wchar_t));
if (fmt)
@@ -151,7 +151,7 @@ public: wchar_t buf[MAXDATASIZE];
va_list vl;
- mir_tstrcpy(fmt, szText);
+ mir_wstrcpy(fmt, szText);
// delete bbcodes
if (!_bBBCode)
@@ -179,7 +179,7 @@ public: }
va_start(vl, szText);
- if (mir_vsntprintf(buf, _countof(buf), fmt, vl) != -1)
+ if (mir_vsnwprintf(buf, _countof(buf), fmt, vl) != -1)
{
SetText(buf);
}
@@ -345,12 +345,12 @@ class CPopupUpdProgress : public CUpdProgress {
if (_szText)
{
- INT_PTR cb = mir_tstrlen(_szText) + 8;
+ INT_PTR cb = mir_wstrlen(_szText) + 8;
LPTSTR pb = (LPTSTR) mir_alloc(cb * sizeof(wchar_t));
if (pb)
{
- mir_tstrcpy(pb, _szText);
+ mir_wstrcpy(pb, _szText);
SendMessage(_hWnd, UM_CHANGEPOPUP, CPT_TITLET, (LPARAM) pb);
}
@@ -424,10 +424,10 @@ public: pd.lpActions = _popupButtons;
// dummy text
- _szText = mir_tstrdup(szTitle);
- mir_tstrcpy(pd.lptzContactName, _szText);
+ _szText = mir_wstrdup(szTitle);
+ mir_wstrcpy(pd.lptzContactName, _szText);
- mir_tstrcpy(pd.lptzText, L" ");
+ mir_wstrcpy(pd.lptzText, L" ");
_pFnCallBack = pFnCallBack;
_hWnd = (HWND) CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &pd, APF_RETURN_HWND|APF_NEWDATA);
@@ -455,7 +455,7 @@ public: virtual void SetTitle(LPCTSTR szText)
{
MIR_FREE(_szText);
- _szText = mir_tstrdup(szText);
+ _szText = mir_wstrdup(szText);
UpdateText();
}
@@ -465,7 +465,7 @@ public: **/
virtual void SetText(LPCTSTR szText)
{
- SendMessage(_hWnd, UM_CHANGEPOPUP, CPT_TEXTT, (LPARAM) mir_tstrdup(szText));
+ SendMessage(_hWnd, UM_CHANGEPOPUP, CPT_TEXTT, (LPARAM) mir_wstrdup(szText));
}
};
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 700575c708..63e077a06f 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -255,11 +255,11 @@ static int NotifyWithPopup(MCONTACT hContact, CEvent::EType eventType, int DaysT if (hContact) {
ppd.lchContact = hContact;
- mir_sntprintf(ppd.lptzContactName, L"%s - %s", TranslateTS(pszDesc), DB::Contact::DisplayName(hContact));
+ mir_snwprintf(ppd.lptzContactName, L"%s - %s", TranslateTS(pszDesc), DB::Contact::DisplayName(hContact));
}
- else mir_tstrncpy(ppd.lptzContactName, TranslateT("Reminder"), _countof(ppd.lptzContactName));
+ else mir_wstrncpy(ppd.lptzContactName, TranslateT("Reminder"), _countof(ppd.lptzContactName));
- mir_tstrncpy(ppd.lptzText, pszMsg, MAX_SECONDLINE);
+ mir_wstrncpy(ppd.lptzText, pszMsg, MAX_SECONDLINE);
ppd.lchIcon = GetAnnivIcon(CEvent(eventType, DaysToAnniv));
@@ -317,12 +317,12 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt) switch (evt._eType) {
case CEvent::BIRTHDAY:
- mir_sntprintf(szMsg, TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("Birthday"));
+ mir_snwprintf(szMsg, TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("Birthday"));
cle.hIcon = IcoLib_GetIcon(ICO_COMMON_BIRTHDAY);
break;
case CEvent::ANNIVERSARY:
- mir_sntprintf(szMsg, TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("an anniversary"));
+ mir_snwprintf(szMsg, TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("an anniversary"));
cle.hIcon = IcoLib_GetIcon(ICO_COMMON_ANNIVERSARY);
break;
@@ -481,29 +481,29 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti switch (Diff) {
case 0:
- cchMsg = mir_sntprintf(szMsg, TranslateT("%s has birthday today."), DB::Contact::DisplayName(hContact));
+ cchMsg = mir_snwprintf(szMsg, TranslateT("%s has birthday today."), DB::Contact::DisplayName(hContact));
break;
case 1:
- cchMsg = mir_sntprintf(szMsg, TranslateT("%s has birthday tomorrow."), DB::Contact::DisplayName(hContact));
+ cchMsg = mir_snwprintf(szMsg, TranslateT("%s has birthday tomorrow."), DB::Contact::DisplayName(hContact));
break;
default:
- cchMsg = mir_sntprintf(szMsg, TranslateT("%s has birthday in %d days."), DB::Contact::DisplayName(hContact), Diff);
+ cchMsg = mir_snwprintf(szMsg, TranslateT("%s has birthday in %d days."), DB::Contact::DisplayName(hContact), Diff);
}
int age = mtb.Age(&Now);
if (age > 0)
switch (GenderOf(hContact)){
case 0:
- mir_sntprintf(szMsg + cchMsg, _countof(szMsg) - cchMsg,
+ mir_snwprintf(szMsg + cchMsg, _countof(szMsg) - cchMsg,
TranslateT("\nHe/she becomes %d years old."),
age + (Diff > 0));
break;
case 'M':
- mir_sntprintf(szMsg + cchMsg, _countof(szMsg) - cchMsg,
+ mir_snwprintf(szMsg + cchMsg, _countof(szMsg) - cchMsg,
TranslateT("\nHe becomes %d years old."),
age + (Diff > 0));
break;
case 'F':
- mir_sntprintf(szMsg + cchMsg, _countof(szMsg) - cchMsg,
+ mir_snwprintf(szMsg + cchMsg, _countof(szMsg) - cchMsg,
TranslateT("\nShe becomes %d years old."),
age + (Diff > 0));
break;
diff --git a/plugins/UserInfoEx/src/svc_timezone_old.cpp b/plugins/UserInfoEx/src/svc_timezone_old.cpp index dfc50be0ed..dfb93928ba 100644 --- a/plugins/UserInfoEx/src/svc_timezone_old.cpp +++ b/plugins/UserInfoEx/src/svc_timezone_old.cpp @@ -91,8 +91,8 @@ class CTzBias : public LIST<CTimeZone> {
int result = tz2->Bias - tz1->Bias;
// DO NOT USE mir_tcsicmp here as it does only return TRUE or FALSE!!!
- // mir_tstrcmpi takes care of umlauts e.g. Ä,Ö,....
- return (result || !tz1->ptszDisplay || !tz2->ptszDisplay) ? result : mir_tstrcmpi(tz1->ptszDisplay, tz2->ptszDisplay);
+ // mir_wstrcmpi takes care of umlauts e.g. Ä,Ö,....
+ return (result || !tz1->ptszDisplay || !tz2->ptszDisplay) ? result : mir_wstrcmpi(tz1->ptszDisplay, tz2->ptszDisplay);
}
public:
CTzBias() : LIST<CTimeZone>(50, &CTzBias::sortFunc)
@@ -126,7 +126,7 @@ class CTzMgr : public LIST<CTimeZone> static int sortFunc(const CTimeZone *tz1, const CTimeZone *tz2)
{
// DO NOT USE mir_tcsicmp here as it does only return TRUE or FALSE!!!
- return mir_tstrcmpi(tz1->ptszName, tz2->ptszName);
+ return mir_wstrcmpi(tz1->ptszName, tz2->ptszName);
}
/**
@@ -203,8 +203,8 @@ public: pTimeZone->dwIndex = TZINDEX_UNSPECIFIED;
if (result == ERROR_SUCCESS) {
- pTimeZone->ptszName = mir_tstrdup(szName);
- pTimeZone->ptszDisplay = mir_tstrdup(szDisplay);
+ pTimeZone->ptszName = mir_wstrdup(szName);
+ pTimeZone->ptszDisplay = mir_wstrdup(szDisplay);
result = (insert(pTimeZone) == ERROR_SUCCESS);
}
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 160b78a1ad..b0a46021ee 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -96,11 +96,11 @@ static mir_cs csContactCache; // converts a string into a CNF_ type
BYTE getContactInfoType(wchar_t* type)
{
- if (type == NULL || mir_tstrlen(type) == 0)
+ if (type == NULL || mir_wstrlen(type) == 0)
return 0;
for (int i = 0; i < _countof(builtinCnfs); i++)
- if (!mir_tstrcmp(builtinCnfs[i].str, type))
+ if (!mir_wstrcmp(builtinCnfs[i].str, type))
return builtinCnfs[i].cnfCode;
return 0;
@@ -120,22 +120,22 @@ wchar_t* getContactInfoT(BYTE type, MCONTACT hContact) wchar_t *res = NULL;
switch (type) {
case CCNF_PROTOID:
- return mir_a2t(szProto);
+ return mir_a2u(szProto);
case CCNF_ACCOUNT:
{
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
- return pa ? mir_tstrdup(pa->tszAccountName) : NULL;
+ return pa ? mir_wstrdup(pa->tszAccountName) : NULL;
}
case CCNF_PROTOCOL:
char protoname[128];
if (CallProtoService(szProto, PS_GETNAME, (WPARAM)sizeof(protoname), (LPARAM)protoname))
return NULL;
- return mir_a2t(protoname);
+ return mir_a2u(protoname);
case CCNF_STATUS:
- return mir_tstrdup(pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0));
+ return mir_wstrdup(pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0));
case CCNF_INTERNALIP:
case CCNF_EXTERNALIP:
@@ -144,7 +144,7 @@ wchar_t* getContactInfoT(BYTE type, MCONTACT hContact) if (ip != 0) {
struct in_addr in;
in.s_addr = htonl(ip);
- return mir_a2t(inet_ntoa(in));
+ return mir_a2u(inet_ntoa(in));
}
}
return NULL;
@@ -208,7 +208,7 @@ MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMat // <proto:id> (exact)
if ((dwFlags & CI_PROTOID) && !bMatch) {
- ptrT cInfo(getContactInfoT(CNF_UNIQUEID, hContact));
+ ptrW cInfo(getContactInfoT(CNF_UNIQUEID, hContact));
if (cInfo) {
tmp.Format(L"<%S:%s>", szProto, cInfo);
if (tmp == tszContact)
@@ -218,50 +218,50 @@ MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMat // id (exact)
if ((dwFlags & CI_UNIQUEID) && !bMatch) {
- ptrT szFind(getContactInfoT(CNF_UNIQUEID, hContact));
- if (!mir_tstrcmp(tszContact, szFind))
+ ptrW szFind(getContactInfoT(CNF_UNIQUEID, hContact));
+ if (!mir_wstrcmp(tszContact, szFind))
bMatch = true;
}
// nick (not exact)
if ((dwFlags & CI_NICK) && !bMatch) {
- ptrT szFind(getContactInfoT(CNF_NICK, hContact));
- if (!mir_tstrcmp(tszContact, szFind))
+ ptrW szFind(getContactInfoT(CNF_NICK, hContact));
+ if (!mir_wstrcmp(tszContact, szFind))
bMatch = true;
}
// list name (not exact)
if ((dwFlags & CI_LISTNAME) && !bMatch) {
- ptrT szFind(getContactInfoT(CNF_DISPLAY, hContact));
- if (!mir_tstrcmp(tszContact, szFind))
+ ptrW szFind(getContactInfoT(CNF_DISPLAY, hContact));
+ if (!mir_wstrcmp(tszContact, szFind))
bMatch = true;
}
// firstname (exact)
if ((dwFlags & CI_FIRSTNAME) && !bMatch) {
- ptrT szFind(getContactInfoT(CNF_FIRSTNAME, hContact));
- if (!mir_tstrcmp(tszContact, szFind))
+ ptrW szFind(getContactInfoT(CNF_FIRSTNAME, hContact));
+ if (!mir_wstrcmp(tszContact, szFind))
bMatch = true;
}
// lastname (exact)
if ((dwFlags & CI_LASTNAME) && !bMatch) {
- ptrT szFind(getContactInfoT(CNF_LASTNAME, hContact));
- if (!mir_tstrcmp(tszContact, szFind))
+ ptrW szFind(getContactInfoT(CNF_LASTNAME, hContact));
+ if (!mir_wstrcmp(tszContact, szFind))
bMatch = true;
}
// email (exact)
if ((dwFlags & CI_EMAIL) && !bMatch) {
- ptrT szFind(getContactInfoT(CNF_EMAIL, hContact));
- if (!mir_tstrcmp(tszContact, szFind))
+ ptrW szFind(getContactInfoT(CNF_EMAIL, hContact));
+ if (!mir_wstrcmp(tszContact, szFind))
bMatch = true;
}
// CNF_ (exact)
if ((dwFlags & CI_CNFINFO) && !bMatch) {
- ptrT szFind(getContactInfoT((BYTE)(dwFlags & ~CI_CNFINFO), hContact));
- if (!mir_tstrcmp(tszContact, szFind))
+ ptrW szFind(getContactInfoT((BYTE)(dwFlags & ~CI_CNFINFO), hContact));
+ if (!mir_wstrcmp(tszContact, szFind))
bMatch = true;
}
@@ -291,7 +291,7 @@ MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMat CONTACTCE *cce = new CONTACTCE();
cce->hContact = hContact;
cce->flags = dwFlags;
- cce->tszContact = mir_tstrdup(tszContact);
+ cce->tszContact = mir_wstrdup(tszContact);
arContactCache.insert(cce);
}
@@ -365,9 +365,9 @@ wchar_t* encodeContactToString(MCONTACT hContact) if (tszUniqueId == NULL)
return NULL;
- size_t size = mir_tstrlen(tszUniqueId) + mir_strlen(szProto) + 4;
+ size_t size = mir_wstrlen(tszUniqueId) + mir_strlen(szProto) + 4;
wchar_t *tszResult = (wchar_t *)mir_calloc(size * sizeof(wchar_t));
if (tszResult)
- mir_sntprintf(tszResult, size, L"<%S:%s>", szProto, tszUniqueId);
+ mir_snwprintf(tszResult, size, L"<%S:%s>", szProto, tszUniqueId);
return tszResult;
}
diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp index 57d5ad1e0c..7d663d4aae 100644 --- a/plugins/Variables/src/help.cpp +++ b/plugins/Variables/src/help.cpp @@ -228,14 +228,14 @@ static wchar_t *getTokenCategory(TOKENREGISTEREX *tr) { *cur = 0; helpText = ( char* )mir_realloc(helpText, mir_strlen(helpText)+1); - wchar_t *res = mir_a2t(helpText); + wchar_t *res = mir_a2u(helpText); mir_free(helpText); return res; } cur++; } - wchar_t *res = mir_a2t(helpText); + wchar_t *res = mir_a2u(helpText); mir_free(helpText); return res; @@ -251,7 +251,7 @@ static wchar_t *getHelpDescription(TOKENREGISTEREX *tr) if (*cur == '\t') { cur = mir_strdup(cur+1); - wchar_t *res = mir_a2t(cur); + wchar_t *res = mir_a2u(cur); mir_free(cur); return res; @@ -259,7 +259,7 @@ static wchar_t *getHelpDescription(TOKENREGISTEREX *tr) cur--; } - return mir_a2t(tr->szHelpText); + return mir_a2u(tr->szHelpText); } @@ -269,7 +269,7 @@ static wchar_t *getTokenDescription(TOKENREGISTEREX *tr) return NULL; if (tr->szHelpText == NULL) - return mir_tstrdup(tr->tszTokenString); + return mir_wstrdup(tr->tszTokenString); char *helpText = mir_strdup(tr->szHelpText); if (helpText == NULL) @@ -294,7 +294,7 @@ static wchar_t *getTokenDescription(TOKENREGISTEREX *tr) } else args = NULL; - size_t len = mir_tstrlen(tr->tszTokenString) + (args!=NULL?mir_strlen(args):0) + 3; + size_t len = mir_wstrlen(tr->tszTokenString) + (args!=NULL?mir_strlen(args):0) + 3; wchar_t *desc = (wchar_t*)mir_calloc(len * sizeof(wchar_t)); if (desc == NULL) { mir_free(helpText); @@ -302,12 +302,12 @@ static wchar_t *getTokenDescription(TOKENREGISTEREX *tr) } if (tr->flags&TRF_FIELD) - mir_sntprintf(desc, len, L"%c%s%c", FIELD_CHAR, tr->szTokenString, FIELD_CHAR); + mir_snwprintf(desc, len, L"%c%s%c", FIELD_CHAR, tr->szTokenString, FIELD_CHAR); else { if (args != NULL) - tArgs = mir_a2t(args); + tArgs = mir_a2u(args); - mir_sntprintf(desc, len, L"%c%s%s", FUNC_CHAR, tr->tszTokenString, (tArgs!=NULL?tArgs:L"")); + mir_snwprintf(desc, len, L"%c%s%s", FUNC_CHAR, tr->tszTokenString, (tArgs!=NULL?tArgs:L"")); } mir_free(tArgs); @@ -322,19 +322,19 @@ static int CALLBACK compareTokenHelp(LPARAM lParam1, LPARAM lParam2, LPARAM) if (tr1 == NULL || tr2 == NULL) return 0; - ptrT cat1(getTokenCategory(tr1)); - ptrT cat2(getTokenCategory(tr2)); + ptrW cat1(getTokenCategory(tr1)); + ptrW cat2(getTokenCategory(tr2)); if (cat1 == NULL || cat2 == NULL) return 0; - int res = mir_tstrcmp(cat1, cat2); + int res = mir_wstrcmp(cat1, cat2); if (res != 0) return res; if (tr1->tszTokenString == NULL || tr2->tszTokenString == NULL) return 0; - return mir_tstrcmp(tr1->tszTokenString, tr2->tszTokenString); + return mir_wstrcmp(tr1->tszTokenString, tr2->tszTokenString); } static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) @@ -367,19 +367,19 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM, LPA continue; else if (hdd != NULL) { - if (!mir_tstrcmp(tr->tszTokenString, SUBJECT)) { + if (!mir_wstrcmp(tr->tszTokenString, SUBJECT)) { if (hdd->vhs->flags&VHF_HIDESUBJECTTOKEN) continue; if (hdd->vhs->szSubjectDesc != NULL) - tszHelpDesc = mir_a2t(hdd->vhs->szSubjectDesc); + tszHelpDesc = mir_a2u(hdd->vhs->szSubjectDesc); } - if (!mir_tstrcmp(tr->tszTokenString, MIR_EXTRATEXT)) { + if (!mir_wstrcmp(tr->tszTokenString, MIR_EXTRATEXT)) { if (hdd->vhs->flags & VHF_HIDEEXTRATEXTTOKEN) continue; if (hdd->vhs->szExtraTextDesc != NULL) - tszHelpDesc = mir_a2t(hdd->vhs->szExtraTextDesc); + tszHelpDesc = mir_a2u(hdd->vhs->szExtraTextDesc); } } @@ -400,7 +400,7 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM, LPA tszHelpDesc = getHelpDescription(tr); if (tszHelpDesc == NULL) - tszHelpDesc = mir_tstrdup(L"unknown"); + tszHelpDesc = mir_wstrdup(L"unknown"); lvItem.iSubItem = 1; lvItem.pszText = TranslateTS(tszHelpDesc); @@ -422,12 +422,12 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM, LPA cat = getTokenCategory((TOKENREGISTEREX *)lvItem.lParam); if (cat != NULL) { - text = mir_tstrdup(TranslateTS(cat)); + text = mir_wstrdup(TranslateTS(cat)); mir_free(cat); } else text = NULL; - if (text != NULL && (last == NULL || mir_tstrcmpi(last, text))) { + if (text != NULL && (last == NULL || mir_wstrcmpi(last, text))) { lvItem.mask = LVIF_TEXT; lvItem.pszText = text; ListView_InsertItem(hList, &lvItem); @@ -464,13 +464,13 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM, LPA if (tr == NULL) break; - size_t len = mir_tstrlen(tr->tszTokenString) + 2; + size_t len = mir_wstrlen(tr->tszTokenString) + 2; wchar_t *tokenString = (wchar_t*)mir_alloc((len+1)*sizeof(wchar_t)); if (tokenString == NULL) break; memset(tokenString, 0, ((len + 1) * sizeof(wchar_t))); - mir_sntprintf(tokenString, len + 1, L"%c%s%c", (tr->flags & TRF_FIELD) ? FIELD_CHAR : FUNC_CHAR, tr->tszTokenString, (tr->flags & TRF_FIELD) ? FIELD_CHAR : '('); + mir_snwprintf(tokenString, len + 1, L"%c%s%c", (tr->flags & TRF_FIELD) ? FIELD_CHAR : FUNC_CHAR, tr->tszTokenString, (tr->flags & TRF_FIELD) ? FIELD_CHAR : '('); SendDlgItemMessage(hwndInputDlg, IDC_TESTSTRING, EM_REPLACESEL, TRUE, (LPARAM)tokenString); mir_free(tokenString); SetFocus(GetDlgItem(hwndInputDlg, IDC_TESTSTRING)); @@ -685,7 +685,7 @@ static INT_PTR CALLBACK inputDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM wchar_t *newString = variables_parsedup(string, extraText, (MCONTACT)SendMessage(GetParent(hwndDlg), VARM_GETSUBJECT, 0, 0)); if (newString != NULL) { wchar_t *oldString = Hlp_GetDlgItemText(hwndDlg, IDC_RESULT); - if (oldString == NULL || mir_tstrcmp(oldString, newString)) + if (oldString == NULL || mir_wstrcmp(oldString, newString)) SetDlgItemText(hwndDlg, IDC_RESULT, newString); mir_free(newString); @@ -812,7 +812,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l SendMessage(hwndDlg, VARM_SETINPUTTEXT, 0, (LPARAM)dat->vhs->fi->tszFormat); else { - WCHAR *wszFormatString = mir_a2t(dat->vhs->fi->szFormat); + WCHAR *wszFormatString = mir_a2u(dat->vhs->fi->szFormat); SendMessage(hwndDlg, VARM_SETINPUTTEXT, 0, (LPARAM)wszFormatString); mir_free(wszFormatString); @@ -866,7 +866,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l SendMessage(hwndDlg, VARM_SETEXTRATEXT, 0, (LPARAM)dat->vhs->fi->tszExtraText); else { - WCHAR *wszSource = mir_a2t(dat->vhs->fi->szExtraText); + WCHAR *wszSource = mir_a2u(dat->vhs->fi->szExtraText); SendMessage(hwndDlg, VARM_SETEXTRATEXT, 0, (LPARAM)wszSource); mir_free(wszSource); diff --git a/plugins/Variables/src/parse_alias.cpp b/plugins/Variables/src/parse_alias.cpp index 8f7ccd9f2e..0c3f1a8060 100644 --- a/plugins/Variables/src/parse_alias.cpp +++ b/plugins/Variables/src/parse_alias.cpp @@ -37,7 +37,7 @@ static ALIASREGISTER* searchAliasRegister(wchar_t *szAlias) mir_cslock lck(csAliasRegister);
for (int i = 0; i < arAliases.getCount(); i++)
- if (!mir_tstrcmp(arAliases[i]->szAlias, szAlias))
+ if (!mir_wstrcmp(arAliases[i]->szAlias, szAlias))
return arAliases[i];
return NULL;
@@ -45,7 +45,7 @@ static ALIASREGISTER* searchAliasRegister(wchar_t *szAlias) static wchar_t *replaceArguments(wchar_t *res, wchar_t *tArg, wchar_t *rArg)
{
- if (mir_tstrlen(tArg) == 0)
+ if (mir_wstrlen(tArg) == 0)
return res;
unsigned int cur = 0, ecur = 0;
@@ -55,14 +55,14 @@ static wchar_t *replaceArguments(wchar_t *res, wchar_t *tArg, wchar_t *rArg) while ((*(res + ecur) != ')') && (*(res + ecur) != ','))
ecur++;
- if (((signed int)mir_tstrlen(tArg) == (ecur - cur)) && (!wcsncmp(tArg, res + cur, mir_tstrlen(tArg)))) {
- if (mir_tstrlen(rArg) > mir_tstrlen(tArg)) {
- res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + (mir_tstrlen(rArg) - mir_tstrlen(tArg)) + 1)*sizeof(wchar_t));
+ if (((signed int)mir_wstrlen(tArg) == (ecur - cur)) && (!wcsncmp(tArg, res + cur, mir_wstrlen(tArg)))) {
+ if (mir_wstrlen(rArg) > mir_wstrlen(tArg)) {
+ res = (wchar_t*)mir_realloc(res, (mir_wstrlen(res) + (mir_wstrlen(rArg) - mir_wstrlen(tArg)) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
}
- memmove(res + ecur + (mir_tstrlen(rArg) - mir_tstrlen(tArg)), res + ecur, (mir_tstrlen(res + ecur) + 1)*sizeof(wchar_t));
- wcsncpy(res + cur, rArg, mir_tstrlen(rArg));
+ memmove(res + ecur + (mir_wstrlen(rArg) - mir_wstrlen(tArg)), res + ecur, (mir_wstrlen(res + ecur) + 1)*sizeof(wchar_t));
+ wcsncpy(res + cur, rArg, mir_wstrlen(rArg));
}
}
cur++;
@@ -77,7 +77,7 @@ static wchar_t *parseTranslateAlias(ARGUMENTSINFO *ai) if (areg == NULL || areg->argc != ai->argc - 1)
return NULL;
- wchar_t *res = mir_tstrdup(areg->szTranslation);
+ wchar_t *res = mir_wstrdup(areg->szTranslation);
for (unsigned i = 0; i < areg->argc; i++) {
res = replaceArguments(res, areg->argv[i], ai->targv[i + 1]);
if (res == NULL)
@@ -89,17 +89,17 @@ static wchar_t *parseTranslateAlias(ARGUMENTSINFO *ai) static int addToAliasRegister(wchar_t *szAlias, unsigned int argc, wchar_t** argv, wchar_t *szTranslation)
{
- if (szAlias == NULL || szTranslation == NULL || mir_tstrlen(szAlias) == 0)
+ if (szAlias == NULL || szTranslation == NULL || mir_wstrlen(szAlias) == 0)
return -1;
mir_cslock lck(csAliasRegister);
for (int i = 0; i < arAliases.getCount(); i++) {
ALIASREGISTER *p = arAliases[i];
- if (mir_tstrcmp(p->szAlias, szAlias))
+ if (mir_wstrcmp(p->szAlias, szAlias))
continue;
mir_free(p->szTranslation);
- p->szTranslation = mir_tstrdup(szTranslation);
+ p->szTranslation = mir_wstrdup(szTranslation);
for (unsigned j = 0; j < p->argc; j++)
mir_free(p->argv[j]);
@@ -110,7 +110,7 @@ static int addToAliasRegister(wchar_t *szAlias, unsigned int argc, wchar_t** arg for (unsigned j = 0; j < argc; j++) {
if (argv[j] != NULL)
- p->argv[j] = mir_tstrdup(argv[j]);
+ p->argv[j] = mir_wstrdup(argv[j]);
else
p->argv[j] = NULL;
}
@@ -121,14 +121,14 @@ static int addToAliasRegister(wchar_t *szAlias, unsigned int argc, wchar_t** arg return -1;
ALIASREGISTER *p = new ALIASREGISTER;
- p->szAlias = mir_tstrdup(szAlias);
- p->szTranslation = mir_tstrdup(szTranslation);
+ p->szAlias = mir_wstrdup(szAlias);
+ p->szTranslation = mir_wstrdup(szTranslation);
p->argc = argc;
p->argv = pargv;
for (unsigned j = 0; j < p->argc; j++) {
if (argv[j] != NULL)
- p->argv[j] = mir_tstrdup(argv[j]);
+ p->argv[j] = mir_wstrdup(argv[j]);
else
p->argv[j] = NULL;
}
@@ -146,7 +146,7 @@ static wchar_t *parseAddAlias(ARGUMENTSINFO *ai) while (isValidTokenChar(*cur))
cur++;
- ptrT alias(mir_tstrndup(ai->targv[1], cur - ai->targv[1]));
+ ptrW alias(mir_wstrndup(ai->targv[1], cur - ai->targv[1]));
TArgList argv;
getArguments(cur, argv);
@@ -156,17 +156,17 @@ static wchar_t *parseAddAlias(ARGUMENTSINFO *ai) wchar_t *szArgs = NULL;
for (int i = 0; i < argv.getCount(); i++) {
if (i == 0)
- szArgs = (wchar_t*)mir_calloc((mir_tstrlen(argv[i]) + 2)*sizeof(wchar_t));
+ szArgs = (wchar_t*)mir_calloc((mir_wstrlen(argv[i]) + 2)*sizeof(wchar_t));
else
- szArgs = (wchar_t*)mir_realloc(szArgs, (mir_tstrlen(szArgs) + mir_tstrlen(argv[i]) + 2)*sizeof(wchar_t));
+ szArgs = (wchar_t*)mir_realloc(szArgs, (mir_wstrlen(szArgs) + mir_wstrlen(argv[i]) + 2)*sizeof(wchar_t));
- mir_tstrcat(szArgs, argv[i]);
+ mir_wstrcat(szArgs, argv[i]);
if (i != argv.getCount() - 1)
- mir_tstrcat(szArgs, L",");
+ mir_wstrcat(szArgs, L",");
}
int res;
if (szArgs != NULL && argv.getCount() > 0) {
- szArgsA = mir_t2a(szArgs);
+ szArgsA = mir_u2a(szArgs);
size_t size = 32 + mir_strlen(szArgsA);
szHelp = (char *)mir_alloc(size);
@@ -184,7 +184,7 @@ static wchar_t *parseAddAlias(ARGUMENTSINFO *ai) mir_free(szArgs);
mir_free(szHelp);
argv.destroy();
- return (res == 0) ? mir_tstrdup(L"") : NULL;
+ return (res == 0) ? mir_wstrdup(L"") : NULL;
}
void registerAliasTokens()
diff --git a/plugins/Variables/src/parse_external.cpp b/plugins/Variables/src/parse_external.cpp index 873be4f90b..820b4a01ee 100644 --- a/plugins/Variables/src/parse_external.cpp +++ b/plugins/Variables/src/parse_external.cpp @@ -37,13 +37,13 @@ static wchar_t *getFullWinampTitleText() mir_free(szWinText);
return NULL;
}
- wchar_t *szTitle = (wchar_t*)mir_alloc((2 * mir_tstrlen(szWinText) + 1)*sizeof(wchar_t));
+ wchar_t *szTitle = (wchar_t*)mir_alloc((2 * mir_wstrlen(szWinText) + 1)*sizeof(wchar_t));
if (szTitle == NULL) {
mir_free(szWinText);
return NULL;
}
- mir_tstrcpy(szTitle, szWinText);
- mir_tstrcpy(szTitle + mir_tstrlen(szTitle), szWinText);
+ mir_wstrcpy(szTitle, szWinText);
+ mir_wstrcpy(szTitle + mir_wstrlen(szTitle), szWinText);
mir_free(szWinText);
return szTitle;
@@ -61,14 +61,14 @@ static wchar_t *parseWinampSong(ARGUMENTSINFO *ai) wchar_t *scur = wcschr(szTitle, '.');
wchar_t *cur;
- if ((scur == NULL) || ((cur = wcsstr(scur, L" - Winamp")) == NULL) || (scur >= cur) || (scur > (szTitle + mir_tstrlen(szTitle) - 2)) || (cur > (szTitle + mir_tstrlen(szTitle)))) {
+ if ((scur == NULL) || ((cur = wcsstr(scur, L" - Winamp")) == NULL) || (scur >= cur) || (scur > (szTitle + mir_wstrlen(szTitle) - 2)) || (cur > (szTitle + mir_wstrlen(szTitle)))) {
mir_free(szTitle);
return NULL;
}
scur++;
scur++;
*cur = '\0';
- res = mir_tstrdup(scur);
+ res = mir_wstrdup(scur);
mir_free(szTitle);
ai->flags |= AIF_DONTPARSE;
@@ -88,13 +88,13 @@ static wchar_t *parseWinampState(ARGUMENTSINFO *ai) wchar_t *scur = wcschr(szTitle, '.');
wchar_t *cur;
if (scur == NULL || (cur = wcsstr(scur, L" - Winamp")) == NULL)
- res = mir_tstrdup(TranslateT("Stopped"));
+ res = mir_wstrdup(TranslateT("Stopped"));
else if ((!wcsncmp(cur + 10, L"[Stopped]", 9)))
- res = mir_tstrdup(TranslateT("Stopped"));
+ res = mir_wstrdup(TranslateT("Stopped"));
else if ((!wcsncmp(cur + 10, L"[Paused]", 8)))
- res = mir_tstrdup(TranslateT("Paused"));
+ res = mir_wstrdup(TranslateT("Paused"));
else
- res = mir_tstrdup(L"Playing");
+ res = mir_wstrdup(L"Playing");
mir_free(szTitle);
return res;
}
diff --git a/plugins/Variables/src/parse_inet.cpp b/plugins/Variables/src/parse_inet.cpp index 58c96df015..cd927fb98b 100644 --- a/plugins/Variables/src/parse_inet.cpp +++ b/plugins/Variables/src/parse_inet.cpp @@ -24,7 +24,7 @@ static wchar_t *parseUrlEnc(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- char *res = mir_t2a(ai->targv[1]);
+ char *res = mir_u2a(ai->targv[1]);
if (res == NULL)
return NULL;
@@ -45,7 +45,7 @@ static wchar_t *parseUrlEnc(ARGUMENTSINFO *ai) cur += mir_strlen(hex);
}
- wchar_t *tres = mir_a2t(res);
+ wchar_t *tres = mir_a2u(res);
mir_free(res);
return tres;
}
@@ -55,7 +55,7 @@ static wchar_t *parseUrlDec(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- char *res = mir_t2a(ai->targv[1]);
+ char *res = mir_u2a(ai->targv[1]);
if (res == NULL)
return NULL;
@@ -72,7 +72,7 @@ static wchar_t *parseUrlDec(ARGUMENTSINFO *ai) }
res = (char*)mir_realloc(res, mir_strlen(res) + 1);
- wchar_t *tres = mir_a2t(res);
+ wchar_t *tres = mir_a2u(res);
mir_free(res);
return tres;
}
@@ -84,7 +84,7 @@ static wchar_t *parseNToA(ARGUMENTSINFO *ai) struct in_addr in;
in.s_addr = ttoi(ai->targv[1]);
- return mir_a2t(inet_ntoa(in));
+ return mir_a2u(inet_ntoa(in));
}
static wchar_t *parseHToA(ARGUMENTSINFO *ai)
@@ -94,7 +94,7 @@ static wchar_t *parseHToA(ARGUMENTSINFO *ai) struct in_addr in;
in.s_addr = htonl(ttoi(ai->targv[1]));
- return mir_a2t(inet_ntoa(in));
+ return mir_a2u(inet_ntoa(in));
}
void registerInetTokens()
diff --git a/plugins/Variables/src/parse_logic.cpp b/plugins/Variables/src/parse_logic.cpp index 763136f821..0737a17d11 100644 --- a/plugins/Variables/src/parse_logic.cpp +++ b/plugins/Variables/src/parse_logic.cpp @@ -32,11 +32,11 @@ static wchar_t *parseAnd(ARGUMENTSINFO *ai) if (fi.eCount > 0) {
ai->flags |= AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
}
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseFalse(ARGUMENTSINFO *ai)
@@ -45,7 +45,7 @@ static wchar_t *parseFalse(ARGUMENTSINFO *ai) return NULL;
ai->flags |= AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseIf(ARGUMENTSINFO *ai)
@@ -59,7 +59,7 @@ static wchar_t *parseIf(ARGUMENTSINFO *ai) fi.tszFormat = ai->targv[1];
mir_free(formatString(&fi));
- return mir_tstrdup((fi.eCount == 0) ? ai->targv[2] : ai->targv[3]);
+ return mir_wstrdup((fi.eCount == 0) ? ai->targv[2] : ai->targv[3]);
}
static wchar_t *parseIf2(ARGUMENTSINFO *ai)
@@ -76,7 +76,7 @@ static wchar_t *parseIf2(ARGUMENTSINFO *ai) return szCondition;
mir_free(szCondition);
- return mir_tstrdup(ai->targv[2]);
+ return mir_wstrdup(ai->targv[2]);
}
static wchar_t *parseIf3(ARGUMENTSINFO *ai)
@@ -104,16 +104,16 @@ static wchar_t *parseIfequal(ARGUMENTSINFO *ai) FORMATINFO fi;
memcpy(&fi, ai->fi, sizeof(fi));
fi.szFormat = ai->argv[1];
- ptrT tszFirst(formatString(&fi));
+ ptrW tszFirst(formatString(&fi));
fi.szFormat = ai->argv[2];
- ptrT tszSecond(formatString(&fi));
+ ptrW tszSecond(formatString(&fi));
if (tszFirst == NULL || tszSecond == NULL)
return NULL;
if (ttoi(tszFirst) == ttoi(tszSecond))
- return mir_tstrdup(ai->targv[3]);
+ return mir_wstrdup(ai->targv[3]);
- return mir_tstrdup(ai->targv[4]);
+ return mir_wstrdup(ai->targv[4]);
}
static wchar_t *parseIfgreater(ARGUMENTSINFO *ai)
@@ -124,16 +124,16 @@ static wchar_t *parseIfgreater(ARGUMENTSINFO *ai) FORMATINFO fi;
memcpy(&fi, ai->fi, sizeof(fi));
fi.szFormat = ai->argv[1];
- ptrT tszFirst(formatString(&fi));
+ ptrW tszFirst(formatString(&fi));
fi.szFormat = ai->argv[2];
- ptrT tszSecond(formatString(&fi));
+ ptrW tszSecond(formatString(&fi));
if (tszFirst == NULL || tszSecond == NULL)
return NULL;
if (ttoi(tszFirst) > ttoi(tszSecond))
- return mir_tstrdup(ai->targv[3]);
+ return mir_wstrdup(ai->targv[3]);
- return mir_tstrdup(ai->targv[4]);
+ return mir_wstrdup(ai->targv[4]);
}
static wchar_t *parseIflonger(ARGUMENTSINFO *ai)
@@ -144,16 +144,16 @@ static wchar_t *parseIflonger(ARGUMENTSINFO *ai) FORMATINFO fi;
memcpy(&fi, ai->fi, sizeof(fi));
fi.szFormat = ai->argv[1];
- ptrT tszFirst(formatString(&fi));
+ ptrW tszFirst(formatString(&fi));
fi.szFormat = ai->argv[2];
- ptrT tszSecond(formatString(&fi));
+ ptrW tszSecond(formatString(&fi));
if (tszFirst == NULL || tszSecond == NULL)
return NULL;
- if (mir_tstrlen(tszFirst) > mir_tstrlen(tszSecond))
- return mir_tstrdup(ai->targv[3]);
+ if (mir_wstrlen(tszFirst) > mir_wstrlen(tszSecond))
+ return mir_wstrdup(ai->targv[3]);
- return mir_tstrdup(ai->targv[4]);
+ return mir_wstrdup(ai->targv[4]);
}
/*
@@ -166,7 +166,7 @@ static wchar_t *parseFor(ARGUMENTSINFO *ai) if (ai->argc != 5)
return NULL;
- wchar_t *res = mir_tstrdup(L"");
+ wchar_t *res = mir_wstrdup(L"");
FORMATINFO fi;
memcpy(&fi, ai->fi, sizeof(fi));
@@ -180,15 +180,15 @@ static wchar_t *parseFor(ARGUMENTSINFO *ai) wchar_t *parsed = formatString(&fi);
if (parsed != NULL) {
if (res == NULL) {
- res = (wchar_t*)mir_alloc(mir_tstrlen(parsed) + 1 * sizeof(wchar_t));
+ res = (wchar_t*)mir_alloc(mir_wstrlen(parsed) + 1 * sizeof(wchar_t));
if (res == NULL) {
mir_free(parsed);
return NULL;
}
}
- else res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(parsed) + 1)*sizeof(wchar_t));
+ else res = (wchar_t*)mir_realloc(res, (mir_wstrlen(res) + mir_wstrlen(parsed) + 1)*sizeof(wchar_t));
- mir_tstrcat(res, parsed);
+ mir_wstrcat(res, parsed);
mir_free(parsed);
}
fi.tszFormat = ai->targv[3];
@@ -209,7 +209,7 @@ static wchar_t *parseEqual(ARGUMENTSINFO *ai) if (ttoi(ai->targv[1]) != ttoi(ai->targv[2]))
ai->flags |= AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseGreater(ARGUMENTSINFO *ai)
@@ -220,7 +220,7 @@ static wchar_t *parseGreater(ARGUMENTSINFO *ai) if (ttoi(ai->targv[1]) <= ttoi(ai->targv[2]))
ai->flags |= AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseLonger(ARGUMENTSINFO *ai)
@@ -228,10 +228,10 @@ static wchar_t *parseLonger(ARGUMENTSINFO *ai) if (ai->argc != 3)
return NULL;
- if (mir_tstrlen(ai->targv[1]) <= mir_tstrlen(ai->targv[2]))
+ if (mir_wstrlen(ai->targv[1]) <= mir_wstrlen(ai->targv[2]))
ai->flags |= AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseNot(ARGUMENTSINFO *ai)
@@ -248,7 +248,7 @@ static wchar_t *parseNot(ARGUMENTSINFO *ai) if (fi.eCount == 0)
ai->flags |= AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseOr(ARGUMENTSINFO *ai)
@@ -268,12 +268,12 @@ static wchar_t *parseOr(ARGUMENTSINFO *ai) ai->flags &= ~AIF_FALSE;
}
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseTrue(ARGUMENTSINFO *ai)
{
- return (ai->argc != 1) ? NULL : mir_tstrdup(L"");
+ return (ai->argc != 1) ? NULL : mir_wstrdup(L"");
}
static wchar_t *parseXor(ARGUMENTSINFO *ai)
@@ -293,7 +293,7 @@ static wchar_t *parseXor(ARGUMENTSINFO *ai) int val2 = fi.eCount == 0;
ai->flags |= ((val1 & AIF_FALSE) == !(val2 & AIF_FALSE)) ? 0 : AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
void registerLogicTokens()
diff --git a/plugins/Variables/src/parse_math.cpp b/plugins/Variables/src/parse_math.cpp index a9946d8a7a..cd028d3651 100644 --- a/plugins/Variables/src/parse_math.cpp +++ b/plugins/Variables/src/parse_math.cpp @@ -54,18 +54,18 @@ static wchar_t *parseHex(ARGUMENTSINFO *ai) int val = ttoi(ai->targv[1]);
int padding = ttoi(ai->targv[2]);
- mir_sntprintf(szVal, L"%x", val);
- unsigned int zeros = max(padding - (signed int)mir_tstrlen(szVal), 0);
- wchar_t *res = (wchar_t*)mir_alloc((zeros + mir_tstrlen(szVal) + 3)*sizeof(wchar_t));
+ mir_snwprintf(szVal, L"%x", val);
+ unsigned int zeros = max(padding - (signed int)mir_wstrlen(szVal), 0);
+ wchar_t *res = (wchar_t*)mir_alloc((zeros + mir_wstrlen(szVal) + 3)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((zeros + mir_tstrlen(szVal) + 3) * sizeof(wchar_t)));
- mir_tstrcpy(res, L"0x");
+ memset(res, 0, ((zeros + mir_wstrlen(szVal) + 3) * sizeof(wchar_t)));
+ mir_wstrcpy(res, L"0x");
for (i = 0; i < zeros; i++)
*(res + 2 + i) = '0';
- mir_tstrcat(res, szVal);
+ mir_wstrcat(res, szVal);
return res;
}
@@ -140,19 +140,19 @@ static wchar_t *parseNum(ARGUMENTSINFO *ai) if (szVal == NULL)
return NULL;
- unsigned zeros = max(padding - (signed int)mir_tstrlen(szVal), 0);
- wchar_t *res = (wchar_t*)mir_alloc((zeros + mir_tstrlen(szVal) + 1)*sizeof(wchar_t));
+ unsigned zeros = max(padding - (signed int)mir_wstrlen(szVal), 0);
+ wchar_t *res = (wchar_t*)mir_alloc((zeros + mir_wstrlen(szVal) + 1)*sizeof(wchar_t));
if (res == NULL) {
mir_free(szVal);
return NULL;
}
- memset(res, 0, ((zeros + mir_tstrlen(szVal) + 1) * sizeof(wchar_t)));
+ memset(res, 0, ((zeros + mir_wstrlen(szVal) + 1) * sizeof(wchar_t)));
wchar_t *cur = res;
for (unsigned i = 0; i < zeros; i++)
*cur++ = '0';
- mir_tstrcat(res, szVal);
+ mir_wstrcat(res, szVal);
mir_free(szVal);
return res;
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp index ac1185edb3..b8d2e9e324 100644 --- a/plugins/Variables/src/parse_metacontacts.cpp +++ b/plugins/Variables/src/parse_metacontacts.cpp @@ -32,7 +32,7 @@ static wchar_t *parseGetParent(ARGUMENTSINFO *ai) if (hContact == NULL)
return NULL;
- ptrT szUniqueID;
+ ptrW szUniqueID;
char* szProto = GetContactProto(hContact);
if (szProto != NULL)
szUniqueID = getContactInfoT(CNF_UNIQUEID, hContact);
@@ -40,8 +40,8 @@ static wchar_t *parseGetParent(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
wchar_t tszID[40];
- mir_sntprintf(tszID, L"%p", hContact);
- szUniqueID = mir_tstrdup(tszID);
+ mir_snwprintf(tszID, L"%p", hContact);
+ szUniqueID = mir_wstrdup(tszID);
}
return CMString(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
@@ -60,7 +60,7 @@ static wchar_t *parseGetDefault(ARGUMENTSINFO *ai) if (hContact == NULL)
return NULL;
- ptrT szUniqueID;
+ ptrW szUniqueID;
char* szProto = GetContactProto(hContact);
if (szProto != NULL)
szUniqueID = getContactInfoT(CNF_UNIQUEID, hContact);
@@ -68,8 +68,8 @@ static wchar_t *parseGetDefault(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
wchar_t tszID[40];
- mir_sntprintf(tszID, L"%p", hContact);
- szUniqueID = mir_tstrdup(tszID);
+ mir_snwprintf(tszID, L"%p", hContact);
+ szUniqueID = mir_wstrdup(tszID);
}
return CMString(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
@@ -88,7 +88,7 @@ static wchar_t *parseGetMostOnline(ARGUMENTSINFO *ai) if (hContact == NULL)
return NULL;
- ptrT szUniqueID;
+ ptrW szUniqueID;
char *szProto = GetContactProto(hContact);
if (szProto != NULL)
szUniqueID = getContactInfoT(CNF_UNIQUEID, hContact);
@@ -96,8 +96,8 @@ static wchar_t *parseGetMostOnline(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
wchar_t tszID[40];
- mir_sntprintf(tszID, L"%p", hContact);
- szUniqueID = mir_tstrdup(tszID);
+ mir_snwprintf(tszID, L"%p", hContact);
+ szUniqueID = mir_wstrdup(tszID);
}
return CMString(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 71722f7e45..11eb8d0181 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -27,7 +27,7 @@ static wchar_t* parseCodeToStatus(ARGUMENTSINFO *ai) unsigned int status = ttoi(ai->targv[1]);
wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
if (szStatus != NULL)
- return mir_tstrdup(szStatus);
+ return mir_wstrdup(szStatus);
return NULL;
}
@@ -35,34 +35,34 @@ static wchar_t* parseCodeToStatus(ARGUMENTSINFO *ai) static int getContactInfoFlags(wchar_t *tszDesc)
{
int flags = 0;
- for (wchar_t *cur = tszDesc; (cur < (tszDesc + mir_tstrlen(tszDesc))); cur++) {
- if (!wcsnicmp(cur, STR_PROTOID, mir_tstrlen(STR_PROTOID))) {
+ for (wchar_t *cur = tszDesc; (cur < (tszDesc + mir_wstrlen(tszDesc))); cur++) {
+ if (!wcsnicmp(cur, STR_PROTOID, mir_wstrlen(STR_PROTOID))) {
flags |= CI_PROTOID;
- cur += mir_tstrlen(STR_PROTOID) - 1;
+ cur += mir_wstrlen(STR_PROTOID) - 1;
}
- else if (!wcsnicmp(cur, STR_NICK, mir_tstrlen(STR_NICK))) {
+ else if (!wcsnicmp(cur, STR_NICK, mir_wstrlen(STR_NICK))) {
flags |= CI_NICK;
- cur += mir_tstrlen(STR_NICK) - 1;
+ cur += mir_wstrlen(STR_NICK) - 1;
}
- else if (!wcsnicmp(cur, STR_FIRSTNAME, mir_tstrlen(STR_FIRSTNAME))) {
+ else if (!wcsnicmp(cur, STR_FIRSTNAME, mir_wstrlen(STR_FIRSTNAME))) {
flags |= CI_FIRSTNAME;
- cur += mir_tstrlen(STR_FIRSTNAME) - 1;
+ cur += mir_wstrlen(STR_FIRSTNAME) - 1;
}
- else if (!wcsnicmp(cur, STR_LASTNAME, mir_tstrlen(STR_LASTNAME))) {
+ else if (!wcsnicmp(cur, STR_LASTNAME, mir_wstrlen(STR_LASTNAME))) {
flags |= CI_LASTNAME;
- cur += mir_tstrlen(STR_LASTNAME) - 1;
+ cur += mir_wstrlen(STR_LASTNAME) - 1;
}
- else if (!wcsnicmp(cur, STR_DISPLAY, mir_tstrlen(STR_DISPLAY))) {
+ else if (!wcsnicmp(cur, STR_DISPLAY, mir_wstrlen(STR_DISPLAY))) {
flags |= CI_LISTNAME;
- cur += mir_tstrlen(STR_DISPLAY) - 1;
+ cur += mir_wstrlen(STR_DISPLAY) - 1;
}
- else if (!wcsnicmp(cur, STR_EMAIL, mir_tstrlen(STR_EMAIL))) {
+ else if (!wcsnicmp(cur, STR_EMAIL, mir_wstrlen(STR_EMAIL))) {
flags |= CI_EMAIL;
- cur += mir_tstrlen(STR_EMAIL) - 1;
+ cur += mir_wstrlen(STR_EMAIL) - 1;
}
- else if (!wcsnicmp(cur, STR_UNIQUEID, mir_tstrlen(STR_UNIQUEID))) {
+ else if (!wcsnicmp(cur, STR_UNIQUEID, mir_wstrlen(STR_UNIQUEID))) {
flags |= CI_UNIQUEID;
- cur += mir_tstrlen(STR_UNIQUEID) - 1;
+ cur += mir_wstrlen(STR_UNIQUEID) - 1;
}
}
if (flags == 0) {
@@ -129,7 +129,7 @@ static wchar_t* parseDBProfileName(ARGUMENTSINFO *ai) if (CallService(MS_DB_GETPROFILENAMET, _countof(name), (LPARAM)name))
return NULL;
- return mir_tstrdup(name);
+ return mir_wstrdup(name);
}
static wchar_t* parseDBProfilePath(ARGUMENTSINFO *ai)
@@ -141,7 +141,7 @@ static wchar_t* parseDBProfilePath(ARGUMENTSINFO *ai) if (CallService(MS_DB_GETPROFILEPATHT, _countof(path), (LPARAM)path))
return NULL;
- return mir_tstrdup(path);
+ return mir_wstrdup(path);
}
static wchar_t* getDBSetting(MCONTACT hContact, char* module, char* setting, wchar_t* defaultValue)
@@ -162,7 +162,7 @@ static wchar_t* getDBSetting(MCONTACT hContact, char* module, char* setting, wch var = itot(dbv.dVal);
break;
case DBVT_ASCIIZ:
- var = mir_a2t(dbv.pszVal);
+ var = mir_a2u(dbv.pszVal);
break;
case DBVT_WCHAR:
var = mir_wstrdup(dbv.pwszVal);
@@ -182,23 +182,23 @@ static wchar_t* parseDBSetting(ARGUMENTSINFO *ai) return NULL;
MCONTACT hContact = NULL;
- if (mir_tstrlen(ai->targv[1]) > 0) {
+ if (mir_wstrlen(ai->targv[1]) > 0) {
hContact = getContactFromString(ai->targv[1], CI_ALLFLAGS);
if (hContact == INVALID_CONTACT_ID)
return NULL;
}
- char *szModule = mir_t2a(ai->targv[2]);
+ char *szModule = mir_u2a(ai->targv[2]);
if (szModule == NULL)
return NULL;
- char *szSetting = mir_t2a(ai->targv[3]);
+ char *szSetting = mir_u2a(ai->targv[3]);
if (szSetting == NULL) {
mir_free(szModule);
return NULL;
}
- wchar_t *szDefaultValue = ((ai->argc > 4 && mir_tstrlen(ai->targv[4]) > 0) ? mir_tstrdup(ai->targv[4]) : NULL);
+ wchar_t *szDefaultValue = ((ai->argc > 4 && mir_wstrlen(ai->targv[4]) > 0) ? mir_wstrdup(ai->targv[4]) : NULL);
wchar_t *res = getDBSetting(hContact, szModule, szSetting, szDefaultValue);
mir_free(szDefaultValue);
mir_free(szSetting);
@@ -216,7 +216,7 @@ static wchar_t* parseLastSeenDate(ARGUMENTSINFO *ai) return NULL;
wchar_t *szFormat;
- if (ai->argc == 2 || (ai->argc > 2 && mir_tstrlen(ai->targv[2]) == 0))
+ if (ai->argc == 2 || (ai->argc > 2 && mir_wstrlen(ai->targv[2]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[2];
@@ -258,7 +258,7 @@ static wchar_t* parseLastSeenTime(ARGUMENTSINFO *ai) return NULL;
wchar_t *szFormat;
- if (ai->argc == 2 || (ai->argc > 2 && mir_tstrlen(ai->targv[2]) == 0))
+ if (ai->argc == 2 || (ai->argc > 2 && mir_wstrlen(ai->targv[2]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[2];
@@ -307,7 +307,7 @@ static wchar_t* parseLastSeenStatus(ARGUMENTSINFO *ai) wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
if (szStatus != NULL)
- return mir_tstrdup(szStatus);
+ return mir_wstrdup(szStatus);
return NULL;
}
@@ -322,7 +322,7 @@ static wchar_t* parseMirandaPath(ARGUMENTSINFO *ai) if (GetModuleFileName(NULL, path, _countof(path)) == 0)
return NULL;
- return mir_tstrdup(path);
+ return mir_wstrdup(path);
}
static wchar_t* parseMyStatus(ARGUMENTSINFO *ai)
@@ -331,13 +331,13 @@ static wchar_t* parseMyStatus(ARGUMENTSINFO *ai) return NULL;
int status;
- if (ai->argc == 1 || mir_tstrlen(ai->targv[1]) == 0)
+ if (ai->argc == 1 || mir_wstrlen(ai->targv[1]) == 0)
status = CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
else
status = CallProtoService(_T2A(ai->targv[1]), PS_GETSTATUS, 0, 0);
wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
- return (szStatus != NULL) ? mir_tstrdup(szStatus) : NULL;
+ return (szStatus != NULL) ? mir_wstrdup(szStatus) : NULL;
}
static wchar_t* parseProtoInfo(ARGUMENTSINFO *ai)
@@ -347,28 +347,28 @@ static wchar_t* parseProtoInfo(ARGUMENTSINFO *ai) char *szRes = NULL;
wchar_t *tszRes = NULL;
- ptrA szProto(mir_t2a(ai->targv[1]));
+ ptrA szProto(mir_u2a(ai->targv[1]));
- if (!mir_tstrcmp(ai->targv[2], _A2W(STR_PINAME)))
+ if (!mir_wstrcmp(ai->targv[2], _A2W(STR_PINAME)))
tszRes = Hlp_GetProtocolName(szProto);
- else if (!mir_tstrcmp(ai->targv[2], _A2W(STR_PIUIDTEXT))) {
+ else if (!mir_wstrcmp(ai->targv[2], _A2W(STR_PIUIDTEXT))) {
szRes = (char *)CallProtoService(szProto, PS_GETCAPS, (WPARAM)PFLAG_UNIQUEIDTEXT, 0);
if (INT_PTR(szRes) == CALLSERVICE_NOTFOUND)
return NULL;
}
- else if (!mir_tstrcmp(ai->targv[2], _A2W(STR_PIUIDSETTING))) {
+ else if (!mir_wstrcmp(ai->targv[2], _A2W(STR_PIUIDSETTING))) {
szRes = (char *)CallProtoService(szProto, PS_GETCAPS, (WPARAM)PFLAG_UNIQUEIDSETTING, 0);
if (INT_PTR(szRes) == CALLSERVICE_NOTFOUND)
return NULL;
}
- else if (!mir_tstrcmp(ai->targv[2], _A2W(STR_PINICK)))
+ else if (!mir_wstrcmp(ai->targv[2], _A2W(STR_PINICK)))
tszRes = Contact_GetInfo(CNF_DISPLAY, NULL, szProto);
if (szRes == NULL && tszRes == NULL)
return NULL;
if (szRes != NULL && tszRes == NULL)
- tszRes = mir_a2t(szRes);
+ tszRes = mir_a2u(szRes);
return tszRes;
}
@@ -379,7 +379,7 @@ static wchar_t* parseSpecialContact(ARGUMENTSINFO *ai) return NULL;
ai->flags |= AIF_DONTPARSE;
- ptrT szUniqueID;
+ ptrW szUniqueID;
char *szProto = GetContactProto(ai->fi->hContact);
if (szProto != NULL)
szUniqueID = getContactInfoT(CNF_UNIQUEID, ai->fi->hContact);
@@ -389,7 +389,7 @@ static wchar_t* parseSpecialContact(ARGUMENTSINFO *ai) szUniqueID = (wchar_t*)mir_alloc(40);
if (szUniqueID == NULL)
return NULL;
- mir_sntprintf(szUniqueID, 20, L"%p", ai->fi->hContact);
+ mir_snwprintf(szUniqueID, 20, L"%p", ai->fi->hContact);
}
if (szUniqueID == NULL)
@@ -590,7 +590,7 @@ static wchar_t* parseTranslate(ARGUMENTSINFO *ai) return NULL;
wchar_t *res = TranslateTS(ai->targv[1]);
- return (res == NULL) ? NULL : mir_tstrdup(res);
+ return (res == NULL) ? NULL : mir_wstrdup(res);
}
static wchar_t* parseVersionString(ARGUMENTSINFO *ai)
@@ -603,7 +603,7 @@ static wchar_t* parseVersionString(ARGUMENTSINFO *ai) if (CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)sizeof(versionString), (LPARAM)versionString))
return NULL;
- return mir_a2t(versionString);
+ return mir_a2u(versionString);
}
static wchar_t *parseContactNameString(ARGUMENTSINFO *ai)
@@ -613,7 +613,7 @@ static wchar_t *parseContactNameString(ARGUMENTSINFO *ai) ai->flags |= AIF_DONTPARSE;
wchar_t *ret = (wchar_t*)pcli->pfnGetContactDisplayName(ai->fi->hContact, 0);
- return (ret == NULL) ? NULL : mir_tstrdup(ret);
+ return (ret == NULL) ? NULL : mir_wstrdup(ret);
}
static wchar_t *parseMirDateString(ARGUMENTSINFO *ai)
@@ -624,7 +624,7 @@ static wchar_t *parseMirDateString(ARGUMENTSINFO *ai) ai->flags |= AIF_DONTPARSE;
wchar_t ret[128];
- return mir_tstrdup(TimeZone_ToStringT(time(NULL), L"d s", ret, _countof(ret)));
+ return mir_wstrdup(TimeZone_ToStringT(time(NULL), L"d s", ret, _countof(ret)));
}
static wchar_t *parseMirandaCoreVar(ARGUMENTSINFO *ai)
@@ -635,7 +635,7 @@ static wchar_t *parseMirandaCoreVar(ARGUMENTSINFO *ai) ai->flags |= AIF_DONTPARSE;
wchar_t corevar[MAX_PATH];
- mir_sntprintf(corevar, L"%%%s%%", ai->targv[0]);
+ mir_snwprintf(corevar, L"%%%s%%", ai->targv[0]);
return Utils_ReplaceVarsT(corevar);
}
@@ -647,7 +647,7 @@ static wchar_t *parseMirSrvExists(ARGUMENTSINFO *ai) if (!ServiceExists(_T2A(ai->targv[1])))
ai->flags |= AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
void registerMirandaTokens()
diff --git a/plugins/Variables/src/parse_regexp.cpp b/plugins/Variables/src/parse_regexp.cpp index f5cb3c6ba8..7031fc4cc6 100644 --- a/plugins/Variables/src/parse_regexp.cpp +++ b/plugins/Variables/src/parse_regexp.cpp @@ -39,14 +39,14 @@ static wchar_t *parseRegExpCheck(ARGUMENTSINFO *ai) return NULL;
pcre16_extra *extra = pcre16_study(ppat, 0, &err);
- int nmat = pcre16_exec(ppat, extra, ai->targv[2], (int)mir_tstrlen(ai->targv[2]), 0, 0, offsets, 99);
+ int nmat = pcre16_exec(ppat, extra, ai->targv[2], (int)mir_wstrlen(ai->targv[2]), 0, 0, offsets, 99);
if (nmat > 0) {
ai->flags &= ~AIF_FALSE;
_ltoa(nmat, szVal, 10);
- return mir_a2t(szVal);
+ return mir_a2u(szVal);
}
- return mir_tstrdup(L"0");
+ return mir_wstrdup(L"0");
}
/*
@@ -72,19 +72,19 @@ static wchar_t *parseRegExpSubstr(ARGUMENTSINFO *ai) return NULL;
pcre16_extra *extra = pcre16_study(ppat, 0, &err);
- int nmat = pcre16_exec(ppat, extra, ai->targv[2], (int)mir_tstrlen(ai->targv[2]), 0, 0, offsets, 99);
+ int nmat = pcre16_exec(ppat, extra, ai->targv[2], (int)mir_wstrlen(ai->targv[2]), 0, 0, offsets, 99);
if (nmat >= 0)
ai->flags &= ~AIF_FALSE;
if (pcre16_get_substring(ai->targv[2], offsets, nmat, number, &substring) < 0)
ai->flags |= AIF_FALSE;
else {
- wchar_t *tres = mir_tstrdup(substring);
+ wchar_t *tres = mir_wstrdup(substring);
pcre16_free_substring(substring);
return tres;
}
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
void registerRegExpTokens()
diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp index 5ee00fb0f7..5779f13dc1 100644 --- a/plugins/Variables/src/parse_str.cpp +++ b/plugins/Variables/src/parse_str.cpp @@ -24,7 +24,7 @@ static wchar_t *parseCaps(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_wstrdup(ai->targv[1]);
wchar_t *cur = res;
CharLower(res);
*cur = (wchar_t)CharUpper((LPTSTR)*cur);
@@ -49,7 +49,7 @@ static wchar_t *parseCaps2(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_wstrdup(ai->targv[1]);
wchar_t *cur = res;
*cur = (wchar_t)CharUpper((LPTSTR)*cur);
cur++;
@@ -67,7 +67,7 @@ static wchar_t *parseCaps2(ARGUMENTSINFO *ai) static wchar_t *parseCrlf(ARGUMENTSINFO *ai)
{
ai->flags |= AIF_DONTPARSE;
- return mir_tstrdup(L"\r\n");
+ return mir_wstrdup(L"\r\n");
}
static wchar_t *parseEolToCrlf(ARGUMENTSINFO *ai)
@@ -75,7 +75,7 @@ static wchar_t *parseEolToCrlf(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_wstrdup(ai->targv[1]);
wchar_t *cur = res;
do {
cur = wcschr(cur, '\n');
@@ -84,9 +84,9 @@ static wchar_t *parseEolToCrlf(ARGUMENTSINFO *ai) log_debug(cur);
int loc = cur - res;
- res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 2)*sizeof(wchar_t));
+ res = (wchar_t*)mir_realloc(res, (mir_wstrlen(res) + 2)*sizeof(wchar_t));
cur = res + loc;
- memmove(cur + 2, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t));
+ memmove(cur + 2, cur + 1, (mir_wstrlen(cur + 1) + 1)*sizeof(wchar_t));
memcpy(cur, L"\r\n", 2 * sizeof(wchar_t));
cur += 2;
}
@@ -106,20 +106,20 @@ static wchar_t *parseFixeol(ARGUMENTSINFO *ai) return NULL;
wchar_t *cur = ai->targv[1];
- while (mir_tstrcmp(cur, L"\r\n") && *cur != '\n' && *cur != 0)
+ while (mir_wstrcmp(cur, L"\r\n") && *cur != '\n' && *cur != 0)
cur++;
if (*cur == '\0')
- return mir_tstrdup(ai->targv[1]);
+ return mir_wstrdup(ai->targv[1]);
cur--;
- wchar_t *res = (wchar_t*)mir_alloc((cur - ai->targv[1] + mir_tstrlen(szReplacement) + 1)*sizeof(wchar_t));
+ wchar_t *res = (wchar_t*)mir_alloc((cur - ai->targv[1] + mir_wstrlen(szReplacement) + 1)*sizeof(wchar_t));
if (res == NULL)
return res;
memset(res, 0, (((cur - ai->targv[1]) + 1) * sizeof(wchar_t)));
wcsncpy(res, ai->targv[1], cur - ai->targv[1]);
- mir_tstrcat(res, szReplacement);
+ mir_wstrcat(res, szReplacement);
return res;
}
@@ -132,27 +132,27 @@ static wchar_t *parseFixeol2(ARGUMENTSINFO *ai) default: return NULL;
}
- wchar_t *res = mir_tstrdup(ai->targv[1]);
- for (size_t pos = 0; pos < mir_tstrlen(res); pos++) {
+ wchar_t *res = mir_wstrdup(ai->targv[1]);
+ for (size_t pos = 0; pos < mir_wstrlen(res); pos++) {
wchar_t *cur = res + pos;
wchar_t *szEol = NULL;
- if (!wcsncmp(cur, L"\r\n", mir_tstrlen(L"\r\n")))
+ if (!wcsncmp(cur, L"\r\n", mir_wstrlen(L"\r\n")))
szEol = L"\r\n";
if (*cur == '\n')
szEol = L"\n";
if (szEol != NULL) {
- if (mir_tstrlen(szReplacement) > mir_tstrlen(szEol)) {
- res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szReplacement) - mir_tstrlen(szEol) + 1)*sizeof(wchar_t));
+ if (mir_wstrlen(szReplacement) > mir_wstrlen(szEol)) {
+ res = (wchar_t*)mir_realloc(res, (mir_wstrlen(res) + mir_wstrlen(szReplacement) - mir_wstrlen(szEol) + 1)*sizeof(wchar_t));
cur = res + pos;
}
- memmove(cur + mir_tstrlen(szReplacement), cur + mir_tstrlen(szEol), (mir_tstrlen(cur + mir_tstrlen(szEol)) + 1)*sizeof(wchar_t));
- memcpy(cur, szReplacement, mir_tstrlen(szReplacement)*sizeof(wchar_t));
- pos += mir_tstrlen(szReplacement) - 1;
+ memmove(cur + mir_wstrlen(szReplacement), cur + mir_wstrlen(szEol), (mir_wstrlen(cur + mir_wstrlen(szEol)) + 1)*sizeof(wchar_t));
+ memcpy(cur, szReplacement, mir_wstrlen(szReplacement)*sizeof(wchar_t));
+ pos += mir_wstrlen(szReplacement) - 1;
}
}
- return (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(wchar_t));
+ return (wchar_t*)mir_realloc(res, (mir_wstrlen(res) + 1)*sizeof(wchar_t));
}
static wchar_t *parseInsert(ARGUMENTSINFO *ai)
@@ -161,17 +161,17 @@ static wchar_t *parseInsert(ARGUMENTSINFO *ai) return NULL;
unsigned int pos = ttoi(ai->targv[3]);
- if (pos > mir_tstrlen(ai->targv[1]))
+ if (pos > mir_wstrlen(ai->targv[1]))
return NULL;
- wchar_t *res = (wchar_t*)mir_alloc((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1)*sizeof(wchar_t));
+ wchar_t *res = (wchar_t*)mir_alloc((mir_wstrlen(ai->targv[1]) + mir_wstrlen(ai->targv[2]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1) * sizeof(wchar_t)));
+ memset(res, 0, ((mir_wstrlen(ai->targv[1]) + mir_wstrlen(ai->targv[2]) + 1) * sizeof(wchar_t)));
wcsncpy(res, ai->targv[1], pos);
- mir_tstrcpy(res + pos, ai->targv[2]);
- mir_tstrcpy(res + pos + mir_tstrlen(ai->targv[2]), ai->targv[1] + pos);
+ mir_wstrcpy(res + pos, ai->targv[2]);
+ mir_wstrcpy(res + pos + mir_wstrlen(ai->targv[2]), ai->targv[1] + pos);
return res;
}
@@ -184,7 +184,7 @@ static wchar_t *parseLeft(ARGUMENTSINFO *ai) if (len < 0)
return NULL;
- len = min(len, (signed int)mir_tstrlen(ai->targv[1]));
+ len = min(len, (signed int)mir_wstrlen(ai->targv[1]));
wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -199,7 +199,7 @@ static wchar_t *parseLen(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- return itot((int)mir_tstrlen(ai->targv[1]));
+ return itot((int)mir_wstrlen(ai->targv[1]));
}
static wchar_t *parseLineCount(ARGUMENTSINFO *ai)
@@ -209,7 +209,7 @@ static wchar_t *parseLineCount(ARGUMENTSINFO *ai) int count = 1;
wchar_t *cur = ai->targv[1];
- while (cur < (ai->targv[1] + mir_tstrlen(ai->targv[1]))) {
+ while (cur < (ai->targv[1] + mir_wstrlen(ai->targv[1]))) {
if (!wcsncmp(cur, L"\r\n", 2)) {
count++;
cur++;
@@ -228,7 +228,7 @@ static wchar_t *parseLower(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_wstrdup(ai->targv[1]);
if (res == NULL)
return NULL;
@@ -242,10 +242,10 @@ static wchar_t *parseLongest(ARGUMENTSINFO *ai) unsigned int iLong = 1;
for (unsigned int i = 2; i < ai->argc; i++)
- if (mir_tstrlen(ai->targv[i]) > mir_tstrlen(ai->targv[iLong]))
+ if (mir_wstrlen(ai->targv[i]) > mir_wstrlen(ai->targv[iLong]))
iLong = i;
- return mir_tstrdup(ai->targv[iLong]);
+ return mir_wstrdup(ai->targv[iLong]);
}
static wchar_t *parseNoOp(ARGUMENTSINFO *ai)
@@ -253,7 +253,7 @@ static wchar_t *parseNoOp(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- return mir_tstrdup(ai->targv[1]);
+ return mir_wstrdup(ai->targv[1]);
}
static wchar_t *parsePad(ARGUMENTSINFO *ai)
@@ -269,17 +269,17 @@ static wchar_t *parsePad(ARGUMENTSINFO *ai) if (padding < 0)
return NULL;
- unsigned int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
- wchar_t *res = (wchar_t*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
+ unsigned int addcount = max(padding - (signed int)mir_wstrlen(ai->targv[1]), 0);
+ wchar_t *res = (wchar_t*)mir_alloc((addcount + mir_wstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
+ memset(res, 0, ((addcount + mir_wstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
wchar_t *cur = res;
for (unsigned int i = 0; i < addcount; i++)
*cur++ = padchar;
- mir_tstrcat(res, ai->targv[1]);
+ mir_wstrcat(res, ai->targv[1]);
return res;
}
@@ -296,14 +296,14 @@ static wchar_t *parsePadright(ARGUMENTSINFO *ai) if (padding < 0)
return NULL;
- unsigned int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
- wchar_t *res = (wchar_t*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
+ unsigned int addcount = max(padding - (signed int)mir_wstrlen(ai->targv[1]), 0);
+ wchar_t *res = (wchar_t*)mir_alloc((addcount + mir_wstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
- mir_tstrcpy(res, ai->targv[1]);
- wchar_t *cur = res + mir_tstrlen(ai->targv[1]);
+ memset(res, 0, ((addcount + mir_wstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
+ mir_wstrcpy(res, ai->targv[1]);
+ wchar_t *cur = res + mir_wstrlen(ai->targv[1]);
for (unsigned int i = 0; i < addcount; i++)
*cur++ = padchar;
@@ -323,7 +323,7 @@ static wchar_t *parsePadcut(ARGUMENTSINFO *ai) if (padding < 0)
return NULL;
- int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
+ int addcount = max(padding - (signed int)mir_wstrlen(ai->targv[1]), 0);
wchar_t *res = (wchar_t*)mir_alloc((padding + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -352,7 +352,7 @@ static wchar_t *parsePadcutright(ARGUMENTSINFO *ai) if (padding < 0)
return NULL;
- int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
+ int addcount = max(padding - (signed int)mir_wstrlen(ai->targv[1]), 0);
wchar_t *res = (wchar_t*)mir_alloc((padding + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -377,13 +377,13 @@ static wchar_t *parseRepeat(ARGUMENTSINFO *ai) if (count < 0)
return NULL;
- wchar_t *res = (wchar_t*)mir_alloc((count * mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
+ wchar_t *res = (wchar_t*)mir_alloc((count * mir_wstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((count * mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
+ memset(res, 0, ((count * mir_wstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
for (int i = 0; i < count; i++)
- mir_tstrcat(res, ai->targv[1]);
+ mir_wstrcat(res, ai->targv[1]);
return res;
}
@@ -396,24 +396,24 @@ static wchar_t *parseReplace(ARGUMENTSINFO *ai) wchar_t *cur;
size_t pos = 0;
- wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_wstrdup(ai->targv[1]);
for (size_t i = 2; i < ai->argc; i += 2) {
- if (mir_tstrlen(ai->targv[i]) == 0)
+ if (mir_wstrlen(ai->targv[i]) == 0)
continue;
- for (pos = 0; pos<mir_tstrlen(res); pos++) {
+ for (pos = 0; pos<mir_wstrlen(res); pos++) {
cur = res + pos;
- if (!wcsncmp(cur, ai->targv[i], mir_tstrlen(ai->targv[i]))) {
- if (mir_tstrlen(ai->targv[i + 1]) > mir_tstrlen(ai->targv[i])) {
- res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(ai->targv[i + 1]) - mir_tstrlen(ai->targv[i]) + 1)*sizeof(wchar_t));
+ if (!wcsncmp(cur, ai->targv[i], mir_wstrlen(ai->targv[i]))) {
+ if (mir_wstrlen(ai->targv[i + 1]) > mir_wstrlen(ai->targv[i])) {
+ res = (wchar_t*)mir_realloc(res, (mir_wstrlen(res) + mir_wstrlen(ai->targv[i + 1]) - mir_wstrlen(ai->targv[i]) + 1)*sizeof(wchar_t));
cur = res + pos;
}
- memmove(cur + mir_tstrlen(ai->targv[i + 1]), cur + mir_tstrlen(ai->targv[i]), (mir_tstrlen(cur + mir_tstrlen(ai->targv[i])) + 1)*sizeof(wchar_t));
- memcpy(cur, ai->targv[i + 1], mir_tstrlen(ai->targv[i + 1])*sizeof(wchar_t));
- pos += mir_tstrlen(ai->targv[i + 1]) - 1;
+ memmove(cur + mir_wstrlen(ai->targv[i + 1]), cur + mir_wstrlen(ai->targv[i]), (mir_wstrlen(cur + mir_wstrlen(ai->targv[i])) + 1)*sizeof(wchar_t));
+ memcpy(cur, ai->targv[i + 1], mir_wstrlen(ai->targv[i + 1])*sizeof(wchar_t));
+ pos += mir_wstrlen(ai->targv[i + 1]) - 1;
}
}
- res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(wchar_t));
+ res = (wchar_t*)mir_realloc(res, (mir_wstrlen(res) + 1)*sizeof(wchar_t));
}
return res;
@@ -428,13 +428,13 @@ static wchar_t *parseRight(ARGUMENTSINFO *ai) if (len < 0)
return NULL;
- len = min(len, (signed int)mir_tstrlen(ai->targv[1]));
+ len = min(len, (signed int)mir_wstrlen(ai->targv[1]));
wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
memset(res, 0, ((len + 1)*sizeof(wchar_t)));
- wcsncpy(res, ai->targv[1] + mir_tstrlen(ai->targv[1]) - len, len);
+ wcsncpy(res, ai->targv[1] + mir_wstrlen(ai->targv[1]) - len, len);
return res;
}
@@ -446,24 +446,24 @@ static wchar_t *parseScroll(ARGUMENTSINFO *ai) if (ai->argc != 4)
return NULL;
- if (mir_tstrlen(ai->targv[1]) == 0)
- return mir_tstrdup(ai->targv[1]);
+ if (mir_wstrlen(ai->targv[1]) == 0)
+ return mir_wstrdup(ai->targv[1]);
- size_t move = ttoi(ai->targv[3]) % mir_tstrlen(ai->targv[1]);
+ size_t move = ttoi(ai->targv[3]) % mir_wstrlen(ai->targv[1]);
size_t display = ttoi(ai->targv[2]);
- if (display > mir_tstrlen(ai->targv[1]))
- display = (unsigned)mir_tstrlen(ai->targv[1]);
+ if (display > mir_wstrlen(ai->targv[1]))
+ display = (unsigned)mir_wstrlen(ai->targv[1]);
- wchar_t *res = (wchar_t*)mir_alloc((2 * mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
+ wchar_t *res = (wchar_t*)mir_alloc((2 * mir_wstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((2 * mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
- mir_tstrcpy(res, ai->targv[1]);
- mir_tstrcat(res, ai->targv[1]);
- memmove(res, res + move, (mir_tstrlen(res + move) + 1)*sizeof(wchar_t));
+ memset(res, 0, ((2 * mir_wstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
+ mir_wstrcpy(res, ai->targv[1]);
+ mir_wstrcat(res, ai->targv[1]);
+ memmove(res, res + move, (mir_wstrlen(res + move) + 1)*sizeof(wchar_t));
*(res + display) = 0;
- res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(wchar_t));
+ res = (wchar_t*)mir_realloc(res, (mir_wstrlen(res) + 1)*sizeof(wchar_t));
return res;
}
@@ -475,10 +475,10 @@ static wchar_t *parseShortest(ARGUMENTSINFO *ai) int iShort = 1;
for (unsigned i = 2; i < ai->argc; i++)
- if (mir_tstrlen(ai->targv[i]) < mir_tstrlen(ai->targv[iShort]))
+ if (mir_wstrlen(ai->targv[i]) < mir_wstrlen(ai->targv[iShort]))
iShort = i;
- return mir_tstrdup(ai->targv[iShort]);
+ return mir_wstrdup(ai->targv[iShort]);
}
static wchar_t *parseStrchr(ARGUMENTSINFO *ai)
@@ -490,7 +490,7 @@ static wchar_t *parseStrchr(ARGUMENTSINFO *ai) memset(szVal, 0, sizeof(szVal));
wchar_t *c = wcschr(ai->targv[1], *ai->targv[2]);
if (c == NULL || *c == 0)
- return mir_tstrdup(L"0");
+ return mir_wstrdup(L"0");
return itot(c - ai->targv[1] + 1);
}
@@ -500,10 +500,10 @@ static wchar_t *parseStrcmp(ARGUMENTSINFO *ai) if (ai->argc != 3)
return NULL;
- if (mir_tstrcmp(ai->targv[1], ai->targv[2]))
+ if (mir_wstrcmp(ai->targv[1], ai->targv[2]))
ai->flags |= AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseStrmcmp(ARGUMENTSINFO *ai)
@@ -513,13 +513,13 @@ static wchar_t *parseStrmcmp(ARGUMENTSINFO *ai) ai->flags |= AIF_FALSE;
for (unsigned i = 2; i < ai->argc; i++) {
- if (!mir_tstrcmp(ai->targv[1], ai->targv[i])) {
+ if (!mir_wstrcmp(ai->targv[1], ai->targv[i])) {
ai->flags &= ~AIF_FALSE;
break;
}
}
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseStrncmp(ARGUMENTSINFO *ai)
@@ -534,7 +534,7 @@ static wchar_t *parseStrncmp(ARGUMENTSINFO *ai) if (wcsncmp(ai->targv[1], ai->targv[2], n))
ai->flags |= AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseStricmp(ARGUMENTSINFO *ai)
@@ -542,10 +542,10 @@ static wchar_t *parseStricmp(ARGUMENTSINFO *ai) if (ai->argc != 3)
return NULL;
- if (mir_tstrcmpi(ai->targv[1], ai->targv[2]))
+ if (mir_wstrcmpi(ai->targv[1], ai->targv[2]))
ai->flags |= AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseStrnicmp(ARGUMENTSINFO *ai)
@@ -560,7 +560,7 @@ static wchar_t *parseStrnicmp(ARGUMENTSINFO *ai) if (wcsnicmp(ai->targv[1], ai->targv[2], n))
ai->flags |= AIF_FALSE;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseStrrchr(ARGUMENTSINFO *ai)
@@ -570,7 +570,7 @@ static wchar_t *parseStrrchr(ARGUMENTSINFO *ai) wchar_t *c = wcsrchr(ai->targv[1], *ai->targv[2]);
if ((c == NULL) || (*c == 0))
- return mir_tstrdup(L"0");
+ return mir_wstrdup(L"0");
return itot(c - ai->targv[1] + 1);
}
@@ -582,7 +582,7 @@ static wchar_t *parseStrstr(ARGUMENTSINFO *ai) wchar_t *c = wcsstr(ai->targv[1], ai->targv[2]);
if ((c == NULL) || (*c == 0))
- return mir_tstrdup(L"0");
+ return mir_wstrdup(L"0");
return itot(c - ai->targv[1] + 1);
}
@@ -594,9 +594,9 @@ static wchar_t *parseSubstr(ARGUMENTSINFO *ai) int to, from = max(ttoi(ai->targv[2]) - 1, 0);
if (ai->argc > 3)
- to = min(ttoi(ai->targv[3]), (int)mir_tstrlen(ai->targv[1]));
+ to = min(ttoi(ai->targv[3]), (int)mir_wstrlen(ai->targv[1]));
else
- to = (int)mir_tstrlen(ai->targv[1]);
+ to = (int)mir_wstrlen(ai->targv[1]);
if (to < from)
return NULL;
@@ -616,7 +616,7 @@ static wchar_t *parseSelect(ARGUMENTSINFO *ai) if ((n > (signed int)ai->argc - 2) || n <= 0)
return NULL;
- return mir_tstrdup(ai->targv[n + 1]);
+ return mir_wstrdup(ai->targv[n + 1]);
}
static wchar_t *parseSwitch(ARGUMENTSINFO *ai)
@@ -625,8 +625,8 @@ static wchar_t *parseSwitch(ARGUMENTSINFO *ai) return NULL;
for (unsigned i = 2; i < ai->argc; i += 2)
- if (!mir_tstrcmp(ai->targv[1], ai->targv[i]))
- return mir_tstrdup(ai->targv[i + 1]);
+ if (!mir_wstrcmp(ai->targv[1], ai->targv[i]))
+ return mir_wstrdup(ai->targv[i + 1]);
return NULL;
}
@@ -640,12 +640,12 @@ static wchar_t *parseTrim(ARGUMENTSINFO *ai) while (*scur == ' ')
scur++;
- wchar_t *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]) - 1;
+ wchar_t *ecur = ai->targv[1] + mir_wstrlen(ai->targv[1]) - 1;
while ((*ecur == ' ') && (ecur > ai->targv[1]))
ecur--;
if (scur >= ecur)
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
wchar_t *res = (wchar_t*)mir_alloc((ecur - scur + 2)*sizeof(wchar_t));
if (res == NULL)
@@ -660,7 +660,7 @@ static wchar_t *parseTrim(ARGUMENTSINFO *ai) static wchar_t *parseTab(ARGUMENTSINFO *ai)
{
int count = 1;
- if ((ai->argc == 2) && (mir_tstrlen(ai->targv[1]) > 0))
+ if ((ai->argc == 2) && (mir_wstrlen(ai->targv[1]) > 0))
count = ttoi(ai->targv[1]);
if (count < 0)
@@ -683,7 +683,7 @@ static wchar_t *parseUpper(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_wstrdup(ai->targv[1]);
if (res == NULL)
return NULL;
@@ -701,7 +701,7 @@ static wchar_t *getNthWord(wchar_t *szString, int w) scur++;
count++;
- while ((count < w) && (scur < szString + mir_tstrlen(szString))) {
+ while ((count < w) && (scur < szString + mir_wstrlen(szString))) {
if (*scur == ' ') {
while (*scur == ' ')
scur++;
@@ -735,7 +735,7 @@ static wchar_t *parseWord(ARGUMENTSINFO *ai) wchar_t *res = NULL;
int to, from = ttoi(ai->targv[2]);
if (ai->argc == 4) {
- if (mir_tstrlen(ai->targv[3]) > 0)
+ if (mir_wstrlen(ai->targv[3]) > 0)
to = ttoi(ai->targv[3]);
else
to = 100000; // rework
@@ -751,11 +751,11 @@ static wchar_t *parseWord(ARGUMENTSINFO *ai) return res;
if (res != NULL) {
- wchar_t *pres = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szWord) + 2)*sizeof(wchar_t));
+ wchar_t *pres = (wchar_t*)mir_realloc(res, (mir_wstrlen(res) + mir_wstrlen(szWord) + 2)*sizeof(wchar_t));
if (pres != NULL) {
res = pres;
- mir_tstrcat(res, L" ");
- mir_tstrcat(res, szWord);
+ mir_wstrcat(res, L" ");
+ mir_wstrcat(res, szWord);
}
mir_free(szWord);
}
@@ -772,7 +772,7 @@ static wchar_t *parseExtratext(ARGUMENTSINFO *ai) ai->flags |= AIF_DONTPARSE;
if (ai->fi->szExtraText != NULL)
- return mir_tstrdup(ai->fi->tszExtraText);
+ return mir_wstrdup(ai->fi->tszExtraText);
return NULL;
}
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index 370c84881e..947a6b33e4 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -51,15 +51,15 @@ static wchar_t *parseCpuLoad(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- if (mir_tstrlen(ai->targv[1]) == 0)
- szCounter = mir_tstrdup(L"\\Processor(_Total)\\% Processor Time");
+ if (mir_wstrlen(ai->targv[1]) == 0)
+ szCounter = mir_wstrdup(L"\\Processor(_Total)\\% Processor Time");
else {
- int size = (int)mir_tstrlen(ai->targv[1]) + 32;
+ int size = (int)mir_wstrlen(ai->targv[1]) + 32;
szCounter = (wchar_t *)mir_alloc(size * sizeof(wchar_t));
if (szCounter == NULL)
return NULL;
- mir_sntprintf(szCounter, size, L"\\Process(%s)\\%% Processor Time", ai->targv[1]);
+ mir_snwprintf(szCounter, size, L"\\Process(%s)\\%% Processor Time", ai->targv[1]);
}
PDH_STATUS pdhStatus = PdhValidatePath(szCounter);
if (pdhStatus != ERROR_SUCCESS) {
@@ -105,18 +105,18 @@ static wchar_t *parseCpuLoad(ARGUMENTSINFO *ai) pdhStatus = PdhCloseQuery(hQuery);
return NULL;
}
- mir_sntprintf(szVal, L"%.0f", cValue.doubleValue);
+ mir_snwprintf(szVal, L"%.0f", cValue.doubleValue);
//PdhRemoveCounter(*hCounter);
PdhCloseQuery(hQuery);
mir_free(szCounter);
- return mir_tstrdup(szVal);
+ return mir_wstrdup(szVal);
}
static wchar_t *parseCurrentDate(ARGUMENTSINFO *ai)
{
wchar_t *szFormat;
- if (ai->argc == 1 || (ai->argc > 1 && mir_tstrlen(ai->targv[1]) == 0))
+ if (ai->argc == 1 || (ai->argc > 1 && mir_wstrlen(ai->targv[1]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[1];
@@ -137,7 +137,7 @@ static wchar_t *parseCurrentDate(ARGUMENTSINFO *ai) static wchar_t *parseCurrentTime(ARGUMENTSINFO *ai)
{
wchar_t *szFormat;
- if (ai->argc == 1 || (ai->argc > 1) && (mir_tstrlen(ai->targv[1]) == 0))
+ if (ai->argc == 1 || (ai->argc > 1) && (mir_wstrlen(ai->targv[1]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[1];
@@ -165,16 +165,16 @@ static wchar_t *parseDirectory(ARGUMENTSINFO *ai) depth = ttoi(ai->targv[2]);
if (depth <= 0)
- return mir_tstrdup(ai->targv[1]);
+ return mir_wstrdup(ai->targv[1]);
size_t bi, ei;
- for (ei = 0; ei < mir_tstrlen(ai->targv[1]); ei++) {
+ for (ei = 0; ei < mir_wstrlen(ai->targv[1]); ei++) {
if (ai->targv[1][ei] == '\\')
depth--;
if (!depth)
break;
}
- if (ei >= mir_tstrlen(ai->targv[1]))
+ if (ei >= mir_wstrlen(ai->targv[1]))
return ai->targv[1];
for (bi = ei - 1; bi > 0; bi--)
@@ -203,7 +203,7 @@ static wchar_t *parseDirectory2(ARGUMENTSINFO *ai) if (depth <= 0)
return NULL;
- wchar_t *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]);
+ wchar_t *ecur = ai->targv[1] + mir_wstrlen(ai->targv[1]);
while (depth > 0) {
while ((*ecur != '\\') && (ecur > ai->targv[1]))
ecur--;
@@ -226,17 +226,17 @@ static int getTime(wchar_t *szTime, struct tm *date) {
// do some extra checks here
wchar_t *cur = szTime;
- if (cur >= szTime + mir_tstrlen(szTime))
+ if (cur >= szTime + mir_wstrlen(szTime))
return -1;
date->tm_mon = wcstoul(cur, &cur, 10) - 1;
cur++;
- if (cur >= szTime + mir_tstrlen(szTime))
+ if (cur >= szTime + mir_wstrlen(szTime))
return -1;
date->tm_mday = wcstoul(cur, &cur, 10);
cur++;
- if (cur >= szTime + mir_tstrlen(szTime))
+ if (cur >= szTime + mir_wstrlen(szTime))
return -1;
date->tm_year = wcstoul(cur, &cur, 10);
@@ -247,17 +247,17 @@ static int getTime(wchar_t *szTime, struct tm *date) date->tm_year = date->tm_year < 38 ? date->tm_year + 100 : date->tm_year;
cur++;
- if (cur >= szTime + mir_tstrlen(szTime))
+ if (cur >= szTime + mir_wstrlen(szTime))
return -1;
date->tm_hour = wcstoul(cur, &cur, 10);
cur++;
- if (cur >= szTime + mir_tstrlen(szTime))
+ if (cur >= szTime + mir_wstrlen(szTime))
return -1;
date->tm_min = wcstoul(cur, &cur, 10);
cur++;
- if (cur >= szTime + mir_tstrlen(szTime))
+ if (cur >= szTime + mir_wstrlen(szTime))
return -1;
date->tm_sec = wcstoul(cur, &cur, 10);
@@ -282,9 +282,9 @@ static wchar_t *parseDiffTime(ARGUMENTSINFO *ai) return NULL;
diff = difftime(mktime(&t1), mktime(&t0));
- mir_sntprintf(szTime, L"%.0f", diff);
+ mir_snwprintf(szTime, L"%.0f", diff);
- return mir_tstrdup(szTime);
+ return mir_wstrdup(szTime);
}
static wchar_t *parseDirExists(ARGUMENTSINFO *ai)
@@ -298,7 +298,7 @@ static wchar_t *parseDirExists(ARGUMENTSINFO *ai) else
CloseHandle(hFile);
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseEnvironmentVariable(ARGUMENTSINFO *ai)
@@ -333,7 +333,7 @@ static wchar_t *parseFileExists(ARGUMENTSINFO *ai) else
CloseHandle(hFile);
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseFindWindow(ARGUMENTSINFO *ai)
@@ -386,11 +386,11 @@ static wchar_t *parseListDir(ARGUMENTSINFO *ai) if (*ai->targv[4] == 'd')
bFiles = FALSE;
}
- if (tszFirst[mir_tstrlen(tszFirst) - 1] == '\\')
- mir_tstrncat(tszFirst, tszFilter, _countof(tszFirst) - mir_tstrlen(tszFirst) - 1);
+ if (tszFirst[mir_wstrlen(tszFirst) - 1] == '\\')
+ mir_wstrncat(tszFirst, tszFilter, _countof(tszFirst) - mir_wstrlen(tszFirst) - 1);
else {
- mir_tstrncat(tszFirst, L"\\", _countof(tszFirst) - mir_tstrlen(tszFirst) - 1);
- mir_tstrncat(tszFirst, tszFilter, _countof(tszFirst) - mir_tstrlen(tszFirst) - 1);
+ mir_wstrncat(tszFirst, L"\\", _countof(tszFirst) - mir_wstrlen(tszFirst) - 1);
+ mir_wstrncat(tszFirst, tszFilter, _countof(tszFirst) - mir_wstrlen(tszFirst) - 1);
}
WIN32_FIND_DATA ffd;
@@ -399,20 +399,20 @@ static wchar_t *parseListDir(ARGUMENTSINFO *ai) return NULL;
}
if (((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles))) {
- tszRes = (wchar_t*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(wchar_t));
- mir_tstrcpy(tszRes, ffd.cFileName);
+ tszRes = (wchar_t*)mir_alloc((mir_wstrlen(ffd.cFileName) + mir_wstrlen(tszSeperator) + 1)*sizeof(wchar_t));
+ mir_wstrcpy(tszRes, ffd.cFileName);
}
while (FindNextFile(hFind, &ffd) != 0) {
if (((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles))) {
if (tszRes != NULL) {
- mir_tstrcat(tszRes, tszSeperator);
- tszRes = (wchar_t*)mir_realloc(tszRes, (mir_tstrlen(tszRes) + mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(wchar_t));
+ mir_wstrcat(tszRes, tszSeperator);
+ tszRes = (wchar_t*)mir_realloc(tszRes, (mir_wstrlen(tszRes) + mir_wstrlen(ffd.cFileName) + mir_wstrlen(tszSeperator) + 1)*sizeof(wchar_t));
}
else {
- tszRes = (wchar_t*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(wchar_t));
- mir_tstrcpy(tszRes, L"");
+ tszRes = (wchar_t*)mir_alloc((mir_wstrlen(ffd.cFileName) + mir_wstrlen(tszSeperator) + 1)*sizeof(wchar_t));
+ mir_wstrcpy(tszRes, L"");
}
- mir_tstrcat(tszRes, ffd.cFileName);
+ mir_wstrcat(tszRes, ffd.cFileName);
}
}
FindClose(hFind);
@@ -443,7 +443,7 @@ static wchar_t *parseProcessRunning(ARGUMENTSINFO *ai) ai->flags |= AIF_FALSE;
mir_free(ref);
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
#endif
@@ -454,7 +454,7 @@ static wchar_t *parseRegistryValue(ARGUMENTSINFO *ai) DWORD len, type;
- wchar_t *key = mir_tstrdup(ai->targv[1]);
+ wchar_t *key = mir_wstrdup(ai->targv[1]);
if (key == NULL)
return NULL;
@@ -466,13 +466,13 @@ static wchar_t *parseRegistryValue(ARGUMENTSINFO *ai) *cur = 0;
HKEY hKey;
- if (!mir_tstrcmp(key, L"HKEY_CLASSES_ROOT"))
+ if (!mir_wstrcmp(key, L"HKEY_CLASSES_ROOT"))
hKey = HKEY_CLASSES_ROOT;
- else if (!mir_tstrcmp(key, L"HKEY_CURRENT_USER"))
+ else if (!mir_wstrcmp(key, L"HKEY_CURRENT_USER"))
hKey = HKEY_CURRENT_USER;
- else if (!mir_tstrcmp(key, L"HKEY_LOCAL_MACHINE"))
+ else if (!mir_wstrcmp(key, L"HKEY_LOCAL_MACHINE"))
hKey = HKEY_LOCAL_MACHINE;
- else if (!mir_tstrcmp(key, L"HKEY_USERS"))
+ else if (!mir_wstrcmp(key, L"HKEY_USERS"))
hKey = HKEY_USERS;
else {
mir_free(key);
@@ -530,7 +530,7 @@ static wchar_t *parseTimestamp2Date(ARGUMENTSINFO *ai) if (timestamp == 0)
return NULL;
- if ((ai->argc == 2) || ((ai->argc > 2) && (mir_tstrlen(ai->targv[2]) == 0)))
+ if ((ai->argc == 2) || ((ai->argc > 2) && (mir_wstrlen(ai->targv[2]) == 0)))
szFormat = NULL;
else
szFormat = ai->targv[2];
@@ -562,7 +562,7 @@ static wchar_t *parseTimestamp2Time(ARGUMENTSINFO *ai) return NULL;
wchar_t *szFormat;
- if ((ai->argc == 2) || ((ai->argc > 2) && (mir_tstrlen(ai->targv[2]) == 0)))
+ if ((ai->argc == 2) || ((ai->argc > 2) && (mir_wstrlen(ai->targv[2]) == 0)))
szFormat = NULL;
else
szFormat = ai->targv[2];
@@ -634,7 +634,7 @@ static wchar_t *parseTextFile(ARGUMENTSINFO *ai) if (tUC)
res = (wchar_t*)pBuf;
else {
- res = mir_a2t((char *)pBuf);
+ res = mir_a2u((char *)pBuf);
mir_free(pBuf);
}
@@ -749,7 +749,7 @@ static wchar_t *parseTextFile(ARGUMENTSINFO *ai) if (tUC)
res = (wchar_t*)pBuf;
else {
- res = mir_a2t((char *)pBuf);
+ res = mir_a2u((char *)pBuf);
mir_free(pBuf);
}
@@ -763,7 +763,7 @@ static wchar_t *parseTextFile(ARGUMENTSINFO *ai) res = (wchar_t*)pBuf;
}
else {
- res = mir_a2t((char *)pBuf);
+ res = mir_a2u((char *)pBuf);
mir_free(pBuf);
}
@@ -819,10 +819,10 @@ static wchar_t *parseUpTime(ARGUMENTSINFO *ai) }
wchar_t szVal[32];
- mir_sntprintf(szVal, L"%u", cValue.largeValue);
+ mir_snwprintf(szVal, L"%u", cValue.largeValue);
PdhRemoveCounter(hCounter);
PdhCloseQuery(hQuery);
- return mir_tstrdup(szVal);
+ return mir_wstrdup(szVal);
}
static wchar_t *parseUserName(ARGUMENTSINFO *ai)
@@ -859,9 +859,9 @@ static wchar_t *parseClipboard(ARGUMENTSINFO *ai) HANDLE hData = GetClipboardData(CF_UNICODETEXT);
if (hData != NULL) {
wchar_t *tszText = (wchar_t*)GlobalLock(hData);
- size_t len = mir_tstrlen(tszText);
+ size_t len = mir_wstrlen(tszText);
res = (wchar_t*)mir_alloc((len + 1) * sizeof(wchar_t));
- mir_tstrcpy(res, tszText);
+ mir_wstrcpy(res, tszText);
res[len] = 0;
GlobalUnlock(hData);
}
diff --git a/plugins/Variables/src/parse_variables.cpp b/plugins/Variables/src/parse_variables.cpp index c54bbf6dce..11d168e678 100644 --- a/plugins/Variables/src/parse_variables.cpp +++ b/plugins/Variables/src/parse_variables.cpp @@ -26,14 +26,14 @@ static int vrCount = 0; static int addToVariablesRegister(wchar_t *szName, wchar_t *szText)
{
- if ((szName == NULL) || (szText == NULL) || (mir_tstrlen(szName) <= 0))
+ if ((szName == NULL) || (szText == NULL) || (mir_wstrlen(szName) <= 0))
return -1;
mir_cslock lck(csVarRegister);
for (int i = 0; i < vrCount; i++) {
- if ((!mir_tstrcmp(vr[i].szName, szName))) {
+ if ((!mir_wstrcmp(vr[i].szName, szName))) {
mir_free(vr[i].szText);
- vr[i].szText = mir_tstrdup(szText);
+ vr[i].szText = mir_wstrdup(szText);
return 0;
}
}
@@ -42,21 +42,21 @@ static int addToVariablesRegister(wchar_t *szName, wchar_t *szText) return -1;
vr = pvr;
- vr[vrCount].szName = mir_tstrdup(szName);
- vr[vrCount].szText = mir_tstrdup(szText);
+ vr[vrCount].szName = mir_wstrdup(szName);
+ vr[vrCount].szText = mir_wstrdup(szText);
vr[vrCount++].dwOwnerThread = GetCurrentThreadId();
return 0;
}
static wchar_t *searchVariableRegister(wchar_t *szName)
{
- if ((szName == NULL) || (mir_tstrlen(szName) <= 0))
+ if ((szName == NULL) || (mir_wstrlen(szName) <= 0))
return NULL;
mir_cslock lck(csVarRegister);
for (int i = 0; i < vrCount; i++)
- if ((!mir_tstrcmp(vr[i].szName, szName)))
- return mir_tstrdup(vr[i].szText);
+ if ((!mir_wstrcmp(vr[i].szName, szName)))
+ return mir_wstrdup(vr[i].szText);
return NULL;
}
@@ -85,7 +85,7 @@ static wchar_t *parsePuts(ARGUMENTSINFO *ai) if (addToVariablesRegister(ai->targv[1], ai->targv[2]))
return NULL;
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
static wchar_t *parseGet(ARGUMENTSINFO *ai)
diff --git a/plugins/Variables/src/tokenregister.cpp b/plugins/Variables/src/tokenregister.cpp index 101d8024f1..158a429582 100644 --- a/plugins/Variables/src/tokenregister.cpp +++ b/plugins/Variables/src/tokenregister.cpp @@ -41,7 +41,7 @@ unsigned long int hashlittle(void *key, size_t length, unsigned long int initval static DWORD NameHashFunction(wchar_t *tszStr)
{
- return (DWORD)hashlittle(tszStr, mir_tstrlen(tszStr)*sizeof(wchar_t), 0);
+ return (DWORD)hashlittle(tszStr, mir_wstrlen(tszStr)*sizeof(wchar_t), 0);
}
static TokenRegisterEntry* FindTokenRegisterByName(wchar_t *name)
@@ -109,7 +109,7 @@ INT_PTR registerToken(WPARAM, LPARAM lParam) hash = NameHashFunction(newVr->tszTokenString);
}
else {
- WCHAR *wtoken = mir_a2t(newVr->szTokenString);
+ WCHAR *wtoken = mir_a2u(newVr->szTokenString);
deRegisterToken(wtoken);
hash = NameHashFunction(wtoken);
mir_free(wtoken);
@@ -121,16 +121,16 @@ INT_PTR registerToken(WPARAM, LPARAM lParam) memcpy(&tre->tr, newVr, newVr->cbSize);
tre->nameHash = hash;
- if (!mir_tstrcmp(newVr->tszTokenString, L"alias"))
+ if (!mir_wstrcmp(newVr->tszTokenString, L"alias"))
log_debugA("alias");
if (!(newVr->flags & TRF_PARSEFUNC) && newVr->szService != NULL)
tre->tr.szService = mir_strdup(newVr->szService);
if (newVr->flags & TRF_TCHAR)
- tre->tr.tszTokenString = mir_tstrdup(newVr->tszTokenString);
+ tre->tr.tszTokenString = mir_wstrdup(newVr->tszTokenString);
else
- tre->tr.tszTokenString = mir_a2t(newVr->szTokenString);
+ tre->tr.tszTokenString = mir_a2u(newVr->szTokenString);
if (newVr->szHelpText != NULL)
tre->tr.szHelpText = mir_strdup(newVr->szHelpText);
@@ -180,7 +180,7 @@ wchar_t *parseFromRegister(ARGUMENTSINFO *ai) memcpy(&cAi, ai, sizeof(ARGUMENTSINFO));
cAi.argv = (char**)mir_alloc(ai->argc*sizeof(char *));
for (unsigned j = 0; j < ai->argc; j++)
- cAi.argv[j] = mir_t2a(ai->targv[j]);
+ cAi.argv[j] = mir_u2a(ai->targv[j]);
if (thisVr->flags & TRF_PARSEFUNC)
callRes = (INT_PTR)thisVr->parseFunction(&cAi);
@@ -191,7 +191,7 @@ wchar_t *parseFromRegister(ARGUMENTSINFO *ai) mir_free(cAi.argv[j]);
if ((char *)callRes != NULL)
- res = mir_a2t((char*)callRes);
+ res = mir_a2u((char*)callRes);
}
else {
// unicode variables calls unicode plugin
@@ -201,7 +201,7 @@ wchar_t *parseFromRegister(ARGUMENTSINFO *ai) callRes = CallService(thisVr->szService, 0, (LPARAM)ai);
if ((wchar_t*)callRes != NULL)
- res = mir_tstrdup((wchar_t*)callRes);
+ res = mir_wstrdup((wchar_t*)callRes);
}
if (callRes != NULL) {
diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp index 2b2e13af0f..ace282aac9 100644 --- a/plugins/Variables/src/variables.cpp +++ b/plugins/Variables/src/variables.cpp @@ -76,9 +76,9 @@ wchar_t* getArguments(wchar_t *string, TArgList &argv) if (bNewArg) { wchar_t *tszArg = NULL; if (cur > scur) - tszArg = mir_tstrndup(scur + 1, cur - (scur + 1)); + tszArg = mir_wstrndup(scur + 1, cur - (scur + 1)); if (tszArg == NULL) - tszArg = mir_tstrdup(L""); + tszArg = mir_wstrdup(L""); argv.insert(tszArg); bNewArg = false; @@ -118,7 +118,7 @@ static wchar_t* replaceDynVars(FORMATINFO *fi) int i, scurPos, curPos, tmpVarPos; - wchar_t *string = mir_tstrdup(fi->tszFormat); + wchar_t *string = mir_wstrdup(fi->tszFormat); if (string == NULL) return NULL; @@ -127,31 +127,31 @@ static wchar_t* replaceDynVars(FORMATINFO *fi) FORMATINFO afi; memcpy(&afi, fi, sizeof(afi)); - for (size_t pos = 0; pos < mir_tstrlen(string); pos++) { + for (size_t pos = 0; pos < mir_wstrlen(string); pos++) { // string may move in memory, iterate by remembering the position in the string wchar_t *cur = string + pos; // new round if (*cur == DONTPARSE_CHAR) { - memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t)); + memmove(cur, cur + 1, (mir_wstrlen(cur + 1) + 1)*sizeof(wchar_t)); if (*cur == DONTPARSE_CHAR) continue; while ((*cur != DONTPARSE_CHAR) && (*cur != 0)) cur++; - memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t)); + memmove(cur, cur + 1, (mir_wstrlen(cur + 1) + 1)*sizeof(wchar_t)); pos = cur - string - 1; continue; } // remove end of lines else if ((!wcsncmp(cur, L"\r\n", 2)) && (gParseOpts.bStripEOL)) { - memmove(cur, cur + 2, (mir_tstrlen(cur + 2) + 1)*sizeof(wchar_t)); + memmove(cur, cur + 2, (mir_wstrlen(cur + 2) + 1)*sizeof(wchar_t)); pos = cur - string - 1; continue; } else if ((*cur == '\n' && gParseOpts.bStripEOL) || (*cur == ' ' && gParseOpts.bStripWS)) { - memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t)); + memmove(cur, cur + 1, (mir_wstrlen(cur + 1) + 1)*sizeof(wchar_t)); pos = cur - string - 1; continue; } @@ -163,16 +163,16 @@ static wchar_t* replaceDynVars(FORMATINFO *fi) if (*cur == 0) { *scur = 0; - string = (wchar_t*)mir_realloc(string, (mir_tstrlen(string) + 1)*sizeof(wchar_t)); + string = (wchar_t*)mir_realloc(string, (mir_wstrlen(string) + 1)*sizeof(wchar_t)); continue; } - memmove(scur, cur, (mir_tstrlen(cur) + 1)*sizeof(wchar_t)); + memmove(scur, cur, (mir_wstrlen(cur) + 1)*sizeof(wchar_t)); pos = scur - string - 1; continue; } else if ((*cur != FIELD_CHAR) && (*cur != FUNC_CHAR) && (*cur != FUNC_ONCE_CHAR)) { if (gParseOpts.bStripAll) { - memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t)); + memmove(cur, cur + 1, (mir_wstrlen(cur + 1) + 1)*sizeof(wchar_t)); pos = cur - string - 1; } continue; @@ -189,13 +189,13 @@ static wchar_t* replaceDynVars(FORMATINFO *fi) TOKENREGISTEREX *tr = NULL; { - ptrT token(mir_tstrndup(cur + 1, tcur - scur)); + ptrW token(mir_wstrndup(cur + 1, tcur - scur)); // cur points to FIELD_CHAR or FUNC_CHAR tmpVarPos = -1; if (*cur == FIELD_CHAR) { for (i = 0; i < fi->cbTemporaryVarsSize; i += 2) { - if (!mir_tstrcmp(fi->tszaTemporaryVars[i], token)) { + if (!mir_wstrcmp(fi->tszaTemporaryVars[i], token)) { tmpVarPos = i; break; } @@ -214,7 +214,7 @@ static wchar_t* replaceDynVars(FORMATINFO *fi) scur = cur; // store this pointer for later use if (*cur == FIELD_CHAR) { - size_t len = mir_tstrlen(tr != NULL ? tr->tszTokenString : fi->tszaTemporaryVars[tmpVarPos]); + size_t len = mir_wstrlen(tr != NULL ? tr->tszTokenString : fi->tszaTemporaryVars[tmpVarPos]); cur++; if (cur[len] != FIELD_CHAR) { // the next char after the token should be % fi->eCount++; @@ -223,7 +223,7 @@ static wchar_t* replaceDynVars(FORMATINFO *fi) cur += len + 1; } else if ((*cur == FUNC_CHAR) || (*cur == FUNC_ONCE_CHAR)) { - cur += mir_tstrlen(tr->tszTokenString) + 1; + cur += mir_wstrlen(tr->tszTokenString) + 1; wchar_t *argcur = getArguments(cur, argv); if (argcur == cur || argcur == NULL) { fi->eCount++; @@ -247,9 +247,9 @@ static wchar_t* replaceDynVars(FORMATINFO *fi) // cur should now point at the character after FIELD_CHAR or after the last ')' ARGUMENTSINFO ai = { 0 }; - ptrT parsedToken; + ptrW parsedToken; if (tr != NULL) { - argv.insert(mir_tstrdup(tr->tszTokenString), 0); + argv.insert(mir_wstrdup(tr->tszTokenString), 0); ai.cbSize = sizeof(ai); ai.argc = argv.getCount(); @@ -260,7 +260,7 @@ static wchar_t* replaceDynVars(FORMATINFO *fi) parsedToken = parseFromRegister(&ai); } - else parsedToken = mir_tstrdup(fi->tszaTemporaryVars[tmpVarPos + 1]); + else parsedToken = mir_wstrdup(fi->tszaTemporaryVars[tmpVarPos + 1]); argv.destroy(); @@ -275,8 +275,8 @@ static wchar_t* replaceDynVars(FORMATINFO *fi) else fi->pCount++; - size_t parsedTokenLen = mir_tstrlen(parsedToken); - size_t initStrLen = mir_tstrlen(string); + size_t parsedTokenLen = mir_wstrlen(parsedToken); + size_t initStrLen = mir_wstrlen(string); size_t tokenLen = cur - scur; scurPos = scur - string; curPos = cur - string; @@ -290,10 +290,10 @@ static wchar_t* replaceDynVars(FORMATINFO *fi) } scur = string + scurPos; cur = string + curPos; - memmove(scur + parsedTokenLen, cur, (mir_tstrlen(cur) + 1)*sizeof(wchar_t)); + memmove(scur + parsedTokenLen, cur, (mir_wstrlen(cur) + 1)*sizeof(wchar_t)); memcpy(scur, parsedToken, parsedTokenLen*sizeof(wchar_t)); { - size_t len = mir_tstrlen(string); + size_t len = mir_wstrlen(string); string = (wchar_t*)mir_realloc(string, (len + 1)*sizeof(wchar_t)); } if ((ai.flags & AIF_DONTPARSE) || tmpVarPos >= 0) @@ -302,7 +302,7 @@ static wchar_t* replaceDynVars(FORMATINFO *fi) pos--; // parse the same pos again, it changed } - return (wchar_t*)mir_realloc(string, (mir_tstrlen(string) + 1)*sizeof(wchar_t)); + return (wchar_t*)mir_realloc(string, (mir_wstrlen(string) + 1)*sizeof(wchar_t)); } /* @@ -341,11 +341,11 @@ static INT_PTR formatStringService(WPARAM wParam, LPARAM) if (!(fi->flags & FIF_TCHAR)) { copied = TRUE; - log_debugA("mir_a2t (%s)", fi->szExtraText); - tszFormat = fi->szFormat != NULL ? mir_a2t(fi->szFormat) : NULL; - tszSource = fi->szExtraText != NULL ? mir_a2t(fi->szExtraText) : NULL; + log_debugA("mir_a2u (%s)", fi->szExtraText); + tszFormat = fi->szFormat != NULL ? mir_a2u(fi->szFormat) : NULL; + tszSource = fi->szExtraText != NULL ? mir_a2u(fi->szExtraText) : NULL; for (i = 0; i < fi->cbTemporaryVarsSize; i++) { - fi->tszaTemporaryVars[i] = fi->szaTemporaryVars[i] != NULL ? mir_a2t(fi->szaTemporaryVars[i]) : NULL; + fi->tszaTemporaryVars[i] = fi->szaTemporaryVars[i] != NULL ? mir_a2u(fi->szaTemporaryVars[i]) : NULL; } } else { diff --git a/plugins/Watrack_MPD/src/main.cpp b/plugins/Watrack_MPD/src/main.cpp index 079718a0f9..a4ca0c1943 100755 --- a/plugins/Watrack_MPD/src/main.cpp +++ b/plugins/Watrack_MPD/src/main.cpp @@ -75,7 +75,7 @@ int Parser() if(!Connected) { char tmp[128]; - char *tmp2 = mir_t2a(gbPassword); + char *tmp2 = mir_u2a(gbPassword); recvResult = CallService(MS_NETLIB_GETMOREPACKETS,(WPARAM)ghPacketReciever, (LPARAM)&nlpr); if(recvResult == SOCKET_ERROR) { @@ -124,20 +124,20 @@ int Parser() tmp[i] = ptr[i]; tmp[i] = '\0'; strncpy_s(ver, tmp, _TRUNCATE); - SongInfo.txtver = mir_utf8decodeT(tmp); + SongInfo.txtver = mir_utf8decodeW(tmp); } else - SongInfo.txtver = mir_utf8decodeT(ver); + SongInfo.txtver = mir_utf8decodeW(ver); if(ptr = strstr(buf, "file:")) { ptr = &ptr[6]; for(i = 0; ((ptr[i] != '\n') && (ptr[i] != '\0')); i++) tmp[i] = ptr[i]; tmp[i] = '\0'; - SongInfo.mfile = mir_utf8decodeT(tmp); + SongInfo.mfile = mir_utf8decodeW(tmp); } else - SongInfo.mfile = mir_tstrdup(L""); + SongInfo.mfile = mir_wstrdup(L""); if(ptr = strstr(buf, "Time:")) { ptr = &ptr[6]; @@ -164,50 +164,50 @@ int Parser() for(i = 0; ((ptr[i] != '\n') && (ptr[i] != '\0')); i++) tmp[i] = ptr[i]; tmp[i] = '\0'; - SongInfo.title = mir_utf8decodeT(tmp); + SongInfo.title = mir_utf8decodeW(tmp); } else - SongInfo.title = mir_tstrdup(L"Unknown track"); + SongInfo.title = mir_wstrdup(L"Unknown track"); if(ptr = strstr(buf, "Artist:")) { ptr = &ptr[8]; for(i = 0; ((ptr[i] != '\n') && (ptr[i] != '\0')); i++) tmp[i] = ptr[i]; tmp[i] = '\0'; - SongInfo.artist = mir_utf8decodeT(tmp); + SongInfo.artist = mir_utf8decodeW(tmp); } else - SongInfo.artist = mir_tstrdup(L"Unknown artist"); + SongInfo.artist = mir_wstrdup(L"Unknown artist"); if(ptr = strstr(buf, "Genre:")) { ptr = &ptr[7]; for(i = 0; ((ptr[i] != '\n') && (ptr[i] != '\0')); i++) tmp[i] = ptr[i]; tmp[i] = '\0'; - SongInfo.genre = mir_utf8decodeT(tmp); + SongInfo.genre = mir_utf8decodeW(tmp); } else - SongInfo.genre = mir_tstrdup(L"Unknown genre"); + SongInfo.genre = mir_wstrdup(L"Unknown genre"); if(ptr = strstr(buf, "Album:")) { ptr = &ptr[7]; for(i = 0; ((ptr[i] != '\n') && (ptr[i] != '\0')); i++) tmp[i] = ptr[i]; tmp[i] = '\0'; - SongInfo.album = mir_utf8decodeT(tmp); + SongInfo.album = mir_utf8decodeW(tmp); } else - SongInfo.album = mir_tstrdup(L"Unknown album"); + SongInfo.album = mir_wstrdup(L"Unknown album"); if(ptr = strstr(buf, "Date:")) { ptr = &ptr[6]; for(i = 0; ((ptr[i] != '\n') && (ptr[i] != '\0')); i++) tmp[i] = ptr[i]; tmp[i] = '\0'; - SongInfo.year = mir_utf8decodeT(tmp); + SongInfo.year = mir_utf8decodeW(tmp); } else - SongInfo.year = mir_tstrdup(L"Unknown year"); + SongInfo.year = mir_wstrdup(L"Unknown year"); if(ptr = strstr(buf, "volume:")) { ptr = &ptr[8]; diff --git a/plugins/Watrack_MPD/src/options.cpp b/plugins/Watrack_MPD/src/options.cpp index 315c2f4100..3178947f61 100755 --- a/plugins/Watrack_MPD/src/options.cpp +++ b/plugins/Watrack_MPD/src/options.cpp @@ -52,10 +52,10 @@ static INT_PTR CALLBACK DlgProcWaMpdOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM gbPort = (WORD)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE); GetDlgItemText(hwndDlg, IDC_SERVER, szText, _countof(szText)); db_set_ts(NULL, szModuleName, "Server", szText); - mir_tstrcpy(gbHost, szText); + mir_wstrcpy(gbHost, szText); GetDlgItemText(hwndDlg, IDC_PASSWORD, szText, _countof(szText)); db_set_ts(NULL, szModuleName, "Password", szText); - mir_tstrcpy(gbPassword, szText); + mir_wstrcpy(gbPassword, szText); return TRUE; } } diff --git a/plugins/Watrack_MPD/src/utilities.cpp b/plugins/Watrack_MPD/src/utilities.cpp index edaf3f42bd..c3e9e40cc8 100755 --- a/plugins/Watrack_MPD/src/utilities.cpp +++ b/plugins/Watrack_MPD/src/utilities.cpp @@ -20,5 +20,5 @@ wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, wchar_t* szDef) { wchar_t *szRes = db_get_tsa(hContact, szModule, szSetting); - return szRes ? szRes : mir_tstrdup(szDef); + return szRes ? szRes : mir_wstrdup(szDef); } diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index bb0e86e011..c1c2f26f67 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -231,7 +231,7 @@ extern "C" int __declspec(dllexport) Load(void) // window needed for popup commands
wchar_t SvcFunc[100];
- mir_sntprintf(SvcFunc, L"%s__PopupWindow", _A2W(WEATHERPROTONAME));
+ mir_snwprintf(SvcFunc, L"%s__PopupWindow", _A2W(WEATHERPROTONAME));
hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", SvcFunc, 0, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL);
SetWindowLongPtr(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc);
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index bf999c9dea..c9a276a484 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -45,7 +45,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) DBVARIANT dbv;
// check ID to see if the contact already exist in the database
if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) {
- if (!mir_tstrcmpi(psr->email.w, dbv.ptszVal)) {
+ if (!mir_wstrcmpi(psr->email.w, dbv.ptszVal)) {
// remove the flag for not on list and hidden, thus make the contact visible
// and add them on the list
if (db_get_b(hContact, "CList", "NotOnList", 1)) {
@@ -90,7 +90,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) AvatarDownloaded(hContact);
wchar_t str[256];
- mir_sntprintf(str, TranslateT("Current weather information for %s."), psr->nick.w);
+ mir_snwprintf(str, TranslateT("Current weather information for %s."), psr->nick.w);
db_set_ts(hContact, WEATHERPROTONAME, "About", str);
// make the last update tags to something invalid
@@ -109,7 +109,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) opt.DefStn = hContact;
if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
// notification message box
- mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
@@ -251,7 +251,7 @@ int IDSearchProc(wchar_t *sID, const int searchId, WIIDSEARCH *sData, wchar_t *s // give no station name but only ID if the search is unavailable
else wcsncpy(str, TranslateT("<Enter station name here>"), MAX_DATA_LEN - 1);
- mir_sntprintf(newID, L"%s/%s", svc, sID);
+ mir_snwprintf(newID, L"%s/%s", svc, sID);
// set the search result and broadcast it
PROTOSEARCHRESULT psr = { sizeof(psr) };
@@ -272,7 +272,7 @@ int IDSearchProc(wchar_t *sID, const int searchId, WIIDSEARCH *sData, wchar_t *s int IDSearch(wchar_t *sID, const int searchId)
{
// for a normal ID search (ID != #)
- if (mir_tstrcmp(sID, L"#")) {
+ if (mir_wstrcmp(sID, L"#")) {
WIDATALIST *Item = WIHead;
// search every weather service using the search station ID
@@ -322,16 +322,16 @@ int NameSearchProc(wchar_t *name, const int searchId, WINAMESEARCH *sData, wchar // for single result
if (sData->Single.Available && (search != NULL || !sData->Multiple.Available)) { // single result
// if station ID appears first in the downloaded data
- if (!mir_tstrcmpi(sData->Single.First, L"ID")) {
+ if (!mir_wstrcmpi(sData->Single.First, L"ID")) {
GetDataValue(&sData->Single.ID, str, &szInfo);
- mir_sntprintf(sID, L"%s/%s", svc, str);
+ mir_snwprintf(sID, L"%s/%s", svc, str);
GetDataValue(&sData->Single.Name, Name, &szInfo);
}
// if station name appears first in the downloaded data
- else if (!mir_tstrcmpi(sData->Single.First, L"NAME")) {
+ else if (!mir_wstrcmpi(sData->Single.First, L"NAME")) {
GetDataValue(&sData->Single.Name, Name, &szInfo);
GetDataValue(&sData->Single.ID, str, &szInfo);
- mir_sntprintf(sID, L"%s/%s", svc, str);
+ mir_snwprintf(sID, L"%s/%s", svc, str);
}
else
str[0] = 0;
@@ -363,16 +363,16 @@ int NameSearchProc(wchar_t *name, const int searchId, WINAMESEARCH *sData, wchar // search for the next occurrence of the string
while (true) {
// if station ID appears first in the downloaded data
- if (!mir_tstrcmpi(sData->Multiple.First, L"ID")) {
+ if (!mir_wstrcmpi(sData->Multiple.First, L"ID")) {
GetDataValue(&sData->Multiple.ID, str, &szInfo);
- mir_sntprintf(sID, L"%s/%s", svc, str);
+ mir_snwprintf(sID, L"%s/%s", svc, str);
GetDataValue(&sData->Multiple.Name, Name, &szInfo);
}
// if station name appears first in the downloaded data
- else if (!mir_tstrcmpi(sData->Multiple.First, L"NAME")) {
+ else if (!mir_wstrcmpi(sData->Multiple.First, L"NAME")) {
GetDataValue(&sData->Multiple.Name, Name, &szInfo);
GetDataValue(&sData->Multiple.ID, str, &szInfo);
- mir_sntprintf(sID, L"%s/%s", svc, str);
+ mir_snwprintf(sID, L"%s/%s", svc, str);
}
else
break;
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 77ecbb11cd..80e7d5f970 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -29,7 +29,7 @@ static void OpenUrl(wchar_t* format, wchar_t* id) {
wchar_t loc[512];
GetID(id);
- mir_sntprintf(loc, format, id);
+ mir_snwprintf(loc, format, id);
Utils_OpenUrlT(loc);
}
@@ -161,7 +161,7 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) {
SetDlgItemText(hwndDlg, IDC_ID, dbv.ptszVal);
// check if the station is a default station
- CheckDlgButton(hwndDlg, IDC_DEFA, mir_tstrcmp(dbv.ptszVal, opt.Default) != 0 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DEFA, mir_wstrcmp(dbv.ptszVal, opt.Default) != 0 ? BST_CHECKED : BST_UNCHECKED);
db_free(&dbv);
}
if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
@@ -272,15 +272,15 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ofn.nMaxFile = _countof(str);
// set filters
wcsncpy(filter, TranslateT("Text Files"), _countof(filter) - 1);
- mir_tstrncat(filter, L" (*.txt)", _countof(filter) - mir_tstrlen(filter));
- pfilter = filter + mir_tstrlen(filter) + 1;
+ mir_wstrncat(filter, L" (*.txt)", _countof(filter) - mir_wstrlen(filter));
+ pfilter = filter + mir_wstrlen(filter) + 1;
wcsncpy(pfilter, L"*.txt", _countof(filter) - 1);
- pfilter = pfilter + mir_tstrlen(pfilter) + 1;
+ pfilter = pfilter + mir_wstrlen(pfilter) + 1;
wcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - 1);
- mir_tstrncat(pfilter, L" (*.*)", _countof(filter) - mir_tstrlen(filter));
- pfilter = pfilter + mir_tstrlen(pfilter) + 1;
+ mir_wstrncat(pfilter, L" (*.*)", _countof(filter) - mir_wstrlen(filter));
+ pfilter = pfilter + mir_wstrlen(pfilter) + 1;
wcsncpy(pfilter, L"*.*", _countof(filter) - 1);
- pfilter = pfilter + mir_tstrlen(pfilter) + 1;
+ pfilter = pfilter + mir_wstrlen(pfilter) + 1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 1;
@@ -343,13 +343,13 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA GetDlgItemText(hwndDlg, IDC_ID, str, _countof(str));
db_set_ts(hContact, WEATHERPROTONAME, "ID", str);
if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_DEFA)) { // if default station is set
- mir_tstrcpy(opt.Default, str);
+ mir_wstrcpy(opt.Default, str);
opt.DefStn = hContact;
db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
}
GetDlgItemText(hwndDlg, IDC_NAME, city, _countof(city));
db_set_ts(hContact, WEATHERPROTONAME, "Nick", city);
- mir_sntprintf(str2, TranslateT("Current weather information for %s."), city);
+ mir_snwprintf(str2, TranslateT("Current weather information for %s."), city);
if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)) {
GetDlgItemText(hwndDlg, IDC_LOG, str, _countof(str));
db_set_ts(hContact, WEATHERPROTONAME, "Log", str);
@@ -436,9 +436,9 @@ int ContactDeleted(WPARAM wParam, LPARAM) removeWindow(wParam);
// exit this function if it is not default station
- ptrT tszID(db_get_tsa(wParam, WEATHERPROTONAME, "ID"));
+ ptrW tszID(db_get_tsa(wParam, WEATHERPROTONAME, "ID"));
if (tszID != NULL)
- if (mir_tstrcmp(tszID, opt.Default))
+ if (mir_wstrcmp(tszID, opt.Default))
return 0;
// now the default station is deleted, try to get a new one
@@ -451,13 +451,13 @@ int ContactDeleted(WPARAM wParam, LPARAM) // if the station is not a default station, set it as the new default station
// this is the first weather station encountered from the search
- if (mir_tstrcmp(opt.Default, tszID)) {
+ if (mir_wstrcmp(opt.Default, tszID)) {
wcsncpy_s(opt.Default, tszID, _TRUNCATE);
opt.DefStn = hContact;
- ptrT tszNick(db_get_tsa(hContact, WEATHERPROTONAME, "Nick"));
+ ptrW tszNick(db_get_tsa(hContact, WEATHERPROTONAME, "Nick"));
if (tszNick != NULL) {
wchar_t str[255];
- mir_sntprintf(str, TranslateT("%s is now the default weather station"), (wchar_t*)tszNick);
+ mir_snwprintf(str, TranslateT("%s is now the default weather station"), (wchar_t*)tszNick);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index 44805cc451..168fd77d09 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -64,9 +64,9 @@ static void numToStr(double num, wchar_t *str, size_t strSize) if (i < 0 && (w || r)) w = -w;
if (r)
- mir_sntprintf(str, strSize, L"%i.%i", w, r);
+ mir_snwprintf(str, strSize, L"%i.%i", w, r);
else
- mir_sntprintf(str, strSize, L"%i", w);
+ mir_snwprintf(str, strSize, L"%i", w);
}
//============ UNIT CONVERSIONS ============
@@ -83,15 +83,15 @@ void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t* str) TrimString(tempchar);
if (tempchar[0] == '-' && tempchar[1] == ' ')
- memmove(&tempchar[1], &tempchar[2], sizeof(wchar_t)*(mir_tstrlen(&tempchar[2]) + 1));
+ memmove(&tempchar[1], &tempchar[2], sizeof(wchar_t)*(mir_wstrlen(&tempchar[2]) + 1));
// quit if the value obtained is N/A or not a number
- if (!mir_tstrcmp(tempchar, NODATA) || !mir_tstrcmp(tempchar, L"N/A")) {
- mir_tstrcpy(str, tempchar);
+ if (!mir_wstrcmp(tempchar, NODATA) || !mir_wstrcmp(tempchar, L"N/A")) {
+ mir_wstrcpy(str, tempchar);
return;
}
if (!is_number(tempchar)) {
- mir_tstrcpy(str, NODATA);
+ mir_wstrcpy(str, NODATA);
return;
}
@@ -99,8 +99,8 @@ void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t* str) temp = _wtof(tempchar);
// convert all to F first
- if (!mir_tstrcmpi(unit, L"C")) temp = (temp * 9 / 5) + 32;
- else if (!mir_tstrcmpi(unit, L"K")) temp = ((temp - 273.15) * 9 / 5) + 32;
+ if (!mir_wstrcmpi(unit, L"C")) temp = (temp * 9 / 5) + 32;
+ else if (!mir_wstrcmpi(unit, L"K")) temp = ((temp - 273.15) * 9 / 5) + 32;
// convert to apporiate unit
switch (opt.tUnit) {
@@ -110,7 +110,7 @@ void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t* str) if (opt.DoNotAppendUnit)
wcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE);
else
- mir_sntprintf(str, MAX_DATA_LEN, L"%s%sC", tstr, opt.DegreeSign);
+ mir_snwprintf(str, MAX_DATA_LEN, L"%s%sC", tstr, opt.DegreeSign);
break;
case 2:
@@ -118,7 +118,7 @@ void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t* str) if (opt.DoNotAppendUnit)
wcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE);
else
- mir_sntprintf(str, MAX_DATA_LEN, L"%s%sF", tstr, opt.DegreeSign);
+ mir_snwprintf(str, MAX_DATA_LEN, L"%s%sF", tstr, opt.DegreeSign);
break;
}
}
@@ -137,44 +137,44 @@ void GetPressure(wchar_t *tempchar, wchar_t *unit, wchar_t* str) // if it end up with 0, then it's not a number, return the original string and quit
output = _wtof(tempchar);
if (output == 0) {
- mir_tstrcpy(str, tempchar);
+ mir_wstrcpy(str, tempchar);
return;
}
// convert all to mb first
- if (!mir_tstrcmpi(unit, L"KPA"))
+ if (!mir_wstrcmpi(unit, L"KPA"))
tempunit = (double)output * 10;
- else if (!mir_tstrcmpi(unit, L"HPA"))
+ else if (!mir_wstrcmpi(unit, L"HPA"))
tempunit = (double)output;
- else if (!mir_tstrcmpi(unit, L"MB"))
+ else if (!mir_wstrcmpi(unit, L"MB"))
tempunit = (double)output;
- else if (!mir_tstrcmpi(unit, L"IN"))
+ else if (!mir_wstrcmpi(unit, L"IN"))
tempunit = (double)output * 33.86388;
- else if (!mir_tstrcmpi(unit, L"MM"))
+ else if (!mir_wstrcmpi(unit, L"MM"))
tempunit = (double)output * 1.33322;
- else if (!mir_tstrcmpi(unit, L"TORR"))
+ else if (!mir_wstrcmpi(unit, L"TORR"))
tempunit = (double)output * 1.33322;
// convert to apporiate unit
switch (opt.pUnit) {
case 1:
intunit = (int)(tempunit + 0.5);
- mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("kPa"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("kPa"));
break;
case 2:
intunit = (int)(tempunit + 0.5);
- mir_sntprintf(str, MAX_DATA_LEN, L"%i %s", intunit, opt.DoNotAppendUnit ? L"" : TranslateT("mb"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%i %s", intunit, opt.DoNotAppendUnit ? L"" : TranslateT("mb"));
break;
case 3:
intunit = (int)((tempunit * 10 / 33.86388) + 0.5);
- mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("in"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("in"));
break;
case 4:
intunit = (int)((tempunit * 10 / 1.33322) + 0.5);
- mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("mm"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("mm"));
break;
default:
- mir_tstrcpy(str, tempchar);
+ mir_wstrcpy(str, tempchar);
break;
}
@@ -199,32 +199,32 @@ void GetSpeed(wchar_t *tempchar, wchar_t *unit, wchar_t *str) return;
// convert all to m/s first
- if (!mir_tstrcmpi(unit, L"KM/H"))
+ if (!mir_wstrcmpi(unit, L"KM/H"))
tempunit /= 3.6;
- // else if ( !mir_tstrcmpi(unit, L"M/S")
+ // else if ( !mir_wstrcmpi(unit, L"M/S")
// tempunit = tempunit;
- else if (!mir_tstrcmpi(unit, L"MPH"))
+ else if (!mir_wstrcmpi(unit, L"MPH"))
tempunit *= 0.44704;
- else if (!mir_tstrcmpi(unit, L"KNOTS"))
+ else if (!mir_wstrcmpi(unit, L"KNOTS"))
tempunit *= 0.514444;
// convert to apporiate unit
switch (opt.wUnit) {
case 1:
numToStr(tempunit * 3.6, tstr, _countof(tstr));
- mir_sntprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("km/h"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("km/h"));
break;
case 2:
numToStr(tempunit, tstr, _countof(tstr));
- mir_sntprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("m/s"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("m/s"));
break;
case 3:
numToStr(tempunit / 0.44704, tstr, _countof(tstr));
- mir_sntprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("mph"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("mph"));
break;
case 4:
numToStr(tempunit / 0.514444, tstr, _countof(tstr));
- mir_sntprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("knots"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("knots"));
break;
}
}
@@ -243,28 +243,28 @@ void GetDist(wchar_t *tempchar, wchar_t *unit, wchar_t *str) // if it end up with 0, then it's not a number, return the original string and quit
output = _wtof(tempchar);
if (output == 0) {
- mir_tstrcpy(str, tempchar);
+ mir_wstrcpy(str, tempchar);
return;
}
// convert all to km first
- if (!mir_tstrcmpi(unit, L"KM"))
+ if (!mir_wstrcmpi(unit, L"KM"))
tempunit = (double)output;
- else if (!mir_tstrcmpi(unit, L"MILES"))
+ else if (!mir_wstrcmpi(unit, L"MILES"))
tempunit = (double)output * 1.609;
// convert to apporiate unit
switch (opt.vUnit) {
case 1:
intunit = (int)((tempunit * 10) + 0.5);
- mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("km"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("km"));
break;
case 2:
intunit = (int)((tempunit * 10 / 1.609) + 0.5);
- mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("miles"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("miles"));
break;
default:
- mir_tstrcpy(str, tempchar);
+ mir_wstrcpy(str, tempchar);
break;
}
}
@@ -283,28 +283,28 @@ void GetElev(wchar_t *tempchar, wchar_t *unit, wchar_t *str) // if it end up with 0, then it's not a number, return the original string and quit
output = _wtof(tempchar);
if (output == 0) {
- mir_tstrcpy(str, tempchar);
+ mir_wstrcpy(str, tempchar);
return;
}
// convert all to m first
- if (!mir_tstrcmpi(unit, L"M"))
+ if (!mir_wstrcmpi(unit, L"M"))
tempunit = (double)output;
- else if (!mir_tstrcmpi(unit, L"FT"))
+ else if (!mir_wstrcmpi(unit, L"FT"))
tempunit = (double)output / 3.28;
// convert to apporiate unit
switch (opt.eUnit) {
case 1:
intunit = (int)((tempunit * 10 * 3.28) + 0.5);
- mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("ft"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("ft"));
break;
case 2:
intunit = (int)((tempunit * 10) + 0.5);
- mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("m"));
+ mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("m"));
break;
default:
- mir_tstrcpy(str, tempchar);
+ mir_wstrcpy(str, tempchar);
break;
}
}
@@ -390,13 +390,13 @@ WORD GetIcon(const wchar_t* cond, WIDATA *Data) do {
j++;
// using the format _T("# Weather <condition name> <counter> #"
- mir_sntprintf(LangPackStr, L"# Weather %s %i #", statusStr[i], j);
+ mir_snwprintf(LangPackStr, L"# Weather %s %i #", statusStr[i], j);
wcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE);
- CharLowerBuff(LangPackStr1, (DWORD)mir_tstrlen(LangPackStr1));
+ CharLowerBuff(LangPackStr1, (DWORD)mir_wstrlen(LangPackStr1));
if (wcsstr(cond, LangPackStr1) != NULL)
return statusValue[i];
// loop until the translation string exists (ie, the translated string is differ from original)
- } while (mir_tstrcmp(TranslateTS(LangPackStr), LangPackStr));
+ } while (mir_wstrcmp(TranslateTS(LangPackStr), LangPackStr));
}
return NA;
@@ -409,7 +409,7 @@ void CaseConv(wchar_t *str) {
BOOL nextUp = TRUE;
- CharLowerBuff(str, (DWORD)mir_tstrlen(str));
+ CharLowerBuff(str, (DWORD)mir_wstrlen(str));
for (wchar_t *pstr = str; *pstr; pstr++) {
if (*pstr == ' ' || *pstr == '-')
nextUp = TRUE;
@@ -496,16 +496,16 @@ wchar_t* GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str) str[0] = 0;
// looking character by character
- for (i = 0; i < mir_tstrlen(dis); i++) {
+ for (i = 0; i < mir_wstrlen(dis); i++) {
// for the escape characters
if (dis[i] == '\\') {
i++;
chr = dis[i];
switch (chr) {
- case '%': mir_tstrcat(str, L"%"); break;
- case 't': mir_tstrcat(str, L"\t"); break;
- case 'n': mir_tstrcat(str, L"\r\n"); break;
- case '\\': mir_tstrcat(str, L"\\"); break;
+ case '%': mir_wstrcat(str, L"%"); break;
+ case 't': mir_wstrcat(str, L"\t"); break;
+ case 'n': mir_wstrcat(str, L"\r\n"); break;
+ case '\\': mir_wstrcat(str, L"\\"); break;
}
}
@@ -516,41 +516,41 @@ wchar_t* GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str) // turn capitalized characters to small case
if (chr < 'a' && chr != '[' && chr != '%') chr = (char)((int)chr + 32);
switch (chr) {
- case 'c': mir_tstrcat(str, w->cond); break;
+ case 'c': mir_wstrcat(str, w->cond); break;
case 'd': // get the current date
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, lpzDate, _countof(lpzDate));
- mir_tstrcat(str, lpzDate); break;
- case 'e': mir_tstrcat(str, w->dewpoint); break;
- case 'f': mir_tstrcat(str, w->feel); break;
- case 'h': mir_tstrcat(str, w->high); break;
- case 'i': mir_tstrcat(str, w->winddir); break;
- case 'l': mir_tstrcat(str, w->low); break;
- case 'm': mir_tstrcat(str, w->humid); break;
- case 'n': mir_tstrcat(str, w->city); break;
- case 'p': mir_tstrcat(str, w->pressure); break;
- case 'r': mir_tstrcat(str, w->sunrise); break;
- case 's': mir_tstrcat(str, w->id); break;
- case 't': mir_tstrcat(str, w->temp); break;
+ mir_wstrcat(str, lpzDate); break;
+ case 'e': mir_wstrcat(str, w->dewpoint); break;
+ case 'f': mir_wstrcat(str, w->feel); break;
+ case 'h': mir_wstrcat(str, w->high); break;
+ case 'i': mir_wstrcat(str, w->winddir); break;
+ case 'l': mir_wstrcat(str, w->low); break;
+ case 'm': mir_wstrcat(str, w->humid); break;
+ case 'n': mir_wstrcat(str, w->city); break;
+ case 'p': mir_wstrcat(str, w->pressure); break;
+ case 'r': mir_wstrcat(str, w->sunrise); break;
+ case 's': mir_wstrcat(str, w->id); break;
+ case 't': mir_wstrcat(str, w->temp); break;
case 'u':
- if (mir_tstrcmp(w->update, NODATA)) mir_tstrcat(str, w->update);
- else mir_tstrcat(str, TranslateT("<unknown time>"));
+ if (mir_wstrcmp(w->update, NODATA)) mir_wstrcat(str, w->update);
+ else mir_wstrcat(str, TranslateT("<unknown time>"));
break;
- case 'v': mir_tstrcat(str, w->vis); break;
- case 'w': mir_tstrcat(str, w->wind); break;
- case 'y': mir_tstrcat(str, w->sunset); break;
- case '%': mir_tstrcat(str, L"%"); break;
+ case 'v': mir_wstrcat(str, w->vis); break;
+ case 'w': mir_wstrcat(str, w->wind); break;
+ case 'y': mir_wstrcat(str, w->sunset); break;
+ case '%': mir_wstrcat(str, L"%"); break;
case '[': // custom variables
i++;
name[0] = 0;
// read the entire variable name
- while (dis[i] != ']' && i < mir_tstrlen(dis)) {
+ while (dis[i] != ']' && i < mir_wstrlen(dis)) {
mir_snprintf(temp, "%c", dis[i++]);
mir_strcat(name, temp);
}
// access the database to get its value
if (!db_get_ts(w->hContact, WEATHERCONDITION, name, &dbv)) {
if (dbv.ptszVal != TranslateTS(NODATA) && dbv.ptszVal != TranslateT("<Error>"))
- mir_tstrcat(str, dbv.ptszVal);
+ mir_wstrcat(str, dbv.ptszVal);
db_free(&dbv);
}
break;
@@ -558,8 +558,8 @@ wchar_t* GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str) }
// if the character is not a variable, write the original character to the new string
else {
- mir_sntprintf(lpzDate, L"%c", dis[i]);
- mir_tstrcat(str, lpzDate);
+ mir_snwprintf(lpzDate, L"%c", dis[i]);
+ mir_wstrcat(str, lpzDate);
}
}
@@ -591,7 +591,7 @@ void GetSvc(wchar_t *pszID) void GetID(wchar_t *pszID)
{
wchar_t *chop = wcsstr(pszID, L"/");
- if (chop != NULL) mir_tstrcpy(pszID, chop + 1);
+ if (chop != NULL) mir_wstrcpy(pszID, chop + 1);
else pszID[0] = 0;
}
@@ -631,9 +631,9 @@ wchar_t *GetError(int code) case 503: str = E503; break;
case 504: str = E504; break;
default:
- mir_sntprintf(str2, TranslateT("HTTP Error %i"), code);
+ mir_snwprintf(str2, TranslateT("HTTP Error %i"), code);
str = str2;
break;
}
- return mir_tstrdup(str);
+ return mir_wstrdup(str);
}
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index 88e9ca12e4..f8df3f7f18 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -142,7 +142,7 @@ void EraseAllInfo() opt.DefStn = hContact;
if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
- mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
@@ -150,7 +150,7 @@ void EraseAllInfo() // get the handle of the default station
if (opt.DefStn == NULL) {
if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) {
- if (!mir_tstrcmp(dbv.ptszVal, opt.Default))
+ if (!mir_wstrcmp(dbv.ptszVal, opt.Default))
opt.DefStn = hContact;
db_free(&dbv);
}
@@ -169,7 +169,7 @@ void EraseAllInfo() }
opt.DefStn = LastContact;
if (!db_get_ts(LastContact, WEATHERPROTONAME, "Nick", &dbv)) {
- mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
@@ -183,57 +183,57 @@ void ConvertDataValue(WIDATAITEM *UpdateData, wchar_t *Data) wchar_t str[MAX_DATA_LEN];
// convert the unit
- if (mir_tstrcmp(Data, TranslateT("<Error>")) && mir_tstrcmp(Data, NODATA) && mir_tstrcmp(Data, TranslateTS(NODATA))) {
+ if (mir_wstrcmp(Data, TranslateT("<Error>")) && mir_wstrcmp(Data, NODATA) && mir_wstrcmp(Data, TranslateTS(NODATA))) {
// temperature
- if (!mir_tstrcmp(UpdateData->Name, L"Temperature") || !mir_tstrcmp(UpdateData->Name, L"High") ||
- !mir_tstrcmp(UpdateData->Name, L"Low") || !mir_tstrcmp(UpdateData->Name, L"Feel") ||
- !mir_tstrcmp(UpdateData->Name, L"Dewpoint") ||
- !mir_tstrcmpi(UpdateData->Unit, L"C") || !mir_tstrcmpi(UpdateData->Unit, L"F") ||
- !mir_tstrcmpi(UpdateData->Unit, L"K")) {
+ if (!mir_wstrcmp(UpdateData->Name, L"Temperature") || !mir_wstrcmp(UpdateData->Name, L"High") ||
+ !mir_wstrcmp(UpdateData->Name, L"Low") || !mir_wstrcmp(UpdateData->Name, L"Feel") ||
+ !mir_wstrcmp(UpdateData->Name, L"Dewpoint") ||
+ !mir_wstrcmpi(UpdateData->Unit, L"C") || !mir_wstrcmpi(UpdateData->Unit, L"F") ||
+ !mir_wstrcmpi(UpdateData->Unit, L"K")) {
GetTemp(Data, UpdateData->Unit, str);
- mir_tstrcpy(Data, str);
+ mir_wstrcpy(Data, str);
}
// pressure
- else if (!mir_tstrcmp(UpdateData->Name, L"Pressure") || !mir_tstrcmpi(UpdateData->Unit, L"HPA") ||
- !mir_tstrcmpi(UpdateData->Unit, L"KPA") || !mir_tstrcmpi(UpdateData->Unit, L"MB") ||
- !mir_tstrcmpi(UpdateData->Unit, L"TORR") || !mir_tstrcmpi(UpdateData->Unit, L"IN") ||
- !mir_tstrcmpi(UpdateData->Unit, L"MM")) {
+ else if (!mir_wstrcmp(UpdateData->Name, L"Pressure") || !mir_wstrcmpi(UpdateData->Unit, L"HPA") ||
+ !mir_wstrcmpi(UpdateData->Unit, L"KPA") || !mir_wstrcmpi(UpdateData->Unit, L"MB") ||
+ !mir_wstrcmpi(UpdateData->Unit, L"TORR") || !mir_wstrcmpi(UpdateData->Unit, L"IN") ||
+ !mir_wstrcmpi(UpdateData->Unit, L"MM")) {
GetPressure(Data, UpdateData->Unit, str);
- mir_tstrcpy(Data, str);
+ mir_wstrcpy(Data, str);
}
// speed
- else if (!mir_tstrcmp(UpdateData->Name, L"Wind Speed") || !mir_tstrcmpi(UpdateData->Unit, L"KM/H") ||
- !mir_tstrcmpi(UpdateData->Unit, L"M/S") || !mir_tstrcmpi(UpdateData->Unit, L"MPH") ||
- !mir_tstrcmpi(UpdateData->Unit, L"KNOTS")) {
+ else if (!mir_wstrcmp(UpdateData->Name, L"Wind Speed") || !mir_wstrcmpi(UpdateData->Unit, L"KM/H") ||
+ !mir_wstrcmpi(UpdateData->Unit, L"M/S") || !mir_wstrcmpi(UpdateData->Unit, L"MPH") ||
+ !mir_wstrcmpi(UpdateData->Unit, L"KNOTS")) {
GetSpeed(Data, UpdateData->Unit, str);
- mir_tstrcpy(Data, str);
+ mir_wstrcpy(Data, str);
}
// visibility
- else if (!mir_tstrcmp(UpdateData->Name, L"Visibility") || !mir_tstrcmpi(UpdateData->Unit, L"KM") ||
- !mir_tstrcmpi(UpdateData->Unit, L"MILES")) {
+ else if (!mir_wstrcmp(UpdateData->Name, L"Visibility") || !mir_wstrcmpi(UpdateData->Unit, L"KM") ||
+ !mir_wstrcmpi(UpdateData->Unit, L"MILES")) {
GetDist(Data, UpdateData->Unit, str);
- mir_tstrcpy(Data, str);
+ mir_wstrcpy(Data, str);
}
// elevation
- else if (!mir_tstrcmp(UpdateData->Name, L"Elevation") || !mir_tstrcmpi(UpdateData->Unit, L"FT") ||
- !mir_tstrcmpi(UpdateData->Unit, L"M")) {
+ else if (!mir_wstrcmp(UpdateData->Name, L"Elevation") || !mir_wstrcmpi(UpdateData->Unit, L"FT") ||
+ !mir_wstrcmpi(UpdateData->Unit, L"M")) {
GetElev(Data, UpdateData->Unit, str);
- mir_tstrcpy(Data, str);
+ mir_wstrcpy(Data, str);
}
// converting case for condition to the upper+lower format
- else if (!mir_tstrcmpi(UpdateData->Unit, L"COND"))
+ else if (!mir_wstrcmpi(UpdateData->Unit, L"COND"))
CaseConv(Data);
// degree sign
- else if (!mir_tstrcmpi(UpdateData->Unit, L"DEG")) {
- if (!opt.DoNotAppendUnit) mir_tstrcat(Data, opt.DegreeSign);
+ else if (!mir_wstrcmpi(UpdateData->Unit, L"DEG")) {
+ if (!opt.DoNotAppendUnit) mir_wstrcat(Data, opt.DegreeSign);
}
// percent sign
- else if (!mir_tstrcmpi(UpdateData->Unit, L"%")) {
- if (!opt.DoNotAppendUnit) mir_tstrcat(Data, L"%");
+ else if (!mir_wstrcmpi(UpdateData->Unit, L"%")) {
+ if (!opt.DoNotAppendUnit) mir_wstrcat(Data, L"%");
}
// truncating strings for day/month to 2 or 3 characters
- else if (!mir_tstrcmpi(UpdateData->Unit, L"DAY") || !mir_tstrcmpi(UpdateData->Unit, L"MONTH"))
- if (opt.dUnit > 1 && mir_tstrlen(Data) > opt.dUnit)
+ else if (!mir_wstrcmpi(UpdateData->Unit, L"DAY") || !mir_wstrcmpi(UpdateData->Unit, L"MONTH"))
+ if (opt.dUnit > 1 && mir_wstrlen(Data) > opt.dUnit)
Data[opt.dUnit] = '\0';
}
}
@@ -261,7 +261,7 @@ void GetDataValue(WIDATAITEM *UpdateData, wchar_t *Data, wchar_t** szData) start = wcsstr(szInfo, UpdateData->Start);
if (start != NULL) {
// set the starting location for getting data
- start += mir_tstrlen(UpdateData->Start);
+ start += mir_wstrlen(UpdateData->Start);
szInfo = start;
}
}
@@ -276,7 +276,7 @@ void GetDataValue(WIDATAITEM *UpdateData, wchar_t *Data, wchar_t** szData) // set the ending location
startloc = 0;
endloc = end - szInfo;
- end += mir_tstrlen(UpdateData->End);
+ end += mir_wstrlen(UpdateData->End);
last = '\n';
}
@@ -315,8 +315,8 @@ void GetDataValue(WIDATAITEM *UpdateData, wchar_t *Data, wchar_t** szData) ++startloc;
// prevent crashes if the string go over maximun length -> generate an error
if (respos >= MAX_DATA_LEN) {
- if (opt.ShowWarnings && UpdateData->Name[0] != 0 && mir_tstrcmp(UpdateData->Name, L"Ignore")) {
- mir_sntprintf(Data, MAX_DATA_LEN, TranslateT("Error when obtaining data: %s"), UpdateData->Name);
+ if (opt.ShowWarnings && UpdateData->Name[0] != 0 && mir_wstrcmp(UpdateData->Name, L"Ignore")) {
+ mir_snwprintf(Data, MAX_DATA_LEN, TranslateT("Error when obtaining data: %s"), UpdateData->Name);
WPShowMessage(Data, SM_WARNING);
}
wcsncpy(Data, TranslateT("<Error>"), MAX_DATA_LEN);
diff --git a/plugins/Weather/src/weather_http.cpp b/plugins/Weather/src/weather_http.cpp index 5567dff83f..7b48509a4d 100644 --- a/plugins/Weather/src/weather_http.cpp +++ b/plugins/Weather/src/weather_http.cpp @@ -79,7 +79,7 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **s // if the data does not downloaded successfully (ie. disconnected), then return 1000 as error code
*szData = (wchar_t*)mir_alloc(512);
// store the error code in szData
- mir_tstrcpy(*szData, L"NetLib error occurred!!");
+ mir_wstrcpy(*szData, L"NetLib error occurred!!");
hNetlibHttp = NULL;
return NLHRF_REDIRECT;
}
@@ -126,9 +126,9 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **s wchar_t *retVal = NULL;
if (bIsUtf)
- retVal = mir_utf8decodeT(nlhrReply->pData);
+ retVal = mir_utf8decodeW(nlhrReply->pData);
if (retVal == NULL)
- retVal = mir_a2t(nlhrReply->pData);
+ retVal = mir_a2u(nlhrReply->pData);
*szData = retVal;
}
else result = DATA_EMPTY;
@@ -137,7 +137,7 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **s else {
*szData = (wchar_t*)mir_alloc(512);
// store the error code in szData
- mir_sntprintf(*szData, 512, L"Error occured! HTTP Error: %i\n", nlhrReply->resultCode);
+ mir_snwprintf(*szData, 512, L"Error occured! HTTP Error: %i\n", nlhrReply->resultCode);
result = nlhrReply->resultCode;
}
diff --git a/plugins/Weather/src/weather_info.cpp b/plugins/Weather/src/weather_info.cpp index f0b3ca4eac..e6ed5291e9 100644 --- a/plugins/Weather/src/weather_info.cpp +++ b/plugins/Weather/src/weather_info.cpp @@ -147,54 +147,54 @@ void GetINIInfo(wchar_t *pszSvc) WIDATA *sData = GetWIData(pszSvc);
// if the service does not exist among the loaded INI's
if (sData == NULL) {
- mir_sntprintf(str2, TranslateT("The corresponding INI file for \"%s\" is not found."), pszSvc);
+ mir_snwprintf(str2, TranslateT("The corresponding INI file for \"%s\" is not found."), pszSvc);
MessageBox(NULL, str2, TranslateT("Weather INI information"), MB_OK | MB_ICONINFORMATION);
}
// if exist, get the information
else {
- mir_sntprintf(str2, TranslateT("Weather INI information for \"%s\":"), pszSvc);
- mir_tstrncat(str2, L"\n\n", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, TranslateT("Name:"), _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\t\t", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, sData->DisplayName, _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, TranslateT("Internal Name:"), _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\t", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, sData->InternalName, _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, TranslateT("Author:"), _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\t\t", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, sData->Author, _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, TranslateT("Version:"), _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\t\t", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, sData->Version, _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, TranslateT("INI Version:"), _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\t", _countof(str2) - mir_tstrlen(str2));
+ mir_snwprintf(str2, TranslateT("Weather INI information for \"%s\":"), pszSvc);
+ mir_wstrncat(str2, L"\n\n", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, TranslateT("Name:"), _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\t\t", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, sData->DisplayName, _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, TranslateT("Internal Name:"), _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\t", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, sData->InternalName, _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, TranslateT("Author:"), _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\t\t", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, sData->Author, _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, TranslateT("Version:"), _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\t\t", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, sData->Version, _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, TranslateT("INI Version:"), _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\t", _countof(str2) - mir_wstrlen(str2));
switch (sData->InternalVer) {
- case 1: mir_tstrncat(str2, L"1.0", _countof(str2) - mir_tstrlen(str2)); break;
- case 2: mir_tstrncat(str2, L"1.1", _countof(str2) - mir_tstrlen(str2)); break;
- case 3: mir_tstrncat(str2, L"1.1a", _countof(str2) - mir_tstrlen(str2)); break;
- case 4: mir_tstrncat(str2, L"1.2", _countof(str2) - mir_tstrlen(str2)); break;
- case 5: mir_tstrncat(str2, L"1.3", _countof(str2) - mir_tstrlen(str2)); break;
- case 6: mir_tstrncat(str2, L"1.4", _countof(str2) - mir_tstrlen(str2)); break;
- case 7: mir_tstrncat(str2, L"1.5", _countof(str2) - mir_tstrlen(str2)); break;
+ case 1: mir_wstrncat(str2, L"1.0", _countof(str2) - mir_wstrlen(str2)); break;
+ case 2: mir_wstrncat(str2, L"1.1", _countof(str2) - mir_wstrlen(str2)); break;
+ case 3: mir_wstrncat(str2, L"1.1a", _countof(str2) - mir_wstrlen(str2)); break;
+ case 4: mir_wstrncat(str2, L"1.2", _countof(str2) - mir_wstrlen(str2)); break;
+ case 5: mir_wstrncat(str2, L"1.3", _countof(str2) - mir_wstrlen(str2)); break;
+ case 6: mir_wstrncat(str2, L"1.4", _countof(str2) - mir_wstrlen(str2)); break;
+ case 7: mir_wstrncat(str2, L"1.5", _countof(str2) - mir_wstrlen(str2)); break;
}
- mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, TranslateT("File Name:"), _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\t", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, sData->ShortFileName, _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, TranslateT("Item Count:"), _countof(str2) - mir_tstrlen(str2));
- mir_sntprintf(str2, L"%s\t%i\n", str2, sData->UpdateDataCount);
- mir_tstrncat(str2, TranslateT("Memory Used:"), _countof(str2) - mir_tstrlen(str2));
- mir_sntprintf(str2, L"%s\t%i ", str2, sData->MemUsed);
- mir_tstrncat(str2, TranslateT("bytes"), _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\n\n", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, TranslateT("Description:"), _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2));
- mir_tstrncat(str2, sData->Description, _countof(str2) - mir_tstrlen(str2));
+ mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, TranslateT("File Name:"), _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\t", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, sData->ShortFileName, _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, TranslateT("Item Count:"), _countof(str2) - mir_wstrlen(str2));
+ mir_snwprintf(str2, L"%s\t%i\n", str2, sData->UpdateDataCount);
+ mir_wstrncat(str2, TranslateT("Memory Used:"), _countof(str2) - mir_wstrlen(str2));
+ mir_snwprintf(str2, L"%s\t%i ", str2, sData->MemUsed);
+ mir_wstrncat(str2, TranslateT("bytes"), _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\n\n", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, TranslateT("Description:"), _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2));
+ mir_wstrncat(str2, sData->Description, _countof(str2) - mir_wstrlen(str2));
// display the message box and quit
MessageBox(NULL, str2, TranslateT("Weather INI information"), MB_OK | MB_ICONINFORMATION);
@@ -211,20 +211,20 @@ void MoreVarList(void) // heading
wcsncpy(str, VARS_LIST, _countof(str) - 1);
- mir_tstrncat(str, L"\n\n", _countof(str) - mir_tstrlen(str));
+ mir_wstrncat(str, L"\n\n", _countof(str) - mir_wstrlen(str));
// loop through all weather services to find custom variables
for (WIDATALIST *Item = WIHead; Item != NULL; Item = Item->next) {
// loop through all update items in a service
for (WIDATAITEMLIST *WItem = Item->Data.UpdateData; WItem != NULL; WItem = WItem->Next) {
// the custom variable is defined as "%[<variable name>]"
// ignore the "hi" item and hidden items
- if (mir_tstrcmp(WItem->Item.Name, L"Ignore") && WItem->Item.Name[0] != '#') {
- mir_sntprintf(tempstr, L"%c[%s]", '%', WItem->Item.Name);
+ if (mir_wstrcmp(WItem->Item.Name, L"Ignore") && WItem->Item.Name[0] != '#') {
+ mir_snwprintf(tempstr, L"%c[%s]", '%', WItem->Item.Name);
wchar_t *find = wcsstr(str, tempstr);
// if the custom variable does not exist in the list, add it to the list
if (find == NULL) {
- mir_tstrncat(str, tempstr, _countof(str) - mir_tstrlen(str));
- mir_tstrncat(str, L", ", _countof(str) - mir_tstrlen(str));
+ mir_wstrncat(str, tempstr, _countof(str) - mir_wstrlen(str));
+ mir_wstrncat(str, L", ", _countof(str) - mir_wstrlen(str));
}
}
}
diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index efa3fb7af2..62514148b2 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -53,7 +53,7 @@ WIDATA* GetWIData(wchar_t *pszServ) // loop through the list to find matching internal name
for (WIDATALIST *Item = WIHead; Item != NULL; Item = Item->next)
// if internal name found, return the data
- if (mir_tstrcmp(Item->Data.InternalName, pszServ) == 0)
+ if (mir_wstrcmp(Item->Data.InternalName, pszServ) == 0)
return &Item->Data;
// return NULL when no match found
@@ -78,7 +78,7 @@ void WIItemListAdd(WIDATAITEM *DataItem, WIDATA *Data) // name = the string to store in the "name" field
void ResetDataItem(WIDATAITEM *Item, const wchar_t *name)
{
- Item->Name = mir_tstrdup(name);
+ Item->Name = mir_wstrdup(name);
Item->Start = L"";
Item->End = L"";
Item->Unit = L"";
@@ -113,7 +113,7 @@ void WICondListAdd(char *str, WICONDLIST *List) {
WICONDITEM *newItem = (WICONDITEM*)mir_alloc(sizeof(WICONDITEM));
wSetData(&newItem->Item, str);
- CharLowerBuff(newItem->Item, (DWORD)mir_tstrlen(newItem->Item));
+ CharLowerBuff(newItem->Item, (DWORD)mir_wstrlen(newItem->Item));
newItem->Next = NULL;
if (List->Tail == NULL) List->Head = newItem;
else List->Tail->Next = newItem;
@@ -183,7 +183,7 @@ static INT_PTR CALLBACK DlgProcSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR wchar_t *chop = wcsrchr(szPath, '\\');
if (chop) {
*chop = '\0';
- mir_tstrncat(szPath, L"\\Plugins\\weather\\", _countof(szPath) - mir_tstrlen(szPath));
+ mir_wstrncat(szPath, L"\\Plugins\\weather\\", _countof(szPath) - mir_wstrlen(szPath));
if (_wmkdir(szPath) == 0)
ShellExecute((HWND)lParam, L"open", szPath, L"", L"", SW_SHOW);
}
@@ -270,7 +270,7 @@ static void LoadStationData(wchar_t *pszFile, wchar_t *pszShortFile, WIDATA *Dat Data->InternalVer = 7;
else {
wchar_t str[4096];
- mir_sntprintf(str, TranslateT("Invalid ini format for: %s"), pszFile);
+ mir_snwprintf(str, TranslateT("Invalid ini format for: %s"), pszFile);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONERROR);
fclose(pfile);
return;
@@ -323,7 +323,7 @@ static void LoadStationData(wchar_t *pszFile, wchar_t *pszShortFile, WIDATA *Dat // initialize the linked list for update items
Data->UpdateDataCount = 0;
- Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (mir_tstrlen(pszShortFile) + mir_tstrlen(pszFile) + 20)*sizeof(wchar_t);
+ Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (mir_wstrlen(pszShortFile) + mir_wstrlen(pszFile) + 20)*sizeof(wchar_t);
Data->UpdateData = NULL;
Data->UpdateDataTail = NULL;
@@ -447,7 +447,7 @@ static void LoadStationData(wchar_t *pszFile, wchar_t *pszShortFile, WIDATA *Dat else if (!_stricmp(ValName, "HIDDEN")) {
if (!_stricmp(Value, "TRUE")) {
wchar_t *nm = Data->UpdateDataTail->Item.Name;
- size_t len = mir_tstrlen(nm) + 1;
+ size_t len = mir_wstrlen(nm) + 1;
Data->UpdateDataTail->Item.Name = nm = (wchar_t*)mir_realloc(nm, sizeof(wchar_t)*(len + 3));
memmove(nm + 1, nm, len*sizeof(wchar_t));
@@ -491,7 +491,7 @@ bool LoadWIData(bool dial) if (chop == NULL)
return false;
*chop = '\0';
- mir_tstrncat(szSearchPath, L"\\Plugins\\Weather\\*.ini", _countof(szSearchPath) - mir_tstrlen(szSearchPath));
+ mir_wstrncat(szSearchPath, L"\\Plugins\\Weather\\*.ini", _countof(szSearchPath) - mir_wstrlen(szSearchPath));
wcsncpy(FileName, szSearchPath, MAX_PATH - 1);
WIN32_FIND_DATA fd;
@@ -503,8 +503,8 @@ bool LoadWIData(bool dial) do {
chop = wcsrchr(FileName, '\\');
chop[1] = '\0';
- mir_tstrncat(FileName, fd.cFileName, _countof(FileName) - mir_tstrlen(FileName));
- if (mir_tstrcmpi(fd.cFileName, L"SAMPLE_INI.INI")) {
+ mir_wstrncat(FileName, fd.cFileName, _countof(FileName) - mir_wstrlen(FileName));
+ if (mir_wstrcmpi(fd.cFileName, L"SAMPLE_INI.INI")) {
WIDATA Data;
LoadStationData(FileName, fd.cFileName, &Data);
if (Data.Enabled)
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 1dd09bf864..aa47bb3580 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -158,15 +158,15 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara {
FontIDT fntid = { 0 };
- mir_tstrcpy(fntid.group, _A2W(WEATHERPROTONAME));
- mir_tstrcpy(fntid.name, LPGENW("Frame Font"));
+ mir_wstrcpy(fntid.group, _A2W(WEATHERPROTONAME));
+ mir_wstrcpy(fntid.name, LPGENW("Frame Font"));
fntc = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt);
- mir_tstrcpy(fntid.name, LPGENW("Frame Title Font"));
+ mir_wstrcpy(fntid.name, LPGENW("Frame Title Font"));
fntc1 = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt1);
}
- ptrT tszInfo(db_get_tsa(data->hContact, WEATHERCONDITION, "WeatherInfo"));
+ ptrW tszInfo(db_get_tsa(data->hContact, WEATHERCONDITION, "WeatherInfo"));
GetClientRect(hwnd, &rc);
@@ -242,7 +242,7 @@ static void addWindow(MCONTACT hContact) return;
wchar_t winname[512];
- mir_sntprintf(winname, L"Weather: %s", dbv.ptszVal);
+ mir_snwprintf(winname, L"Weather: %s", dbv.ptszVal);
db_free(&dbv);
HWND hWnd = CreateWindow(L"WeatherFrame", L"", WS_CHILD | WS_VISIBLE,
@@ -328,8 +328,8 @@ void InitMwin(void) colourid.cbSize = sizeof(ColourIDT);
mir_strcpy(colourid.dbSettingsGroup, WEATHERPROTONAME);
mir_strcpy(colourid.setting, "ColorMwinFrame");
- mir_tstrcpy(colourid.name, LPGENW("Frame Background"));
- mir_tstrcpy(colourid.group, _A2W(WEATHERPROTONAME));
+ mir_wstrcpy(colourid.name, LPGENW("Frame Background"));
+ mir_wstrcpy(colourid.group, _A2W(WEATHERPROTONAME));
colourid.defcolour = GetSysColor(COLOR_3DFACE);
ColourRegisterT(&colourid);
@@ -337,8 +337,8 @@ void InitMwin(void) fontid.cbSize = sizeof(FontIDT);
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
mir_strcpy(fontid.dbSettingsGroup, WEATHERPROTONAME);
- mir_tstrcpy(fontid.group, _A2W(WEATHERPROTONAME));
- mir_tstrcpy(fontid.name, LPGENW("Frame Font"));
+ mir_wstrcpy(fontid.group, _A2W(WEATHERPROTONAME));
+ mir_wstrcpy(fontid.name, LPGENW("Frame Font"));
mir_strcpy(fontid.prefix, "fnt0");
HDC hdc = GetDC(NULL);
@@ -346,13 +346,13 @@ void InitMwin(void) ReleaseDC(0, hdc);
fontid.deffontsettings.charset = DEFAULT_CHARSET;
- mir_tstrcpy(fontid.deffontsettings.szFace, L"Verdana");
- mir_tstrcpy(fontid.backgroundGroup, _A2W(WEATHERPROTONAME));
- mir_tstrcpy(fontid.backgroundName, LPGENW("Frame Background"));
+ mir_wstrcpy(fontid.deffontsettings.szFace, L"Verdana");
+ mir_wstrcpy(fontid.backgroundGroup, _A2W(WEATHERPROTONAME));
+ mir_wstrcpy(fontid.backgroundName, LPGENW("Frame Background"));
FontRegisterT(&fontid);
fontid.deffontsettings.style = DBFONTF_BOLD;
- mir_tstrcpy(fontid.name, LPGENW("Frame Title Font"));
+ mir_wstrcpy(fontid.name, LPGENW("Frame Title Font"));
mir_strcpy(fontid.prefix, "fnt1");
FontRegisterT(&fontid);
diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index 6f866cd99a..c971ef7857 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -114,7 +114,7 @@ void LoadOptions(void) opt.dUnit = db_get_w(NULL, WEATHERPROTONAME, "dUnit", 1);
opt.eUnit = db_get_w(NULL, WEATHERPROTONAME, "eUnit", 2);
- ptrT szValue(db_get_tsa(NULL, WEATHERPROTONAME, "DegreeSign"));
+ ptrW szValue(db_get_tsa(NULL, WEATHERPROTONAME, "DegreeSign"));
wcsncpy_s(opt.DegreeSign, (szValue == NULL) ? L"" : szValue, _TRUNCATE);
opt.DoNotAppendUnit = db_get_b(NULL, WEATHERPROTONAME, "DoNotAppendUnit", 0);
diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index 4e721a07a5..6e1ddba4ea 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -67,8 +67,8 @@ int WeatherError(WPARAM wParam, LPARAM lParam) // setup the popup
ppd.lchIcon = (HICON)LoadImage(NULL, MAKEINTRESOURCE(OIC_BANG), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
- mir_tstrcpy(ppd.lptzContactName, str1);
- mir_tstrcpy(ppd.lptzText, str2);
+ mir_wstrcpy(ppd.lptzContactName, str1);
+ mir_wstrcpy(ppd.lptzText, str2);
ppd.colorBack = (opt.UseWinColors) ? GetSysColor(COLOR_BTNFACE) : opt.BGColour;
ppd.colorText = (opt.UseWinColors) ? GetSysColor(COLOR_WINDOWTEXT) : opt.TextColour;
ppd.iSeconds = opt.pDelay;
@@ -395,9 +395,9 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) case IDC_VAR3:
// display variable list
wcsncpy(str, L" \n", _countof(str) - 1); // to make the message box wider
- mir_tstrncat(str, VAR_LIST_POPUP, _countof(str) - mir_tstrlen(str));
- mir_tstrncat(str, L"\n", _countof(str) - mir_tstrlen(str));
- mir_tstrncat(str, CUSTOM_VARS, _countof(str) - mir_tstrlen(str));
+ mir_wstrncat(str, VAR_LIST_POPUP, _countof(str) - mir_wstrlen(str));
+ mir_wstrncat(str, L"\n", _countof(str) - mir_wstrlen(str));
+ mir_wstrncat(str, CUSTOM_VARS, _countof(str) - mir_wstrlen(str));
MessageBox(NULL, str, TranslateT("Variable List"), MB_OK | MB_ICONASTERISK | MB_TOPMOST);
break;
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index cd283324bb..e301a0302d 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -147,12 +147,12 @@ INT_PTR WeatherGetAvatarInfo(WPARAM, LPARAM lParam) return GAIR_NOAVATAR;
pai->format = PA_FORMAT_PNG;
- mir_sntprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.png", szSearchPath, statusStr[i]);
+ mir_snwprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.png", szSearchPath, statusStr[i]);
if (_waccess(pai->filename, 4) == 0)
return GAIR_SUCCESS;
pai->format = PA_FORMAT_GIF;
- mir_sntprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.gif", szSearchPath, statusStr[i]);
+ mir_snwprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.gif", szSearchPath, statusStr[i]);
if (_waccess(pai->filename, 4) == 0)
return GAIR_SUCCESS;
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index 65c814dee1..c6159a10a3 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -56,11 +56,11 @@ int UpdateWeather(MCONTACT hContact) // error occurs if the return value is not equals to 0
if (opt.ShowWarnings) {
// show warnings by popup
- mir_sntprintf(str, _countof(str) - 105,
+ mir_snwprintf(str, _countof(str) - 105,
TranslateT("Unable to retrieve weather information for %s"), dbv.ptszVal);
- mir_tstrncat(str, L"\n", _countof(str) - mir_tstrlen(str));
+ mir_wstrncat(str, L"\n", _countof(str) - mir_wstrlen(str));
wchar_t *tszError = GetError(code);
- mir_tstrncat(str, tszError, _countof(str) - mir_tstrlen(str));
+ mir_wstrncat(str, tszError, _countof(str) - mir_wstrlen(str));
WPShowMessage(str, SM_WARNING);
mir_free(tszError);
}
@@ -76,24 +76,24 @@ int UpdateWeather(MCONTACT hContact) WEATHERINFO winfo = LoadWeatherInfo(hContact);
// translate weather condition
- mir_tstrcpy(winfo.cond, TranslateTS(winfo.cond));
+ mir_wstrcpy(winfo.cond, TranslateTS(winfo.cond));
// compare the old condition and determine if the weather had changed
if (opt.UpdateOnlyConditionChanged) { // consider condition change
if (!db_get_ts(hContact, WEATHERPROTONAME, "LastCondition", &dbv)) {
- if (mir_tstrcmpi(winfo.cond, dbv.ptszVal)) Ch = TRUE; // the weather condition is changed
+ if (mir_wstrcmpi(winfo.cond, dbv.ptszVal)) Ch = TRUE; // the weather condition is changed
db_free(&dbv);
}
else Ch = TRUE;
if (!db_get_ts(hContact, WEATHERPROTONAME, "LastTemperature", &dbv)) {
- if (mir_tstrcmpi(winfo.temp, dbv.ptszVal)) Ch = TRUE; // the temperature is changed
+ if (mir_wstrcmpi(winfo.temp, dbv.ptszVal)) Ch = TRUE; // the temperature is changed
db_free(&dbv);
}
else Ch = TRUE;
}
else { // consider update time change
if (!db_get_ts(hContact, WEATHERPROTONAME, "LastUpdate", &dbv)) {
- if (mir_tstrcmpi(winfo.update, dbv.ptszVal)) Ch = TRUE; // the update time is changed
+ if (mir_wstrcmpi(winfo.update, dbv.ptszVal)) Ch = TRUE; // the update time is changed
db_free(&dbv);
}
else Ch = TRUE;
@@ -104,7 +104,7 @@ int UpdateWeather(MCONTACT hContact) if (!dbres && dbv.ptszVal[0] != 0) {
if (opt.AlertPopup && !db_get_b(hContact, WEATHERPROTONAME, "DPopUp", 0) && Ch) {
// display alert popup
- mir_sntprintf(str, L"Alert for %s%c%s", winfo.city, 255, dbv.ptszVal);
+ mir_snwprintf(str, L"Alert for %s%c%s", winfo.city, 255, dbv.ptszVal);
WPShowMessage(str, SM_WEATHERALERT);
}
// alert issued, set display to italic
@@ -150,7 +150,7 @@ int UpdateWeather(MCONTACT hContact) db_set_b(hContact, WEATHERPROTONAME, "IsUpdated", TRUE);
// save info for default weather condition
- if (!mir_tstrcmp(winfo.id, opt.Default) && !opt.NoProtoCondition) {
+ if (!mir_wstrcmp(winfo.id, opt.Default) && !opt.NoProtoCondition) {
// save current condition for default station to be displayed after the update
old_status = status;
status = winfo.status;
@@ -458,7 +458,7 @@ int GetWeatherData(MCONTACT hContact) // if it is a normal item with start= and end=, then parse through the downloaded string
// to get a data value.
GetDataValue(&Item->Item, DataValue, &szInfo);
- if (mir_tstrcmp(Item->Item.Name, L"Condition") && mir_tstrcmpi(Item->Item.Unit, L"Cond"))
+ if (mir_wstrcmp(Item->Item.Name, L"Condition") && mir_wstrcmpi(Item->Item.Unit, L"Cond"))
wcsncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1);
break;
@@ -488,14 +488,14 @@ int GetWeatherData(MCONTACT hContact) case '[': // variable, add the value to the result string
hasvar = TRUE;
if (!DBGetData(hContact, _T2A(str2), &dbv)) {
- mir_tstrncat(DataValue, dbv.ptszVal, _countof(DataValue) - mir_tstrlen(DataValue));
+ mir_wstrncat(DataValue, dbv.ptszVal, _countof(DataValue) - mir_wstrlen(DataValue));
DataValue[_countof(DataValue) - 1] = 0;
db_free(&dbv);
}
break;
case'\"': // constant, add it to the result string
- mir_tstrncat(DataValue, TranslateTS(str2), _countof(DataValue) - mir_tstrlen(DataValue));
+ mir_wstrncat(DataValue, TranslateTS(str2), _countof(DataValue) - mir_wstrlen(DataValue));
DataValue[_countof(DataValue) - 1] = 0;
break;
}
@@ -528,7 +528,7 @@ int GetWeatherData(MCONTACT hContact) break; // exit if break string is not found
}
*end = '\0';
- end += mir_tstrlen(Item->Item.Break);
+ end += mir_wstrlen(Item->Item.Break);
while (end[0] == ' ')
end++; // remove extra space
@@ -542,28 +542,28 @@ int GetWeatherData(MCONTACT hContact) }
// don't store data if it is not available
- if ((DataValue[0] != 0 && mir_tstrcmp(DataValue, NODATA) &&
- mir_tstrcmp(DataValue, TranslateTS(NODATA)) && mir_tstrcmp(Item->Item.Name, L"Ignore")) ||
- (!mir_tstrcmp(Item->Item.Name, L"Alert") && i == 0)) {
+ if ((DataValue[0] != 0 && mir_wstrcmp(DataValue, NODATA) &&
+ mir_wstrcmp(DataValue, TranslateTS(NODATA)) && mir_wstrcmp(Item->Item.Name, L"Ignore")) ||
+ (!mir_wstrcmp(Item->Item.Name, L"Alert") && i == 0)) {
// temporary workaround for mToolTip to show feel-like temperature
- if (!mir_tstrcmp(Item->Item.Name, L"Feel"))
+ if (!mir_wstrcmp(Item->Item.Name, L"Feel"))
db_set_ts(hContact, WEATHERCONDITION, "Heat Index", DataValue);
GetStationID(hContact, Svc, _countof(Svc));
- if (!mir_tstrcmp(Svc, opt.Default))
+ if (!mir_wstrcmp(Svc, opt.Default))
db_set_ts(NULL, DEFCURRENTWEATHER, _T2A(Item->Item.Name), DataValue);
- if (!mir_tstrcmp(Item->Item.Name, L"Condition")) {
+ if (!mir_wstrcmp(Item->Item.Name, L"Condition")) {
wchar_t buf[128], *cbuf;
- mir_sntprintf(buf, L"#%s Weather", DataValue);
+ mir_snwprintf(buf, L"#%s Weather", DataValue);
cbuf = TranslateTS(buf);
if (cbuf[0] == '#')
cbuf = TranslateTS(DataValue);
db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf);
- CharLowerBuff(DataValue, (DWORD)mir_tstrlen(DataValue));
+ CharLowerBuff(DataValue, (DWORD)mir_wstrlen(DataValue));
cond = GetIcon(DataValue, Data);
}
- else if (mir_tstrcmpi(Item->Item.Unit, L"Cond") == 0) {
+ else if (mir_wstrcmpi(Item->Item.Unit, L"Cond") == 0) {
wchar_t buf[128], *cbuf;
- mir_sntprintf(buf, L"#%s Weather", DataValue);
+ mir_snwprintf(buf, L"#%s Weather", DataValue);
cbuf = TranslateTS(buf);
if (cbuf[0] == '#')
cbuf = TranslateTS(DataValue);
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index 7bc2acf7a3..a47782293c 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -221,7 +221,7 @@ extern "C" int __declspec(dllexport) Load() CreateServiceFunction("Countdown", CountdownMenuCommand);
mi.flags |= CMIF_KEEPUNTRANSLATED;
wchar_t countername[100];
- mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
+ mir_snwprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
mi.position = 600090099;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
mi.name.w = countername;
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index 3abb94ffb6..39cbf6dfc7 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -64,7 +64,7 @@ void ChangeMenuItemCountdown() HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
wchar_t countername[100];
- mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
+ mir_snwprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
Menu_ModifyItem(hMenuItemCountdown, countername, hIcon, CMIF_KEEPUNTRANSLATED);
}
@@ -173,7 +173,7 @@ int Doubleclick(WPARAM wParam, LPARAM) int action = db_get_b(hContact, MODULENAME, DBLE_WIN_KEY, 1);
if (action == 0) {
- ptrT url(db_get_tsa(hContact, MODULENAME, "URL"));
+ ptrW url(db_get_tsa(hContact, MODULENAME, "URL"));
Utils_OpenUrlT(url);
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);
@@ -241,10 +241,10 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb cfFM.dwEffects = bold | italic | underline;
if (!db_get_ts(NULL, MODULENAME, FONT_FACE_KEY, &dbv)) {
- mir_tstrcpy(cfFM.szFaceName, dbv.ptszVal);
+ mir_wstrcpy(cfFM.szFaceName, dbv.ptszVal);
db_free(&dbv);
}
- else mir_tstrcpy(cfFM.szFaceName, Def_font_face);
+ else mir_wstrcpy(cfFM.szFaceName, Def_font_face);
HDC hDC = GetDC(hWindow);
cfFM.yHeight = (BYTE)MulDiv(abs(g_lf.lfHeight), 120, GetDeviceCaps(GetDC(hWindow), LOGPIXELSY)) * (db_get_b(NULL, MODULENAME, FONT_SIZE_KEY, 14));
@@ -327,7 +327,7 @@ void FontSettings(void) g_lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
g_lf.lfQuality = DEFAULT_QUALITY;
g_lf.lfPitchAndFamily = FIXED_PITCH | FF_MODERN;
- mir_tstrcpy(g_lf.lfFaceName, Def_font_face);
+ mir_wstrcpy(g_lf.lfFaceName, Def_font_face);
}
/*****************************************************************************/
@@ -443,7 +443,7 @@ int OnTopMenuCommand(WPARAM, LPARAM, MCONTACT singlecontact) INT_PTR WebsiteMenuCommand(WPARAM wParam, LPARAM)
{
MCONTACT hContact = wParam;
- ptrT url(db_get_tsa(hContact, MODULENAME, "URL"));
+ ptrW url(db_get_tsa(hContact, MODULENAME, "URL"));
if (url)
Utils_OpenUrlT(url);
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 65987f66f9..eee757a5e8 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -30,7 +30,7 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_COMMAND:
case WM_CONTEXTMENU:
MCONTACT hContact = PUGetContact(hWnd);
- ptrT url( db_get_tsa(hContact, MODULENAME, URL_KEY));
+ ptrW url( db_get_tsa(hContact, MODULENAME, URL_KEY));
if (message == WM_COMMAND) { // left click
if(hContact != NULL) {
@@ -116,19 +116,19 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) if( ((HANDLE)wParam) != NULL) {
DBVARIANT dbv;
db_get_ts(wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv);
- mir_tstrncpy(ppd.lptzContactName, dbv.ptszVal, _countof(ppd.lptzContactName));
+ mir_wstrncpy(ppd.lptzContactName, dbv.ptszVal, _countof(ppd.lptzContactName));
db_free(&dbv);
}
- else mir_tstrcpy(ppd.lptzContactName, MODULENAMEW);
+ else mir_wstrcpy(ppd.lptzContactName, MODULENAMEW);
ppd.lchContact = wParam;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
wchar_t *displaytext = (wchar_t*)lParam;
- if ((mir_tstrlen(displaytext) == MAX_SECONDLINE) || (mir_tstrlen(displaytext) > MAX_SECONDLINE))
- mir_sntprintf(ppd.lptzText, displaytext);
- else if (mir_tstrlen(displaytext) < MAX_SECONDLINE)
- mir_sntprintf(ppd.lptzText, displaytext);
+ if ((mir_wstrlen(displaytext) == MAX_SECONDLINE) || (mir_wstrlen(displaytext) > MAX_SECONDLINE))
+ mir_snwprintf(ppd.lptzText, displaytext);
+ else if (mir_wstrlen(displaytext) < MAX_SECONDLINE)
+ mir_snwprintf(ppd.lptzText, displaytext);
if ( db_get_b(NULL, MODULENAME, POP_USECUSTCLRS_KEY, 0)) {
ppd.colorBack = db_get_dw(NULL, MODULENAME, POP_BG_CLR_KEY, Def_color_bg);
@@ -188,11 +188,11 @@ int ErrorMsgs(WPARAM wParam, LPARAM lParam) wchar_t *ptszContactName = pcli->pfnGetContactDisplayName(hContact, 0);
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
- mir_sntprintf(newdisplaytext, L"%s\n%s", ptszContactName, displaytext);
+ mir_snwprintf(newdisplaytext, L"%s\n%s", ptszContactName, displaytext);
PUShowMessageT(newdisplaytext, SM_WARNING);
}
else if ( ServiceExists("OSD/Announce") && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
- mir_sntprintf(newdisplaytext, L"%s: %s", ptszContactName, TranslateTS(displaytext));
+ mir_snwprintf(newdisplaytext, L"%s: %s", ptszContactName, TranslateTS(displaytext));
CallService("OSD/Announce", (WPARAM)newdisplaytext, 0);
}
else if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
@@ -357,7 +357,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn //
if ((!notpresent)) {
if (alertIndex == 0) { // popup
- mir_sntprintf(displaystring, L"%s \"%S\" %s.", Translate("The string"), alertstring, Translate("has been found on the web page"));
+ mir_snwprintf(displaystring, L"%s \"%S\" %s.", Translate("The string"), alertstring, Translate("has been found on the web page"));
WAlertPopup(hContact, displaystring);
// contactlist name//
@@ -397,7 +397,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn }
}
else if (alertIndex == 3) {
- mir_sntprintf(displaystring, L"%s \"%s\" %s.", TranslateT("The string"), alertstring, TranslateT("has been found on the web page"));
+ mir_snwprintf(displaystring, L"%s \"%s\" %s.", TranslateT("The string"), alertstring, TranslateT("has been found on the web page"));
WAlertOSD(hContact, displaystring);
// contactlist name//
@@ -426,9 +426,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, L"%s%S%S", cachepath, MODULENAME, "cache\\");
+ mir_snwprintf(cachedirectorypath, L"%s%S%S", cachepath, MODULENAME, "cache\\");
CreateDirectory(cachedirectorypath, NULL);
- mir_sntprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt");
+ mir_snwprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt");
// file exists?
if ( _waccess(newcachepath, 0) != -1) {
if ((pcachefile = _wfopen(newcachepath, L"r")) == NULL)
@@ -638,9 +638,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, L"%s%S%S", cachepath, MODULENAME, "cache\\");
+ mir_snwprintf(cachedirectorypath, L"%s%S%S", cachepath, MODULENAME, "cache\\");
CreateDirectory(cachedirectorypath, NULL);
- mir_sntprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt");
+ mir_snwprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt");
// file exists?
if ( _waccess(newcachepath, 0) != -1) {
if ((pcachefile = _wfopen(newcachepath, L"r")) == NULL)
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index acd228eb6d..a45f188ac1 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -129,10 +129,10 @@ static MCONTACT FindContactByUrl(HWND hwndDlg) GetWindowText(hwndDlg, titlebartxt, _countof(titlebartxt));
for (MCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
- ptrT db1( db_get_tsa(hContact, MODULENAME, URL_KEY));
- ptrT db2( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY));
+ ptrW db1( db_get_tsa(hContact, MODULENAME, URL_KEY));
+ ptrW db2( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY));
- if (!mir_tstrcmp(urltext, db1) && !mir_tstrcmp(titlebartxt, db2)) {
+ if (!mir_wstrcmp(urltext, db1) && !mir_wstrcmp(titlebartxt, db2)) {
contactcount++;
if (contactcount > 1) {
MessageBox(NULL, TranslateT("ERROR: You have two or more Webview contacts with the same URL and contact name."), MODULENAMEW, MB_OK);
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index a833fed559..69d878fbd6 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -53,9 +53,9 @@ wchar_t* FixButtonText(wchar_t *url, size_t len) int pos = (stringafter - buttontext);
int posbefore = (stringafter - buttontext) - 1;
int posafter = (stringafter - buttontext) + 1;
- strdelt(stringafter, 1);
+ strdelw(stringafter, 1);
wcsncpy_s(stringbefore, pos, buttontext, _TRUNCATE);
- mir_sntprintf(newbuttontext, L"%s!!%s", stringbefore, stringafter);
+ mir_snwprintf(newbuttontext, L"%s!!%s", stringbefore, stringafter);
posafter = 0;
posbefore = 0;
@@ -206,9 +206,9 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) TextColour = TextClr;
}
ppd.lchContact = NULL;
- mir_tstrcpy(ppd.lptzContactName, MODULENAMEW);
+ mir_wstrcpy(ppd.lptzContactName, MODULENAMEW);
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
- mir_tstrcpy(ppd.lptzText, TranslateT("This is a preview popup."));
+ mir_wstrcpy(ppd.lptzText, TranslateT("This is a preview popup."));
ppd.colorBack = BGColour;
ppd.colorText = TextColour;
ppd.PluginWindowProc = NULL;
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 718c57fdbf..b3d8a70504 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -46,12 +46,12 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) // A contact is renamed if (!strcmp(cws->szSetting, "MyHandle")) { - ptrT oldName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); + ptrW oldName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); if (oldName == NULL) return 0; wchar_t nick[100]; - ptrT oldnick( db_get_tsa(hContact, "CList", "MyHandle")); + ptrW oldnick( db_get_tsa(hContact, "CList", "MyHandle")); if (oldnick != NULL) wcsncpy_s(nick, oldnick, _TRUNCATE); else @@ -70,7 +70,7 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) srand((unsigned)time(NULL)); wchar_t ranStr[7]; _itow((int)10000 *rand() / (RAND_MAX + 1.0), ranStr, 10); - mir_tstrcat(nick, ranStr); + mir_wstrcat(nick, ranStr); } if ( wcschr(nick, '(') == 0) { @@ -85,19 +85,19 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) wchar_t *cacheend = wcsrchr(cachepath, '\\'); cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); + mir_snwprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); CreateDirectory(cachedirectorypath, NULL); wchar_t newcachepath[MAX_PATH + 50], renamedcachepath[MAX_PATH + 50]; - mir_sntprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, oldName); - mir_sntprintf(renamedcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, nick); + mir_snwprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, oldName); + mir_snwprintf(renamedcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, nick); // file exists? if ( _waccess(newcachepath, 0) != -1) { FILE *pcachefile = _wfopen(newcachepath, L"r"); if (pcachefile != NULL) { fclose(pcachefile); - if (mir_tstrcmp(newcachepath, renamedcachepath)) { + if (mir_wstrcmp(newcachepath, renamedcachepath)) { MoveFile(newcachepath, renamedcachepath); db_set_ts(hContact, MODULENAME, CACHE_FILE_KEY, renamedcachepath); } @@ -115,7 +115,7 @@ int SiteDeleted(WPARAM wParam, LPARAM) if (mir_strcmp(GetContactProto(hContact), MODULENAME)) return 0; - ptrT contactName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); + ptrW contactName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); // TEST GET NAME FOR CACHE wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50]; @@ -124,9 +124,9 @@ int SiteDeleted(WPARAM wParam, LPARAM) cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); + mir_snwprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); CreateDirectory(cachedirectorypath, NULL); - mir_sntprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, contactName); + mir_snwprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, contactName); // file exists? if ( _waccess(newcachepath, 0) != -1) { FILE *pcachefile = _wfopen(newcachepath, L"r"); @@ -149,7 +149,7 @@ INT_PTR OpenCacheDir(WPARAM, LPARAM) cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\%s", cachepath, cacheend); + mir_snwprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\%s", cachepath, cacheend); if( _waccess(cachedirectorypath, 0) != 0) WErrorPopup((UINT_PTR)"ERROR", TranslateT("Cache folder does not exist.")); @@ -167,7 +167,7 @@ INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM) return 0; } - ptrT url( db_get_tsa(wParam, MODULENAME, "URL")); + ptrW url( db_get_tsa(wParam, MODULENAME, "URL")); if (url == NULL) return 0; @@ -319,12 +319,12 @@ INT_PTR BasicSearch(WPARAM, LPARAM lParam) static wchar_t buf[300]; if (lParam) - mir_tstrncpy(buf, (const wchar_t*) lParam, 256); + mir_wstrncpy(buf, (const wchar_t*) lParam, 256); if (searchId != -1) return 0; // only one search at a time - mir_tstrncpy(sID, (wchar_t*)lParam, _countof(sID)); + mir_wstrncpy(sID, (wchar_t*)lParam, _countof(sID)); searchId = 1; // create a thread for the ID search @@ -355,7 +355,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) // check ID to see if the contact already exist in the database if (db_get_ts(hContact, MODULENAME, "URL", &dbv)) continue; - if (!mir_tstrcmpi(psr->nick.w, dbv.ptszVal)) { + if (!mir_wstrcmpi(psr->nick.w, dbv.ptszVal)) { // remove the flag for not on list and hidden, thus make the // contact visible // and add them on the list @@ -406,7 +406,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) for (MCONTACT hContact2 = db_find_first(MODULENAME); hContact2 != NULL; hContact2 = db_find_next(hContact2, MODULENAME)) { if (!db_get_ts(hContact2, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { - if (!mir_tstrcmpi(Newnick, dbv.ptszVal)) { + if (!mir_wstrcmpi(Newnick, dbv.ptszVal)) { // remove the flag for not on list and hidden, thus make the // contact visible // and add them on the list @@ -427,7 +427,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) wchar_t ranStr[10]; _itow((int) 10000 *rand() / (RAND_MAX + 1.0), ranStr, 10); - mir_tstrcat(Newnick, ranStr); + mir_wstrcat(Newnick, ranStr); } //end convert diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 3b269468c9..24af71cc3d 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -124,7 +124,7 @@ SIZE GetControlTextSize(HWND hCtrl) wchar_t buffer[maxSize];
SIZE size;
GetWindowText(hCtrl, buffer, _countof(buffer));
- GetTextExtentPoint32(hDC, buffer, (int)mir_tstrlen(buffer), &size);
+ GetTextExtentPoint32(hDC, buffer, (int)mir_wstrlen(buffer), &size);
SelectObject(hDC, oldFont);
ReleaseDC(hCtrl, hDC);
return size;
@@ -144,7 +144,7 @@ int EnlargeControl(HWND hCtrl, HWND, SIZE oldSize) wchar_t *strtrim(wchar_t *str)
{
size_t i = 0;
- size_t len = mir_tstrlen(str);
+ size_t len = mir_wstrlen(str);
while ((i < len) && (str[i] == ' ')) { i++; }
if (i) {
memmove(str, str + i, len - i + 1);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara SetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer);
_itow(commonData.checkInterval, buffer, 10);
SetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer);
- mir_sntprintf(buffer, L"%d|%d", commonData.popupTimeout, commonData.popupTimeoutToday);
+ mir_snwprintf(buffer, L"%d|%d", commonData.popupTimeout, commonData.popupTimeoutToday);
SetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer);
_itow(commonData.cSoundNearDays, buffer, 10);
SetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer);
@@ -327,11 +327,11 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara if (pos) {
wchar_t tmp[128];
*pos = 0;
- mir_tstrcpy(tmp, buffer);
+ mir_wstrcpy(tmp, buffer);
strtrim(tmp);
commonData.popupTimeout = _wtol(tmp);
- mir_tstrcpy(tmp, pos + 1);
+ mir_wstrcpy(tmp, pos + 1);
strtrim(tmp);
commonData.popupTimeoutToday = _wtol(tmp);
@@ -417,7 +417,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l char *szProto = GetContactProto(hContact);
wchar_t buffer[2048];
- mir_sntprintf(buffer, TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(buffer, TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hWnd, buffer);
HWND hDate = GetDlgItem(hWnd, IDC_DATE);
@@ -441,7 +441,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l case DOB_PROTOCOL:
DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_PROTOCOL);
- mir_sntprintf(buffer, TranslateT("%S protocol"), szProto);
+ mir_snwprintf(buffer, TranslateT("%S protocol"), szProto);
szCurrentModuleTooltip = buffer;
break;
@@ -560,7 +560,7 @@ INT_PTR CALLBACK BirthdaysCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam else
res = (value1 != value2);
}
- else res = mir_tstrcmpi(text1, text2);
+ else res = mir_wstrcmpi(text1, text2);
res = (params.column == lastColumn) ? -res : res;
return res;
@@ -609,22 +609,22 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll, wchar_t buffer[2048];
if ((dtb <= 366) && (dtb >= 0))
- mir_sntprintf(buffer, L"%d", dtb);
+ mir_snwprintf(buffer, L"%d", dtb);
else
- mir_sntprintf(buffer, NA);
+ mir_snwprintf(buffer, NA);
ListView_SetItemText(hList, entry, 2, buffer);
if ((month != 0) && (day != 0))
- mir_sntprintf(buffer, L"%04d-%02d-%02d", year, month, day);
+ mir_snwprintf(buffer, L"%04d-%02d-%02d", year, month, day);
else
- mir_sntprintf(buffer, NA);
+ mir_snwprintf(buffer, NA);
ListView_SetItemText(hList, entry, 3, buffer);
if (age < 400 && age > 0) //hopefully noone lives longer than this :)
- mir_sntprintf(buffer, L"%d", age);
+ mir_snwprintf(buffer, L"%d", age);
else
- mir_sntprintf(buffer, NA);
+ mir_snwprintf(buffer, NA);
ListView_SetItemText(hList, entry, 4, buffer);
ListView_SetItemText(hList, entry, 5, GetBirthdayModule(module, hContact));
@@ -694,7 +694,7 @@ void SetBirthdaysCount(HWND hWnd) {
int count = ListView_GetItemCount((GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST)));
wchar_t title[512];
- mir_sntprintf(title, TranslateT("Birthday list (%d)"), count);
+ mir_snwprintf(title, TranslateT("Birthday list (%d)"), count);
SetWindowText(hWnd, title);
}
@@ -881,7 +881,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar const int MAX_SIZE = 512;
wchar_t buffer[MAX_SIZE];
timeout--;
- mir_sntprintf(buffer, (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
+ mir_snwprintf(buffer, (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
SetDlgItemText(hWnd, IDC_CLOSE, buffer);
if (timeout <= 0)
@@ -914,9 +914,9 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar ListView_InsertItem(hList, &item);
wchar_t buffer[512];
- mir_sntprintf(buffer, L"%d", data->age);
+ mir_snwprintf(buffer, L"%d", data->age);
ListView_SetItemText(hList, index, 1, buffer);
- mir_sntprintf(buffer, L"%d", data->dtb);
+ mir_snwprintf(buffer, L"%d", data->dtb);
ListView_SetItemText(hList, index, 2, buffer);
BirthdaysSortParams params = { 0 };
diff --git a/plugins/WhenWasIt/src/notifiers.cpp b/plugins/WhenWasIt/src/notifiers.cpp index f7eeb0c150..c4869a53dd 100644 --- a/plugins/WhenWasIt/src/notifiers.cpp +++ b/plugins/WhenWasIt/src/notifiers.cpp @@ -43,11 +43,11 @@ void PopupNotifyNoBirthdays() wchar_t *BuildDTBText(int dtb, wchar_t *name, wchar_t *text, int size)
{
if (dtb > 1)
- mir_sntprintf(text, size, TranslateT("%s has birthday in %d days."), name, dtb);
+ mir_snwprintf(text, size, TranslateT("%s has birthday in %d days."), name, dtb);
else if (dtb == 1)
- mir_sntprintf(text, size, TranslateT("%s has birthday tomorrow."), name);
+ mir_snwprintf(text, size, TranslateT("%s has birthday tomorrow."), name);
else
- mir_sntprintf(text, size, TranslateT("%s has birthday today."), name);
+ mir_snwprintf(text, size, TranslateT("%s has birthday today."), name);
return text;
}
@@ -55,11 +55,11 @@ wchar_t *BuildDTBText(int dtb, wchar_t *name, wchar_t *text, int size) wchar_t *BuildDABText(int dab, wchar_t *name, wchar_t *text, int size)
{
if (dab > 1)
- mir_sntprintf(text, size, TranslateT("%s had birthday %d days ago."), name, dab);
+ mir_snwprintf(text, size, TranslateT("%s had birthday %d days ago."), name, dab);
else if (dab == 1)
- mir_sntprintf(text, size, TranslateT("%s had birthday yesterday."), name);
+ mir_snwprintf(text, size, TranslateT("%s had birthday yesterday."), name);
else
- mir_sntprintf(text, size, TranslateT("%s has birthday today (Should not happen, please report)."), name);
+ mir_snwprintf(text, size, TranslateT("%s has birthday today (Should not happen, please report)."), name);
return text;
}
@@ -81,7 +81,7 @@ int PopupNotifyBirthday(MCONTACT hContact, int dtb, int age) pd.PluginWindowProc = DlgProcPopup;
pd.lchIcon = GetDTBIcon(dtb);
- mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
+ mir_snwprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
wchar_t *sex;
switch (toupper(gender)) {
case 'M':
@@ -96,12 +96,12 @@ int PopupNotifyBirthday(MCONTACT hContact, int dtb, int age) }
if (age > 0) {
if (dtb > 0)
- mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s will be %d years old."), text, sex, age);
+ mir_snwprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s will be %d years old."), text, sex, age);
else
- mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
+ mir_snwprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
}
else
- mir_tstrncpy(pd.lptzText, text, MAX_SECONDLINE - 1);
+ mir_wstrncpy(pd.lptzText, text, MAX_SECONDLINE - 1);
PUAddPopupT(&pd);
@@ -125,7 +125,7 @@ int PopupNotifyMissedBirthday(MCONTACT hContact, int dab, int age) pd.PluginWindowProc = DlgProcPopup;
pd.lchIcon = GetDTBIcon(dab);
- mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
+ mir_snwprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
wchar_t *sex;
switch (toupper(gender)) {
case 'M':
@@ -140,12 +140,12 @@ int PopupNotifyMissedBirthday(MCONTACT hContact, int dab, int age) }
if (age > 0){
if (dab > 0)
- mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
+ mir_snwprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
else
- mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
+ mir_snwprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
}
else
- mir_tstrncpy(pd.lptzText, text, MAX_SECONDLINE - 1);
+ mir_wstrncpy(pd.lptzText, text, MAX_SECONDLINE - 1);
PUAddPopupT(&pd);
return 0;
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index a40f104f13..7ac4d016a5 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -217,7 +217,7 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM) of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c", TranslateT("Birthdays files"), 0, 0);
+ mir_snwprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c", TranslateT("Birthdays files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
@@ -226,7 +226,7 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM) if (GetOpenFileName(&of)) {
wchar_t buffer[2048];
- mir_sntprintf(buffer, TranslateT("Importing birthdays from file: %s"), fileName);
+ mir_snwprintf(buffer, TranslateT("Importing birthdays from file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hImportBirthdays);
DoImport(fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done importing birthdays"), hImportBirthdays);
@@ -242,7 +242,7 @@ INT_PTR ExportBirthdaysService(WPARAM, LPARAM) of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c%s (*.*)%c*.*%c", TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
+ mir_snwprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c%s (*.*)%c*.*%c", TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
@@ -252,9 +252,9 @@ INT_PTR ExportBirthdaysService(WPARAM, LPARAM) wchar_t buffer[2048];
wchar_t *fn = wcsrchr(fileName, '\\') + 1;
if (!wcschr(fn, '.'))
- mir_tstrcat(fileName, BIRTHDAY_EXTENSION);
+ mir_wstrcat(fileName, BIRTHDAY_EXTENSION);
- mir_sntprintf(buffer, TranslateT("Exporting birthdays to file: %s"), fileName);
+ mir_snwprintf(buffer, TranslateT("Exporting birthdays to file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hExportBirthdays);
DoExport(fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done exporting birthdays"), hExportBirthdays);
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 6c0c253a12..2b1a8e3551 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -145,7 +145,7 @@ wchar_t* GetContactID(MCONTACT hContact) wchar_t* GetContactID(MCONTACT hContact, char *szProto)
{
- ptrT res(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto));
+ ptrW res(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto));
return (res) ? wcsdup(res) : NULL;
}
@@ -155,7 +155,7 @@ MCONTACT GetContactFromID(wchar_t *szID, char *szProto) char *m_szProto = GetContactProto(hContact);
wchar_t *szHandle = GetContactID(hContact, szProto);
if (szHandle) {
- bool found = (!mir_tstrcmpi(szHandle, szID) && !_stricmp(szProto, m_szProto));
+ bool found = (!mir_wstrcmpi(szHandle, szID) && !_stricmp(szProto, m_szProto));
free(szHandle);
if (found)
return hContact;
diff --git a/plugins/WhoUsesMyFiles/src/list.cpp b/plugins/WhoUsesMyFiles/src/list.cpp index 2a1c189c9b..028d17f035 100644 --- a/plugins/WhoUsesMyFiles/src/list.cpp +++ b/plugins/WhoUsesMyFiles/src/list.cpp @@ -13,18 +13,18 @@ PWumf new_wumf( DWORD dwID, if (!w)
return NULL;
- w->szUser = mir_tstrdup(szUser);
- w->szPath = mir_tstrdup(szPath);
- w->szComp = mir_tstrdup(szComp);
- w->szUNC = mir_tstrdup(szUNC);
+ w->szUser = mir_wstrdup(szUser);
+ w->szPath = mir_wstrdup(szPath);
+ w->szComp = mir_wstrdup(szComp);
+ w->szUNC = mir_wstrdup(szUNC);
switch(dwPerm) {
- case PERM_FILE_READ: mir_tstrcpy(w->szPerm, L"Read");break;
- case PERM_FILE_WRITE: mir_tstrcpy(w->szPerm, L"Write");break;
- case PERM_FILE_CREATE: mir_tstrcpy(w->szPerm, L"Create");break;
- default: mir_tstrcpy(w->szPerm, L"Execute");
+ case PERM_FILE_READ: mir_wstrcpy(w->szPerm, L"Read");break;
+ case PERM_FILE_WRITE: mir_wstrcpy(w->szPerm, L"Write");break;
+ case PERM_FILE_CREATE: mir_wstrcpy(w->szPerm, L"Create");break;
+ default: mir_wstrcpy(w->szPerm, L"Execute");
}
- mir_sntprintf(w->szID, L"%i", dwID);
+ mir_snwprintf(w->szID, L"%i", dwID);
w->dwID = dwID;
w->dwSess = dwSess;
diff --git a/plugins/WhoUsesMyFiles/src/wumf.cpp b/plugins/WhoUsesMyFiles/src/wumf.cpp index 00508fe262..99e2102d04 100644 --- a/plugins/WhoUsesMyFiles/src/wumf.cpp +++ b/plugins/WhoUsesMyFiles/src/wumf.cpp @@ -5,8 +5,8 @@ #define NAME "WUMF"
#define WM_MYCMD 0x0401
-static PWumf list = NULL;
-static PWumf lst = NULL;
+PWumf list = NULL;
+PWumf lst = NULL;
HANDLE hLogger = NULL;
BOOL wumf();
@@ -140,7 +140,7 @@ void LogWumf(PWumf w) hLogger = mir_createLog("wumf", L"WhoIsUsingMyFiles log file", WumfOptions.LogFile, 0);
if (hLogger == NULL) {
wchar_t str[256];
- mir_sntprintf(str, L"Can't open log file %s", WumfOptions.LogFile);
+ mir_snwprintf(str, L"Can't open log file %s", WumfOptions.LogFile);
MessageBox(NULL, str, TranslateT("Error opening file"), MB_OK | MB_ICONSTOP);
WumfOptions.LogToFile = FALSE;
return;
@@ -153,7 +153,7 @@ void LogWumf(PWumf w) wchar_t lpDateStr[20], lpTimeStr[20];
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &time, NULL, lpDateStr, 20);
GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER, &time, NULL, lpTimeStr, 20);
- mir_writeLogT(hLogger, L"%s %s %20s\t%s\r\n", lpDateStr, lpTimeStr, w->szUser, w->szPath);
+ mir_writeLogW(hLogger, L"%s %s %20s\t%s\r\n", lpDateStr, lpTimeStr, w->szUser, w->szPath);
}
BOOL wumf()
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index f39cb61e82..fc2ff253db 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -119,8 +119,8 @@ void ShowWumfPopup(PWumf w) wchar_t text[512], title[512];
if (!WumfOptions.AlertFolders && (w->dwAttr & FILE_ATTRIBUTE_DIRECTORY)) return;
- mir_sntprintf(title, L"%s (%s)", w->szComp, w->szUser);
- mir_sntprintf(text, L"%s (%s)", w->szPath, w->szPerm);
+ mir_snwprintf(title, L"%s (%s)", w->szComp, w->szUser);
+ mir_snwprintf(text, L"%s (%s)", w->szPath, w->szPerm);
ShowThePopup(w, title, text);
}
@@ -137,8 +137,8 @@ void ShowThePopup(PWumf w, LPTSTR title, LPTSTR text) else if (WumfOptions.DelaySet)
ppd.iSeconds = WumfOptions.DelaySec;
- mir_tstrncpy(ppd.lptzContactName, title, MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lptzText, text, MAX_SECONDLINE);
+ mir_wstrncpy(ppd.lptzContactName, title, MAX_CONTACTNAME);
+ mir_wstrncpy(ppd.lptzText, text, MAX_SECONDLINE);
if (WumfOptions.UseWinColor) {
ppd.colorBack = GetSysColor(COLOR_WINDOW);
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
@@ -268,13 +268,13 @@ void ChooseFile(HWND hwndDlg) HANDLE hf = CreateFile(szFile,GENERIC_WRITE,0,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL, NULL);
if (hf != INVALID_HANDLE_VALUE) {
SetDlgItemText(hwndDlg,IDC_FILE,szFile);
- mir_tstrncpy(WumfOptions.LogFile, szFile, MAX_PATH);
+ mir_wstrncpy(WumfOptions.LogFile, szFile, MAX_PATH);
CloseHandle(hf);
}
}
else if (CommDlgExtendedError() != 0) {
wchar_t str[256];
- mir_sntprintf(str, TranslateT("Common Dialog Error 0x%lx"), CommDlgExtendedError());
+ mir_snwprintf(str, TranslateT("Common Dialog Error 0x%lx"), CommDlgExtendedError());
MessageBox(hwndDlg, str, TranslateT("Error"), MB_OK | MB_ICONSTOP);
}
}
diff --git a/plugins/WinterSpeak/src/EventInformation.cpp b/plugins/WinterSpeak/src/EventInformation.cpp index 451449f343..f9a9799a4f 100644 --- a/plugins/WinterSpeak/src/EventInformation.cpp +++ b/plugins/WinterSpeak/src/EventInformation.cpp @@ -67,7 +67,7 @@ std::wstring EventInformation::getMessage() {
const std::wstring intro = TranslateT("%u says");
- return intro + L" " + mir_a2t_cp((char*)m_event_info.pBlob, CP_UTF8);
+ return intro + L" " + mir_a2u_cp((char*)m_event_info.pBlob, CP_UTF8);
}
//------------------------------------------------------------------------------
diff --git a/plugins/WinterSpeak/src/SpeechApi40a.cpp b/plugins/WinterSpeak/src/SpeechApi40a.cpp index 518e9ed602..fbb6851364 100644 --- a/plugins/WinterSpeak/src/SpeechApi40a.cpp +++ b/plugins/WinterSpeak/src/SpeechApi40a.cpp @@ -88,7 +88,7 @@ bool SpeechApi40a::isLoaded() const //------------------------------------------------------------------------------
bool SpeechApi40a::say(const std::wstring &sentence)
{
- //std::string text = mir_t2a_cp(sentence.c_str(), CP_ACP);
+ //std::string text = mir_u2a_cp(sentence.c_str(), CP_ACP);
//MessageBoxA(NULL, text.c_str(), "TTS4", MB_OK);
bool ret = true;
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 5a6bff9772..ca68cabc9f 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -35,17 +35,17 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP break;
case DBVT_ASCIIZ:
- mir_tstrcpy(uid, _A2T(dbvuid.pszVal));
+ mir_wstrcpy(uid, _A2T(dbvuid.pszVal));
break;
case DBVT_UTF8:
- mir_tstrcpy(uid, ptrT(mir_utf8decodeT(dbvuid.pszVal)));
+ mir_wstrcpy(uid, ptrW(mir_utf8decodeW(dbvuid.pszVal)));
break;
}
wchar_t *nick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
wchar_t value[100];
- mir_sntprintf(value, TranslateT("Custom sound for %s (%s)"), nick, uid);
+ mir_snwprintf(value, TranslateT("Custom sound for %s (%s)"), nick, uid);
SetWindowText(hwndDlg, value);
db_free(&dbvuid);
}
@@ -67,7 +67,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP CheckDlgButton(hwndDlg, IDC_CONT_IGNORE_SOUND, db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0) ? BST_CHECKED : BST_UNCHECKED);
p = XSN_Users.find((XSN_Data *)&hContact);
if (p == NULL) {
- ptrT name(db_get_tsa(hContact, SETTINGSNAME, SETTINGSKEY));
+ ptrW name(db_get_tsa(hContact, SETTINGSNAME, SETTINGSKEY));
if (name != NULL)
XSN_Users.insert(new XSN_Data(hContact, name, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0));
}
@@ -79,7 +79,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP case IDOK:
p = XSN_Users.find((XSN_Data *)&hContact);
if (p != NULL) {
- if (mir_tstrcmpi(p->path, L"")) {
+ if (mir_wstrcmpi(p->path, L"")) {
wchar_t shortpath[MAX_PATH];
PathToRelativeT(p->path, shortpath);
db_set_ts(hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
@@ -100,9 +100,9 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP ofn.lStructSize = sizeof(ofn);
wchar_t tmp[MAX_PATH];
if (GetModuleHandle(L"bass_interface.dll"))
- mir_sntprintf(tmp, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c", TranslateT("Sound files"), 0, 0, 0);
+ mir_snwprintf(tmp, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c", TranslateT("Sound files"), 0, 0, 0);
else
- mir_sntprintf(tmp, L"%s (*.wav)%c*.wav%c%c", TranslateT("WAV files"), 0, 0, 0);
+ mir_snwprintf(tmp, L"%s (*.wav)%c*.wav%c%c", TranslateT("WAV files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index 775cfc6ffd..61a846a53e 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -66,21 +66,21 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l break;
case DBVT_ASCIIZ:
- mir_tstrcpy(uid, _A2T(dbvuid.pszVal));
+ mir_wstrcpy(uid, _A2T(dbvuid.pszVal));
break;
case DBVT_UTF8:
- mir_tstrcpy(uid, ptrT(mir_utf8decodeT(dbvuid.pszVal)));
+ mir_wstrcpy(uid, ptrW(mir_utf8decodeW(dbvuid.pszVal)));
break;
default:
- mir_tstrcpy(uid, TranslateT("(Unknown contact)"));
+ mir_wstrcpy(uid, TranslateT("(Unknown contact)"));
}
wchar_t *nick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
- size_t value_max_len = (mir_tstrlen(uid) + mir_tstrlen(nick) + 4);
+ size_t value_max_len = (mir_wstrlen(uid) + mir_wstrlen(nick) + 4);
wchar_t *value = (wchar_t *)mir_alloc(sizeof(wchar_t) * value_max_len);
- mir_sntprintf(value, value_max_len, L"%s (%s)", nick, uid);
+ mir_snwprintf(value, value_max_len, L"%s (%s)", nick, uid);
SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_ADDSTRING, 0, (LPARAM)value), hContact);
mir_free(value);
db_free(&dbvuid);
@@ -122,9 +122,9 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ofn.lStructSize = sizeof(ofn);
wchar_t tmp[MAX_PATH];
if (GetModuleHandle(L"bass_interface.dll"))
- mir_sntprintf(tmp, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c", TranslateT("Sound files"), 0, 0, 0);
+ mir_snwprintf(tmp, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c", TranslateT("Sound files"), 0, 0, 0);
else
- mir_sntprintf(tmp, L"%s (*.wav)%c*.wav%c%c", TranslateT("WAV files"), 0, 0, 0);
+ mir_snwprintf(tmp, L"%s (*.wav)%c*.wav%c%c", TranslateT("WAV files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
@@ -224,7 +224,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l switch (hdr->code) {
case PSN_APPLY:
for (int i = 0; i < XSN_Users.getCount(); i++) {
- if (mir_tstrcmpi(XSN_Users[i]->path, L"")) {
+ if (mir_wstrcmpi(XSN_Users[i]->path, L"")) {
wchar_t shortpath[MAX_PATH];
PathToRelativeT(XSN_Users[i]->path, shortpath);
db_set_ts(XSN_Users[i]->hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index afb720d85b..02ea729792 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -77,7 +77,7 @@ void InitSelfSounds() mir_snprintf(namebuf, "%s%s", protos[i]->szModuleName, selfSounds[j].szName);
wchar_t infobuf[256];
- mir_sntprintf(infobuf, L"%s [%s]", TranslateT("Self status"), protos[i]->tszAccountName);
+ mir_snwprintf(infobuf, L"%s [%s]", TranslateT("Self status"), protos[i]->tszAccountName);
SkinAddNewSoundExT(namebuf, infobuf, pcli->pfnGetStatusModeDescription(selfSounds[j].iStatus, 0));
}
}
@@ -141,7 +141,7 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam) MCONTACT hContact = pci->FindRoom(gcd->pszModule, gcd->ptszID);
if (hContact != 0) {
- ptrT nick(db_get_tsa(hContact, gcd->pszModule, "MyNick"));
+ ptrW nick(db_get_tsa(hContact, gcd->pszModule, "MyNick"));
if (nick == NULL || gce->ptszText == NULL)
return 0;
if (wcsstr(gce->ptszText, nick)) {
diff --git a/plugins/YAMN/src/account.cpp b/plugins/YAMN/src/account.cpp index a79c650ce7..fa1262c1da 100644 --- a/plugins/YAMN/src/account.cpp +++ b/plugins/YAMN/src/account.cpp @@ -224,7 +224,7 @@ DWORD ReadStringFromMemory(char **Parser,wchar_t *End,char **StoreTo,wchar_t *De Finder=*Parser; while((*Finder != (wchar_t)0) && (Finder<=End)) Finder++; - mir_sntprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, End-Finder); + mir_snwprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, End-Finder); MessageBox(NULL,Debug,L"debug",MB_OK); if (Finder>=End) return EACC_FILECOMPATIBILITY; @@ -279,7 +279,7 @@ DWORD ReadStringFromMemoryW(WCHAR **Parser,wchar_t *End,WCHAR **StoreTo,WCHAR *D Finder=*Parser; while((*Finder != (WCHAR)0) && (Finder<=(WCHAR *)End)) Finder++; - mir_sntprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, (WCHAR *)End-Finder); + mir_snwprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, (WCHAR *)End-Finder); MessageBoxW(NULL,Debug,L"debug",MB_OK); if (Finder>=(WCHAR *)End) return EACC_FILECOMPATIBILITY; @@ -335,7 +335,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"NFlags: %04x, remaining %d chars", Which->Flags, End-*Parser); + mir_snwprintf(Debug, L"NFlags: %04x, remaining %d chars", Which->Flags, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif @@ -344,7 +344,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"PopupB: %04x, remaining %d chars", Which->PopupB, End-*Parser); + mir_snwprintf(Debug, L"PopupB: %04x, remaining %d chars", Which->PopupB, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif Which->PopupT = *(COLORREF *)(*Parser); @@ -352,7 +352,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"PopupT: %04x, remaining %d chars", Which->PopupT, End-*Parser); + mir_snwprintf(Debug, L"PopupT: %04x, remaining %d chars", Which->PopupT, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif Which->PopupTime = *(DWORD *)(*Parser); @@ -360,7 +360,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"PopupTime: %04x, remaining %d chars", Which->PopupTime, End-*Parser); + mir_snwprintf(Debug, L"PopupTime: %04x, remaining %d chars", Which->PopupTime, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif @@ -510,7 +510,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"Port: %d, remaining %d chars", Which->Server->Port, End-*Parser); + mir_snwprintf(Debug, L"Port: %d, remaining %d chars", Which->Server->Port, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif #ifdef DEBUG_FILEREAD @@ -533,19 +533,19 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"Flags: %04x, remaining %d chars", Which->Flags, End-*Parser); + mir_snwprintf(Debug, L"Flags: %04x, remaining %d chars", Which->Flags, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif Which->StatusFlags = *(DWORD *)(*Parser); (*Parser) += sizeof(DWORD); #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"STFlags: %04x, remaining %d chars", Which->StatusFlags, End-*Parser); + mir_snwprintf(Debug, L"STFlags: %04x, remaining %d chars", Which->StatusFlags, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif Which->PluginFlags = *(DWORD *)(*Parser); (*Parser) += sizeof(DWORD); #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"PFlags: %04x, remaining %d chars", Which->PluginFlags, End-*Parser); + mir_snwprintf(Debug, L"PFlags: %04x, remaining %d chars", Which->PluginFlags, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif @@ -556,7 +556,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"Interval: %d, remaining %d chars", Which->Interval, End-*Parser); + mir_snwprintf(Debug, L"Interval: %d, remaining %d chars", Which->Interval, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif @@ -599,7 +599,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"LastChecked: %04x, remaining %d chars", Which->LastChecked, End-*Parser); + mir_snwprintf(Debug, L"LastChecked: %04x, remaining %d chars", Which->LastChecked, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif Which->LastSChecked = *(SYSTEMTIME *)(*Parser); @@ -607,7 +607,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"LastSChecked: %04x, remaining %d chars", Which->LastSChecked, End-*Parser); + mir_snwprintf(Debug, L"LastSChecked: %04x, remaining %d chars", Which->LastSChecked, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif Which->LastSynchronised = *(SYSTEMTIME *)(*Parser); @@ -615,7 +615,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"LastSynchronised: %04x, remaining %d chars", Which->LastSynchronised, End-*Parser); + mir_snwprintf(Debug, L"LastSynchronised: %04x, remaining %d chars", Which->LastSynchronised, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif Which->LastMail = *(SYSTEMTIME *)(*Parser); @@ -623,7 +623,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser > End) //WARNING! There's only > at the end of testing return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, L"LastMail: %04x, remaining %d chars", Which->LastMail, End-*Parser); + mir_snwprintf(Debug, L"LastMail: %04x, remaining %d chars", Which->LastMail, End-*Parser); MessageBox(NULL,Debug,L"debug",MB_OK); #endif if (*Parser == End) @@ -1232,14 +1232,14 @@ void WINAPI GetStatusFcn(HACCOUNT Which, wchar_t *Value) return; mir_cslock lck(csAccountStatusCS); - mir_tstrcpy(Value, Which->Status); + mir_wstrcpy(Value, Which->Status); } void WINAPI SetStatusFcn(HACCOUNT Which, wchar_t *Value) { if (Which != NULL) { mir_cslock lck(csAccountStatusCS); - mir_tstrcpy(Which->Status, Value); + mir_wstrcpy(Which->Status, Value); } WindowList_BroadcastAsync(YAMNVar.MessageWnds, WM_YAMN_CHANGESTATUS, (WPARAM)Which, 0); diff --git a/plugins/YAMN/src/browser/badconnect.cpp b/plugins/YAMN/src/browser/badconnect.cpp index d6e4fdf2e6..31cbb57829 100644 --- a/plugins/YAMN/src/browser/badconnect.cpp +++ b/plugins/YAMN/src/browser/badconnect.cpp @@ -119,7 +119,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP BadConnectPopup.PluginWindowProc = BadConnectPopupProc;
BadConnectPopup.PluginData = ActualAccount;
- mir_tstrncpy(BadConnectPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(BadConnectPopup.lptzContactName));
+ mir_wstrncpy(BadConnectPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(BadConnectPopup.lptzContactName));
}
if (ActualAccount->Plugin->Fcn != NULL && ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr != NULL) {
@@ -257,7 +257,7 @@ void __cdecl BadConnection(void *Param) nid.hIcon = g_LoadIconEx(3);
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_YAMN_NOTIFYICON;
- mir_sntprintf(nid.szTip, L"%S%s", ActualAccount->Name, TranslateT(" - connection error"));
+ mir_snwprintf(nid.szTip, L"%S%s", ActualAccount->Name, TranslateT(" - connection error"));
Shell_NotifyIcon(NIM_ADD, &nid);
}
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index d768f3e363..2dae05544b 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -543,7 +543,7 @@ int AddNewMailsToListView(HWND hListView, HACCOUNT ActualAccount, DWORD nflags) if ((UnicodeHeader.From != NULL) && (UnicodeHeader.FromNick != NULL)) { size_t size = mir_wstrlen(UnicodeHeader.From) + mir_wstrlen(UnicodeHeader.FromNick) + 4; FromStr = new WCHAR[size]; - mir_sntprintf(FromStr, size, L"%s <%s>", UnicodeHeader.FromNick, UnicodeHeader.From); + mir_snwprintf(FromStr, size, L"%s <%s>", UnicodeHeader.FromNick, UnicodeHeader.From); FromStrNew = TRUE; } else if (UnicodeHeader.From != NULL) @@ -569,7 +569,7 @@ int AddNewMailsToListView(HWND hListView, HACCOUNT ActualAccount, DWORD nflags) SendMessage(hListView, LVM_SETITEMTEXT, (WPARAM)item.iItem, (LPARAM)&item); item.iSubItem = 2; - mir_sntprintf(SizeStr, L"%d kB", msgq->MailData->Size / 1024); + mir_snwprintf(SizeStr, L"%d kB", msgq->MailData->Size / 1024); item.pszText = SizeStr; SendMessage(hListView, LVM_SETITEMTEXT, (WPARAM)item.iItem, (LPARAM)&item); @@ -587,8 +587,8 @@ int AddNewMailsToListView(HWND hListView, HACCOUNT ActualAccount, DWORD nflags) } if ((nflags & YAMN_ACC_POP) && (ActualAccount->Flags & YAMN_ACC_POPN) && (msgq->Flags & YAMN_MSG_POPUP) && (msgq->Flags & YAMN_MSG_NEW)) { - mir_tstrncpy(NewMailPopup.lptzContactName, FromStr, _countof(NewMailPopup.lptzContactName)); - mir_tstrncpy(NewMailPopup.lptzText, UnicodeHeader.Subject, _countof(NewMailPopup.lptzText)); + mir_wstrncpy(NewMailPopup.lptzContactName, FromStr, _countof(NewMailPopup.lptzContactName)); + mir_wstrncpy(NewMailPopup.lptzText, UnicodeHeader.Subject, _countof(NewMailPopup.lptzText)); PYAMN_MAILSHOWPARAM MailParam = (PYAMN_MAILSHOWPARAM)malloc(sizeof(YAMN_MAILSHOWPARAM)); if (MailParam) { @@ -634,7 +634,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D if ((nflags & YAMN_ACC_CONT) && (MN->Real.PopupRun + MN->Virtual.PopupRun)) { wchar_t tszMsg[250]; - mir_sntprintf(tszMsg, TranslateT("%s : %d new mail message(s), %d total"), _A2T(ActualAccount->Name), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); + mir_snwprintf(tszMsg, TranslateT("%s : %d new mail message(s), %d total"), _A2T(ActualAccount->Name), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); if (!(nflags & YAMN_ACC_CONTNOEVENT)) { CLISTEVENT evt = {}; @@ -673,8 +673,8 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D NewMailPopup.PluginWindowProc = NewMailPopupProc; NewMailPopup.PluginData = (void *)0; //multiple popups - mir_tstrncpy(NewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NewMailPopup.lptzContactName)); - mir_sntprintf(NewMailPopup.lptzText, TranslateT("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); + mir_wstrncpy(NewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NewMailPopup.lptzContactName)); + mir_snwprintf(NewMailPopup.lptzText, TranslateT("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); PUAddPopupT(&NewMailPopup); } @@ -704,7 +704,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D nid.hIcon = g_LoadIconEx(2); nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; nid.uCallbackMessage = WM_YAMN_NOTIFYICON; - mir_sntprintf(nid.szTip, L"%S %s", ActualAccount->Name, TranslateT("- new mail message(s)")); + mir_snwprintf(nid.szTip, L"%S %s", ActualAccount->Name, TranslateT("- new mail message(s)")); Shell_NotifyIcon(NIM_ADD, &nid); SetTimer(hDlg, TIMER_FLASHING, 500, NULL); } @@ -761,11 +761,11 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D NoNewMailPopup.PluginWindowProc = NoNewMailPopupProc; NoNewMailPopup.PluginData = 0; //it's not new mail popup - mir_tstrncpy(NoNewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NoNewMailPopup.lptzContactName)); + mir_wstrncpy(NoNewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NoNewMailPopup.lptzContactName)); if (MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC) - mir_sntprintf(NoNewMailPopup.lptzText, TranslateT("No new mail message, %d spam(s)"), MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC); + mir_snwprintf(NoNewMailPopup.lptzText, TranslateT("No new mail message, %d spam(s)"), MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC); else - mir_tstrncpy(NoNewMailPopup.lptzText, TranslateT("No new mail message"), _countof(NoNewMailPopup.lptzText)); + mir_wstrncpy(NoNewMailPopup.lptzText, TranslateT("No new mail message"), _countof(NoNewMailPopup.lptzText)); PUAddPopupT(&NoNewMailPopup); } @@ -1435,7 +1435,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR size_t size = (From ? mir_wstrlen(From) : 0) + (Subj ? mir_wstrlen(Subj) : 0) + 4; title = new WCHAR[size]; if (From && Subj) - mir_sntprintf(title, size, L"%s (%s)", Subj, From); + mir_snwprintf(title, size, L"%s (%s)", Subj, From); else if (From) wcsncpy_s(title, size, From, _TRUNCATE); else if (Subj) @@ -1562,9 +1562,9 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue; ListView_GetItemText(hList, courRow, 0, headname, _countof(headname)); ListView_GetItemText(hList, courRow, 1, headvalue, _countof(headvalue)); - size_t headnamelen = mir_tstrlen(headname); + size_t headnamelen = mir_wstrlen(headname); if (headnamelen) sizeNeeded += 1 + headnamelen; - sizeNeeded += 3 + mir_tstrlen(headvalue); + sizeNeeded += 3 + mir_wstrlen(headvalue); } if (sizeNeeded && OpenClipboard(hDlg)) { EmptyClipboard(); @@ -1575,8 +1575,8 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue; ListView_GetItemText(hList, courRow, 0, headname, _countof(headname)); ListView_GetItemText(hList, courRow, 1, headvalue, _countof(headvalue)); - if (mir_tstrlen(headname)) courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, L"%s:\t%s\r\n", headname, headvalue); - else courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, L"\t%s\r\n", headvalue); + if (mir_wstrlen(headname)) courPos += mir_snwprintf(&buff[courPos], sizeNeeded + 1, L"%s:\t%s\r\n", headname, headvalue); + else courPos += mir_snwprintf(&buff[courPos], sizeNeeded + 1, L"\t%s\r\n", headvalue); } GlobalUnlock(hData); @@ -2039,7 +2039,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR if (Total) { wchar_t DeleteMsg[1024]; - mir_sntprintf(DeleteMsg, TranslateT("Do you really want to delete %d selected mails?"), Total); + mir_snwprintf(DeleteMsg, TranslateT("Do you really want to delete %d selected mails?"), Total); if (IDOK == MessageBox(hDlg, DeleteMsg, TranslateT("Delete confirmation"), MB_OKCANCEL | MB_ICONWARNING)) { struct DeleteParam ParamToDeleteMails = { YAMN_DELETEVERSION, ThreadRunningEV, ActualAccount, NULL }; @@ -2243,7 +2243,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR ListView_GetItemText(hList, courRow, 1, subject, _countof(subject)); ListView_GetItemText(hList, courRow, 2, size, _countof(size)); ListView_GetItemText(hList, courRow, 3, date, _countof(date)); - sizeNeeded += 5 + mir_tstrlen(from) + mir_tstrlen(subject) + mir_tstrlen(size) + mir_tstrlen(date); + sizeNeeded += 5 + mir_wstrlen(from) + mir_wstrlen(subject) + mir_wstrlen(size) + mir_wstrlen(date); } if (sizeNeeded && OpenClipboard(hDlg)) { EmptyClipboard(); @@ -2256,7 +2256,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR ListView_GetItemText(hList, courRow, 1, subject, _countof(subject)); ListView_GetItemText(hList, courRow, 2, size, _countof(size)); ListView_GetItemText(hList, courRow, 3, date, _countof(date)); - courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, L"%s\t%s\t%s\t%s\r\n", from, subject, size, date); + courPos += mir_snwprintf(&buff[courPos], sizeNeeded + 1, L"%s\t%s\t%s\t%s\r\n", from, subject, size, date); } GlobalUnlock(hData); diff --git a/plugins/YAMN/src/debug.cpp b/plugins/YAMN/src/debug.cpp index fcf594018d..06644d78ef 100644 --- a/plugins/YAMN/src/debug.cpp +++ b/plugins/YAMN/src/debug.cpp @@ -43,21 +43,21 @@ void InitDebug() InitializeCriticalSection(&FileAccessCS);
#ifdef DEBUG_SYNCHRO
- mir_sntprintf(DebugFileName, DebugSynchroFileName2, DebugUserDirectory);
+ mir_snwprintf(DebugFileName, DebugSynchroFileName2, DebugUserDirectory);
SynchroFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(SynchroFile,"Synchro debug file created by %s\n",YAMN_VER);
#endif
#ifdef DEBUG_COMM
- mir_sntprintf(DebugFileName, DebugCommFileName2, DebugUserDirectory);
+ mir_snwprintf(DebugFileName, DebugCommFileName2, DebugUserDirectory);
CommFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(CommFile,"Communication debug file created by %s\n",YAMN_VER);
#endif
#ifdef DEBUG_DECODE
- mir_sntprintf(DebugFileName, DebugDecodeFileName2, DebugUserDirectory);
+ mir_snwprintf(DebugFileName, DebugDecodeFileName2, DebugUserDirectory);
DecodeFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(DecodeFile,"Decoding kernel debug file created by %s\n",YAMN_VER);
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index 230ee89486..73e21c95af 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -63,7 +63,7 @@ static void GetProfileDirectory(wchar_t *szPath, int cbPath) { wchar_t tszOldPath[MAX_PATH]; CallService(MS_DB_GETPROFILEPATHT, _countof(tszOldPath), (LPARAM)tszOldPath); - mir_tstrcat(tszOldPath, L"\\*.book"); + mir_wstrcat(tszOldPath, L"\\*.book"); VARST ptszNewPath( L"%miranda_userdata%"); @@ -125,8 +125,8 @@ BOOL CALLBACK EnumSystemCodePagesProc(LPTSTR cpStr) } #ifdef _DEBUG if (!found) { - mir_tstrcat(unknownCP, info.CodePageName); - mir_tstrcat(unknownCP, L"\n"); + mir_wstrcat(unknownCP, info.CodePageName); + mir_wstrcat(unknownCP, L"\n"); } #endif } @@ -207,7 +207,7 @@ void WINAPI g_ReleaseIcon( HICON hIcon ) static void LoadPlugins() { wchar_t szSearchPath[MAX_PATH]; - mir_sntprintf(szSearchPath, L"%s\\Plugins\\YAMN\\*.dll", szMirandaDir); + mir_snwprintf(szSearchPath, L"%s\\Plugins\\YAMN\\*.dll", szMirandaDir); hDllPlugins = NULL; @@ -221,15 +221,15 @@ static void LoadPlugins() continue; // we have a dot - int len = (int)mir_tstrlen(fd.cFileName); // find the length of the string + int len = (int)mir_wstrlen(fd.cFileName); // find the length of the string wchar_t* end = fd.cFileName+len; // get a pointer to the NULL int safe = (end-dot)-1; // figure out how many chars after the dot are "safe", not including NULL - if ((safe != 3) || (mir_tstrcmpi(dot+1, L"dll") != 0)) //not bound, however the "dll" string should mean only 3 chars are compared + if ((safe != 3) || (mir_wstrcmpi(dot+1, L"dll") != 0)) //not bound, however the "dll" string should mean only 3 chars are compared continue; wchar_t szPluginPath[MAX_PATH]; - mir_sntprintf(szPluginPath, L"%s\\Plugins\\YAMN\\%s", szMirandaDir, fd.cFileName); + mir_snwprintf(szPluginPath, L"%s\\Plugins\\YAMN\\%s", szMirandaDir, fd.cFileName); HINSTANCE hDll = LoadLibrary(szPluginPath); if (hDll == NULL) continue; diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index cd8c3121db..9b2d0da53e 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -269,7 +269,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) if (ERROR_FILE_NOT_FOUND != GetLastError())
{
wchar_t temp[1024] = { 0 };
- mir_sntprintf(temp, L"%s\n%s", TranslateT("Reading file error. File already in use?"), FileName);
+ mir_snwprintf(temp, L"%s\n%s", TranslateT("Reading file error. File already in use?"), FileName);
MessageBox(NULL, temp, TranslateT("YAMN (internal POP3) read error"), MB_OK);
CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0);
FileName = NULL;
@@ -344,7 +344,7 @@ DWORD WINAPI WritePOP3Accounts() DWORD ReturnValue = CallService(MS_YAMN_WRITEACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName);
if (ReturnValue == EACC_SYSTEM) {
wchar_t temp[1024] = { 0 };
- mir_sntprintf(temp, L"%s\n%s", TranslateT("Error while copying data to disk occurred. Is file in use?"), FileName);
+ mir_snwprintf(temp, L"%s\n%s", TranslateT("Error while copying data to disk occurred. Is file in use?"), FileName);
MessageBox(NULL, temp, TranslateT("POP3 plugin - write file error"), MB_OK);
}
@@ -380,7 +380,7 @@ DWORD WINAPI ReadPOP3Options(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"CodePage: %d, remaining %d chars", ((HPOP3ACCOUNT)Which)->CP, End-*Parser);
+ mir_snwprintf(Debug, L"CodePage: %d, remaining %d chars", ((HPOP3ACCOUNT)Which)->CP, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
return 0;
@@ -713,7 +713,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) for (NewMsgsPtr = (HYAMNMAIL)NewMails; NewMsgsPtr != NULL; NewMsgsPtr = NewMsgsPtr->Next) {
if (!mir_strcmp(MsgQueuePtr->ID, NewMsgsPtr->ID)) {
wchar_t accstatus[512];
- mir_sntprintf(accstatus, TranslateT("Reading body %s"), NewMsgsPtr->ID);
+ mir_snwprintf(accstatus, TranslateT("Reading body %s"), NewMsgsPtr->ID);
SetAccountStatus(ActualAccount, accstatus);
DataRX = MyClient->Top(MsgQueuePtr->Number, 100);
#ifdef DEBUG_DECODE
@@ -786,7 +786,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) {
BOOL autoretr = (ActualAccount->Flags & YAMN_ACC_BODY) != 0;
DataRX = MyClient->Top(MsgQueuePtr->Number, autoretr ? 100 : 0);
- mir_sntprintf(accstatus, TranslateT("Reading new mail messages (%d%% done)"), 100 * i / msgs);
+ mir_snwprintf(accstatus, TranslateT("Reading new mail messages (%d%% done)"), 100 * i / msgs);
SetAccountStatus(ActualAccount, accstatus);
#ifdef DEBUG_DECODE
@@ -1542,14 +1542,14 @@ wchar_t* WINAPI GetErrorString(DWORD Code) wchar_t *ErrorString = new wchar_t[ERRORSTR_MAXLEN];
POP3_ERRORCODE *ErrorCode = (POP3_ERRORCODE *)(UINT_PTR)Code;
- mir_sntprintf(ErrorString, ERRORSTR_MAXLEN, TranslateT("Error %d-%d-%d-%d:"), ErrorCode->AppError, ErrorCode->POP3Error, ErrorCode->NetError, ErrorCode->SystemError);
+ mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, TranslateT("Error %d-%d-%d-%d:"), ErrorCode->AppError, ErrorCode->POP3Error, ErrorCode->NetError, ErrorCode->SystemError);
if (ErrorCode->POP3Error)
- mir_sntprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(POP3Errors[ErrorCode->POP3Error - 1]));
+ mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(POP3Errors[ErrorCode->POP3Error - 1]));
if (ErrorCode->NetError) {
if (ErrorCode->SSL)
- mir_sntprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(SSLErrors[ErrorCode->NetError - 1]));
+ mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(SSLErrors[ErrorCode->NetError - 1]));
else
- mir_sntprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(NetlibErrors[ErrorCode->NetError - 4]));
+ mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(NetlibErrors[ErrorCode->NetError - 4]));
}
return ErrorString;
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index 4e083211fd..3148158989 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -650,7 +650,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_ADDSTRING, 0, (LPARAM)TranslateT("Default"));
for (i = 1; i < CPLENSUPP; i++) {
CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[i].CP, 0, &info);
- size_t len = mir_tstrlen(info.CodePageName + 7);
+ size_t len = mir_wstrlen(info.CodePageName + 7);
info.CodePageName[len + 6] = 0;
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_ADDSTRING, 0, (LPARAM)(info.CodePageName + 7));
}
@@ -687,7 +687,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_YAMN_CHANGETIME:
if ((HPOP3ACCOUNT)wParam == ActualAccount) {
wchar_t Text[256];
- mir_sntprintf(Text, TranslateT("Time left to next check [s]: %d"), (DWORD)lParam);
+ mir_snwprintf(Text, TranslateT("Time left to next check [s]: %d"), (DWORD)lParam);
SetDlgItemText(hDlg, IDC_STTIMELEFT, Text);
}
return TRUE;
@@ -830,7 +830,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP case IDC_BTNAPP:
{
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*.exe;*.bat;*.cmd;*.com)%c*.exe;*.bat;*.cmd;*.com%c%s (*.*)%c*.*%c",
+ mir_snwprintf(filter, L"%s (*.exe;*.bat;*.cmd;*.com)%c*.exe;*.bat;*.cmd;*.com%c%s (*.*)%c*.*%c",
TranslateT("Executables"), 0, 0, TranslateT("All Files"), 0, 0);
OPENFILENAME OFNStruct = { 0 };
@@ -1289,12 +1289,12 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM TesterF.lchIcon = g_LoadIconEx(3);
TesterN.lchIcon = g_LoadIconEx(1);
- mir_tstrncpy(Tester.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
- mir_tstrncpy(TesterF.lptzContactName, TranslateT("Account Test (failed)"), MAX_CONTACTNAME);
- mir_tstrncpy(TesterN.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
- mir_tstrncpy(Tester.lptzText, TranslateT("You have N new mail messages"), MAX_SECONDLINE);
- mir_tstrncpy(TesterF.lptzText, TranslateT("Connection failed message"), MAX_SECONDLINE);
- mir_tstrncpy(TesterN.lptzText, TranslateT("No new mail message"), MAX_SECONDLINE);
+ mir_wstrncpy(Tester.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
+ mir_wstrncpy(TesterF.lptzContactName, TranslateT("Account Test (failed)"), MAX_CONTACTNAME);
+ mir_wstrncpy(TesterN.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
+ mir_wstrncpy(Tester.lptzText, TranslateT("You have N new mail messages"), MAX_SECONDLINE);
+ mir_wstrncpy(TesterF.lptzText, TranslateT("Connection failed message"), MAX_SECONDLINE);
+ mir_wstrncpy(TesterN.lptzText, TranslateT("No new mail message"), MAX_SECONDLINE);
if (TesterC) {
Tester.colorBack = SendDlgItemMessage(hDlg, IDC_CPB, CPM_GETCOLOUR, 0, 0);
Tester.colorText = SendDlgItemMessage(hDlg, IDC_CPT, CPM_GETCOLOUR, 0, 0);
diff --git a/plugins/YAMN/src/protoplugin.cpp b/plugins/YAMN/src/protoplugin.cpp index 25e7a5a42c..20fc0f5817 100644 --- a/plugins/YAMN/src/protoplugin.cpp +++ b/plugins/YAMN/src/protoplugin.cpp @@ -179,7 +179,7 @@ INT_PTR GetFileNameSvc(WPARAM wParam,LPARAM) if (FileName == NULL)
return NULL;
- mir_sntprintf(FileName, MAX_PATH, L"%s\\yamn-accounts.%s.%s.book", UserDirectory, wParam, ProfileName);
+ mir_snwprintf(FileName, MAX_PATH, L"%s\\yamn-accounts.%s.%s.book", UserDirectory, wParam, ProfileName);
return (INT_PTR)FileName;
}
diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp index 7bbdc6ca52..60f273e1f0 100644 --- a/plugins/YAPP/src/popwin.cpp +++ b/plugins/YAPP/src/popwin.cpp @@ -469,7 +469,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (pwd->custom_col) SetTextColor(ps.hdc, pd->colorText);
else SetTextColor(ps.hdc, colFirstLine);
- wchar_t *title = mir_u2t(pd->pwzTitle);
+ wchar_t *title = mir_wstrdup(pd->pwzTitle);
DrawText(ps.hdc, title, -1, &tr, DT_VCENTER | DT_LEFT | DT_END_ELLIPSIS | DT_SINGLELINE | DT_NOPREFIX);
mir_free(title);
@@ -491,7 +491,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (options.av_layout != PAV_NONE && options.time_layout == PT_WITHAV && pwd->time_height <= pwd->tb_height && !pwd->have_av)
GetClientRect(hwnd, &r);
- wchar_t *text = mir_u2t(pd->pwzText);
+ wchar_t *text = mir_wstrdup(pd->pwzText);
tr.left = r.left + options.padding + options.text_indent; tr.right = r.right - options.padding; tr.top = tr.bottom + options.padding; tr.bottom = r.bottom - options.padding;
DrawText(ps.hdc, text, -1, &tr, DT_NOPREFIX | DT_WORDBREAK | DT_EXTERNALLEADING | DT_TOP | DT_LEFT | DT_WORD_ELLIPSIS);
mir_free(text);
@@ -560,7 +560,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa return TRUE;
case PUM_SETTEXT:
- replaceStrT(pd->ptzText, (wchar_t*)lParam);
+ replaceStrW(pd->ptzText, (wchar_t*)lParam);
InvalidateRect(hwnd, 0, TRUE);
RepositionWindows();
return TRUE;
@@ -585,15 +585,15 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (options.time_layout != PT_NONE) {
SIZE size_t;
if (hFontTime) SelectObject(hdc, (HGDIOBJ)hFontTime);
- GetTextExtentPoint32(hdc, pwd->tbuff, (int)mir_tstrlen(pwd->tbuff), &size_t);
+ GetTextExtentPoint32(hdc, pwd->tbuff, (int)mir_wstrlen(pwd->tbuff), &size_t);
pwd->time_height = size_t.cy;
pwd->time_width = size_t.cx;
}
// titlebar height
if (hFontFirstLine) SelectObject(hdc, (HGDIOBJ)hFontFirstLine);
- wchar_t *title = mir_u2t(pd->pwzTitle);
- GetTextExtentPoint32(hdc, title, (int)mir_tstrlen(title), &size);
+ wchar_t *title = mir_wstrdup(pd->pwzTitle);
+ GetTextExtentPoint32(hdc, title, (int)mir_wstrlen(title), &size);
mir_free(title);
pwd->tb_height = size.cy;
if (options.time_layout == PT_LEFT || options.time_layout == PT_RIGHT) {
@@ -630,7 +630,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa r.right -= pwd->time_width + options.padding;
if (hFontSecondLine) SelectObject(hdc, (HGDIOBJ)hFontSecondLine);
- wchar_t *text = mir_u2t(pd->pwzText);
+ wchar_t *text = mir_wstrdup(pd->pwzText);
DrawText(hdc, text, -1, &r, DT_CALCRECT | DT_NOPREFIX | DT_WORDBREAK | DT_EXTERNALLEADING | DT_TOP | DT_LEFT | DT_WORD_ELLIPSIS);
pwd->text_height = r.bottom;
mir_free(text);
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp index 8b74676a1b..da7c2d89b8 100644 --- a/plugins/YAPP/src/services.cpp +++ b/plugins/YAPP/src/services.cpp @@ -289,7 +289,7 @@ static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam) if (db_get_b(0, "Popup", "ModuleIsEnabled", 1)) {
POPUPDATAT pd = {0};
- mir_tstrcpy(pd.lptzContactName, lParam == SM_WARNING ? L"Warning" : L"Notification");
+ mir_wstrcpy(pd.lptzContactName, lParam == SM_WARNING ? L"Warning" : L"Notification");
pd.lchIcon = LoadIcon(0, lParam == SM_WARNING ? IDI_WARNING : IDI_INFORMATION);
wcsncpy(pd.lptzText, _A2T((char *)wParam), MAX_SECONDLINE); pd.lptzText[MAX_SECONDLINE-1] = 0;
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, 0);
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index 06ce6610fd..79f787dbc7 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -94,40 +94,40 @@ static void InitFonts() {
font_id_firstline.cbSize = sizeof(FontIDT);
font_id_firstline.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(font_id_firstline.group, LPGENW("Popups"));
- mir_tstrcpy(font_id_firstline.name, LPGENW("First line"));
+ mir_wstrcpy(font_id_firstline.group, LPGENW("Popups"));
+ mir_wstrcpy(font_id_firstline.name, LPGENW("First line"));
mir_strcpy(font_id_firstline.dbSettingsGroup, MODULE);
mir_strcpy(font_id_firstline.prefix, "FontFirst");
- mir_tstrcpy(font_id_firstline.backgroundGroup, L"Popups");
- mir_tstrcpy(font_id_firstline.backgroundName, L"Background");
+ mir_wstrcpy(font_id_firstline.backgroundGroup, L"Popups");
+ mir_wstrcpy(font_id_firstline.backgroundName, L"Background");
font_id_firstline.order = 0;
FontRegisterT(&font_id_firstline);
font_id_secondline.cbSize = sizeof(FontIDT);
font_id_secondline.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(font_id_secondline.group, LPGENW("Popups"));
- mir_tstrcpy(font_id_secondline.name, LPGENW("Second line"));
+ mir_wstrcpy(font_id_secondline.group, LPGENW("Popups"));
+ mir_wstrcpy(font_id_secondline.name, LPGENW("Second line"));
mir_strcpy(font_id_secondline.dbSettingsGroup, MODULE);
mir_strcpy(font_id_secondline.prefix, "FontSecond");
- mir_tstrcpy(font_id_secondline.backgroundGroup, L"Popups");
- mir_tstrcpy(font_id_secondline.backgroundName, L"Background");
+ mir_wstrcpy(font_id_secondline.backgroundGroup, L"Popups");
+ mir_wstrcpy(font_id_secondline.backgroundName, L"Background");
font_id_secondline.order = 1;
FontRegisterT(&font_id_secondline);
font_id_time.cbSize = sizeof(FontIDT);
font_id_time.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(font_id_time.group, LPGENW("Popups"));
- mir_tstrcpy(font_id_time.name, LPGENW("Time"));
+ mir_wstrcpy(font_id_time.group, LPGENW("Popups"));
+ mir_wstrcpy(font_id_time.name, LPGENW("Time"));
mir_strcpy(font_id_time.dbSettingsGroup, MODULE);
mir_strcpy(font_id_time.prefix, "FontTime");
- mir_tstrcpy(font_id_time.backgroundGroup, L"Popups");
- mir_tstrcpy(font_id_time.backgroundName, L"Background");
+ mir_wstrcpy(font_id_time.backgroundGroup, L"Popups");
+ mir_wstrcpy(font_id_time.backgroundName, L"Background");
font_id_time.order = 2;
FontRegisterT(&font_id_time);
colour_id_bg.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_bg.group, LPGENW("Popups"));
- mir_tstrcpy(colour_id_bg.name, LPGENW("Background"));
+ mir_wstrcpy(colour_id_bg.group, LPGENW("Popups"));
+ mir_wstrcpy(colour_id_bg.name, LPGENW("Background"));
mir_strcpy(colour_id_bg.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_bg.setting, "ColourBg");
colour_id_bg.defcolour = GetSysColor(COLOR_3DSHADOW);
@@ -135,8 +135,8 @@ static void InitFonts() ColourRegisterT(&colour_id_bg);
colour_id_border.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_border.group, LPGENW("Popups"));
- mir_tstrcpy(colour_id_border.name, LPGENW("Border"));
+ mir_wstrcpy(colour_id_border.group, LPGENW("Popups"));
+ mir_wstrcpy(colour_id_border.name, LPGENW("Border"));
mir_strcpy(colour_id_border.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_border.setting, "ColourBorder");
colour_id_border.defcolour = RGB(0, 0, 0);
@@ -144,8 +144,8 @@ static void InitFonts() ColourRegisterT(&colour_id_border);
colour_id_sidebar.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_sidebar.group, LPGENW("Popups"));
- mir_tstrcpy(colour_id_sidebar.name, LPGENW("Sidebar"));
+ mir_wstrcpy(colour_id_sidebar.group, LPGENW("Popups"));
+ mir_wstrcpy(colour_id_sidebar.name, LPGENW("Sidebar"));
mir_strcpy(colour_id_sidebar.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_sidebar.setting, "ColourSidebar");
colour_id_sidebar.defcolour = RGB(128, 128, 128);
@@ -153,8 +153,8 @@ static void InitFonts() ColourRegisterT(&colour_id_sidebar);
colour_id_titleunderline.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_titleunderline.group, LPGENW("Popups"));
- mir_tstrcpy(colour_id_titleunderline.name, LPGENW("Title underline"));
+ mir_wstrcpy(colour_id_titleunderline.group, LPGENW("Popups"));
+ mir_wstrcpy(colour_id_titleunderline.name, LPGENW("Title underline"));
mir_strcpy(colour_id_titleunderline.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_titleunderline.setting, "ColourTitleUnderline");
colour_id_titleunderline.defcolour = GetSysColor(COLOR_3DSHADOW);
diff --git a/plugins/YAPP/src/yapp_history.cpp b/plugins/YAPP/src/yapp_history.cpp index 08ff8f747a..8e02c3c2ca 100644 --- a/plugins/YAPP/src/yapp_history.cpp +++ b/plugins/YAPP/src/yapp_history.cpp @@ -68,8 +68,8 @@ void PopupHistoryList::Add(wchar_t *title, wchar_t *message, time_t timestamp) PopupHistoryData item = {0}; //create an unicode history item item.flags = PHDF_UNICODE; //mark it as unicode item.timestamp = timestamp; - item.titleT = mir_u2t(title); - item.messageT = mir_u2t(message); + item.titleT = mir_wstrdup(title); + item.messageT = mir_wstrdup(message); AddItem(item); //add it } diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp index 535b4a7ee5..c3b7a08e35 100644 --- a/plugins/YAPP/src/yapp_history_dlg.cpp +++ b/plugins/YAPP/src/yapp_history_dlg.cpp @@ -120,7 +120,7 @@ static int lastColumn = -1; //last sort column int MatchesFilterCS(const wchar_t *filter, const PopupHistoryData *popupItem) //case sensitive
{
- if (mir_tstrlen(filter) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
+ if (mir_wstrlen(filter) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
int match = 0;
match = (wcsstr(popupItem->messageT, filter)) ? 1 : match; //check message part
@@ -149,7 +149,7 @@ __inline void ConvertCase(wchar_t *dest, const wchar_t *source, size_t size) int MatchesFilterCI(const wchar_t *filterS, const PopupHistoryData *popupItem)
{
- if (mir_tstrlen(filterS) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
+ if (mir_wstrlen(filterS) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
int match = 0;
const int BUFFER_SIZE = 1024;
wchar_t buffer[BUFFER_SIZE];
@@ -187,7 +187,7 @@ int CALLBACK PopupsCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam) ListView_GetItemText(params.hList, (int) lParam1, params.column, text1, _countof(text1));
ListView_GetItemText(params.hList, (int) lParam2, params.column, text2, _countof(text2));
- res = mir_tstrcmpi(text1, text2);
+ res = mir_wstrcmpi(text1, text2);
res = (params.column == lastColumn) ? -res : res; //do reverse search on second click on same column
@@ -489,7 +489,7 @@ void CopyPopupDataToClipboard(HWND hList, int selection) if (found)
{
EmptyClipboard();
- int len = (int)mir_tstrlen(buffer);
+ int len = (int)mir_wstrlen(buffer);
HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, (len + 2) * sizeof(wchar_t));
clipboard = (wchar_t *) GlobalLock(hData);
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index f611fce2f5..3e2112eb27 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -151,11 +151,11 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent) case 'i':
case 'I':
{
- ptrT id(Contact_GetInfo(CNF_UNIQUEID, NULL));
+ ptrW id(Contact_GetInfo(CNF_UNIQUEID, NULL));
if (id != NULL)
wcsncpy_s(buf, id, _TRUNCATE);
else
- mir_sntprintf(buf, L"%p", hContact);
+ mir_snwprintf(buf, L"%p", hContact);
}
szUtfMsg.append(T2Utf(buf));
break;
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index 57ac86c10c..7b9ff8ec90 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -160,7 +160,7 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, wchar_t* GetContactName(MCONTACT hContact, char *szProto)
{
- ptrT id(Contact_GetInfo(CNF_DISPLAYUID, hContact, szProto));
+ ptrW id(Contact_GetInfo(CNF_DISPLAYUID, hContact, szProto));
return (id != NULL) ? wcsdup(id) : NULL;
}
@@ -179,7 +179,7 @@ wchar_t *GetContactID(MCONTACT hContact) wchar_t* GetContactID(MCONTACT hContact, char *szProto)
{
- ptrT id(Contact_GetInfo(CNF_DISPLAY, hContact, szProto));
+ ptrW id(Contact_GetInfo(CNF_DISPLAY, hContact, szProto));
return (id != NULL) ? wcsdup(id) : NULL;
}
@@ -198,7 +198,7 @@ MCONTACT GetContactFromID(wchar_t *szID, char *szProto) tmp = pcli->pfnGetContactDisplayName(hContact, 0);
wcsncpy(dispName, tmp, _countof(dispName));
- if ((szHandle) && ((mir_tstrcmpi(szHandle, szID) == 0) || (mir_tstrcmpi(dispName, szID) == 0)) && ((szProto == NULL) || (_stricmp(szProto, cProtocol) == 0)))
+ if ((szHandle) && ((mir_wstrcmpi(szHandle, szID) == 0) || (mir_wstrcmpi(dispName, szID) == 0)) && ((szProto == NULL) || (_stricmp(szProto, cProtocol) == 0)))
found = 1;
if (szHandle) { free(szHandle); }
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index 41f4f20276..c397936b37 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -26,7 +26,7 @@ wchar_t *Hlp_GetProtocolName(const char *proto) { if ((!ProtoServiceExists(proto, PS_GETNAME)) || (CallProtoService(proto, PS_GETNAME, (WPARAM)sizeof(protoname), (LPARAM)protoname)))
return NULL;
- return mir_a2t(protoname);
+ return mir_a2u(protoname);
}
@@ -103,16 +103,16 @@ int AddDebugLogMessage(const wchar_t* fmt, ...) va_list va;
va_start(va, fmt);
- mir_vsntprintf(tszText, _countof(tszText), fmt, va);
+ mir_vsnwprintf(tszText, _countof(tszText), fmt, va);
va_end(va);
#ifdef MODULENAME
- mir_sntprintf(tszFinal, L"%s: %s", MODULENAME, tszText);
+ mir_snwprintf(tszFinal, L"%s: %s", MODULENAME, tszText);
#else
wcsncpy(tszFinal, tszText, _countof(tszFinal));
#endif
- szFinal = mir_t2a(tszFinal);
+ szFinal = mir_u2a(tszFinal);
res = WriteToDebugLogA(szFinal);
mir_free(szFinal);
@@ -130,5 +130,5 @@ wchar_t *itot(int num) wchar_t tRes[32];
// check this
_itow(num, tRes, 10);
- return mir_tstrdup(tRes);
+ return mir_wstrdup(tRes);
}
diff --git a/plugins/mTextControl/src/richeditutils.cpp b/plugins/mTextControl/src/richeditutils.cpp index 3f3614dc1b..442e512d4e 100644 --- a/plugins/mTextControl/src/richeditutils.cpp +++ b/plugins/mTextControl/src/richeditutils.cpp @@ -77,7 +77,7 @@ public: HRESULT STDMETHODCALLTYPE GetNewStorage(LPSTORAGE * lplpstg)
{
wchar_t sztName[64];
- mir_sntprintf(sztName, L"s%u", this->nextStgId);
+ mir_snwprintf(sztName, L"s%u", this->nextStgId);
if (this->pictStg == NULL)
return STG_E_MEDIUMFULL;
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index 015e240ff4..e2207bd059 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -63,7 +63,7 @@ int ProtoAck(WPARAM,LPARAM lparam) DWORD ann = db_get_dw( NULL, THIS_MODULE, "announce", DEFAULT_ANNOUNCE );
if ( ann & ( 1 << ( ack->lParam - ID_STATUS_OFFLINE ))) {
wchar_t buffer[512];
- mir_sntprintf(buffer, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(ack->hContact, 0), pcli->pfnGetStatusModeDescription(ack->lParam, 0));
+ mir_snwprintf(buffer, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(ack->hContact, 0), pcli->pfnGetStatusModeDescription(ack->lParam, 0));
ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), ack->hContact);
} } }
@@ -121,7 +121,7 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam) return 0;
wchar_t bufferW[512];
- mir_sntprintf(bufferW, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(wParam, 0), pcli->pfnGetStatusModeDescription(newStatus, 0));
+ mir_snwprintf(bufferW, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(wParam, 0), pcli->pfnGetStatusModeDescription(newStatus, 0));
ShowOSD(bufferW, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), hContact);
return 0;
}
@@ -155,7 +155,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) DBVARIANT dbv;
if(!db_get_ts(NULL,THIS_MODULE,"message_format",&dbv)) {
- mir_tstrcpy(buf, dbv.ptszVal);
+ mir_wstrcpy(buf, dbv.ptszVal);
db_free(&dbv);
}
@@ -183,17 +183,17 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) wchar_t *c1 = 0, *c2 = 0;
if ( i1 == 1 )
- c1 = mir_tstrdup(pcli->pfnGetContactDisplayName(wParam, 0));
+ c1 = mir_wstrdup(pcli->pfnGetContactDisplayName(wParam, 0));
else if ( i1 == 2 )
c1 = DbGetEventTextT( &dbe, 0 );
if ( i2 == 1 )
- c2 = mir_tstrdup(pcli->pfnGetContactDisplayName(wParam, 0));
+ c2 = mir_wstrdup(pcli->pfnGetContactDisplayName(wParam, 0));
else if ( i2 == 2 )
c2 = DbGetEventTextT( &dbe, 0 );
wchar_t buffer[512];
- mir_sntprintf(buffer, buf, c1, c2);
+ mir_snwprintf(buffer, buf, c1, c2);
ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG), wParam);
mir_free( c1 );
diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp index 76af0a3bb1..3749330a0f 100644 --- a/plugins/wbOSD/src/options.cpp +++ b/plugins/wbOSD/src/options.cpp @@ -128,10 +128,10 @@ void loadDBSettings(plgsettings *ps) DBVARIANT dbv;
if (!db_get_ts(NULL, THIS_MODULE, "message_format", &dbv)) {
- mir_tstrcpy(ps->msgformat, dbv.ptszVal);
+ mir_wstrcpy(ps->msgformat, dbv.ptszVal);
db_free(&dbv);
}
- else mir_tstrcpy(ps->msgformat, DEFAULT_MESSAGEFORMAT);
+ else mir_wstrcpy(ps->msgformat, DEFAULT_MESSAGEFORMAT);
ps->announce = db_get_dw(NULL, THIS_MODULE, "announce", DEFAULT_ANNOUNCE);
@@ -150,11 +150,11 @@ void loadDBSettings(plgsettings *ps) ps->lf.lfPitchAndFamily = db_get_b(NULL, THIS_MODULE, "fntPitchAndFamily", DEFAULT_FNT_PITCHANDFAM);
if (!db_get_ts(NULL, THIS_MODULE, "fntFaceName", &dbv)) {
- mir_tstrcpy(ps->lf.lfFaceName, dbv.ptszVal);
+ mir_wstrcpy(ps->lf.lfFaceName, dbv.ptszVal);
db_free(&dbv);
}
else
- mir_tstrcpy(ps->lf.lfFaceName, DEFAULT_FNT_FACENAME);
+ mir_wstrcpy(ps->lf.lfFaceName, DEFAULT_FNT_FACENAME);
}
void saveDBSettings(plgsettings *ps)
@@ -250,7 +250,7 @@ INT_PTR CALLBACK OptDlgProc(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lparam) {
wchar_t buf[20];
- mir_sntprintf(buf, L"%d %%", ps->alpha * 100 / 255);
+ mir_snwprintf(buf, L"%d %%", ps->alpha * 100 / 255);
SetDlgItemText(hDlg, IDC_ALPHATXT, buf);
}
@@ -266,7 +266,7 @@ INT_PTR CALLBACK OptDlgProc(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lparam) ps->alpha = SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_GETPOS, 0, 0);
{
wchar_t buf[20];
- mir_sntprintf(buf, L"%d %%", ps->alpha * 100 / 255);
+ mir_snwprintf(buf, L"%d %%", ps->alpha * 100 / 255);
SetDlgItemText(hDlg, IDC_ALPHATXT, buf);
}
goto xxx;
diff --git a/plugins/wbOSD/src/wbOSD.cpp b/plugins/wbOSD/src/wbOSD.cpp index bc602ec52c..b48bfd6ee0 100644 --- a/plugins/wbOSD/src/wbOSD.cpp +++ b/plugins/wbOSD/src/wbOSD.cpp @@ -161,7 +161,7 @@ LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM logmsg("WindowProcedure::USER+1");
ms = (osdmsg*)mir_alloc(sizeof(osdmsg));
- ms->text = mir_tstrdup((wchar_t *)wParam);
+ ms->text = mir_wstrdup((wchar_t *)wParam);
if (lParam == 0)
lParam = db_get_dw(NULL, THIS_MODULE, "timeout", DEFAULT_TIMEOUT);
ms->timeout = lParam;
@@ -206,7 +206,7 @@ LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM ms = (osdmsg*)mir_alloc(sizeof(osdmsg));
memcpy(ms, (osdmsg*)wParam, sizeof(osdmsg));
- ms->text = mir_tstrdup(ms->text);
+ ms->text = mir_wstrdup(ms->text);
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)ms);
SetTimer(hwnd, (UINT_PTR)ms, (UINT)ms->timeout, 0);
|