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/DbEditorPP | |
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/DbEditorPP')
-rw-r--r-- | plugins/DbEditorPP/src/copymodule.cpp | 2 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/deletemodule.cpp | 2 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/exportimport.cpp | 28 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/findwindow.cpp | 14 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/main.cpp | 20 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/main_window.cpp | 4 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/moduletree.cpp | 10 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/renamemodule.cpp | 2 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/settinglist.cpp | 50 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/settingsdlg.cpp | 6 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/watchedvars.cpp | 16 |
11 files changed, 77 insertions, 77 deletions
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;
|