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/Scriver/src/chat/manager.cpp | 2 +- plugins/Scriver/src/chat/options.cpp | 12 ++++---- plugins/Scriver/src/chat/tools.cpp | 10 +++---- plugins/Scriver/src/chat/window.cpp | 56 ++++++++++++++++++------------------ plugins/Scriver/src/globals.cpp | 4 +-- plugins/Scriver/src/infobar.cpp | 8 +++--- plugins/Scriver/src/input.cpp | 4 +-- plugins/Scriver/src/msgdialog.cpp | 28 +++++++++--------- plugins/Scriver/src/msglog.cpp | 36 +++++++++++------------ plugins/Scriver/src/msgoptions.cpp | 4 +-- plugins/Scriver/src/msgs.cpp | 8 +++--- plugins/Scriver/src/msgtimedout.cpp | 2 +- plugins/Scriver/src/msgwindow.cpp | 10 +++---- plugins/Scriver/src/sendqueue.cpp | 4 +-- plugins/Scriver/src/utils.cpp | 6 ++-- 15 files changed, 97 insertions(+), 97 deletions(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/chat/manager.cpp b/plugins/Scriver/src/chat/manager.cpp index e71eecc249..1d4e61c90a 100644 --- a/plugins/Scriver/src/chat/manager.cpp +++ b/plugins/Scriver/src/chat/manager.cpp @@ -48,7 +48,7 @@ SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* cu while (pTemp != NULL) { if (pTemp != currSession && !mir_strcmpi(pszModule, pTemp->pszModule)) { if (my_strstri(pTemp->ptszName, pszOriginal) == pTemp->ptszName) { - if (prevSession != pTemp && mir_tstrcmpi(pTemp->ptszName, pszCurrent) > 0 && (!pszName || mir_tstrcmpi(pTemp->ptszName, pszName) < 0)) { + if (prevSession != pTemp && mir_wstrcmpi(pTemp->ptszName, pszCurrent) > 0 && (!pszName || mir_wstrcmpi(pTemp->ptszName, pszName) < 0)) { pResult = pTemp; pszName = pTemp->ptszName; } diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index 6f83994009..985077fde9 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -226,10 +226,10 @@ static void InitSetting(wchar_t **ppPointer, char *pszSetting, wchar_t *pszDefau { DBVARIANT dbv; if ( !db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv )) { - replaceStrT(*ppPointer, dbv.ptszVal); + replaceStrW(*ppPointer, dbv.ptszVal); db_free(&dbv); } - else replaceStrT(*ppPointer, pszDefault); + else replaceStrW(*ppPointer, pszDefault); } #define OPT_FIXHEADINGS (WM_USER+1) @@ -365,7 +365,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa wchar_t tszTooltipText[2048]; RECT rect; - mir_sntprintf(tszTooltipText, + mir_snwprintf(tszTooltipText, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n" L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n" L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s", @@ -464,9 +464,9 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa LPITEMIDLIST idList = SHBrowseForFolder(&bi); if (idList) { SHGetPathFromIDList(idList, tszDirectory); - mir_tstrcat(tszDirectory, L"\\"); + mir_wstrcat(tszDirectory, L"\\"); PathToRelativeT(tszDirectory, tszTemp); - SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME); + SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, mir_wstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME); } psMalloc->Free(idList); psMalloc->Release(); @@ -543,7 +543,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa free(pszText1); } else { - mir_tstrncpy(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH); + mir_wstrncpy(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH); db_unset(NULL, CHAT_MODULE, "LogDirectory"); } pci->SM_InvalidateLogDirectories(); diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index eebd6fdd00..3b9c78291c 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -53,7 +53,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s if (pszWordText && pszWordText[0]) { wchar_t szMenuText[4096]; - mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText); + mir_snwprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText); ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText); SetSearchEngineIcons(*hMenu, g_dat.hSearchEngineIconList); } @@ -63,12 +63,12 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s else if (iIndex == 0) { wchar_t szTemp[50]; if (pszWordText) - mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText); + mir_snwprintf(szTemp, TranslateT("&Message %s"), pszWordText); else - mir_tstrncpy(szTemp, TranslateT("&Message"), _countof(szTemp) - 1); + mir_wstrncpy(szTemp, TranslateT("&Message"), _countof(szTemp) - 1); - if (mir_tstrlen(szTemp) > 40) - mir_tstrncpy(szTemp + 40, L"...", 4); + if (mir_wstrlen(szTemp) > 40) + mir_wstrncpy(szTemp + 40, L"...", 4); ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp); gcmi.Type = MENU_ON_NICKLIST; } diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 9e5d799407..0be7880de0 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -217,7 +217,7 @@ static void TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si) start -= 2; if (dat->szSearchResult != NULL) { - int cbResult = (int)mir_tstrlen(dat->szSearchResult); + int cbResult = (int)mir_wstrlen(dat->szSearchResult); if (start >= cbResult && !wcsnicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) { start -= cbResult; goto LBL_SkipEnd; @@ -243,8 +243,8 @@ LBL_SkipEnd: if (dat->szSearchQuery == NULL) { dat->szSearchQuery = (wchar_t*)mir_alloc(sizeof(wchar_t)*(end - start + 1)); - mir_tstrncpy(dat->szSearchQuery, pszText + start, end - start + 1); - dat->szSearchResult = mir_tstrdup(dat->szSearchQuery); + mir_wstrncpy(dat->szSearchQuery, pszText + start, end - start + 1); + dat->szSearchResult = mir_wstrdup(dat->szSearchQuery); dat->lastSession = NULL; } @@ -258,23 +258,23 @@ LBL_SkipEnd: else pszName = pci->UM_FindUserAutoComplete(si->pUsers, dat->szSearchQuery, dat->szSearchResult); mir_free(pszText); - replaceStrT(dat->szSearchResult, NULL); + replaceStrW(dat->szSearchResult, NULL); if (pszName == NULL) { if (end != start) { SendMessage(hwnd, EM_SETSEL, start, end); SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM)dat->szSearchQuery); } - replaceStrT(dat->szSearchQuery, NULL); + replaceStrW(dat->szSearchQuery, NULL); } else { - dat->szSearchResult = mir_tstrdup(pszName); + dat->szSearchResult = mir_wstrdup(pszName); if (end != start) { - ptrT szReplace; + ptrW szReplace; if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) { - szReplace = (wchar_t*)mir_alloc((mir_tstrlen(pszName) + 4) * sizeof(wchar_t)); - mir_tstrcpy(szReplace, pszName); - mir_tstrcat(szReplace, L": "); + szReplace = (wchar_t*)mir_alloc((mir_wstrlen(pszName) + 4) * sizeof(wchar_t)); + mir_wstrcpy(szReplace, pszName); + mir_wstrcat(szReplace, L": "); pszName = szReplace; } SendMessage(hwnd, EM_SETSEL, start, end); @@ -684,7 +684,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ptl.y = (LONG)pt.y; ScreenToClient(hwnd, (LPPOINT)&ptl); { - ptrT pszWord(GetRichTextWord(hwnd, &ptl)); + ptrW pszWord(GetRichTextWord(hwnd, &ptl)); inMenu = TRUE; CHARRANGE all = { 0, -1 }; @@ -795,7 +795,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO * p } if (tszBuf[0] == 0) - mir_sntprintf(tszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s", + mir_snwprintf(tszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s", TranslateT("Nickname"), ui->pszNick, TranslateT("Unique ID"), ui->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status)); @@ -956,18 +956,18 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break; } else if (wParam == '\b' && si->szSearch[0]) // backspace - si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0'; + si->szSearch[mir_wstrlen(si->szSearch) - 1] = '\0'; else if (wParam < ' ') break; else { wchar_t szNew[2]; szNew[0] = (wchar_t)wParam; szNew[1] = '\0'; - if (mir_tstrlen(si->szSearch) >= _countof(si->szSearch) - 2) { + if (mir_wstrlen(si->szSearch) >= _countof(si->szSearch) - 2) { MessageBeep(MB_OK); break; } - mir_tstrcat(si->szSearch, szNew); + mir_wstrcat(si->szSearch, szNew); } if (si->szSearch[0]) { // iterate over the (sorted) list of nicknames and search for the @@ -976,7 +976,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, for (int i = 0; i < iItems; i++) { USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i); if (ui) { - if (!wcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) { + if (!wcsnicmp(ui->pszNick, si->szSearch, mir_wstrlen(si->szSearch))) { SendMessage(hwnd, LB_SETCURSEL, i, 0); InvalidateRect(hwnd, NULL, FALSE); return 0; @@ -985,7 +985,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, } MessageBeep(MB_OK); - si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0'; + si->szSearch[mir_wstrlen(si->szSearch) - 1] = '\0'; return 0; } break; @@ -1177,17 +1177,17 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR switch (si->iType) { case GCW_CHATROOM: - mir_sntprintf(szTemp, + mir_snwprintf(szTemp, (si->nUsersInNicklist == 1) ? TranslateT("%s: chat room (%u user)") : TranslateT("%s: chat room (%u users)"), si->ptszName, si->nUsersInNicklist); break; case GCW_PRIVMESS: - mir_sntprintf(szTemp, + mir_snwprintf(szTemp, (si->nUsersInNicklist == 1) ? TranslateT("%s: message session") : TranslateT("%s: message session (%u users)"), si->ptszName, si->nUsersInNicklist); break; case GCW_SERVER: - mir_sntprintf(szTemp, L"%s: Server", si->ptszName); + mir_snwprintf(szTemp, L"%s: Server", si->ptszName); break; } tbd.iFlags = TBDF_TEXT | TBDF_ICON; @@ -1200,7 +1200,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR { MODULEINFO *mi = pci->MM_FindModule(si->pszModule); hIcon = si->wStatus == ID_STATUS_ONLINE ? mi->hOnlineIcon : mi->hOfflineIcon; - mir_sntprintf(szTemp, L"%s : %s", mi->ptszModDispName, si->ptszStatusbarText ? si->ptszStatusbarText : L""); + mir_snwprintf(szTemp, L"%s : %s", mi->ptszModDispName, si->ptszStatusbarText ? si->ptszStatusbarText : L""); StatusBarData sbd; sbd.iItem = 0; @@ -1411,7 +1411,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR } SetTextColor(dis->hDC, ui->iStatusEx == 0 ? g_Settings.crUserListColor : g_Settings.crUserListHeadingsColor); - TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, (int)mir_tstrlen(ui->pszNick)); + TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, (int)mir_wstrlen(ui->pszNick)); SelectObject(dis->hDC, hOldFont); } return TRUE; @@ -1428,7 +1428,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR char szIndicator = SM_GetStatusIndicator(si, ui); if (szIndicator > '\0') { static wchar_t ptszBuf[128]; - mir_sntprintf(ptszBuf, L"%c%s", szIndicator, ui->pszNick); + mir_snwprintf(ptszBuf, L"%c%s", szIndicator, ui->pszNick); SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ptszBuf); } else SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ui->pszNick); @@ -1637,7 +1637,7 @@ LABEL_SHOWWINDOW: USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item); if (ui != NULL) { static wchar_t ptszBuf[1024]; - mir_sntprintf(ptszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s", + mir_snwprintf(ptszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s", TranslateT("Nickname"), ui->pszNick, TranslateT("Unique ID"), ui->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status)); @@ -1667,12 +1667,12 @@ LABEL_SHOWWINDOW: if (GetKeyState(VK_SHIFT) & 0x8000) { LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETSEL, 0, 0); int start = LOWORD(lResult); - size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 4); + size_t dwNameLenMax = (mir_wstrlen(ui->pszUID) + 4); wchar_t* pszName = (wchar_t*)alloca(sizeof(wchar_t) * dwNameLenMax); if (start == 0) - mir_sntprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID); + mir_snwprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID); else - mir_sntprintf(pszName, dwNameLenMax, L"%s ", ui->pszUID); + mir_snwprintf(pszName, dwNameLenMax, L"%s ", ui->pszUID); SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)pszName); PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0); @@ -1706,7 +1706,7 @@ LABEL_SHOWWINDOW: // takes pszRtf to a queue, no leak here si->cmdList = tcmdlist_append(si->cmdList, pszRtf, 20, FALSE); - CMString ptszText(ptrT(mir_utf8decodeT(pszRtf))); + CMString ptszText(ptrW(mir_utf8decodeW(pszRtf))); pci->DoRtfToTags(ptszText, mi->nColorCount, mi->crColors); ptszText.Trim(); ptszText.Replace(L"%", L"%%"); diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 42ec8e52c0..cf50d1ad42 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -131,8 +131,8 @@ static int ackevent(WPARAM, LPARAM lParam) SendMessage(hwndSender, DM_STOPMESSAGESENDING, 0, 0); ErrorWindowData *ewd = (ErrorWindowData*)mir_alloc(sizeof(ErrorWindowData)); - ewd->szName = mir_tstrdup(pcli->pfnGetContactDisplayName(item->hContact, 0)); - ewd->szDescription = mir_a2t((char *)pAck->lParam); + ewd->szName = mir_wstrdup(pcli->pfnGetContactDisplayName(item->hContact, 0)); + ewd->szDescription = mir_a2u((char *)pAck->lParam); ewd->szText = GetSendBufferMsg(item); ewd->hwndParent = hwndSender; ewd->queueItem = item; diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp index 0175199ccc..8ff69e1288 100644 --- a/plugins/Scriver/src/infobar.cpp +++ b/plugins/Scriver/src/infobar.cpp @@ -79,14 +79,14 @@ void RefreshInfobar(InfobarWindowData* idat) { HWND hwnd = idat->hWnd; SrmmWindowData *dat = idat->mwd; - ptrT szContactStatusMsg(db_get_tsa(dat->hContact, "CList", "StatusMsg")); - ptrT szXStatusName(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusName")); - ptrT szXStatusMsg(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusMsg")); + ptrW szContactStatusMsg(db_get_tsa(dat->hContact, "CList", "StatusMsg")); + ptrW szXStatusName(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusName")); + ptrW szXStatusMsg(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusMsg")); HICON hIcon = GetExtraStatusIcon(idat); wchar_t szText[2048]; SETTEXTEX st; if (szXStatusMsg && *szXStatusMsg) - mir_sntprintf(szText, L"%s (%s)", TranslateTS(szXStatusName), szXStatusMsg); + mir_snwprintf(szText, L"%s (%s)", TranslateTS(szXStatusName), szXStatusMsg); else wcsncpy_s(szText, TranslateTS(szXStatusName), _TRUNCATE); st.flags = ST_DEFAULT; diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index d9ecad41e3..e0e838ddbc 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -399,8 +399,8 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK * if (!OpenClipboard(hwndDlg)) break; EmptyClipboard(); - HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_tstrlen(tr.lpstrText) + 1)); - mir_tstrcpy((LPWSTR)GlobalLock(hData), tr.lpstrText); + HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_wstrlen(tr.lpstrText) + 1)); + mir_wstrcpy((LPWSTR)GlobalLock(hData), tr.lpstrText); GlobalUnlock(hData); SetClipboardData(CF_UNICODETEXT, hData); CloseClipboard(); diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 341c9c6a3a..5aab926147 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -48,7 +48,7 @@ static wchar_t* GetIEViewSelection(SrmmWindowData *dat) evt.hwnd = dat->hwndLog; evt.hContact = dat->hContact; evt.iType = IEE_GET_SELECTION; - return mir_tstrdup((wchar_t*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&evt)); + return mir_wstrdup((wchar_t*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&evt)); } static wchar_t* GetQuotedTextW(wchar_t *text) @@ -160,17 +160,17 @@ static void AddToFileList(wchar_t ***pppFiles, int *totalCount, const wchar_t* s { *pppFiles = (wchar_t**)mir_realloc(*pppFiles, (++*totalCount + 1)*sizeof(wchar_t*)); (*pppFiles)[*totalCount] = NULL; - (*pppFiles)[*totalCount - 1] = mir_tstrdup(szFilename); + (*pppFiles)[*totalCount - 1] = mir_wstrdup(szFilename); if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) { WIN32_FIND_DATA fd; wchar_t szPath[MAX_PATH]; - mir_sntprintf(szPath, L"%s\\*", szFilename); + mir_snwprintf(szPath, L"%s\\*", szFilename); HANDLE hFind = FindFirstFile(szPath, &fd); if (hFind != INVALID_HANDLE_VALUE) { do { - if (!mir_tstrcmp(fd.cFileName, L".") || !mir_tstrcmp(fd.cFileName, L"..")) continue; - mir_sntprintf(szPath, L"%s\\%s", szFilename, fd.cFileName); + if (!mir_wstrcmp(fd.cFileName, L".") || !mir_wstrcmp(fd.cFileName, L"..")) continue; + mir_snwprintf(szPath, L"%s\\%s", szFilename, fd.cFileName); AddToFileList(pppFiles, totalCount, szPath); } while (FindNextFile(hFind, &fd)); FindClose(hFind); @@ -295,10 +295,10 @@ static LRESULT CALLBACK LogEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, POINTL ptl = { (LONG)pt.x, (LONG)pt.y }; ScreenToClient(hwnd, (LPPOINT)&ptl); - ptrT pszWord(GetRichTextWord(hwnd, &ptl)); + ptrW pszWord(GetRichTextWord(hwnd, &ptl)); if (pszWord && pszWord[0]) { wchar_t szMenuText[4096]; - mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWord); + mir_snwprintf(szMenuText, TranslateT("Look up '%s':"), pszWord); ModifyMenu(hSubMenu, 5, MF_STRING | MF_BYPOSITION, 5, szMenuText); SetSearchEngineIcons(hMenu, g_dat.hSearchEngineIconList); } @@ -552,7 +552,7 @@ static void UpdateReadChars(HWND hwndDlg, SrmmWindowData *dat) sbd.iFlags = SBDF_TEXT | SBDF_ICON; sbd.hIcon = NULL; sbd.pszText = szText; - mir_sntprintf(szText, L"%d", len); + mir_snwprintf(szText, L"%d", len); SendMessage(dat->hwndParent, CM_UPDATESTATUSBAR, (WPARAM)&sbd, (LPARAM)hwndDlg); } } @@ -759,7 +759,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText); } else if (g_dat.flags & SMF_SAVEDRAFTS) { - ptrT ptszSavedMsg(db_get_tsa(dat->hContact, "SRMM", "SavedMsg")); + ptrW ptszSavedMsg(db_get_tsa(dat->hContact, "SRMM", "SavedMsg")); if (ptszSavedMsg) len = SetRichText(GetDlgItem(hwndDlg, IDC_MESSAGE), ptszSavedMsg); PostMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETSEL, len, len); @@ -1351,19 +1351,19 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->messagesInProgress && (g_dat.flags & SMF_SHOWPROGRESS)) { sbd.hIcon = GetCachedIcon("scriver_DELIVERING"); sbd.pszText = szText; - mir_sntprintf(szText, TranslateT("Sending in progress: %d message(s) left..."), dat->messagesInProgress); + mir_snwprintf(szText, TranslateT("Sending in progress: %d message(s) left..."), dat->messagesInProgress); } else if (dat->nTypeSecs) { sbd.hIcon = GetCachedIcon("scriver_TYPING"); sbd.pszText = szText; - mir_sntprintf(szText, TranslateT("%s is typing a message..."), pcli->pfnGetContactDisplayName(dat->hContact, 0)); + mir_snwprintf(szText, TranslateT("%s is typing a message..."), pcli->pfnGetContactDisplayName(dat->hContact, 0)); dat->nTypeSecs--; } else if (dat->lastMessage) { wchar_t date[64], time[64]; TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0); TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"t", time, _countof(time), 0); - mir_sntprintf(szText, TranslateT("Last message received on %s at %s."), date, time); + mir_snwprintf(szText, TranslateT("Last message received on %s at %s."), date, time); sbd.pszText = szText; } else sbd.pszText = L""; @@ -1576,7 +1576,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETPARAFORMAT, 0, (LPARAM)&pf2); int bufSize = GetRichTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE), 1200, TRUE) + 2; - ptrT ptszUnicode((wchar_t*)mir_alloc(bufSize * sizeof(wchar_t))); + ptrW ptszUnicode((wchar_t*)mir_alloc(bufSize * sizeof(wchar_t))); MessageSendQueueItem msi = { 0 }; if (pf2.wEffects & PFE_RTLPARA) @@ -1590,7 +1590,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (RTL_Detect(ptszUnicode)) msi.flags |= PREF_RTL; - msi.sendBuffer = mir_utf8encodeT(ptszUnicode); + msi.sendBuffer = mir_utf8encodeW(ptszUnicode); msi.sendBufferSize = (int)mir_strlen(msi.sendBuffer); if (msi.sendBufferSize == 0) break; diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index fc1bdea405..f75057670b 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -147,7 +147,7 @@ EventData* getEventFromDB(SrmmWindowData *dat, MCONTACT hContact, MEVENT hDbEven if (evt->dwFlags & IEEDF_SENT) evt->pszNickT = Contact_GetInfo(CNF_DISPLAY, NULL, dat->szProto); else - evt->pszNickT = mir_tstrdup(pcli->pfnGetContactDisplayName(hContact, 0)); + evt->pszNickT = mir_wstrdup(pcli->pfnGetContactDisplayName(hContact, 0)); if (evt->eventType == EVENTTYPE_FILE) { char *filename = ((char*)dbei.pBlob) + sizeof(DWORD); @@ -179,24 +179,24 @@ static EventData* GetTestEvents() { EventData *evt, *firstEvent, *prevEvent; firstEvent = prevEvent = evt = GetTestEvent(IEEDF_SENT); - evt->pszNickT = mir_tstrdup(TranslateT("Me")); - evt->pszTextT = mir_tstrdup(TranslateT("O Lord, bless this Thy hand grenade that with it Thou mayest blow Thine enemies")); + evt->pszNickT = mir_wstrdup(TranslateT("Me")); + evt->pszTextT = mir_wstrdup(TranslateT("O Lord, bless this Thy hand grenade that with it Thou mayest blow Thine enemies")); evt = GetTestEvent(IEEDF_SENT); - evt->pszNickT = mir_tstrdup(TranslateT("Me")); - evt->pszTextT = mir_tstrdup(TranslateT("to tiny bits, in Thy mercy")); + evt->pszNickT = mir_wstrdup(TranslateT("Me")); + evt->pszTextT = mir_wstrdup(TranslateT("to tiny bits, in Thy mercy")); prevEvent->next = evt; prevEvent = evt; evt = GetTestEvent(0); - evt->pszNickT = mir_tstrdup(TranslateT("My contact")); - evt->pszTextT = mir_tstrdup(TranslateT("Lorem ipsum dolor sit amet,")); + evt->pszNickT = mir_wstrdup(TranslateT("My contact")); + evt->pszTextT = mir_wstrdup(TranslateT("Lorem ipsum dolor sit amet,")); prevEvent->next = evt; prevEvent = evt; evt = GetTestEvent(0); - evt->pszNickT = mir_tstrdup(TranslateT("My contact")); - evt->pszTextT = mir_tstrdup(TranslateT("consectetur adipisicing elit")); + evt->pszNickT = mir_wstrdup(TranslateT("My contact")); + evt->pszTextT = mir_wstrdup(TranslateT("consectetur adipisicing elit")); prevEvent->next = evt; prevEvent = evt; return firstEvent; @@ -364,31 +364,31 @@ wchar_t* TimestampToString(DWORD dwFlags, time_t check, int mode) today = mktime(&tm_today); if (dwFlags & SMF_RELATIVEDATE && check >= today) { - mir_tstrcpy(szResult, TranslateT("Today")); + mir_wstrcpy(szResult, TranslateT("Today")); if (mode == 0) - mir_tstrcat(szResult, L","); + mir_wstrcat(szResult, L","); } else if (dwFlags & SMF_RELATIVEDATE && check > (today - 86400)) { - mir_tstrcpy(szResult, TranslateT("Yesterday")); + mir_wstrcpy(szResult, TranslateT("Yesterday")); if (mode == 0) - mir_tstrcat(szResult, L","); + mir_wstrcat(szResult, L","); } else { if (dwFlags & SMF_LONGDATE) - mir_tstrcpy(format, L"D"); + mir_wstrcpy(format, L"D"); else - mir_tstrcpy(format, L"d"); + mir_wstrcpy(format, L"d"); } } if (mode == 0 || mode == 2) { if (mode == 0 && (dwFlags & SMF_SHOWDATE)) - mir_tstrcat(format, L" "); + mir_wstrcat(format, L" "); - mir_tstrcat(format, (dwFlags & SMF_SHOWSECONDS) ? L"s" : L"t"); + mir_wstrcat(format, (dwFlags & SMF_SHOWSECONDS) ? L"s" : L"t"); } if (format[0] != '\0') { TimeZone_PrintTimeStamp(NULL, check, format, str, _countof(str), 0); - mir_tstrncat(szResult, str, _countof(szResult) - mir_tstrlen(szResult)); + mir_wstrncat(szResult, str, _countof(szResult) - mir_wstrlen(szResult)); } return szResult; } diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 85f3f26fcc..6685fdc099 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -188,9 +188,9 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; mir_snprintf(str, "%s%d", "SRMFont", i); - ptrT tszFace(db_get_tsa(NULL, SRMMMOD, str)); + ptrW tszFace(db_get_tsa(NULL, SRMMMOD, str)); if (tszFace == NULL) - mir_tstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace); + mir_wstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace); else wcsncpy(lf->lfFaceName, tszFace, _countof(lf->lfFaceName)); diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 41c9fc09e9..19f42b14f9 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -121,7 +121,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) } if (hwnd == NULL || !IsWindowVisible(GetParent(hwnd))) { wchar_t toolTip[256]; - mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); CLISTEVENT cle = {}; cle.flags = CLEF_TCHAR; @@ -206,7 +206,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) SendMessage(hwnd, DM_TYPING, 0, lParam); else if (lParam && (g_dat.flags2 & SMF2_SHOWTYPINGTRAY)) { wchar_t szTip[256]; - mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_snwprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags2 & SMF2_SHOWTYPINGCLIST)) { MIRANDASYSTRAYNOTIFY tn; @@ -302,7 +302,7 @@ static void RestoreUnreadMessageAlerts(void) for (int i = 0; i < arEvents.getCount(); i++) { MSavedEvent &e = arEvents[i]; - mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0)); + mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0)); cle.hContact = e.hContact; cle.hDbEvent = e.hEvent; pcli->pfnAddEvent(&cle); @@ -647,7 +647,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg) { wchar_t sztName[64]; - mir_sntprintf(sztName, L"s%u", nextStgId++); + mir_snwprintf(sztName, L"s%u", nextStgId++); if (pictStg == NULL) return STG_E_MEDIUMFULL; return pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg); diff --git a/plugins/Scriver/src/msgtimedout.cpp b/plugins/Scriver/src/msgtimedout.cpp index 1db437ddbf..61c930800a 100644 --- a/plugins/Scriver/src/msgtimedout.cpp +++ b/plugins/Scriver/src/msgtimedout.cpp @@ -50,7 +50,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar SendDlgItemMessage(hwndDlg, IDC_MSGTEXT, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)ewd->szText); } if (ewd->szName) - mir_sntprintf(szText, L"%s - %s", TranslateT("Send error"), ewd->szName); + mir_snwprintf(szText, L"%s - %s", TranslateT("Send error"), ewd->szName); else wcsncpy_s(szText, TranslateT("Send error"), _TRUNCATE); diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index 3bf73b1fb3..8744cb1b64 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -37,7 +37,7 @@ static const wchar_t *titleTokenNames[] = { L"%name%", L"%status%", L"%statusmsg wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto) { - ptrT tmplt; + ptrW tmplt; const wchar_t* tokens[4] = { 0 }; CMString tszTemplate, tszStatus, tszTitle; @@ -45,7 +45,7 @@ wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto) tokens[0] = pcli->pfnGetContactDisplayName(hContact, 0); tokens[1] = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0); - tszStatus = ptrT(db_get_tsa(hContact, "CList", "StatusMsg")); + tszStatus = ptrW(db_get_tsa(hContact, "CList", "StatusMsg")); tszStatus.Replace(L"\r\n", L" "); tokens[2] = tszStatus; @@ -53,7 +53,7 @@ wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto) if (accModule != NULL) { PROTOACCOUNT* proto = Proto_GetAccount(accModule); if (proto != NULL) - tokens[3] = mir_tstrdup(proto->tszAccountName); + tokens[3] = mir_wstrdup(proto->tszAccountName); } tmplt = db_get_tsa(NULL, SRMMMOD, SRMSGSET_WINDOWTITLE); @@ -71,7 +71,7 @@ wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto) if (*p == '%') { int i; for (i = 0; i < _countof(titleTokenNames); i++) { - size_t tnlen = mir_tstrlen(titleTokenNames[i]); + size_t tnlen = mir_wstrlen(titleTokenNames[i]); if (!wcsncmp(p, titleTokenNames[i], tnlen)) { if (tokens[i] != NULL) tszTitle.Append(tokens[i]); @@ -1209,7 +1209,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (tbd->iFlags & TBDF_TEXT) { wchar_t oldtitle[256]; GetWindowText(hwndDlg, oldtitle, _countof(oldtitle)); - if (mir_tstrcmp(tbd->pszText, oldtitle)) + if (mir_wstrcmp(tbd->pszText, oldtitle)) SetWindowText(hwndDlg, tbd->pszText); } if (tbd->iFlags & TBDF_ICON) { diff --git a/plugins/Scriver/src/sendqueue.cpp b/plugins/Scriver/src/sendqueue.cpp index 770d00dc9c..d192556df0 100644 --- a/plugins/Scriver/src/sendqueue.cpp +++ b/plugins/Scriver/src/sendqueue.cpp @@ -104,8 +104,8 @@ void ReportSendQueueTimeouts(HWND hwndSender) if (item->hwndSender == hwndSender && item->hwndErrorDlg == NULL) { if (hwndSender != NULL) { ErrorWindowData *ewd = (ErrorWindowData *)mir_alloc(sizeof(ErrorWindowData)); - ewd->szName = mir_tstrdup(pcli->pfnGetContactDisplayName(item->hContact, 0)); - ewd->szDescription = mir_tstrdup(TranslateT("The message send timed out.")); + ewd->szName = mir_wstrdup(pcli->pfnGetContactDisplayName(item->hContact, 0)); + ewd->szDescription = mir_wstrdup(TranslateT("The message send timed out.")); ewd->szText = GetSendBufferMsg(item); ewd->hwndParent = hwndSender; ewd->queueItem = item; diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index 8e771e2485..e52f9db5cc 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -143,7 +143,7 @@ char* GetRichTextRTF(HWND hwnd) void rtrimText(wchar_t *text) { static wchar_t szTrimString[] = L":;,.!?\'\"><()[]- \r\n"; - size_t iLen = mir_tstrlen(text) - 1; + size_t iLen = mir_wstrlen(text) - 1; while (wcschr(szTrimString, text[iLen])) { text[iLen] = '\0'; iLen--; @@ -152,7 +152,7 @@ void rtrimText(wchar_t *text) wchar_t* limitText(wchar_t *text, int limit) { - size_t len = mir_tstrlen(text); + size_t len = mir_wstrlen(text); if (len > g_dat.limitNamesLength) { wchar_t *ptszTemp = (wchar_t*)mir_alloc(sizeof(wchar_t) * (limit + 4)); wcsncpy(ptszTemp, text, limit + 1); @@ -387,7 +387,7 @@ void SetSearchEngineIcons(HMENU hMenu, HIMAGELIST hImageList) void GetContactUniqueId(SrmmWindowData *dat, char *buf, int maxlen) { - ptrT id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact, dat->szProto)); + ptrW id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact, dat->szProto)); if (id != NULL) strncpy_s(buf, maxlen, _T2A(id), _TRUNCATE); } -- cgit v1.2.3