From 2f261839b60692e33d0e160344d0d636d49c90ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Jul 2016 14:23:31 +0000 Subject: less TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp | 2 +- plugins/UserInfoEx/src/classMAnnivDate.cpp | 2 +- plugins/UserInfoEx/src/classMTime.cpp | 4 +-- plugins/UserInfoEx/src/classPsTree.cpp | 2 +- plugins/UserInfoEx/src/classPsTreeItem.cpp | 18 ++++++------ plugins/UserInfoEx/src/ctrl_annivedit.cpp | 2 +- plugins/UserInfoEx/src/ctrl_contact.cpp | 32 +++++++++++----------- plugins/UserInfoEx/src/ctrl_edit.cpp | 10 +++---- plugins/UserInfoEx/src/dlg_anniversarylist.cpp | 6 ++-- plugins/UserInfoEx/src/dlg_msgbox.cpp | 10 +++---- plugins/UserInfoEx/src/dlg_propsheet.cpp | 24 ++++++++-------- .../src/ex_import/classExImContactBase.cpp | 8 +++--- .../src/ex_import/classExImContactXML.cpp | 6 ++-- .../UserInfoEx/src/ex_import/dlg_ExImModules.cpp | 4 +-- .../src/ex_import/dlg_ExImOpenSaveFile.cpp | 2 +- .../UserInfoEx/src/ex_import/dlg_ExImProgress.cpp | 6 ++-- plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp | 4 +-- plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp | 10 +++---- plugins/UserInfoEx/src/mir_icolib.cpp | 4 +-- plugins/UserInfoEx/src/psp_anniversary.cpp | 2 +- plugins/UserInfoEx/src/psp_contact.cpp | 4 +-- plugins/UserInfoEx/src/psp_options.cpp | 6 ++-- plugins/UserInfoEx/src/psp_origin.cpp | 4 +-- plugins/UserInfoEx/src/psp_profile.cpp | 12 ++++---- plugins/UserInfoEx/src/svc_constants.cpp | 4 +-- plugins/UserInfoEx/src/svc_refreshci.cpp | 22 +++++++-------- plugins/UserInfoEx/src/svc_reminder.cpp | 22 +++++++-------- plugins/UserInfoEx/src/svc_timezone_old.cpp | 10 +++---- 28 files changed, 121 insertions(+), 121 deletions(-) (limited to 'plugins/UserInfoEx/src') 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 { 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(50, &CTzBias::sortFunc) @@ -126,7 +126,7 @@ class CTzMgr : public LIST 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); } -- cgit v1.2.3