From 688f55ba998c19304a29727c910504903f4cc49a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 30 Nov 2014 18:51:36 +0000 Subject: lstr* replacements git-svn-id: http://svn.miranda-ng.org/main/trunk@11176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/chat/log.cpp | 2 +- plugins/Scriver/src/chat/message.cpp | 8 ++++---- plugins/Scriver/src/chat/options.cpp | 6 +++--- plugins/Scriver/src/chat/tools.cpp | 6 +++--- plugins/Scriver/src/chat/window.cpp | 18 +++++++++--------- plugins/Scriver/src/globals.cpp | 2 +- plugins/Scriver/src/input.cpp | 4 ++-- plugins/Scriver/src/msgdialog.cpp | 18 +++++++++--------- plugins/Scriver/src/msglog.cpp | 20 ++++++++++---------- plugins/Scriver/src/msgoptions.cpp | 2 +- plugins/Scriver/src/msgwindow.cpp | 16 ++++++++-------- plugins/Scriver/src/utils.cpp | 4 ++-- 12 files changed, 53 insertions(+), 53 deletions(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/chat/log.cpp b/plugins/Scriver/src/chat/log.cpp index bb8274587b..e743e82bc6 100644 --- a/plugins/Scriver/src/chat/log.cpp +++ b/plugins/Scriver/src/chat/log.cpp @@ -33,7 +33,7 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG if (lstrdat->buffer == NULL) { lstrdat->bufferOffset = 0; lstrdat->buffer = pci->Log_CreateRTF(lstrdat); - lstrdat->bufferLen = lstrlenA(lstrdat->buffer); + lstrdat->bufferLen = mir_strlen(lstrdat->buffer); } // give the RTF to the RE control diff --git a/plugins/Scriver/src/chat/message.cpp b/plugins/Scriver/src/chat/message.cpp index 1bcc285f79..fa228ab895 100644 --- a/plugins/Scriver/src/chat/message.cpp +++ b/plugins/Scriver/src/chat/message.cpp @@ -95,7 +95,7 @@ TCHAR* DoRtfToTags(char *pszText, SESSION_INFO *si) p1 += 5; - MoveMemory(pszText, p1, lstrlenA(p1) + 1); + MoveMemory(pszText, p1, mir_strlen(p1) + 1); p1 = pszText; // iterate through all characters, if rtf control character found then take action @@ -287,9 +287,9 @@ TCHAR* DoRtfToTags(char *pszText, SESSION_INFO *si) // move the memory and paste in new commands instead of the old RTF if (InsertThis[0] || iRemoveChars) { - MoveMemory(p1 + lstrlenA(InsertThis), p1 + iRemoveChars, lstrlenA(p1) - iRemoveChars + 1); - CopyMemory(p1, InsertThis, lstrlenA(InsertThis)); - p1 += lstrlenA(InsertThis); + MoveMemory(p1 + mir_strlen(InsertThis), p1 + iRemoveChars, mir_strlen(p1) - iRemoveChars + 1); + CopyMemory(p1, InsertThis, mir_strlen(InsertThis)); + p1 += mir_strlen(InsertThis); } else p1++; } diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index 938130031d..d06a6a8c50 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -465,9 +465,9 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa LPITEMIDLIST idList = SHBrowseForFolder(&bi); if (idList) { SHGetPathFromIDList(idList, tszDirectory); - lstrcat(tszDirectory, _T("\\")); + mir_tstrcat(tszDirectory, _T("\\")); PathToRelativeT(tszDirectory, tszTemp); - SetWindowText(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY), lstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME); + SetWindowText(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY), mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME); } psMalloc->Free(idList); psMalloc->Release(); @@ -544,7 +544,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa free(pszText1); } else { - lstrcpyn(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH); + mir_tstrncpy(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 5053c2b5d7..7af2a95929 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -78,10 +78,10 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s if (pszWordText) mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("&Message %s"), pszWordText); else - lstrcpyn(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1); + mir_tstrncpy(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1); - if (lstrlen(szTemp) > 40) - lstrcpyn(szTemp + 40, _T("..."), 4); + if (mir_tstrlen(szTemp) > 40) + mir_tstrncpy(szTemp + 40, _T("..."), 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 a383b869f3..0fa3c1485d 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -256,7 +256,7 @@ LBL_SkipEnd: if (dat->szSearchQuery == NULL) { dat->szSearchQuery = (TCHAR*)mir_alloc(sizeof(TCHAR)*(end - start + 1)); - lstrcpyn(dat->szSearchQuery, pszText + start, end - start + 1); + mir_tstrncpy(dat->szSearchQuery, pszText + start, end - start + 1); dat->szSearchResult = mir_tstrdup(dat->szSearchQuery); dat->lastSession = NULL; } @@ -969,14 +969,14 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break; } else if (wParam == '\b' && si->szSearch[0]) // backspace - si->szSearch[lstrlen(si->szSearch) - 1] = '\0'; + si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0'; else if (wParam < ' ') break; else { TCHAR szNew[2]; szNew[0] = (TCHAR)wParam; szNew[1] = '\0'; - if (lstrlen(si->szSearch) >= SIZEOF(si->szSearch) - 2) { + if (mir_tstrlen(si->szSearch) >= SIZEOF(si->szSearch) - 2) { MessageBeep(MB_OK); break; } @@ -991,7 +991,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 (!_tcsnicmp(ui->pszNick, si->szSearch, lstrlen(si->szSearch))) { + if (!_tcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) { SendMessage(hwnd, LB_SETCURSEL, i, 0); InvalidateRect(hwnd, NULL, FALSE); return 0; @@ -1000,7 +1000,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, } MessageBeep(MB_OK); - si->szSearch[lstrlen(si->szSearch) - 1] = '\0'; + si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0'; return 0; } break; @@ -1441,7 +1441,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, lstrlen(ui->pszNick)); + TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, mir_tstrlen(ui->pszNick)); SelectObject(dis->hDC, hOldFont); } return TRUE; @@ -1715,11 +1715,11 @@ LABEL_SHOWWINDOW: if (GetKeyState(VK_SHIFT) & 0x8000) { LRESULT lResult = (LRESULT)SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_GETSEL, 0, 0); int start = LOWORD(lResult); - TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR)*(lstrlen(ui->pszUID) + 3)); + TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR)*(mir_tstrlen(ui->pszUID) + 3)); if (start == 0) - mir_sntprintf(pszName, lstrlen(ui->pszUID) + 3, _T("%s: "), ui->pszUID); + mir_sntprintf(pszName, mir_tstrlen(ui->pszUID) + 3, _T("%s: "), ui->pszUID); else - mir_sntprintf(pszName, lstrlen(ui->pszUID) + 2, _T("%s "), ui->pszUID); + mir_sntprintf(pszName, mir_tstrlen(ui->pszUID) + 2, _T("%s "), ui->pszUID); SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_REPLACESEL, FALSE, (LPARAM)pszName); PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0); diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 9b306dac6c..f36a1d24f6 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -150,7 +150,7 @@ static int ackevent(WPARAM wParam, LPARAM lParam) dbei.flags |= DBEF_UTF; dbei.szModule = GetContactProto(hContact); dbei.timestamp = time(NULL); - dbei.cbBlob = lstrlenA(item->sendBuffer) + 1; + dbei.cbBlob = mir_strlen(item->sendBuffer) + 1; if (!(item->flags & PREF_UTF)) dbei.cbBlob *= sizeof(TCHAR) + 1; dbei.pBlob = (PBYTE)item->sendBuffer; diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index 41e2227a7a..8c07b4dd28 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -408,8 +408,8 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK * if (!OpenClipboard(hwndDlg)) break; EmptyClipboard(); - HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(lstrlen(tr.lpstrText) + 1)); - lstrcpy((LPWSTR)GlobalLock(hData), tr.lpstrText); + HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(tr.lpstrText) + 1)); + mir_tstrcpy((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 e471643fc2..596af74bae 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -171,7 +171,7 @@ int RTL_Detect(WCHAR *pszwText) { WORD *infoTypeC2; int i; - int iLen = lstrlenW(pszwText); + int iLen = mir_wstrlen(pszwText); infoTypeC2 = (WORD *)mir_alloc(sizeof(WORD) * (iLen + 2)); @@ -201,14 +201,14 @@ static void AddToFileList(TCHAR ***pppFiles,int *totalCount,const TCHAR* szFilen WIN32_FIND_DATA fd; HANDLE hFind; TCHAR szPath[MAX_PATH]; - lstrcpy(szPath,szFilename); - lstrcat(szPath,_T("\\*")); + mir_tstrcpy(szPath,szFilename); + mir_tstrcat(szPath,_T("\\*")); if (( hFind = FindFirstFile( szPath, &fd )) != INVALID_HANDLE_VALUE ) { do { if ( !lstrcmp(fd.cFileName,_T(".")) || !lstrcmp(fd.cFileName,_T(".."))) continue; - lstrcpy(szPath,szFilename); - lstrcat(szPath,_T("\\")); - lstrcat(szPath,fd.cFileName); + mir_tstrcpy(szPath,szFilename); + mir_tstrcat(szPath,_T("\\")); + mir_tstrcat(szPath,fd.cFileName); AddToFileList(pppFiles,totalCount,szPath); } while( FindNextFile( hFind,&fd )); @@ -1167,12 +1167,12 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->windowData.hContact) { char buf[128]; GetContactUniqueId(dat, buf, sizeof(buf)); - if (!OpenClipboard(hwndDlg) || !lstrlenA(buf)) + if (!OpenClipboard(hwndDlg) || !mir_strlen(buf)) break; EmptyClipboard(); - HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, lstrlenA(buf) + 1); - lstrcpyA((LPSTR)GlobalLock(hData), buf); + HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, mir_strlen(buf) + 1); + mir_strcpy((LPSTR)GlobalLock(hData), buf); GlobalUnlock(hData); SetClipboardData(CF_TEXT, hData); CloseClipboard(); diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index e6a7d453d0..aa99c773d1 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -191,7 +191,7 @@ EventData* getEventFromDB(SrmmWindowData *dat, MCONTACT hContact, HANDLE hDbEven if (evt->eventType == EVENTTYPE_FILE) { char *filename = ((char*)dbei.pBlob) + sizeof(DWORD); - char *descr = filename + lstrlenA(filename) + 1; + char *descr = filename + mir_strlen(filename) + 1; evt->pszTextT = DbGetEventStringT(&dbei, filename); if (*descr != 0) evt->pszText2T = DbGetEventStringT(&dbei, descr); @@ -428,27 +428,27 @@ TCHAR* TimestampToString(DWORD dwFlags, time_t check, int mode) today = mktime(&tm_today); if (dwFlags & SMF_RELATIVEDATE && check >= today) { - lstrcpy(szResult, TranslateT("Today")); + mir_tstrcpy(szResult, TranslateT("Today")); if (mode == 0) - lstrcat(szResult, _T(",")); + mir_tstrcat(szResult, _T(",")); } else if (dwFlags & SMF_RELATIVEDATE && check > (today - 86400)) { - lstrcpy(szResult, TranslateT("Yesterday")); + mir_tstrcpy(szResult, TranslateT("Yesterday")); if (mode == 0) - lstrcat(szResult, _T(",")); + mir_tstrcat(szResult, _T(",")); } else { if (dwFlags & SMF_LONGDATE) - lstrcpy(format, _T("D")); + mir_tstrcpy(format, _T("D")); else - lstrcpy(format, _T("d")); + mir_tstrcpy(format, _T("d")); } } if (mode == 0 || mode == 2) { if (mode == 0 && (dwFlags & SMF_SHOWDATE)) - lstrcat(format, _T(" ")); + mir_tstrcat(format, _T(" ")); - lstrcat(format, (dwFlags & SMF_SHOWSECONDS) ? _T("s") : _T("t")); + mir_tstrcat(format, (dwFlags & SMF_SHOWSECONDS) ? _T("s") : _T("t")); } if (format[0] != '\0') { tmi.printTimeStamp(NULL, check, format, str, SIZEOF(str), 0); @@ -812,7 +812,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG *pcb = 0; return 0; } - dat->bufferLen = lstrlenA(dat->buffer); + dat->bufferLen = mir_strlen(dat->buffer); } *pcb = min(cb, dat->bufferLen - dat->bufferOffset); CopyMemory(pbBuff, dat->buffer + dat->bufferOffset, *pcb); diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 53d2703f72..b0773914c3 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -196,7 +196,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) ptrT tszFace(db_get_tsa(NULL, SRMMMOD, str)); if (tszFace == NULL) - lstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace); + mir_tstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace); else _tcsncpy(lf->lfFaceName, tszFace, SIZEOF(lf->lfFaceName)); diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index f2e1bc7c86..bd6899a7d7 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -49,12 +49,12 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto) isTemplate = 0; if (hContact && szProto) { tokens[0] = GetNickname(hContact, szProto); - tokenLen[0] = lstrlen(tokens[0]); + tokenLen[0] = mir_tstrlen(tokens[0]); tokens[1] = mir_tstrdup(pcli->pfnGetStatusModeDescription(szProto ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : ID_STATUS_OFFLINE, 0)); - tokenLen[1] = lstrlen(tokens[1]); + tokenLen[1] = mir_tstrlen(tokens[1]); tokens[2] = db_get_tsa(hContact, "CList", "StatusMsg"); if (tokens[2] != NULL) { - tokenLen[2] = lstrlen(tokens[2]); + tokenLen[2] = mir_tstrlen(tokens[2]); for (i = j = 0; i < tokenLen[2]; i++) { if (tokens[2][i] == '\r') continue; @@ -72,7 +72,7 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto) PROTOACCOUNT* proto = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)accModule); if (proto != NULL) { tokens[3] = mir_tstrdup(proto->tszAccountName); - tokenLen[3] = lstrlen(tokens[3]); + tokenLen[3] = mir_tstrlen(tokens[3]); } } tmplt = db_get_tsa(NULL, SRMMMOD, SRMSGSET_WINDOWTITLE); @@ -100,13 +100,13 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto) } } if (!isTemplate) - len += lstrlen(pszNewTitleEnd); + len += mir_tstrlen(pszNewTitleEnd); title = (TCHAR *)mir_alloc(sizeof(TCHAR) * (len + 1)); for (len = 0, p = tmplt; *p; p++) { if (*p == '%') { for (i = 0; i < SIZEOF(titleTokenNames); i ++) { - int tnlen = lstrlen(titleTokenNames[i]); + int tnlen = mir_tstrlen(titleTokenNames[i]); if (!_tcsncmp(p, titleTokenNames[i], tnlen)) { if (tokens[i] != NULL) { memcpy(title+len, tokens[i], sizeof(TCHAR) * tokenLen[i]); @@ -121,8 +121,8 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto) title[len++] = *p; } if (!isTemplate) { - memcpy(title+len, pszNewTitleEnd, sizeof(TCHAR) * lstrlen(pszNewTitleEnd)); - len += lstrlen(pszNewTitleEnd); + memcpy(title+len, pszNewTitleEnd, sizeof(TCHAR) * mir_tstrlen(pszNewTitleEnd)); + len += mir_tstrlen(pszNewTitleEnd); } title[len] = '\0'; if (isTemplate) diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index f7b158df80..07f033524c 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -187,7 +187,7 @@ char* GetRichTextRTF(HWND hwnd) void rtrimText(TCHAR *text) { static TCHAR szTrimString[] = _T(":;,.!?\'\"><()[]- \r\n"); - int iLen = lstrlen(text)-1; + int iLen = mir_tstrlen(text)-1; while(iLen >= 0 && _tcschr(szTrimString, text[iLen])) { text[iLen] = _T('\0'); iLen--; @@ -196,7 +196,7 @@ void rtrimText(TCHAR *text) TCHAR *limitText(TCHAR *text, int limit) { - int len = lstrlen(text); + int len = mir_tstrlen(text); if (len > g_dat.limitNamesLength) { TCHAR *ptszTemp = (TCHAR *)mir_alloc(sizeof(TCHAR) * (limit + 4)); -- cgit v1.2.3