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/TipperYM/src/message_pump.cpp | 6 +-- plugins/TipperYM/src/mir_smileys.cpp | 4 +- plugins/TipperYM/src/options.cpp | 14 +++--- plugins/TipperYM/src/popwin.cpp | 90 +++++++++++++++++------------------ plugins/TipperYM/src/skin_parser.cpp | 40 ++++++++-------- plugins/TipperYM/src/str_utils.cpp | 4 +- plugins/TipperYM/src/subst.cpp | 82 +++++++++++++++---------------- plugins/TipperYM/src/tipper.cpp | 52 ++++++++++---------- plugins/TipperYM/src/translations.cpp | 30 ++++++------ 9 files changed, 161 insertions(+), 161 deletions(-) (limited to 'plugins/TipperYM/src') 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(": ")); + else mir_wstrcat(pchData, TranslateT(": ")); 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("")); + mir_wstrcat(pchData, TranslateT("")); - 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; } -- cgit v1.2.3