From 1eb922f8075c53a1a8487045b096693bd27b56dd Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 22 May 2015 19:23:27 +0000 Subject: replace _tcsicmp to mir_tstrcmpi git-svn-id: http://svn.miranda-ng.org/main/trunk@13761 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Weather/src/weather_addstn.cpp | 12 ++++++------ plugins/Weather/src/weather_conv.cpp | 32 ++++++++++++++++---------------- plugins/Weather/src/weather_data.cpp | 34 +++++++++++++++++----------------- plugins/Weather/src/weather_ini.cpp | 2 +- plugins/Weather/src/weather_update.cpp | 10 +++++----- 5 files changed, 45 insertions(+), 45 deletions(-) (limited to 'plugins/Weather') diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index cede7efbf4..5f2fd10f6b 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -46,12 +46,12 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam) DBVARIANT dbv; // check ID to see if the contact already exist in the database if ( !db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) { - if ( !_tcsicmp(psr->email, dbv.ptszVal)) { + if ( !mir_tstrcmpi(psr->email, dbv.ptszVal)) { // remove the flag for not on list and hidden, thus make the contact visible // and add them on the list if (db_get_b(hContact, "CList", "NotOnList", 1)) { db_unset(hContact, "CList", "NotOnList"); - db_unset(hContact, "CList", "Hidden"); + db_unset(hContact, "CList", "Hidden"); } db_free(&dbv); // contact is added, function quitting @@ -322,13 +322,13 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // for single result if (sData->Single.Available && (search != NULL || !sData->Multiple.Available)) { // single result // if station ID appears first in the downloaded data - if ( !_tcsicmp(sData->Single.First, _T("ID"))) { + if ( !mir_tstrcmpi(sData->Single.First, _T("ID"))) { GetDataValue(&sData->Single.ID, str, &szInfo); mir_sntprintf(sID, SIZEOF(sID), _T("%s/%s"), svc, str); GetDataValue(&sData->Single.Name, Name, &szInfo); } // if station name appears first in the downloaded data - else if ( !_tcsicmp(sData->Single.First, _T("NAME"))) { + else if ( !mir_tstrcmpi(sData->Single.First, _T("NAME"))) { GetDataValue(&sData->Single.Name, Name, &szInfo); GetDataValue(&sData->Single.ID, str, &szInfo); mir_sntprintf(sID, SIZEOF(sID), _T("%s/%s"), svc, str); @@ -363,13 +363,13 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // search for the next occurrence of the string while (true) { // if station ID appears first in the downloaded data - if ( !_tcsicmp(sData->Multiple.First, _T("ID"))) { + if ( !mir_tstrcmpi(sData->Multiple.First, _T("ID"))) { GetDataValue(&sData->Multiple.ID, str, &szInfo); mir_sntprintf(sID, SIZEOF(sID), _T("%s/%s"), svc, str); GetDataValue(&sData->Multiple.Name, Name, &szInfo); } // if station name appears first in the downloaded data - else if ( !_tcsicmp(sData->Multiple.First, _T("NAME"))) { + else if ( !mir_tstrcmpi(sData->Multiple.First, _T("NAME"))) { GetDataValue(&sData->Multiple.Name, Name, &szInfo); GetDataValue(&sData->Multiple.ID, str, &szInfo); mir_sntprintf(sID, SIZEOF(sID), _T("%s/%s"), svc, str); diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index b8cbb97f95..7d73d76fed 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -100,8 +100,8 @@ void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR* str) temp = _ttof(tempchar); // convert all to F first - if ( !_tcsicmp(unit, _T("C"))) temp = (temp*9/5)+32; - else if ( !_tcsicmp(unit, _T("K"))) temp = ((temp-273.15)*9/5)+32; + if ( !mir_tstrcmpi(unit, _T("C"))) temp = (temp*9/5)+32; + else if ( !mir_tstrcmpi(unit, _T("K"))) temp = ((temp-273.15)*9/5)+32; // convert to apporiate unit switch (opt.tUnit) { @@ -143,17 +143,17 @@ void GetPressure(TCHAR *tempchar, TCHAR *unit, TCHAR* str) } // convert all to mb first - if ( !_tcsicmp(unit, _T("KPA"))) + if ( !mir_tstrcmpi(unit, _T("KPA"))) tempunit = (double)output * 10; - else if ( !_tcsicmp(unit, _T("HPA"))) + else if ( !mir_tstrcmpi(unit, _T("HPA"))) tempunit = (double)output; - else if ( !_tcsicmp(unit, _T("MB"))) + else if ( !mir_tstrcmpi(unit, _T("MB"))) tempunit = (double)output; - else if ( !_tcsicmp(unit, _T("IN"))) + else if ( !mir_tstrcmpi(unit, _T("IN"))) tempunit = (double)output * 33.86388; - else if ( !_tcsicmp(unit, _T("MM"))) + else if ( !mir_tstrcmpi(unit, _T("MM"))) tempunit = (double)output * 1.33322; - else if ( !_tcsicmp(unit, _T("TORR"))) + else if ( !mir_tstrcmpi(unit, _T("TORR"))) tempunit = (double)output * 1.33322; // convert to apporiate unit @@ -200,13 +200,13 @@ void GetSpeed(TCHAR *tempchar, TCHAR *unit, TCHAR *str) return; // convert all to m/s first - if ( !_tcsicmp(unit, _T("KM/H"))) + if ( !mir_tstrcmpi(unit, _T("KM/H"))) tempunit /= 3.6; -// else if ( !_tcsicmp(unit, _T("M/S")) +// else if ( !mir_tstrcmpi(unit, _T("M/S")) // tempunit = tempunit; - else if ( !_tcsicmp(unit, _T("MPH"))) + else if ( !mir_tstrcmpi(unit, _T("MPH"))) tempunit *= 0.44704; - else if ( !_tcsicmp(unit, _T("KNOTS"))) + else if ( !mir_tstrcmpi(unit, _T("KNOTS"))) tempunit *= 0.514444; // convert to apporiate unit @@ -249,9 +249,9 @@ void GetDist(TCHAR *tempchar, TCHAR *unit, TCHAR *str) } // convert all to km first - if ( !_tcsicmp(unit, _T("KM"))) + if ( !mir_tstrcmpi(unit, _T("KM"))) tempunit = (double)output; - else if ( !_tcsicmp(unit, _T("MILES"))) + else if ( !mir_tstrcmpi(unit, _T("MILES"))) tempunit = (double)output * 1.609; // convert to apporiate unit @@ -289,9 +289,9 @@ void GetElev(TCHAR *tempchar, TCHAR *unit, TCHAR *str) } // convert all to m first - if ( !_tcsicmp(unit, _T("M"))) + if ( !mir_tstrcmpi(unit, _T("M"))) tempunit = (double)output; - else if ( !_tcsicmp(unit, _T("FT"))) + else if ( !mir_tstrcmpi(unit, _T("FT"))) tempunit = (double)output / 3.28; // convert to apporiate unit diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index 02ee823423..81175f2ea4 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -200,58 +200,58 @@ void ConvertDataValue(WIDATAITEM *UpdateData, TCHAR *Data) if ( !mir_tstrcmp(UpdateData->Name, _T("Temperature")) || !mir_tstrcmp(UpdateData->Name, _T("High")) || !mir_tstrcmp(UpdateData->Name, _T("Low")) || !mir_tstrcmp(UpdateData->Name, _T("Feel")) || !mir_tstrcmp(UpdateData->Name, _T("Dewpoint")) || - !_tcsicmp(UpdateData->Unit, _T("C")) || !_tcsicmp(UpdateData->Unit, _T("F")) || - !_tcsicmp(UpdateData->Unit, _T("K"))) + !mir_tstrcmpi(UpdateData->Unit, _T("C")) || !mir_tstrcmpi(UpdateData->Unit, _T("F")) || + !mir_tstrcmpi(UpdateData->Unit, _T("K"))) { GetTemp(Data, UpdateData->Unit, str); _tcscpy(Data, str); } // pressure - else if ( !mir_tstrcmp(UpdateData->Name, _T("Pressure")) || !_tcsicmp(UpdateData->Unit, _T("HPA")) || - !_tcsicmp(UpdateData->Unit, _T("KPA")) || !_tcsicmp(UpdateData->Unit, _T("MB")) || - !_tcsicmp(UpdateData->Unit, _T("TORR")) || !_tcsicmp(UpdateData->Unit, _T("IN")) || - !_tcsicmp(UpdateData->Unit, _T("MM"))) + else if ( !mir_tstrcmp(UpdateData->Name, _T("Pressure")) || !mir_tstrcmpi(UpdateData->Unit, _T("HPA")) || + !mir_tstrcmpi(UpdateData->Unit, _T("KPA")) || !mir_tstrcmpi(UpdateData->Unit, _T("MB")) || + !mir_tstrcmpi(UpdateData->Unit, _T("TORR")) || !mir_tstrcmpi(UpdateData->Unit, _T("IN")) || + !mir_tstrcmpi(UpdateData->Unit, _T("MM"))) { GetPressure(Data, UpdateData->Unit, str); _tcscpy(Data, str); } // speed - else if ( !mir_tstrcmp(UpdateData->Name, _T("Wind Speed")) || !_tcsicmp(UpdateData->Unit, _T("KM/H")) || - !_tcsicmp(UpdateData->Unit, _T("M/S")) || !_tcsicmp(UpdateData->Unit, _T("MPH")) || - !_tcsicmp(UpdateData->Unit, _T("KNOTS"))) + else if ( !mir_tstrcmp(UpdateData->Name, _T("Wind Speed")) || !mir_tstrcmpi(UpdateData->Unit, _T("KM/H")) || + !mir_tstrcmpi(UpdateData->Unit, _T("M/S")) || !mir_tstrcmpi(UpdateData->Unit, _T("MPH")) || + !mir_tstrcmpi(UpdateData->Unit, _T("KNOTS"))) { GetSpeed(Data, UpdateData->Unit, str); _tcscpy(Data, str); } // visibility - else if ( !mir_tstrcmp(UpdateData->Name, _T("Visibility")) || !_tcsicmp(UpdateData->Unit, _T("KM")) || - !_tcsicmp(UpdateData->Unit, _T("MILES"))) + else if ( !mir_tstrcmp(UpdateData->Name, _T("Visibility")) || !mir_tstrcmpi(UpdateData->Unit, _T("KM")) || + !mir_tstrcmpi(UpdateData->Unit, _T("MILES"))) { GetDist(Data, UpdateData->Unit, str); _tcscpy(Data, str); } // elevation - else if ( !mir_tstrcmp(UpdateData->Name, _T("Elevation")) || !_tcsicmp(UpdateData->Unit, _T("FT")) || - !_tcsicmp(UpdateData->Unit, _T("M"))) + else if ( !mir_tstrcmp(UpdateData->Name, _T("Elevation")) || !mir_tstrcmpi(UpdateData->Unit, _T("FT")) || + !mir_tstrcmpi(UpdateData->Unit, _T("M"))) { GetElev(Data, UpdateData->Unit, str); _tcscpy(Data, str); } // converting case for condition to the upper+lower format - else if ( !_tcsicmp(UpdateData->Unit, _T("COND"))) + else if ( !mir_tstrcmpi(UpdateData->Unit, _T("COND"))) CaseConv(Data); // degree sign - else if ( !_tcsicmp(UpdateData->Unit, _T("DEG"))) + else if ( !mir_tstrcmpi(UpdateData->Unit, _T("DEG"))) { if ( !opt.DoNotAppendUnit) _tcscat(Data, opt.DegreeSign); } // percent sign - else if ( !_tcsicmp(UpdateData->Unit, _T("%"))) + else if ( !mir_tstrcmpi(UpdateData->Unit, _T("%"))) { if ( !opt.DoNotAppendUnit) _tcscat(Data, _T("%")); } // truncating strings for day/month to 2 or 3 characters - else if ( !_tcsicmp(UpdateData->Unit, _T("DAY")) || !_tcsicmp(UpdateData->Unit, _T("MONTH"))) + else if ( !mir_tstrcmpi(UpdateData->Unit, _T("DAY")) || !mir_tstrcmpi(UpdateData->Unit, _T("MONTH"))) if (opt.dUnit > 1 && mir_tstrlen(Data) > opt.dUnit) Data[opt.dUnit] = '\0'; } diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index e563353491..812ec987f3 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -196,7 +196,7 @@ bool LoadWIData(bool dial) chop = _tcsrchr(FileName, '\\'); chop[1] = '\0'; _tcsncat(FileName, fd.cFileName, SIZEOF(FileName) - mir_tstrlen(FileName)); - if ( _tcsicmp(fd.cFileName, _T("SAMPLE_INI.INI"))) { + if ( mir_tstrcmpi(fd.cFileName, _T("SAMPLE_INI.INI"))) { WIDATA Data; LoadStationData(FileName, fd.cFileName, &Data); if (Data.Enabled) diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index fc94299a79..ffa4818c19 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -83,19 +83,19 @@ int UpdateWeather(MCONTACT hContact) // compare the old condition and determine if the weather had changed if (opt.UpdateOnlyConditionChanged) { // consider condition change if (!db_get_ts(hContact, WEATHERPROTONAME, "LastCondition", &dbv)) { - if (_tcsicmp(winfo.cond, dbv.ptszVal)) Ch = TRUE; // the weather condition is changed + if (mir_tstrcmpi(winfo.cond, dbv.ptszVal)) Ch = TRUE; // the weather condition is changed db_free(&dbv); } else Ch = TRUE; if (!db_get_ts(hContact, WEATHERPROTONAME, "LastTemperature", &dbv)) { - if (_tcsicmp(winfo.temp, dbv.ptszVal)) Ch = TRUE; // the temperature is changed + if (mir_tstrcmpi(winfo.temp, dbv.ptszVal)) Ch = TRUE; // the temperature is changed db_free(&dbv); } else Ch = TRUE; } else { // consider update time change if (!db_get_ts(hContact, WEATHERPROTONAME, "LastUpdate", &dbv)) { - if (_tcsicmp(winfo.update, dbv.ptszVal)) Ch = TRUE; // the update time is changed + if (mir_tstrcmpi(winfo.update, dbv.ptszVal)) Ch = TRUE; // the update time is changed db_free(&dbv); } else Ch = TRUE; @@ -459,7 +459,7 @@ int GetWeatherData(MCONTACT hContact) // if it is a normal item with start= and end=, then parse through the downloaded string // to get a data value. GetDataValue(&Item->Item, DataValue, &szInfo); - if ( mir_tstrcmp(Item->Item.Name, _T("Condition")) && _tcsicmp(Item->Item.Unit, _T("Cond"))) + if ( mir_tstrcmp(Item->Item.Name, _T("Condition")) && mir_tstrcmpi(Item->Item.Unit, _T("Cond"))) _tcsncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1); break; @@ -562,7 +562,7 @@ int GetWeatherData(MCONTACT hContact) CharLowerBuff(DataValue, (DWORD)mir_tstrlen(DataValue)); cond = GetIcon(DataValue, Data); } - else if ( _tcsicmp(Item->Item.Unit, _T("Cond")) == 0) { + else if ( mir_tstrcmpi(Item->Item.Unit, _T("Cond")) == 0) { TCHAR buf[128], *cbuf; mir_sntprintf(buf, SIZEOF(buf), _T("#%s Weather"), DataValue); cbuf = TranslateTS(buf); -- cgit v1.2.3