diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 10:18:21 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 10:18:21 +0000 |
commit | b499ebc740aa5480be013d40e0d8097066800642 (patch) | |
tree | ed410ee863f4afc0c579599741bf38b4e3ffb706 /src | |
parent | 5a17c9299e03bebf46169927abdeee34aaf8e854 (diff) |
replace _tcslen to mir_tstrlen
git-svn-id: http://svn.miranda-ng.org/main/trunk@13748 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdfile/src/fileexistsdlg.cpp | 4 | ||||
-rw-r--r-- | src/core/stdfile/src/fileopts.cpp | 2 | ||||
-rw-r--r-- | src/core/stdfile/src/filexferdlg.cpp | 6 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 6 | ||||
-rw-r--r-- | src/core/stdmsg/src/msglog.cpp | 4 | ||||
-rw-r--r-- | src/modules/chat/clist.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/genmenu.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/movetogroup.cpp | 2 | ||||
-rw-r--r-- | src/modules/database/database.cpp | 4 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_addto.cpp | 2 | ||||
-rw-r--r-- | src/modules/netlib/netlibsecurity.cpp | 2 | ||||
-rw-r--r-- | src/modules/options/filter.cpp | 10 | ||||
-rw-r--r-- | src/modules/options/filter.h | 2 | ||||
-rw-r--r-- | src/modules/plugins/newplugins.cpp | 2 | ||||
-rw-r--r-- | src/modules/utils/path.cpp | 2 |
15 files changed, 27 insertions, 27 deletions
diff --git a/src/core/stdfile/src/fileexistsdlg.cpp b/src/core/stdfile/src/fileexistsdlg.cpp index 3c15484676..959a14ccdd 100644 --- a/src/core/stdfile/src/fileexistsdlg.cpp +++ b/src/core/stdfile/src/fileexistsdlg.cpp @@ -289,9 +289,9 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
_tcsncpy(filter, TranslateT("All files"),SIZEOF(filter)-1);
_tcscat(filter, _T(" (*)"));
- pfilter = filter + _tcslen(filter) + 1;
+ pfilter = filter + mir_tstrlen(filter) + 1;
_tcscpy(pfilter, _T("*"));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
ofn.lpstrFile = str;
diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp index 8fc3cfc8b3..63c1cdcec1 100644 --- a/src/core/stdfile/src/fileopts.cpp +++ b/src/core/stdfile/src/fileopts.cpp @@ -180,7 +180,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L TCHAR *pszQuote = _tcschr(str + 1, '"');
if (pszQuote)
*pszQuote = 0;
- memmove(str, str + 1, (_tcslen(str) * sizeof(TCHAR)));
+ memmove(str, str + 1, (mir_tstrlen(str) * sizeof(TCHAR)));
}
else {
TCHAR *pszSpace = _tcschr(str, ' ');
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index c89c518fa4..2af724720a 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -102,8 +102,8 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) TCHAR *pszReplace = _tcsstr(dbv.ptszVal, _T("%f")); TCHAR szCmdLine[768]; if (pszReplace) { - if (info->szFile[_tcslen(info->szFile) - 1] == '\\') - info->szFile[_tcslen(info->szFile) - 1] = '\0'; + if (info->szFile[mir_tstrlen(info->szFile) - 1] == '\\') + info->szFile[mir_tstrlen(info->szFile) - 1] = '\0'; *pszReplace = 0; mir_sntprintf(szCmdLine, SIZEOF(szCmdLine), _T("%s\"%s\"%s"), dbv.ptszVal, info->szFile, pszReplace + 2); } else @@ -414,7 +414,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR pszFilename++; if (pszFilename) { - size_t cbFileNameLen = _tcslen(pszFilename); + size_t cbFileNameLen = mir_tstrlen(pszFilename); pszNewFileName = (TCHAR*)mir_alloc(cbFileNameLen * 2 * sizeof(TCHAR)); TCHAR *p = pszNewFileName; diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index af2c574587..64a8ec7625 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 TCHAR *ptszText)
{
- int iLen = (int)_tcslen(ptszText);
+ int iLen = (int)mir_tstrlen(ptszText);
WORD *infoTypeC2 = (WORD*)alloca(sizeof(WORD)* (iLen + 2));
GetStringTypeEx(LOCALE_USER_DEFAULT, CT_CTYPE2, ptszText, iLen, infoTypeC2);
@@ -965,7 +965,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
if (buf[0] && OpenClipboard(hwndDlg)) {
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, _tcslen(buf) * sizeof(TCHAR)+1);
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(buf) * sizeof(TCHAR)+1);
_tcscpy((TCHAR*)GlobalLock(hData), buf);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
@@ -1617,7 +1617,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case IDM_COPYLINK:
if (OpenClipboard(hwndDlg)) {
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (_tcslen(tr.lpstrText) + 1) * sizeof(TCHAR));
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(tr.lpstrText) + 1) * sizeof(TCHAR));
_tcscpy((TCHAR*)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index aa8cf996f3..f3e13ccd9d 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -78,7 +78,7 @@ static int AppendToBufferWithRTF(char *&buffer, size_t &cbBufferEnd, size_t &cbB if (line == NULL)
return 0;
- size_t lineLen = _tcslen(line) * 9 + 8;
+ size_t lineLen = mir_tstrlen(line) * 9 + 8;
if (cbBufferEnd + lineLen > cbBufferAlloced) {
cbBufferAlloced += lineLen + 1024 - lineLen % 1024;
buffer = (char*)mir_realloc(buffer, cbBufferAlloced);
@@ -110,7 +110,7 @@ static int AppendToBufferWithRTF(char *&buffer, size_t &cbBufferEnd, size_t &cbB int i, found = 0;
for (i = 0; i < SIZEOF(bbcodes); ++i) {
if (line[1] == bbcodes[i][1]) {
- size_t lenb = _tcslen(bbcodes[i]);
+ size_t lenb = mir_tstrlen(bbcodes[i]);
if (!_tcsnicmp(line, bbcodes[i], lenb)) {
size_t len = mir_strlen(bbcodefmt[i]);
memcpy(d, bbcodefmt[i], len);
diff --git a/src/modules/chat/clist.cpp b/src/modules/chat/clist.cpp index e86ad505fb..7d90bfe084 100644 --- a/src/modules/chat/clist.cpp +++ b/src/modules/chat/clist.cpp @@ -207,7 +207,7 @@ BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fm {
TCHAR szBuf[4096];
- if (!fmt || !fmt[0] || _tcslen(fmt) > 2000)
+ if (!fmt || !fmt[0] || mir_tstrlen(fmt) > 2000)
return FALSE;
va_list marker;
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index 7270447bcd..0193777539 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -936,7 +936,7 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para // mi.pszName
mir_snprintf(DBString, SIZEOF(DBString), "%s_name", menuItemName);
if (!db_get_ts(NULL, MenuNameItems, DBString, &dbv)) {
- if (_tcslen(dbv.ptszVal) > 0)
+ if (mir_tstrlen(dbv.ptszVal) > 0)
replaceStrT(pmi->CustomName, dbv.ptszVal);
db_free(&dbv);
}
@@ -1073,7 +1073,7 @@ static int MO_RegisterIcon(PMO_IntMenuItem pmi, void*) if ((p = _tcschr(p, '&')) == NULL)
break;
- memmove(p, p + 1, sizeof(TCHAR)*(_tcslen(p + 1) + 1));
+ memmove(p, p + 1, sizeof(TCHAR)*(mir_tstrlen(p + 1) + 1));
if (*p == '\0')
p++;
}
diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp index 12ec065367..5b9ca54af2 100644 --- a/src/modules/clist/movetogroup.cpp +++ b/src/modules/clist/movetogroup.cpp @@ -54,7 +54,7 @@ static TCHAR* PrepareGroupName(TCHAR* str) if (p == NULL)
return mir_tstrdup(str);
- d = p = (TCHAR*)mir_alloc(sizeof(TCHAR)*(2*_tcslen(str)+1));
+ d = p = (TCHAR*)mir_alloc(sizeof(TCHAR)*(2*mir_tstrlen(str)+1));
while (*str) {
if (*str == '&')
*d++='&';
diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp index 28abf44605..292f0000ab 100644 --- a/src/modules/database/database.cpp +++ b/src/modules/database/database.cpp @@ -66,7 +66,7 @@ bool IsInsideRootDir(TCHAR* profiledir, bool exact) if (exact)
return _tcsicmp(profiledir, pfd) == 0;
- return _tcsnicmp(profiledir, pfd, _tcslen(pfd)) == 0;
+ return _tcsnicmp(profiledir, pfd, mir_tstrlen(pfd)) == 0;
}
// returns 1 if the profile path was returned, without trailing slash
@@ -89,7 +89,7 @@ int getProfilePath(TCHAR *buf, size_t cch) // returns 1 if *.dat spec is matched
int isValidProfileName(const TCHAR *name)
{
- size_t len = _tcslen(name) - 4;
+ size_t len = mir_tstrlen(name) - 4;
return len > 0 && _tcsicmp(&name[len], _T(".dat")) == 0;
}
diff --git a/src/modules/metacontacts/meta_addto.cpp b/src/modules/metacontacts/meta_addto.cpp index 9311ff97d5..f974b2b3f8 100644 --- a/src/modules/metacontacts/meta_addto.cpp +++ b/src/modules/metacontacts/meta_addto.cpp @@ -52,7 +52,7 @@ static int FillList(HWND list, BOOL sort) // get contact display name from clist
TCHAR *swzContactDisplayName = cli.pfnGetContactDisplayName(hMetaUser, 0);
// don't insert huge strings that we have to compare with later
- if (_tcslen(swzContactDisplayName) > 1023)
+ if (mir_tstrlen(swzContactDisplayName) > 1023)
swzContactDisplayName[1024] = 0;
int pos = -1;
diff --git a/src/modules/netlib/netlibsecurity.cpp b/src/modules/netlib/netlibsecurity.cpp index 0e4151d1ad..10a322453d 100644 --- a/src/modules/netlib/netlibsecurity.cpp +++ b/src/modules/netlib/netlibsecurity.cpp @@ -292,7 +292,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, else domainLen /= sizeof(wchar_t);
if (domainLen) {
- size_t newLoginLen = _tcslen(login) + domainLen + 1;
+ size_t newLoginLen = mir_tstrlen(login) + domainLen + 1;
TCHAR *newLogin = (TCHAR*)alloca(newLoginLen * sizeof(TCHAR));
_tcsncpy(newLogin, domainName, domainLen);
diff --git a/src/modules/options/filter.cpp b/src/modules/options/filter.cpp index aa7e2ca7aa..982fe77399 100644 --- a/src/modules/options/filter.cpp +++ b/src/modules/options/filter.cpp @@ -62,7 +62,7 @@ void AddTreeViewNodes(HWND hWndDlg, PageHash key, HTREEITEM root) item.cchTextMax = SIZEOF(title);
if (TreeView_GetItem(hWndDlg, &item))
- if (_tcslen(title) > 0)
+ if (mir_tstrlen(title) > 0)
AddFilterString(key, title);
HTREEITEM child = root;
@@ -79,7 +79,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) {
TCHAR title[2048];
GetWindowText(hWndDlg, title, SIZEOF(title));
- if (_tcslen(title) > 0)
+ if (mir_tstrlen(title) > 0)
AddFilterString(key, title);
TCHAR szClass[64];
@@ -99,7 +99,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) int res = ListBox_GetText(hWndDlg, i, title);
if (res != LB_ERR) {
title[SIZEOF(title) - 1] = 0;
- if (_tcslen(title) > 0)
+ if (mir_tstrlen(title) > 0)
AddFilterString(key, title);
}
}
@@ -113,7 +113,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) title[0] = 0; //safety
ListView_GetItemText(hWndDlg, i, 0, title, SIZEOF(title));
- if (_tcslen(title) > 0)
+ if (mir_tstrlen(title) > 0)
AddFilterString(key, title);
}
return;
@@ -128,7 +128,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) if (res != CB_ERR) {
title[SIZEOF(title) - 1] = 0;
- if (_tcslen(title) > 0)
+ if (mir_tstrlen(title) > 0)
AddFilterString(key, title);
}
}
diff --git a/src/modules/options/filter.h b/src/modules/options/filter.h index 261c99b342..590f74a76f 100644 --- a/src/modules/options/filter.h +++ b/src/modules/options/filter.h @@ -36,7 +36,7 @@ void GetDialogStrings(int enableKeywordFiltering, const PageHash key, TCHAR *plu _inline TCHAR *_tcslwr_locale(TCHAR *buf)
{
- LCMapString(Langpack_GetDefaultLocale() , LCMAP_LOWERCASE, buf, (int)_tcslen(buf), buf, (int)_tcslen(buf));
+ LCMapString(Langpack_GetDefaultLocale() , LCMAP_LOWERCASE, buf, (int)mir_tstrlen(buf), buf, (int)mir_tstrlen(buf));
return buf;
}
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp index ff12e0d907..b2cabeecab 100644 --- a/src/modules/plugins/newplugins.cpp +++ b/src/modules/plugins/newplugins.cpp @@ -671,7 +671,7 @@ int LoadDefaultServiceModePlugin() if (param == NULL || *param == 0)
return SERVICE_CONTINUE;
- size_t cbLen = _tcslen(param);
+ size_t cbLen = mir_tstrlen(param);
for (int i = 0; i < servicePlugins.getCount(); i++) {
pluginEntry *p = servicePlugins[i];
if (!_tcsnicmp(p->pluginname, param, cbLen)) {
diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index f1fa55ea5c..0a2bccb038 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.cpp @@ -194,7 +194,7 @@ static __forceinline char *GetPathVarX(char *, int code) static __forceinline int _xcscmp(const TCHAR *s1, const TCHAR *s2) { return _tcscmp(s1, s2); }
static __forceinline int _xcsncmp(const TCHAR *s1, const TCHAR *s2, size_t n) { return _tcsncmp(s1, s2, n); }
-static __forceinline size_t _xcslen(const TCHAR *s1) { return _tcslen(s1); }
+static __forceinline size_t _xcslen(const TCHAR *s1) { return mir_tstrlen(s1); }
static __forceinline TCHAR *_xcscpy(TCHAR *s1, const TCHAR *s2) { return _tcscpy(s1, s2); }
static __forceinline TCHAR *_xcsncpy(TCHAR *s1, const TCHAR *s2, size_t n) { return _tcsncpy(s1, s2, n); }
static __forceinline TCHAR *_xstrselect(TCHAR *, char *s1, TCHAR *s2) { return s2; }
|