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 --- src/core/stdmsg/src/msgdialog.cpp | 42 ++++++++++++++++++------------------- src/core/stdmsg/src/msglog.cpp | 6 +++--- src/core/stdmsg/src/msgoptions.cpp | 2 +- src/core/stdmsg/src/msgs.cpp | 6 +++--- src/core/stdmsg/src/msgtimedout.cpp | 6 +++--- 5 files changed, 31 insertions(+), 31 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 79822ad339..0c68e5b22d 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -55,7 +55,7 @@ static void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type) static int RTL_Detect(const wchar_t *ptszText) { - int iLen = (int)mir_tstrlen(ptszText); + int iLen = (int)mir_wstrlen(ptszText); WORD *infoTypeC2 = (WORD*)alloca(sizeof(WORD)* (iLen + 2)); GetStringTypeEx(LOCALE_USER_DEFAULT, CT_CTYPE2, ptszText, iLen, infoTypeC2); @@ -91,17 +91,17 @@ static void AddToFileList(wchar_t ***pppFiles, int *totalCount, const wchar_t* s { *pppFiles = (wchar_t**)mir_realloc(*pppFiles, (++*totalCount + 1)*sizeof(wchar_t*)); (*pppFiles)[*totalCount] = NULL; - (*pppFiles)[*totalCount - 1] = mir_tstrdup(szFilename); + (*pppFiles)[*totalCount - 1] = mir_wstrdup(szFilename); if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) { WIN32_FIND_DATA fd; wchar_t szPath[MAX_PATH]; - mir_sntprintf(szPath, L"%s\\*", szFilename); + mir_snwprintf(szPath, L"%s\\*", szFilename); HANDLE hFind = FindFirstFile(szPath, &fd); if (hFind != INVALID_HANDLE_VALUE) { do { - if (!mir_tstrcmp(fd.cFileName, L".") || !mir_tstrcmp(fd.cFileName, L"..")) continue; - mir_sntprintf(szPath, L"%s\\%s", szFilename, fd.cFileName); + if (!mir_wstrcmp(fd.cFileName, L".") || !mir_wstrcmp(fd.cFileName, L"..")) continue; + mir_snwprintf(szPath, L"%s\\%s", szFilename, fd.cFileName); AddToFileList(pppFiles, totalCount, szPath); } while (FindNextFile(hFind, &fd)); @@ -122,7 +122,7 @@ static void UpdateReadChars(HWND hwndDlg, HWND hwndStatus) wchar_t buf[32]; int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)); - mir_sntprintf(buf, L"%d", len); + mir_snwprintf(buf, L"%d", len); SendMessage(hwndStatus, SB_SETTEXT, 1, (LPARAM)buf); } } @@ -495,7 +495,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * HFONT hFont = (HFONT)SelectObject(hdc, (HFONT)SendDlgItemMessage(hwndDlg, IDOK, WM_GETFONT, 0, 0)); SIZE textSize; - GetTextExtentPoint32(hdc, buf, (int)mir_tstrlen(buf), &textSize); + GetTextExtentPoint32(hdc, buf, (int)mir_wstrlen(buf), &textSize); urc->rcItem.right = urc->rcItem.left + textSize.cx + 10; if ((g_dat.flags&SMF_SHOWBTNS) && urc->rcItem.right > urc->dlgNewSize.cx - dat->nLabelRight) urc->rcItem.right = urc->dlgNewSize.cx - dat->nLabelRight; @@ -918,11 +918,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case DM_USERNAMETOCLIP: if (dat->hContact) { - ptrT id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact, dat->szProto)); + ptrW id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact, dat->szProto)); if (id != NULL && OpenClipboard(hwndDlg)) { EmptyClipboard(); - HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(id) * sizeof(wchar_t)+1); - mir_tstrcpy((wchar_t*)GlobalLock(hData), id); + HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, mir_wstrlen(id) * sizeof(wchar_t)+1); + mir_wstrcpy((wchar_t*)GlobalLock(hData), id); GlobalUnlock(hData); SetClipboardData(CF_UNICODETEXT, hData); CloseClipboard(); @@ -938,7 +938,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l wchar_t date[64], time[64], fmt[128]; TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0); TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"t", time, _countof(time), 0); - mir_sntprintf(fmt, TranslateT("Last message received on %s at %s."), date, time); + mir_snwprintf(fmt, TranslateT("Last message received on %s at %s."), date, time); SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)fmt); } else SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)L""); @@ -1007,14 +1007,14 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l dat->wStatus = db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE); wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0); - ptrT id(Contact_GetInfo(CNF_DISPLAYUID, dat->hContact, dat->szProto)); + ptrW id(Contact_GetInfo(CNF_DISPLAYUID, dat->hContact, dat->szProto)); SetDlgItemText(hwndDlg, IDC_NAME, (id) ? id : contactName); wchar_t *szStatus = pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE), 0); if (statusIcon) - mir_sntprintf(newtitle, L"%s - %s", contactName, TranslateT("Message session")); + mir_snwprintf(newtitle, L"%s - %s", contactName, TranslateT("Message session")); else - mir_sntprintf(newtitle, L"%s (%s): %s", contactName, szStatus, TranslateT("Message session")); + mir_snwprintf(newtitle, L"%s (%s): %s", contactName, szStatus, TranslateT("Message session")); DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)wParam; if (!cws || (!mir_strcmp(cws->szModule, dat->szProto) && !mir_strcmp(cws->szSetting, "Status"))) { @@ -1026,11 +1026,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l dat->wOldStatus = dat->wStatus; } else - mir_tstrncpy(newtitle, TranslateT("Message session"), _countof(newtitle)); + mir_wstrncpy(newtitle, TranslateT("Message session"), _countof(newtitle)); wchar_t oldtitle[256]; GetWindowText(hwndDlg, oldtitle, _countof(oldtitle)); - if (mir_tstrcmp(newtitle, oldtitle)) { //swt() flickers even if the title hasn't actually changed + if (mir_wstrcmp(newtitle, oldtitle)) { //swt() flickers even if the title hasn't actually changed SetWindowText(hwndDlg, newtitle); SendMessage(hwndDlg, WM_SIZE, 0, 0); } @@ -1258,7 +1258,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l wchar_t* szContactName = pcli->pfnGetContactDisplayName(dat->hContact, 0); HICON hTyping = Skin_LoadIcon(SKINICON_OTHER_TYPING); - mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), szContactName); + mir_snwprintf(szBuf, TranslateT("%s is typing a message..."), szContactName); dat->nTypeSecs--; SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)szBuf); @@ -1346,9 +1346,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (!temp[0]) break; - int sendId = SendMessageDirect(rtrimt(temp), dat->hContact, dat->szProto); + int sendId = SendMessageDirect(rtrimw(temp), dat->hContact, dat->szProto); if (sendId) { - dat->cmdList.insert(mir_tstrdup(temp)); + dat->cmdList.insert(mir_wstrdup(temp)); dat->cmdListInd = -1; if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON) @@ -1546,8 +1546,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case IDM_COPYLINK: if (OpenClipboard(hwndDlg)) { EmptyClipboard(); - HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(tr.lpstrText) + 1) * sizeof(wchar_t)); - mir_tstrcpy((wchar_t*)GlobalLock(hData), tr.lpstrText); + HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (mir_wstrlen(tr.lpstrText) + 1) * sizeof(wchar_t)); + mir_wstrcpy((wchar_t*)GlobalLock(hData), tr.lpstrText); GlobalUnlock(hData); SetClipboardData(CF_UNICODETEXT, hData); CloseClipboard(); diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 62ab631a35..7096284dac 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -89,7 +89,7 @@ static void AppendToBufferWithRTF(CMStringA &buf, const wchar_t *line) int i, found = 0; for (i = 0; i < _countof(bbcodes); ++i) { if (line[1] == bbcodes[i][1]) { - size_t lenb = mir_tstrlen(bbcodes[i]); + size_t lenb = mir_wstrlen(bbcodes[i]); if (!wcsnicmp(line, bbcodes[i], lenb)) { buf.Append(bbcodefmt[i]); line += lenb - 1; @@ -317,14 +317,14 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT char* filename = (char*)dbei.pBlob + sizeof(DWORD); char* descr = filename + mir_strlen(filename) + 1; - ptrT ptszFileName(DbGetEventStringT(&dbei, filename)); + ptrW ptszFileName(DbGetEventStringT(&dbei, filename)); buffer.AppendFormat(" %s ", SetToStyle(MSGFONTID_NOTICE)); AppendToBufferWithRTF(buffer, (dbei.flags & DBEF_SENT) ? TranslateT("File sent") : TranslateT("File received")); buffer.Append(": "); AppendToBufferWithRTF(buffer, ptszFileName); if (*descr != 0) { - ptrT ptszDescr(DbGetEventStringT(&dbei, descr)); + ptrW ptszDescr(DbGetEventStringT(&dbei, descr)); buffer.Append(" ("); AppendToBufferWithRTF(buffer, ptszDescr); buffer.Append(")"); diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index 52bfb5f630..f5968b5cce 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -84,7 +84,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour) if (db_get_ts(NULL, SRMMMOD, str, &dbv)) wcsncpy(lf->lfFaceName, fontOptionsList[i].szDefFace, _countof(lf->lfFaceName)-1); else { - mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName)); + mir_wstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName)); db_free(&dbv); } mir_snprintf(str, "SRMFont%dSet", i); diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 2b67cb4590..2737384610 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -89,7 +89,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) } wchar_t toolTip[256]; - mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); CLISTEVENT cle = {}; cle.hContact = hContact; @@ -167,7 +167,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) SendMessage(hwnd, DM_TYPING, 0, lParam); else if (lParam && (g_dat.flags & SMF_SHOWTYPINGTRAY)) { wchar_t szTip[256]; - mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_snwprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags & SMF_SHOWTYPINGCLIST)) { MIRANDASYSTRAYNOTIFY tn = { sizeof(tn) }; @@ -281,7 +281,7 @@ static void RestoreUnreadMessageAlerts(void) for (int i = 0; i < arEvents.getCount(); i++) { MSavedEvent &e = arEvents[i]; - mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0)); + mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0)); cle.hContact = e.hContact; cle.hDbEvent = e.hEvent; pcli->pfnAddEvent(&cle); diff --git a/src/core/stdmsg/src/msgtimedout.cpp b/src/core/stdmsg/src/msgtimedout.cpp index 0f3d4ac508..2a39135e88 100644 --- a/src/core/stdmsg/src/msgtimedout.cpp +++ b/src/core/stdmsg/src/msgtimedout.cpp @@ -44,11 +44,11 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (!param->szMsg || !param->szMsg[0]) SetDlgItemText(hwndDlg, IDC_ERRORTEXT, TranslateT("An unknown error has occurred.")); else { - ptrT ptszError(Langpack_PcharToTchar(param->szMsg)); + ptrW ptszError(Langpack_PcharToTchar(param->szMsg)); SetDlgItemText(hwndDlg, IDC_ERRORTEXT, ptszError); } - SetDlgItemText(hwndDlg, IDC_MSGTEXT, ptrT(mir_utf8decodeT(item->szMsg))); + SetDlgItemText(hwndDlg, IDC_MSGTEXT, ptrW(mir_utf8decodeW(item->szMsg))); HWND hwndParent = GetParent(hwndDlg); if (hwndParent != NULL) @@ -76,7 +76,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: - SendMessageDirect(ptrT(mir_utf8decodeT(item->szMsg)), item->hContact, GetContactProto(item->hContact)); + SendMessageDirect(ptrW(mir_utf8decodeW(item->szMsg)), item->hContact, GetContactProto(item->hContact)); DestroyWindow(hwndDlg); break; -- cgit v1.2.3