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 --- protocols/MRA/src/MraAdvancedSearch.cpp | 2 +- protocols/MRA/src/MraAvatars.cpp | 10 +++++----- protocols/MRA/src/MraChat.cpp | 2 +- protocols/MRA/src/MraFilesQueue.cpp | 20 ++++++++++---------- protocols/MRA/src/MraPlaces.h | 4 ++-- protocols/MRA/src/MraPopUp.cpp | 4 ++-- protocols/MRA/src/MraProto.cpp | 14 +++++++------- protocols/MRA/src/MraRTFMsg.cpp | 2 +- protocols/MRA/src/Mra_functions.cpp | 22 +++++++++++----------- protocols/MRA/src/Mra_menus.cpp | 2 +- protocols/MRA/src/Mra_options.cpp | 2 +- protocols/MRA/src/Mra_proto.cpp | 12 ++++++------ protocols/MRA/src/Mra_svcs.cpp | 10 +++++----- 13 files changed, 53 insertions(+), 53 deletions(-) (limited to 'protocols/MRA/src') diff --git a/protocols/MRA/src/MraAdvancedSearch.cpp b/protocols/MRA/src/MraAdvancedSearch.cpp index fd0bd8ecb0..5ea4500c69 100644 --- a/protocols/MRA/src/MraAdvancedSearch.cpp +++ b/protocols/MRA/src/MraAdvancedSearch.cpp @@ -77,7 +77,7 @@ void InitComboBoxNumders(HWND hWndCombo, DWORD dwStart, DWORD dwEnd) for (DWORD i = dwStart; i <= dwEnd; i++) { wchar_t szBuff[MAX_PATH]; - mir_sntprintf(szBuff, L"%lu", i); + mir_snwprintf(szBuff, L"%lu", i); DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)szBuff); SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, i); } diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index b7f7aac5b2..ca412ee5dc 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -56,7 +56,7 @@ DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle) MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = new MRA_AVATARS_QUEUE(); wchar_t szBuffer[MAX_PATH]; - mir_sntprintf(szBuffer, L"%s %s", m_tszUserName, TranslateT("Avatars' plugin connections")); + mir_snwprintf(szBuffer, L"%s %s", m_tszUserName, TranslateT("Avatars' plugin connections")); NETLIBUSER nlu = { sizeof(nlu) }; nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; @@ -232,7 +232,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) break; default: - mir_sntprintf(szErrorText, TranslateT("Avatars: server return HTTP code: %lu"), dwResultCode); + mir_snwprintf(szErrorText, TranslateT("Avatars: server return HTTP code: %lu"), dwResultCode); ShowFormattedErrorMessage(szErrorText, NO_ERROR); break; } @@ -290,7 +290,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) } else { dwErrorCode = GetLastError(); - mir_sntprintf(szErrorText, TranslateT("Avatars: can't open file %s, error"), wszFileName); + mir_snwprintf(szErrorText, TranslateT("Avatars: can't open file %s, error"), wszFileName); ShowFormattedErrorMessage(szErrorText, dwErrorCode); } } @@ -476,7 +476,7 @@ DWORD CMraProto::MraAvatarsGetFileName(HANDLE hQueue, MCONTACT hContact, DWORD d return ERROR_NOT_SUPPORTED; wchar_t tszBase[MAX_PATH]; - mir_sntprintf(tszBase, L"%s\\%s\\", VARST(L"%miranda_avatarcache%"), m_tszUserName); + mir_snwprintf(tszBase, L"%s\\%s\\", VARST(L"%miranda_avatarcache%"), m_tszUserName); res = tszBase; // some path in buff and free space for file name is avaible @@ -530,7 +530,7 @@ DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hQueue, DWORD dwFlags, MCONTACT // файл с аватаром существует и не устарел/не было комманды обновлять(просто запрос имени) if (lpszPath) { if (db_get_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", MRA_AVT_DEFAULT_RET_ABC_PATH)) - mir_tstrncpy(lpszPath, wszFileName, MAX_PATH); + mir_wstrncpy(lpszPath, wszFileName, MAX_PATH); else PathToRelativeT(wszFileName, lpszPath); } diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp index 782cb3fe40..58b17b39f8 100644 --- a/protocols/MRA/src/MraChat.cpp +++ b/protocols/MRA/src/MraChat.cpp @@ -192,7 +192,7 @@ int CMraProto::MraChatGcEventHook(WPARAM, LPARAM lParam) if (!_stricmp(gch->pDest->pszModule, m_szModuleName)) { switch (gch->pDest->iType) { case GC_USER_MESSAGE: - if (gch->ptszText && mir_tstrlen(gch->ptszText)) { + if (gch->ptszText && mir_wstrlen(gch->ptszText)) { CMStringA szEmail = gch->pDest->ptszID; MCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL); BOOL bSlowSend = getByte("SlowSend", MRA_DEFAULT_SLOW_SEND); diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index bcb9aead3c..83234d5adf 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -563,7 +563,7 @@ HANDLE CMraProto::MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *dat) lpwszCurPos = lpwszFiles; for (size_t i = 0; i < dat->dwFilesCount; i++) { MRA_FILES_QUEUE_FILE &p = dat->pmfqfFiles[i]; - lpwszCurPos += mir_sntprintf(lpwszCurPos, (dwFilesSize - ((size_t)lpwszCurPos - (size_t)lpwszFiles)), L"%s;%I64u;", + lpwszCurPos += mir_snwprintf(lpwszCurPos, (dwFilesSize - ((size_t)lpwszCurPos - (size_t)lpwszFiles)), L"%s;%I64u;", GetFileNameFromFullPathW(p.lpwszName, p.dwNameLen), p.dwSize); } dwFilesSize = (lpwszCurPos - lpwszFiles);// size in WCHARs @@ -658,7 +658,7 @@ DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hQueue, DWORD dwFlags, MCONTACT MRA_FILES_QUEUE_FILE &p = dat->pmfqfFiles[dat->dwFilesCount]; p.lpwszName = mir_wstrdup(wszCurrFile); - p.dwNameLen = mir_tstrlen(p.lpwszName); + p.dwNameLen = mir_wstrlen(p.lpwszName); p.dwSize = _wtoi(wszCurrSize); dat->dwFilesTotalSize += p.dwSize; dwFileNameTotalSize += p.dwNameLen * sizeof(wchar_t); @@ -674,13 +674,13 @@ DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hQueue, DWORD dwFlags, MCONTACT LPWSTR lpwszDelimiter = dat->pwszFilesList; LPWSTR lpwszCurrentItem = dat->pwszDescription; StrFormatByteSizeW(dat->dwFilesTotalSize, szBuff, _countof(szBuff)); - lpwszCurrentItem += mir_sntprintf(lpwszCurrentItem, ((dwMemSize - ((size_t)lpwszCurrentItem - (size_t)dat->pwszDescription)) / sizeof(WCHAR)), L"%I64u Files (%s)\r\n", dat->dwFilesCount, szBuff); + lpwszCurrentItem += mir_snwprintf(lpwszCurrentItem, ((dwMemSize - ((size_t)lpwszCurrentItem - (size_t)dat->pwszDescription)) / sizeof(WCHAR)), L"%I64u Files (%s)\r\n", dat->dwFilesCount, szBuff); // description + filesnames for (size_t i = 0; i < dat->dwFilesCount; i++) { - lpwszDelimiter += mir_sntprintf(lpwszDelimiter, ((dwMemSize - ((size_t)lpwszDelimiter - (size_t)dat->pwszFilesList)) / sizeof(WCHAR)), L"%s", dat->pmfqfFiles[i].lpwszName); + lpwszDelimiter += mir_snwprintf(lpwszDelimiter, ((dwMemSize - ((size_t)lpwszDelimiter - (size_t)dat->pwszFilesList)) / sizeof(WCHAR)), L"%s", dat->pmfqfFiles[i].lpwszName); StrFormatByteSizeW(dat->pmfqfFiles[i].dwSize, szBuff, _countof(szBuff)); - lpwszCurrentItem += mir_sntprintf(lpwszCurrentItem, ((dwMemSize - ((size_t)lpwszCurrentItem - (size_t)dat->pwszDescription)) / sizeof(WCHAR)), L"%s - %s\r\n", dat->pmfqfFiles[i].lpwszName, szBuff); + lpwszCurrentItem += mir_snwprintf(lpwszCurrentItem, ((dwMemSize - ((size_t)lpwszCurrentItem - (size_t)dat->pwszDescription)) / sizeof(WCHAR)), L"%s - %s\r\n", dat->pmfqfFiles[i].lpwszName, szBuff); } lpwszCurrentItem += MultiByteToWideChar(MRA_CODE_PAGE, 0, szAddresses, (int)szAddresses.GetLength(), lpwszCurrentItem, (int)((dwMemSize - ((size_t)lpwszCurrentItem - (size_t)dat->pwszDescription)) / sizeof(WCHAR))); @@ -862,7 +862,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) } else {// err allocating file disk space dwRetErrorCode = GetLastError(); - mir_sntprintf(szErrorText, TranslateT("Receive files: can't allocate disk space for file, size %lu bytes, error"), dat->pmfqfFiles[i].dwSize); + mir_snwprintf(szErrorText, TranslateT("Receive files: can't allocate disk space for file, size %lu bytes, error"), dat->pmfqfFiles[i].dwSize); ShowFormattedErrorMessage(szErrorText, dwRetErrorCode); } CloseHandle(hFile); @@ -875,7 +875,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) } else {// err on open file dwRetErrorCode = GetLastError(); - mir_sntprintf(szErrorText, TranslateT("Receive files: can't open file %s, error"), wszFileName); + mir_snwprintf(szErrorText, TranslateT("Receive files: can't open file %s, error"), wszFileName); ShowFormattedErrorMessage(szErrorText, dwRetErrorCode); bFailed = TRUE; break; @@ -883,7 +883,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) } else {// err on send request for file dwRetErrorCode = GetLastError(); - mir_sntprintf(szErrorText, TranslateT("Receive files: request for file %s not sent, error"), dat->pmfqfFiles[i].lpwszName); + mir_snwprintf(szErrorText, TranslateT("Receive files: request for file %s not sent, error"), dat->pmfqfFiles[i].lpwszName); ShowFormattedErrorMessage(szErrorText, NO_ERROR); bFailed = TRUE; break; @@ -1108,14 +1108,14 @@ void CMraProto::MraFilesQueueSendThreadProc(LPVOID lpParameter) } else { // err on open file dwRetErrorCode = GetLastError(); - mir_sntprintf(szErrorText, TranslateT("Send files: can't open file %s, error"), dat->pmfqfFiles[j].lpwszName); + mir_snwprintf(szErrorText, TranslateT("Send files: can't open file %s, error"), dat->pmfqfFiles[j].lpwszName); ShowFormattedErrorMessage(szErrorText, dwRetErrorCode); bFailed = TRUE; break; } } else { - mir_sntprintf(szErrorText, TranslateT("Send files: requested file: %S - not found in send files list."), (((LPSTR)btBuff) + sizeof(MRA_FT_GET_FILE))); + mir_snwprintf(szErrorText, TranslateT("Send files: requested file: %S - not found in send files list."), (((LPSTR)btBuff) + sizeof(MRA_FT_GET_FILE))); ShowFormattedErrorMessage(szErrorText, NO_ERROR); bFailed = TRUE; break; diff --git a/protocols/MRA/src/MraPlaces.h b/protocols/MRA/src/MraPlaces.h index e58e27962b..100887c18a 100644 --- a/protocols/MRA/src/MraPlaces.h +++ b/protocols/MRA/src/MraPlaces.h @@ -41,7 +41,7 @@ typedef struct { if (mrapPlaces[i].dwCityID == 0 && mrapPlaces[i].dwPlaceID == 0) { - mir_sntprintf(szBuff, L" {%ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].lpszData); + mir_snwprintf(szBuff, L" {%ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].lpszData); DebugPrintCRLFW(szBuff); } } @@ -53,7 +53,7 @@ typedef struct { if (mrapPlaces[i].dwCityID && mrapPlaces[i].dwPlaceID == 0) { - mir_sntprintf(szBuff, L" {%ld, %ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].dwCityID, mrapPlaces[i].lpszData); + mir_snwprintf(szBuff, L" {%ld, %ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].dwCityID, mrapPlaces[i].lpszData); DebugPrintCRLFW(szBuff); } } diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp index bad3861365..2f5bc21800 100644 --- a/protocols/MRA/src/MraPopUp.cpp +++ b/protocols/MRA/src/MraPopUp.cpp @@ -254,9 +254,9 @@ void CMraProto::MraPopupShowW(MCONTACT hContact, DWORD dwType, DWORD dwFlags, LP ppd.lchContact = hContact; if (lpszTitle) - mir_tstrncpy(ppd.lptzContactName, lpszTitle, MAX_CONTACTNAME); + mir_wstrncpy(ppd.lptzContactName, lpszTitle, MAX_CONTACTNAME); if (lpszMessage) - mir_tstrncpy(ppd.lptzText, lpszMessage, MAX_SECONDLINE); + mir_wstrncpy(ppd.lptzText, lpszMessage, MAX_SECONDLINE); ppd.PluginWindowProc = MraPopupDlgProc; ppd.PluginData = dat; diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index ac34d5dfd1..5ba003938d 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -36,7 +36,7 @@ CMraProto::CMraProto(const char* _module, const wchar_t* _displayName) : m_heNudgeReceived = CreateProtoEvent(PE_NUDGE); wchar_t name[MAX_PATH]; - mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName); + mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName); NETLIBUSER nlu = { sizeof(nlu) }; nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; @@ -172,7 +172,7 @@ MCONTACT CMraProto::AddToListByEvent(int, int, MEVENT hDbEvent) char *firstName = nick + mir_strlen(nick) + 1; char *lastName = firstName + mir_strlen(firstName) + 1; char *email = lastName + mir_strlen(lastName) + 1; - return AddToListByEmail(ptrT(mir_utf8decodeT(email)), ptrT(mir_utf8decodeT(nick)), ptrT(mir_utf8decodeT(firstName)), ptrT(mir_utf8decodeT(lastName)), 0); + return AddToListByEmail(ptrW(mir_utf8decodeW(email)), ptrW(mir_utf8decodeW(nick)), ptrW(mir_utf8decodeW(firstName)), ptrW(mir_utf8decodeW(lastName)), 0); } } return 0; @@ -233,7 +233,7 @@ int CMraProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre) HANDLE CMraProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t *szPath) { if (szPath != NULL) - if (MraFilesQueueAccept(hFilesQueueHandle, (DWORD_PTR)hTransfer, szPath, mir_tstrlen(szPath)) == NO_ERROR) + if (MraFilesQueueAccept(hFilesQueueHandle, (DWORD_PTR)hTransfer, szPath, mir_wstrlen(szPath)) == NO_ERROR) return hTransfer; // Success return NULL; @@ -392,7 +392,7 @@ int CMraProto::SendMsg(MCONTACT hContact, int, const char *lpszMessage) } DWORD dwFlags = 0; - CMStringW wszMessage(ptrW(mir_utf8decodeT(lpszMessage))); + CMStringW wszMessage(ptrW(mir_utf8decodeW(lpszMessage))); if (wszMessage.IsEmpty()) { ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)"Cant allocate buffer for convert to unicode."); return 0; @@ -526,11 +526,11 @@ HANDLE CMraProto::GetAwayMsg(MCONTACT hContact) SYSTEMTIME tt = { 0 }; dwTime = getDword(hContact, DBSETTING_BLOGSTATUSTIME, 0); if (dwTime && MakeLocalSystemTimeFromTime32(dwTime, &tt)) - mir_sntprintf(szTime, L"%04ld.%02ld.%02ld %02ld:%02ld: ", tt.wYear, tt.wMonth, tt.wDay, tt.wHour, tt.wMinute); + mir_snwprintf(szTime, L"%04ld.%02ld.%02ld %02ld:%02ld: ", tt.wYear, tt.wMonth, tt.wDay, tt.wHour, tt.wMinute); else szTime[0] = 0; - mir_sntprintf(szStatusDesc, L"%s%s", szTime, szBlogStatus.c_str()); + mir_snwprintf(szStatusDesc, L"%s%s", szTime, szBlogStatus.c_str()); iRet = GetTickCount(); ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)iRet, (LPARAM)szStatusDesc); } @@ -542,7 +542,7 @@ int CMraProto::SetAwayMsg(int iStatus, const wchar_t *msg) if (!m_bLoggedIn) return 1; - size_t dwStatusDescSize = mir_tstrlen(msg); + size_t dwStatusDescSize = mir_wstrlen(msg); DWORD dwStatus = iStatus; DWORD dwXStatus = m_iXStatus; diff --git a/protocols/MRA/src/MraRTFMsg.cpp b/protocols/MRA/src/MraRTFMsg.cpp index ab7077f9d1..1f735924d2 100644 --- a/protocols/MRA/src/MraRTFMsg.cpp +++ b/protocols/MRA/src/MraRTFMsg.cpp @@ -210,7 +210,7 @@ DWORD CMraProto::MraConvertToRTFW(const CMStringW &wszMessage, CMStringA &szMess HDC hDC = GetDC(NULL);// kegl lf.lfCharSet = MRA_DEFAULT_RTF_FONT_CHARSET; lf.lfHeight = -MulDiv(MRA_DEFAULT_RTF_FONT_SIZE, GetDeviceCaps(hDC, LOGPIXELSY), 72); - mir_tstrncpy(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE); + mir_wstrncpy(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE); ReleaseDC(NULL, hDC); } dwFontSize = ((-lf.lfHeight)+(((-lf.lfHeight)+4)/8)); diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 3f863a1ed5..60d4784a14 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -458,8 +458,8 @@ DWORD CMraProto::SetContactBasicInfoW(MCONTACT hContact, DWORD dwSetInfoFlags, D MraGroupItem *grp = m_groups.find((MraGroupItem*)&dwGroupID); if (grp) { - ptrT tszGroup(db_get_tsa(hContact, "CList", "Group")); - if (mir_tstrcmp(tszGroup, grp->m_name)) + ptrW tszGroup(db_get_tsa(hContact, "CList", "Group")); + if (mir_wstrcmp(tszGroup, grp->m_name)) db_set_ts(hContact, "CList", "Group", grp->m_name); } } @@ -649,14 +649,14 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & MCONTACT hContact = NULL; wchar_t szMailBoxStatus[MAX_SECONDLINE]; - mir_sntprintf(szMailBoxStatus, TranslateT("Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal); + mir_snwprintf(szMailBoxStatus, TranslateT("Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal); if (!pszFrom.IsEmpty() || !pszSubject.IsEmpty()) { CMStringA szFrom, szSubject; if (GetEMailFromString(szFrom, szEmail)) hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL); - mir_sntprintf(szStatusText, TranslateT("From: %S\r\nSubject: %S\r\n%s"), pszFrom.c_str(), szSubject.c_str(), szMailBoxStatus); + mir_snwprintf(szStatusText, TranslateT("From: %S\r\nSubject: %S\r\n%s"), pszFrom.c_str(), szSubject.c_str(), szMailBoxStatus); } else wcsncpy_s(szStatusText, szMailBoxStatus, _TRUNCATE); @@ -693,7 +693,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & hWndEMailPopupStatus = NULL; } else { - mir_sntprintf(szStatusText, TranslateT("No unread mail is available\r\nTotal messages: %lu"), dwEmailMessagesTotal); + mir_snwprintf(szStatusText, TranslateT("No unread mail is available\r\nTotal messages: %lu"), dwEmailMessagesTotal); MraPopupShowFromAgentW(MRA_POPUP_TYPE_EMAIL_STATUS, (MRA_POPUP_ALLOW_ENTER), szStatusText); } } @@ -878,7 +878,7 @@ void CMraProto::ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode else { dwErrDescriptionSize = (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode, 0, szErrDescription, (_countof(szErrDescription) - sizeof(WCHAR)), NULL) - 2); szErrDescription[dwErrDescriptionSize] = 0; - mir_sntprintf(szErrorText, L"%s %lu: %s", TranslateTS(lpwszErrText), dwErrorCode, szErrDescription); + mir_snwprintf(szErrorText, L"%s %lu: %s", TranslateTS(lpwszErrText), dwErrorCode, szErrDescription); } MraPopupShowFromAgentW(MRA_POPUP_TYPE_ERROR, 0, szErrorText); } @@ -1020,7 +1020,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP case WM_TIMER: if (dat->dwCountdown != -1) { wchar_t szBuff[MAX_PATH]; - mir_sntprintf(szBuff, TranslateT("Closing in %ld"), dat->dwCountdown--); + mir_snwprintf(szBuff, TranslateT("Closing in %ld"), dat->dwCountdown--); SetDlgItemText(hWndDlg, IDOK, szBuff); break; } @@ -1056,7 +1056,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP dwBuffSize = GetDlgItemText(hWndDlg, IDC_XTITLE, szBuff, (STATUS_TITLE_MAX + 1)); if (dwBuffSize == 0) { // user delete all text - mir_tstrncpy(szBuff, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]), STATUS_TITLE_MAX + 1); + mir_wstrncpy(szBuff, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]), STATUS_TITLE_MAX + 1); dwBuffSize = (DWORD)mir_wstrlen(szBuff); } mir_snprintf(szValueName, "XStatus%dName", dat->dwXStatus); @@ -1176,7 +1176,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w size_t dwMessageSize = GetWindowTextLength(GetDlgItem(hWndDlg, IDC_MSG_TO_SEND)); EnableWindow(GetDlgItem(hWndDlg, IDOK), (int)dwMessageSize); - mir_sntprintf(tszBuff, L"%d/%d", dwMessageSize, MICBLOG_STATUS_MAX); + mir_snwprintf(tszBuff, L"%d/%d", dwMessageSize, MICBLOG_STATUS_MAX); SetDlgItemText(hWndDlg, IDC_STATIC_CHARS_COUNTER, tszBuff); } break; @@ -1250,7 +1250,7 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD dwPathLen++; } szPath[dwPathLen] = 0; - mir_tstrcat(szPath, L"*.*"); + mir_wstrcat(szPath, L"*.*"); dwRetErrorCode = ERROR_FILE_NOT_FOUND; prdsiItems[dwRecDeepCurPos].dwFileNameLen = 0; @@ -1265,7 +1265,7 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD if (CompareString(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, L"..", 2) != CSTR_EQUAL) { prdsiItems[dwRecDeepCurPos].dwFileNameLen = (int)mir_wstrlen(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName) + 1; memcpy((szPath + dwPathLen), prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, (prdsiItems[dwRecDeepCurPos].dwFileNameLen*sizeof(WCHAR))); - mir_tstrcat(szPath, L"\\*.*"); + mir_wstrcat(szPath, L"\\*.*"); dwPathLen += prdsiItems[dwRecDeepCurPos].dwFileNameLen; dwRecDeepCurPos++; diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index a0ac316017..f54ecfb595 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -282,7 +282,7 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) HGENMENU hRoot; { wchar_t szItem[MAX_PATH + 64]; - mir_sntprintf(szItem, L"%s Custom Status", m_tszUserName); + mir_snwprintf(szItem, L"%s Custom Status", m_tszUserName); CMenuItem mi; mi.root = pcli->pfnGetProtocolMenu(m_szModuleName); diff --git a/protocols/MRA/src/Mra_options.cpp b/protocols/MRA/src/Mra_options.cpp index 6247ef9249..1bd1a5694f 100644 --- a/protocols/MRA/src/Mra_options.cpp +++ b/protocols/MRA/src/Mra_options.cpp @@ -169,7 +169,7 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L HDC hDC = GetDC(NULL);// kegl lf.lfCharSet = MRA_DEFAULT_RTF_FONT_CHARSET; lf.lfHeight = -MulDiv(MRA_DEFAULT_RTF_FONT_SIZE, GetDeviceCaps(hDC, LOGPIXELSY), 72); - mir_tstrncpy(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE); + mir_wstrncpy(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE); ReleaseDC(NULL, hDC); } diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 283726a3d2..19d568e54c 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -653,7 +653,7 @@ bool CMraProto::CmdFileTransferAck(BinBuffer &buf) break; default:// ## unknown error wchar_t szBuff[1024]; - mir_sntprintf(szBuff, TranslateT("MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"), dwAckType); + mir_snwprintf(szBuff, TranslateT("MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"), dwAckType); ShowFormattedErrorMessage(szBuff, NO_ERROR); break; } @@ -721,7 +721,7 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf) case CONTACT_OPER_SUCCESS:// ## добавление произведено успешно if (cmd == MRIM_CS_ADD_CONTACT_ACK) { DWORD dwFlags = SCBIF_ID | SCBIF_SERVER_FLAG, dwGroupID = 0; - ptrT grpName(db_get_tsa(hContact, "CList", "Group")); + ptrW grpName(db_get_tsa(hContact, "CList", "Group")); if (grpName) { dwFlags |= SCBIF_GROUP_ID; dwGroupID = MraMoveContactToGroup(hContact, -1, grpName); @@ -750,7 +750,7 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf) break; default:// ## unknown error wchar_t szBuff[1024]; - mir_sntprintf(szBuff, TranslateT("MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"), dwTemp); + mir_snwprintf(szBuff, TranslateT("MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"), dwTemp); MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff); break; } @@ -1044,7 +1044,7 @@ bool CMraProto::CmdGame(BinBuffer &buf) break; default: wchar_t szBuff[1024]; - mir_sntprintf(szBuff, TranslateT("MRIM_CS_GAME: unknown internal game message code: %lu"), dwGameMsg); + mir_snwprintf(szBuff, TranslateT("MRIM_CS_GAME: unknown internal game message code: %lu"), dwGameMsg); MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff); break; } @@ -1259,7 +1259,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) } else { if (iGroupMode == 100) { // first start - ptrT tszGroup(db_get_tsa(hContact, "CList", "Group")); + ptrW tszGroup(db_get_tsa(hContact, "CList", "Group")); if (tszGroup) dwGroupID = MraMoveContactToGroup(hContact, dwGroupID, tszGroup); } @@ -1351,7 +1351,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) ShowFormattedErrorMessage(L"MRIM_CS_CONTACT_LIST2: internal server error", NO_ERROR); else { wchar_t szBuff[1024]; - mir_sntprintf(szBuff, TranslateT("MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"), dwTemp); + mir_snwprintf(szBuff, TranslateT("MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"), dwTemp); MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff); } } diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index b5902ed4ae..c957ad89d5 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -310,7 +310,7 @@ INT_PTR CMraProto::MraSetListeningTo(WPARAM, LPARAM lParam) else if (pliInfo->dwFlags & LTI_UNICODE) { CMStringW wszListeningTo; if (ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT)) - wszListeningTo = ptrT((LPWSTR)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%track%. %title% - %artist% - %player%", (LPARAM)pliInfo)); + wszListeningTo = ptrW((LPWSTR)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%track%. %title% - %artist% - %player%", (LPARAM)pliInfo)); else wszListeningTo.Format(L"%s. %s - %s - %s", pliInfo->ptszTrack ? pliInfo->ptszTrack : L"", pliInfo->ptszTitle ? pliInfo->ptszTitle : L"", pliInfo->ptszArtist ? pliInfo->ptszArtist : L"", pliInfo->ptszPlayer ? pliInfo->ptszPlayer : L""); @@ -466,9 +466,9 @@ INT_PTR CMraProto::MraGetXStatusEx(WPARAM hContact, LPARAM lParam) return 1; if (pData->flags & CSSF_UNICODE) - mir_tstrncpy(pData->ptszName, lpcszXStatusNameDef[dwXStatus], (STATUS_TITLE_MAX + 1)); + mir_wstrncpy(pData->ptszName, lpcszXStatusNameDef[dwXStatus], (STATUS_TITLE_MAX + 1)); else { - size_t dwStatusTitleSize = mir_tstrlen(lpcszXStatusNameDef[dwXStatus]); + size_t dwStatusTitleSize = mir_wstrlen(lpcszXStatusNameDef[dwXStatus]); if (dwStatusTitleSize > STATUS_TITLE_MAX) dwStatusTitleSize = STATUS_TITLE_MAX; @@ -625,7 +625,7 @@ INT_PTR CMraProto::MraGetMyAvatar(WPARAM wParam, LPARAM lParam) { CMStringW wszFileName; if (MraAvatarsGetFileName(hAvatarsQueueHandle, NULL, GetContactAvatarFormat(NULL, PA_FORMAT_DEFAULT), wszFileName) == NO_ERROR) { - mir_tstrncpy((LPTSTR)wParam, wszFileName, (size_t)lParam); + mir_wstrncpy((LPTSTR)wParam, wszFileName, (size_t)lParam); return 0; } return 1; @@ -644,7 +644,7 @@ int CMraProto::OnGroupChanged(WPARAM hContact, LPARAM lParam) MraGroupItem *pGrp = NULL; for (int i = 0; i < m_groups.getCount(); i++) { MraGroupItem &p = m_groups[i]; - if (!mir_tstrcmp(p.m_name, cgc->pszOldName)) { + if (!mir_wstrcmp(p.m_name, cgc->pszOldName)) { pGrp = &p; break; } -- cgit v1.2.3