From b499ebc740aa5480be013d40e0d8097066800642 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 22 May 2015 10:18:21 +0000 Subject: replace _tcslen to mir_tstrlen git-svn-id: http://svn.miranda-ng.org/main/trunk@13748 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Weather/src/weather_contacts.cpp | 8 ++++---- plugins/Weather/src/weather_conv.cpp | 10 +++++----- plugins/Weather/src/weather_data.cpp | 6 +++--- plugins/Weather/src/weather_ini.cpp | 6 +++--- plugins/Weather/src/weather_update.cpp | 8 ++++---- 5 files changed, 19 insertions(+), 19 deletions(-) (limited to 'plugins/Weather/src') diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 17d2c70e31..1949517426 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -295,14 +295,14 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa // set filters _tcsncpy(filter, TranslateT("Text Files"), SIZEOF(filter) - 1); _tcsncat(filter, _T(" (*.txt)"), SIZEOF(filter) - mir_tstrlen(filter)); - pfilter = filter + _tcslen(filter)+1; + pfilter = filter + mir_tstrlen(filter)+1; _tcsncpy(pfilter, _T("*.txt"), SIZEOF(filter) - 1); - pfilter = pfilter + _tcslen(pfilter)+1; + pfilter = pfilter + mir_tstrlen(pfilter)+1; _tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - 1); _tcsncat(pfilter, _T(" (*.*)"), SIZEOF(filter) - mir_tstrlen(filter)); - pfilter = pfilter + _tcslen(pfilter)+1; + pfilter = pfilter + mir_tstrlen(pfilter)+1; _tcsncpy(pfilter, _T("*.*"), SIZEOF(filter) - 1); - pfilter = pfilter + _tcslen(pfilter)+1; + pfilter = pfilter + mir_tstrlen(pfilter)+1; *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.nFilterIndex = 1; diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index c3e1774746..15288b052a 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -84,7 +84,7 @@ void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR* str) TrimString(tempchar); if (tempchar[0] == '-' && tempchar[1] == ' ') - memmove(&tempchar[1], &tempchar[2], sizeof(TCHAR)*(_tcslen(&tempchar[2])+1)); + memmove(&tempchar[1], &tempchar[2], sizeof(TCHAR)*(mir_tstrlen(&tempchar[2])+1)); // quit if the value obtained is N/A or not a number if ( !_tcscmp(tempchar, NODATA) || !_tcscmp(tempchar, _T("N/A"))) { @@ -395,7 +395,7 @@ WORD GetIcon(const TCHAR* cond, WIDATA *Data) // using the format _T("# Weather #" mir_sntprintf(LangPackStr, SIZEOF(LangPackStr), _T("# Weather %s %i #"), statusStr[i], j); _tcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE); - CharLowerBuff(LangPackStr1, (DWORD)_tcslen(LangPackStr1)); + CharLowerBuff(LangPackStr1, (DWORD)mir_tstrlen(LangPackStr1)); if (_tcsstr(cond, LangPackStr1) != NULL) return statusValue[i]; // loop until the translation string exists (ie, the translated string is differ from original) @@ -414,7 +414,7 @@ void CaseConv(TCHAR *str) TCHAR *pstr; BOOL nextUp = TRUE; - CharLowerBuff(str, (DWORD)_tcslen(str)); + CharLowerBuff(str, (DWORD)mir_tstrlen(str)); for(pstr = str; *pstr; pstr++) { if (*pstr == ' ' || *pstr == '-') nextUp = TRUE; @@ -499,7 +499,7 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str) str[0] = 0; // looking character by character - for (i=0; i < _tcslen(dis); i++) { + for (i=0; i < mir_tstrlen(dis); i++) { // for the escape characters if (dis[i] == '\\') { i++; @@ -547,7 +547,7 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str) i++; name[0] = 0; // read the entire variable name - while (dis[i] != ']' && i < _tcslen(dis)) { + while (dis[i] != ']' && i < mir_tstrlen(dis)) { mir_snprintf(temp, SIZEOF(temp), "%c", dis[i++]); strcat(name, temp); } diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index e49019e489..deb04358ec 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -252,7 +252,7 @@ void ConvertDataValue(WIDATAITEM *UpdateData, TCHAR *Data) } // truncating strings for day/month to 2 or 3 characters else if ( !_tcsicmp(UpdateData->Unit, _T("DAY")) || !_tcsicmp(UpdateData->Unit, _T("MONTH"))) - if (opt.dUnit > 1 && _tcslen(Data) > opt.dUnit) + if (opt.dUnit > 1 && mir_tstrlen(Data) > opt.dUnit) Data[opt.dUnit] = '\0'; } } @@ -280,7 +280,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData) start = _tcsstr(szInfo, UpdateData->Start); if (start != NULL) { // set the starting location for getting data - start += _tcslen(UpdateData->Start); + start += mir_tstrlen(UpdateData->Start); szInfo = start; } } @@ -295,7 +295,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData) // set the ending location startloc = 0; endloc = end - szInfo; - end += _tcslen(UpdateData->End); + end += mir_tstrlen(UpdateData->End); last = '\n'; } diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index 4fcb96d091..7c69dc38f4 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -131,7 +131,7 @@ void WICondListAdd(char *str, WICONDLIST *List) { WICONDITEM *newItem = (WICONDITEM*)mir_alloc(sizeof(WICONDITEM)); wSetData(&newItem->Item, str); - CharLowerBuff(newItem->Item, (DWORD)_tcslen( newItem->Item )); + CharLowerBuff(newItem->Item, (DWORD)mir_tstrlen( newItem->Item )); newItem->Next = NULL; if (List->Tail == NULL) List->Head = newItem; else List->Tail->Next = newItem; @@ -327,7 +327,7 @@ void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data) // initialize the linked list for update items Data->UpdateDataCount = 0; - Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (_tcslen(pszShortFile) + _tcslen(pszFile) + 20)*sizeof( TCHAR ); + Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (mir_tstrlen(pszShortFile) + mir_tstrlen(pszFile) + 20)*sizeof( TCHAR ); Data->UpdateData = NULL; Data->UpdateDataTail = NULL; @@ -453,7 +453,7 @@ void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data) else if ( !_stricmp(ValName, "HIDDEN")) { if ( !_stricmp(Value, "TRUE")) { TCHAR *nm = Data->UpdateDataTail->Item.Name; - size_t len = _tcslen(nm) + 1; + size_t len = mir_tstrlen(nm) + 1; Data->UpdateDataTail->Item.Name = nm = ( TCHAR* )mir_realloc(nm, sizeof(TCHAR)*(len + 3)); memmove(nm + 1, nm, len*sizeof( TCHAR )); diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index c16649a62a..8e74b14a38 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -487,14 +487,14 @@ int GetWeatherData(MCONTACT hContact) case '[': // variable, add the value to the result string hasvar = TRUE; if ( !DBGetData(hContact, _T2A(str2), &dbv)) { - _tcsncat(DataValue, dbv.ptszVal, SIZEOF(DataValue) - _tcslen(DataValue)); + _tcsncat(DataValue, dbv.ptszVal, SIZEOF(DataValue) - mir_tstrlen(DataValue)); DataValue[SIZEOF(DataValue)-1] = 0; db_free(&dbv); } break; case'\"': // constant, add it to the result string - _tcsncat(DataValue, TranslateTS(str2), SIZEOF(DataValue) - _tcslen(DataValue)); + _tcsncat(DataValue, TranslateTS(str2), SIZEOF(DataValue) - mir_tstrlen(DataValue)); DataValue[SIZEOF(DataValue)-1] = 0; break; } @@ -527,7 +527,7 @@ int GetWeatherData(MCONTACT hContact) break; // exit if break string is not found } *end = '\0'; - end += _tcslen(Item->Item.Break); + end += mir_tstrlen(Item->Item.Break); while (end[0] == ' ') end++; // remove extra space @@ -557,7 +557,7 @@ int GetWeatherData(MCONTACT hContact) if (cbuf[0] == '#') cbuf = TranslateTS(DataValue); db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf); - CharLowerBuff(DataValue, (DWORD)_tcslen(DataValue)); + CharLowerBuff(DataValue, (DWORD)mir_tstrlen(DataValue)); cond = GetIcon(DataValue, Data); } else if ( _tcsicmp(Item->Item.Unit, _T("Cond")) == 0) { -- cgit v1.2.3