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 --- plugins/Weather/src/weather.cpp | 2 +- plugins/Weather/src/weather_addstn.cpp | 26 +++--- plugins/Weather/src/weather_contacts.cpp | 30 +++--- plugins/Weather/src/weather_conv.cpp | 154 +++++++++++++++---------------- plugins/Weather/src/weather_data.cpp | 72 +++++++-------- plugins/Weather/src/weather_http.cpp | 8 +- plugins/Weather/src/weather_info.cpp | 94 +++++++++---------- plugins/Weather/src/weather_ini.cpp | 20 ++-- plugins/Weather/src/weather_mwin.cpp | 26 +++--- plugins/Weather/src/weather_opt.cpp | 2 +- plugins/Weather/src/weather_popup.cpp | 10 +- plugins/Weather/src/weather_svcs.cpp | 4 +- plugins/Weather/src/weather_update.cpp | 46 ++++----- 13 files changed, 247 insertions(+), 247 deletions(-) (limited to 'plugins/Weather') diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index bb0e86e011..c1c2f26f67 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -231,7 +231,7 @@ extern "C" int __declspec(dllexport) Load(void) // window needed for popup commands wchar_t SvcFunc[100]; - mir_sntprintf(SvcFunc, L"%s__PopupWindow", _A2W(WEATHERPROTONAME)); + mir_snwprintf(SvcFunc, L"%s__PopupWindow", _A2W(WEATHERPROTONAME)); hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", SvcFunc, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL); SetWindowLongPtr(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc); diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index bf999c9dea..c9a276a484 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -45,7 +45,7 @@ INT_PTR WeatherAddToList(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 (!mir_tstrcmpi(psr->email.w, dbv.ptszVal)) { + if (!mir_wstrcmpi(psr->email.w, 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)) { @@ -90,7 +90,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) AvatarDownloaded(hContact); wchar_t str[256]; - mir_sntprintf(str, TranslateT("Current weather information for %s."), psr->nick.w); + mir_snwprintf(str, TranslateT("Current weather information for %s."), psr->nick.w); db_set_ts(hContact, WEATHERPROTONAME, "About", str); // make the last update tags to something invalid @@ -109,7 +109,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) opt.DefStn = hContact; if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) { // notification message box - mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal); + mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal); db_free(&dbv); MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION); } @@ -251,7 +251,7 @@ int IDSearchProc(wchar_t *sID, const int searchId, WIIDSEARCH *sData, wchar_t *s // give no station name but only ID if the search is unavailable else wcsncpy(str, TranslateT(""), MAX_DATA_LEN - 1); - mir_sntprintf(newID, L"%s/%s", svc, sID); + mir_snwprintf(newID, L"%s/%s", svc, sID); // set the search result and broadcast it PROTOSEARCHRESULT psr = { sizeof(psr) }; @@ -272,7 +272,7 @@ int IDSearchProc(wchar_t *sID, const int searchId, WIIDSEARCH *sData, wchar_t *s int IDSearch(wchar_t *sID, const int searchId) { // for a normal ID search (ID != #) - if (mir_tstrcmp(sID, L"#")) { + if (mir_wstrcmp(sID, L"#")) { WIDATALIST *Item = WIHead; // search every weather service using the search station ID @@ -322,16 +322,16 @@ int NameSearchProc(wchar_t *name, const int searchId, WINAMESEARCH *sData, wchar // for single result if (sData->Single.Available && (search != NULL || !sData->Multiple.Available)) { // single result // if station ID appears first in the downloaded data - if (!mir_tstrcmpi(sData->Single.First, L"ID")) { + if (!mir_wstrcmpi(sData->Single.First, L"ID")) { GetDataValue(&sData->Single.ID, str, &szInfo); - mir_sntprintf(sID, L"%s/%s", svc, str); + mir_snwprintf(sID, L"%s/%s", svc, str); GetDataValue(&sData->Single.Name, Name, &szInfo); } // if station name appears first in the downloaded data - else if (!mir_tstrcmpi(sData->Single.First, L"NAME")) { + else if (!mir_wstrcmpi(sData->Single.First, L"NAME")) { GetDataValue(&sData->Single.Name, Name, &szInfo); GetDataValue(&sData->Single.ID, str, &szInfo); - mir_sntprintf(sID, L"%s/%s", svc, str); + mir_snwprintf(sID, L"%s/%s", svc, str); } else str[0] = 0; @@ -363,16 +363,16 @@ int NameSearchProc(wchar_t *name, const int searchId, WINAMESEARCH *sData, wchar // search for the next occurrence of the string while (true) { // if station ID appears first in the downloaded data - if (!mir_tstrcmpi(sData->Multiple.First, L"ID")) { + if (!mir_wstrcmpi(sData->Multiple.First, L"ID")) { GetDataValue(&sData->Multiple.ID, str, &szInfo); - mir_sntprintf(sID, L"%s/%s", svc, str); + mir_snwprintf(sID, L"%s/%s", svc, str); GetDataValue(&sData->Multiple.Name, Name, &szInfo); } // if station name appears first in the downloaded data - else if (!mir_tstrcmpi(sData->Multiple.First, L"NAME")) { + else if (!mir_wstrcmpi(sData->Multiple.First, L"NAME")) { GetDataValue(&sData->Multiple.Name, Name, &szInfo); GetDataValue(&sData->Multiple.ID, str, &szInfo); - mir_sntprintf(sID, L"%s/%s", svc, str); + mir_snwprintf(sID, L"%s/%s", svc, str); } else break; diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 77ecbb11cd..80e7d5f970 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -29,7 +29,7 @@ static void OpenUrl(wchar_t* format, wchar_t* id) { wchar_t loc[512]; GetID(id); - mir_sntprintf(loc, format, id); + mir_snwprintf(loc, format, id); Utils_OpenUrlT(loc); } @@ -161,7 +161,7 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) { SetDlgItemText(hwndDlg, IDC_ID, dbv.ptszVal); // check if the station is a default station - CheckDlgButton(hwndDlg, IDC_DEFA, mir_tstrcmp(dbv.ptszVal, opt.Default) != 0 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_DEFA, mir_wstrcmp(dbv.ptszVal, opt.Default) != 0 ? BST_CHECKED : BST_UNCHECKED); db_free(&dbv); } if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) { @@ -272,15 +272,15 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ofn.nMaxFile = _countof(str); // set filters wcsncpy(filter, TranslateT("Text Files"), _countof(filter) - 1); - mir_tstrncat(filter, L" (*.txt)", _countof(filter) - mir_tstrlen(filter)); - pfilter = filter + mir_tstrlen(filter) + 1; + mir_wstrncat(filter, L" (*.txt)", _countof(filter) - mir_wstrlen(filter)); + pfilter = filter + mir_wstrlen(filter) + 1; wcsncpy(pfilter, L"*.txt", _countof(filter) - 1); - pfilter = pfilter + mir_tstrlen(pfilter) + 1; + pfilter = pfilter + mir_wstrlen(pfilter) + 1; wcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - 1); - mir_tstrncat(pfilter, L" (*.*)", _countof(filter) - mir_tstrlen(filter)); - pfilter = pfilter + mir_tstrlen(pfilter) + 1; + mir_wstrncat(pfilter, L" (*.*)", _countof(filter) - mir_wstrlen(filter)); + pfilter = pfilter + mir_wstrlen(pfilter) + 1; wcsncpy(pfilter, L"*.*", _countof(filter) - 1); - pfilter = pfilter + mir_tstrlen(pfilter) + 1; + pfilter = pfilter + mir_wstrlen(pfilter) + 1; *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.nFilterIndex = 1; @@ -343,13 +343,13 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA GetDlgItemText(hwndDlg, IDC_ID, str, _countof(str)); db_set_ts(hContact, WEATHERPROTONAME, "ID", str); if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_DEFA)) { // if default station is set - mir_tstrcpy(opt.Default, str); + mir_wstrcpy(opt.Default, str); opt.DefStn = hContact; db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default); } GetDlgItemText(hwndDlg, IDC_NAME, city, _countof(city)); db_set_ts(hContact, WEATHERPROTONAME, "Nick", city); - mir_sntprintf(str2, TranslateT("Current weather information for %s."), city); + mir_snwprintf(str2, TranslateT("Current weather information for %s."), city); if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)) { GetDlgItemText(hwndDlg, IDC_LOG, str, _countof(str)); db_set_ts(hContact, WEATHERPROTONAME, "Log", str); @@ -436,9 +436,9 @@ int ContactDeleted(WPARAM wParam, LPARAM) removeWindow(wParam); // exit this function if it is not default station - ptrT tszID(db_get_tsa(wParam, WEATHERPROTONAME, "ID")); + ptrW tszID(db_get_tsa(wParam, WEATHERPROTONAME, "ID")); if (tszID != NULL) - if (mir_tstrcmp(tszID, opt.Default)) + if (mir_wstrcmp(tszID, opt.Default)) return 0; // now the default station is deleted, try to get a new one @@ -451,13 +451,13 @@ int ContactDeleted(WPARAM wParam, LPARAM) // if the station is not a default station, set it as the new default station // this is the first weather station encountered from the search - if (mir_tstrcmp(opt.Default, tszID)) { + if (mir_wstrcmp(opt.Default, tszID)) { wcsncpy_s(opt.Default, tszID, _TRUNCATE); opt.DefStn = hContact; - ptrT tszNick(db_get_tsa(hContact, WEATHERPROTONAME, "Nick")); + ptrW tszNick(db_get_tsa(hContact, WEATHERPROTONAME, "Nick")); if (tszNick != NULL) { wchar_t str[255]; - mir_sntprintf(str, TranslateT("%s is now the default weather station"), (wchar_t*)tszNick); + mir_snwprintf(str, TranslateT("%s is now the default weather station"), (wchar_t*)tszNick); MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION); } db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default); diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index 44805cc451..168fd77d09 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -64,9 +64,9 @@ static void numToStr(double num, wchar_t *str, size_t strSize) if (i < 0 && (w || r)) w = -w; if (r) - mir_sntprintf(str, strSize, L"%i.%i", w, r); + mir_snwprintf(str, strSize, L"%i.%i", w, r); else - mir_sntprintf(str, strSize, L"%i", w); + mir_snwprintf(str, strSize, L"%i", w); } //============ UNIT CONVERSIONS ============ @@ -83,15 +83,15 @@ void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t* str) TrimString(tempchar); if (tempchar[0] == '-' && tempchar[1] == ' ') - memmove(&tempchar[1], &tempchar[2], sizeof(wchar_t)*(mir_tstrlen(&tempchar[2]) + 1)); + memmove(&tempchar[1], &tempchar[2], sizeof(wchar_t)*(mir_wstrlen(&tempchar[2]) + 1)); // quit if the value obtained is N/A or not a number - if (!mir_tstrcmp(tempchar, NODATA) || !mir_tstrcmp(tempchar, L"N/A")) { - mir_tstrcpy(str, tempchar); + if (!mir_wstrcmp(tempchar, NODATA) || !mir_wstrcmp(tempchar, L"N/A")) { + mir_wstrcpy(str, tempchar); return; } if (!is_number(tempchar)) { - mir_tstrcpy(str, NODATA); + mir_wstrcpy(str, NODATA); return; } @@ -99,8 +99,8 @@ void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t* str) temp = _wtof(tempchar); // convert all to F first - if (!mir_tstrcmpi(unit, L"C")) temp = (temp * 9 / 5) + 32; - else if (!mir_tstrcmpi(unit, L"K")) temp = ((temp - 273.15) * 9 / 5) + 32; + if (!mir_wstrcmpi(unit, L"C")) temp = (temp * 9 / 5) + 32; + else if (!mir_wstrcmpi(unit, L"K")) temp = ((temp - 273.15) * 9 / 5) + 32; // convert to apporiate unit switch (opt.tUnit) { @@ -110,7 +110,7 @@ void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t* str) if (opt.DoNotAppendUnit) wcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE); else - mir_sntprintf(str, MAX_DATA_LEN, L"%s%sC", tstr, opt.DegreeSign); + mir_snwprintf(str, MAX_DATA_LEN, L"%s%sC", tstr, opt.DegreeSign); break; case 2: @@ -118,7 +118,7 @@ void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t* str) if (opt.DoNotAppendUnit) wcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE); else - mir_sntprintf(str, MAX_DATA_LEN, L"%s%sF", tstr, opt.DegreeSign); + mir_snwprintf(str, MAX_DATA_LEN, L"%s%sF", tstr, opt.DegreeSign); break; } } @@ -137,44 +137,44 @@ void GetPressure(wchar_t *tempchar, wchar_t *unit, wchar_t* str) // if it end up with 0, then it's not a number, return the original string and quit output = _wtof(tempchar); if (output == 0) { - mir_tstrcpy(str, tempchar); + mir_wstrcpy(str, tempchar); return; } // convert all to mb first - if (!mir_tstrcmpi(unit, L"KPA")) + if (!mir_wstrcmpi(unit, L"KPA")) tempunit = (double)output * 10; - else if (!mir_tstrcmpi(unit, L"HPA")) + else if (!mir_wstrcmpi(unit, L"HPA")) tempunit = (double)output; - else if (!mir_tstrcmpi(unit, L"MB")) + else if (!mir_wstrcmpi(unit, L"MB")) tempunit = (double)output; - else if (!mir_tstrcmpi(unit, L"IN")) + else if (!mir_wstrcmpi(unit, L"IN")) tempunit = (double)output * 33.86388; - else if (!mir_tstrcmpi(unit, L"MM")) + else if (!mir_wstrcmpi(unit, L"MM")) tempunit = (double)output * 1.33322; - else if (!mir_tstrcmpi(unit, L"TORR")) + else if (!mir_wstrcmpi(unit, L"TORR")) tempunit = (double)output * 1.33322; // convert to apporiate unit switch (opt.pUnit) { case 1: intunit = (int)(tempunit + 0.5); - mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("kPa")); + mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("kPa")); break; case 2: intunit = (int)(tempunit + 0.5); - mir_sntprintf(str, MAX_DATA_LEN, L"%i %s", intunit, opt.DoNotAppendUnit ? L"" : TranslateT("mb")); + mir_snwprintf(str, MAX_DATA_LEN, L"%i %s", intunit, opt.DoNotAppendUnit ? L"" : TranslateT("mb")); break; case 3: intunit = (int)((tempunit * 10 / 33.86388) + 0.5); - mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("in")); + mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("in")); break; case 4: intunit = (int)((tempunit * 10 / 1.33322) + 0.5); - mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("mm")); + mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("mm")); break; default: - mir_tstrcpy(str, tempchar); + mir_wstrcpy(str, tempchar); break; } @@ -199,32 +199,32 @@ void GetSpeed(wchar_t *tempchar, wchar_t *unit, wchar_t *str) return; // convert all to m/s first - if (!mir_tstrcmpi(unit, L"KM/H")) + if (!mir_wstrcmpi(unit, L"KM/H")) tempunit /= 3.6; - // else if ( !mir_tstrcmpi(unit, L"M/S") + // else if ( !mir_wstrcmpi(unit, L"M/S") // tempunit = tempunit; - else if (!mir_tstrcmpi(unit, L"MPH")) + else if (!mir_wstrcmpi(unit, L"MPH")) tempunit *= 0.44704; - else if (!mir_tstrcmpi(unit, L"KNOTS")) + else if (!mir_wstrcmpi(unit, L"KNOTS")) tempunit *= 0.514444; // convert to apporiate unit switch (opt.wUnit) { case 1: numToStr(tempunit * 3.6, tstr, _countof(tstr)); - mir_sntprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("km/h")); + mir_snwprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("km/h")); break; case 2: numToStr(tempunit, tstr, _countof(tstr)); - mir_sntprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("m/s")); + mir_snwprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("m/s")); break; case 3: numToStr(tempunit / 0.44704, tstr, _countof(tstr)); - mir_sntprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("mph")); + mir_snwprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("mph")); break; case 4: numToStr(tempunit / 0.514444, tstr, _countof(tstr)); - mir_sntprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("knots")); + mir_snwprintf(str, MAX_DATA_LEN, L"%s %s", tstr, opt.DoNotAppendUnit ? L"" : TranslateT("knots")); break; } } @@ -243,28 +243,28 @@ void GetDist(wchar_t *tempchar, wchar_t *unit, wchar_t *str) // if it end up with 0, then it's not a number, return the original string and quit output = _wtof(tempchar); if (output == 0) { - mir_tstrcpy(str, tempchar); + mir_wstrcpy(str, tempchar); return; } // convert all to km first - if (!mir_tstrcmpi(unit, L"KM")) + if (!mir_wstrcmpi(unit, L"KM")) tempunit = (double)output; - else if (!mir_tstrcmpi(unit, L"MILES")) + else if (!mir_wstrcmpi(unit, L"MILES")) tempunit = (double)output * 1.609; // convert to apporiate unit switch (opt.vUnit) { case 1: intunit = (int)((tempunit * 10) + 0.5); - mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("km")); + mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("km")); break; case 2: intunit = (int)((tempunit * 10 / 1.609) + 0.5); - mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("miles")); + mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("miles")); break; default: - mir_tstrcpy(str, tempchar); + mir_wstrcpy(str, tempchar); break; } } @@ -283,28 +283,28 @@ void GetElev(wchar_t *tempchar, wchar_t *unit, wchar_t *str) // if it end up with 0, then it's not a number, return the original string and quit output = _wtof(tempchar); if (output == 0) { - mir_tstrcpy(str, tempchar); + mir_wstrcpy(str, tempchar); return; } // convert all to m first - if (!mir_tstrcmpi(unit, L"M")) + if (!mir_wstrcmpi(unit, L"M")) tempunit = (double)output; - else if (!mir_tstrcmpi(unit, L"FT")) + else if (!mir_wstrcmpi(unit, L"FT")) tempunit = (double)output / 3.28; // convert to apporiate unit switch (opt.eUnit) { case 1: intunit = (int)((tempunit * 10 * 3.28) + 0.5); - mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("ft")); + mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("ft")); break; case 2: intunit = (int)((tempunit * 10) + 0.5); - mir_sntprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("m")); + mir_snwprintf(str, MAX_DATA_LEN, L"%i.%i %s", intunit / 10, intunit % 10, opt.DoNotAppendUnit ? L"" : TranslateT("m")); break; default: - mir_tstrcpy(str, tempchar); + mir_wstrcpy(str, tempchar); break; } } @@ -390,13 +390,13 @@ WORD GetIcon(const wchar_t* cond, WIDATA *Data) do { j++; // using the format _T("# Weather #" - mir_sntprintf(LangPackStr, L"# Weather %s %i #", statusStr[i], j); + mir_snwprintf(LangPackStr, L"# Weather %s %i #", statusStr[i], j); wcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE); - CharLowerBuff(LangPackStr1, (DWORD)mir_tstrlen(LangPackStr1)); + CharLowerBuff(LangPackStr1, (DWORD)mir_wstrlen(LangPackStr1)); if (wcsstr(cond, LangPackStr1) != NULL) return statusValue[i]; // loop until the translation string exists (ie, the translated string is differ from original) - } while (mir_tstrcmp(TranslateTS(LangPackStr), LangPackStr)); + } while (mir_wstrcmp(TranslateTS(LangPackStr), LangPackStr)); } return NA; @@ -409,7 +409,7 @@ void CaseConv(wchar_t *str) { BOOL nextUp = TRUE; - CharLowerBuff(str, (DWORD)mir_tstrlen(str)); + CharLowerBuff(str, (DWORD)mir_wstrlen(str)); for (wchar_t *pstr = str; *pstr; pstr++) { if (*pstr == ' ' || *pstr == '-') nextUp = TRUE; @@ -496,16 +496,16 @@ wchar_t* GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str) str[0] = 0; // looking character by character - for (i = 0; i < mir_tstrlen(dis); i++) { + for (i = 0; i < mir_wstrlen(dis); i++) { // for the escape characters if (dis[i] == '\\') { i++; chr = dis[i]; switch (chr) { - case '%': mir_tstrcat(str, L"%"); break; - case 't': mir_tstrcat(str, L"\t"); break; - case 'n': mir_tstrcat(str, L"\r\n"); break; - case '\\': mir_tstrcat(str, L"\\"); break; + case '%': mir_wstrcat(str, L"%"); break; + case 't': mir_wstrcat(str, L"\t"); break; + case 'n': mir_wstrcat(str, L"\r\n"); break; + case '\\': mir_wstrcat(str, L"\\"); break; } } @@ -516,41 +516,41 @@ wchar_t* GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str) // turn capitalized characters to small case if (chr < 'a' && chr != '[' && chr != '%') chr = (char)((int)chr + 32); switch (chr) { - case 'c': mir_tstrcat(str, w->cond); break; + case 'c': mir_wstrcat(str, w->cond); break; case 'd': // get the current date GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, lpzDate, _countof(lpzDate)); - mir_tstrcat(str, lpzDate); break; - case 'e': mir_tstrcat(str, w->dewpoint); break; - case 'f': mir_tstrcat(str, w->feel); break; - case 'h': mir_tstrcat(str, w->high); break; - case 'i': mir_tstrcat(str, w->winddir); break; - case 'l': mir_tstrcat(str, w->low); break; - case 'm': mir_tstrcat(str, w->humid); break; - case 'n': mir_tstrcat(str, w->city); break; - case 'p': mir_tstrcat(str, w->pressure); break; - case 'r': mir_tstrcat(str, w->sunrise); break; - case 's': mir_tstrcat(str, w->id); break; - case 't': mir_tstrcat(str, w->temp); break; + mir_wstrcat(str, lpzDate); break; + case 'e': mir_wstrcat(str, w->dewpoint); break; + case 'f': mir_wstrcat(str, w->feel); break; + case 'h': mir_wstrcat(str, w->high); break; + case 'i': mir_wstrcat(str, w->winddir); break; + case 'l': mir_wstrcat(str, w->low); break; + case 'm': mir_wstrcat(str, w->humid); break; + case 'n': mir_wstrcat(str, w->city); break; + case 'p': mir_wstrcat(str, w->pressure); break; + case 'r': mir_wstrcat(str, w->sunrise); break; + case 's': mir_wstrcat(str, w->id); break; + case 't': mir_wstrcat(str, w->temp); break; case 'u': - if (mir_tstrcmp(w->update, NODATA)) mir_tstrcat(str, w->update); - else mir_tstrcat(str, TranslateT("")); + if (mir_wstrcmp(w->update, NODATA)) mir_wstrcat(str, w->update); + else mir_wstrcat(str, TranslateT("")); break; - case 'v': mir_tstrcat(str, w->vis); break; - case 'w': mir_tstrcat(str, w->wind); break; - case 'y': mir_tstrcat(str, w->sunset); break; - case '%': mir_tstrcat(str, L"%"); break; + case 'v': mir_wstrcat(str, w->vis); break; + case 'w': mir_wstrcat(str, w->wind); break; + case 'y': mir_wstrcat(str, w->sunset); break; + case '%': mir_wstrcat(str, L"%"); break; case '[': // custom variables i++; name[0] = 0; // read the entire variable name - while (dis[i] != ']' && i < mir_tstrlen(dis)) { + while (dis[i] != ']' && i < mir_wstrlen(dis)) { mir_snprintf(temp, "%c", dis[i++]); mir_strcat(name, temp); } // access the database to get its value if (!db_get_ts(w->hContact, WEATHERCONDITION, name, &dbv)) { if (dbv.ptszVal != TranslateTS(NODATA) && dbv.ptszVal != TranslateT("")) - mir_tstrcat(str, dbv.ptszVal); + mir_wstrcat(str, dbv.ptszVal); db_free(&dbv); } break; @@ -558,8 +558,8 @@ wchar_t* GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str) } // if the character is not a variable, write the original character to the new string else { - mir_sntprintf(lpzDate, L"%c", dis[i]); - mir_tstrcat(str, lpzDate); + mir_snwprintf(lpzDate, L"%c", dis[i]); + mir_wstrcat(str, lpzDate); } } @@ -591,7 +591,7 @@ void GetSvc(wchar_t *pszID) void GetID(wchar_t *pszID) { wchar_t *chop = wcsstr(pszID, L"/"); - if (chop != NULL) mir_tstrcpy(pszID, chop + 1); + if (chop != NULL) mir_wstrcpy(pszID, chop + 1); else pszID[0] = 0; } @@ -631,9 +631,9 @@ wchar_t *GetError(int code) case 503: str = E503; break; case 504: str = E504; break; default: - mir_sntprintf(str2, TranslateT("HTTP Error %i"), code); + mir_snwprintf(str2, TranslateT("HTTP Error %i"), code); str = str2; break; } - return mir_tstrdup(str); + return mir_wstrdup(str); } diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index 88e9ca12e4..f8df3f7f18 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -142,7 +142,7 @@ void EraseAllInfo() opt.DefStn = hContact; if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) { - mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal); + mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal); db_free(&dbv); MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION); } @@ -150,7 +150,7 @@ void EraseAllInfo() // get the handle of the default station if (opt.DefStn == NULL) { if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) { - if (!mir_tstrcmp(dbv.ptszVal, opt.Default)) + if (!mir_wstrcmp(dbv.ptszVal, opt.Default)) opt.DefStn = hContact; db_free(&dbv); } @@ -169,7 +169,7 @@ void EraseAllInfo() } opt.DefStn = LastContact; if (!db_get_ts(LastContact, WEATHERPROTONAME, "Nick", &dbv)) { - mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal); + mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal); db_free(&dbv); MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION); } @@ -183,57 +183,57 @@ void ConvertDataValue(WIDATAITEM *UpdateData, wchar_t *Data) wchar_t str[MAX_DATA_LEN]; // convert the unit - if (mir_tstrcmp(Data, TranslateT("")) && mir_tstrcmp(Data, NODATA) && mir_tstrcmp(Data, TranslateTS(NODATA))) { + if (mir_wstrcmp(Data, TranslateT("")) && mir_wstrcmp(Data, NODATA) && mir_wstrcmp(Data, TranslateTS(NODATA))) { // temperature - if (!mir_tstrcmp(UpdateData->Name, L"Temperature") || !mir_tstrcmp(UpdateData->Name, L"High") || - !mir_tstrcmp(UpdateData->Name, L"Low") || !mir_tstrcmp(UpdateData->Name, L"Feel") || - !mir_tstrcmp(UpdateData->Name, L"Dewpoint") || - !mir_tstrcmpi(UpdateData->Unit, L"C") || !mir_tstrcmpi(UpdateData->Unit, L"F") || - !mir_tstrcmpi(UpdateData->Unit, L"K")) { + if (!mir_wstrcmp(UpdateData->Name, L"Temperature") || !mir_wstrcmp(UpdateData->Name, L"High") || + !mir_wstrcmp(UpdateData->Name, L"Low") || !mir_wstrcmp(UpdateData->Name, L"Feel") || + !mir_wstrcmp(UpdateData->Name, L"Dewpoint") || + !mir_wstrcmpi(UpdateData->Unit, L"C") || !mir_wstrcmpi(UpdateData->Unit, L"F") || + !mir_wstrcmpi(UpdateData->Unit, L"K")) { GetTemp(Data, UpdateData->Unit, str); - mir_tstrcpy(Data, str); + mir_wstrcpy(Data, str); } // pressure - else if (!mir_tstrcmp(UpdateData->Name, L"Pressure") || !mir_tstrcmpi(UpdateData->Unit, L"HPA") || - !mir_tstrcmpi(UpdateData->Unit, L"KPA") || !mir_tstrcmpi(UpdateData->Unit, L"MB") || - !mir_tstrcmpi(UpdateData->Unit, L"TORR") || !mir_tstrcmpi(UpdateData->Unit, L"IN") || - !mir_tstrcmpi(UpdateData->Unit, L"MM")) { + else if (!mir_wstrcmp(UpdateData->Name, L"Pressure") || !mir_wstrcmpi(UpdateData->Unit, L"HPA") || + !mir_wstrcmpi(UpdateData->Unit, L"KPA") || !mir_wstrcmpi(UpdateData->Unit, L"MB") || + !mir_wstrcmpi(UpdateData->Unit, L"TORR") || !mir_wstrcmpi(UpdateData->Unit, L"IN") || + !mir_wstrcmpi(UpdateData->Unit, L"MM")) { GetPressure(Data, UpdateData->Unit, str); - mir_tstrcpy(Data, str); + mir_wstrcpy(Data, str); } // speed - else if (!mir_tstrcmp(UpdateData->Name, L"Wind Speed") || !mir_tstrcmpi(UpdateData->Unit, L"KM/H") || - !mir_tstrcmpi(UpdateData->Unit, L"M/S") || !mir_tstrcmpi(UpdateData->Unit, L"MPH") || - !mir_tstrcmpi(UpdateData->Unit, L"KNOTS")) { + else if (!mir_wstrcmp(UpdateData->Name, L"Wind Speed") || !mir_wstrcmpi(UpdateData->Unit, L"KM/H") || + !mir_wstrcmpi(UpdateData->Unit, L"M/S") || !mir_wstrcmpi(UpdateData->Unit, L"MPH") || + !mir_wstrcmpi(UpdateData->Unit, L"KNOTS")) { GetSpeed(Data, UpdateData->Unit, str); - mir_tstrcpy(Data, str); + mir_wstrcpy(Data, str); } // visibility - else if (!mir_tstrcmp(UpdateData->Name, L"Visibility") || !mir_tstrcmpi(UpdateData->Unit, L"KM") || - !mir_tstrcmpi(UpdateData->Unit, L"MILES")) { + else if (!mir_wstrcmp(UpdateData->Name, L"Visibility") || !mir_wstrcmpi(UpdateData->Unit, L"KM") || + !mir_wstrcmpi(UpdateData->Unit, L"MILES")) { GetDist(Data, UpdateData->Unit, str); - mir_tstrcpy(Data, str); + mir_wstrcpy(Data, str); } // elevation - else if (!mir_tstrcmp(UpdateData->Name, L"Elevation") || !mir_tstrcmpi(UpdateData->Unit, L"FT") || - !mir_tstrcmpi(UpdateData->Unit, L"M")) { + else if (!mir_wstrcmp(UpdateData->Name, L"Elevation") || !mir_wstrcmpi(UpdateData->Unit, L"FT") || + !mir_wstrcmpi(UpdateData->Unit, L"M")) { GetElev(Data, UpdateData->Unit, str); - mir_tstrcpy(Data, str); + mir_wstrcpy(Data, str); } // converting case for condition to the upper+lower format - else if (!mir_tstrcmpi(UpdateData->Unit, L"COND")) + else if (!mir_wstrcmpi(UpdateData->Unit, L"COND")) CaseConv(Data); // degree sign - else if (!mir_tstrcmpi(UpdateData->Unit, L"DEG")) { - if (!opt.DoNotAppendUnit) mir_tstrcat(Data, opt.DegreeSign); + else if (!mir_wstrcmpi(UpdateData->Unit, L"DEG")) { + if (!opt.DoNotAppendUnit) mir_wstrcat(Data, opt.DegreeSign); } // percent sign - else if (!mir_tstrcmpi(UpdateData->Unit, L"%")) { - if (!opt.DoNotAppendUnit) mir_tstrcat(Data, L"%"); + else if (!mir_wstrcmpi(UpdateData->Unit, L"%")) { + if (!opt.DoNotAppendUnit) mir_wstrcat(Data, L"%"); } // truncating strings for day/month to 2 or 3 characters - else if (!mir_tstrcmpi(UpdateData->Unit, L"DAY") || !mir_tstrcmpi(UpdateData->Unit, L"MONTH")) - if (opt.dUnit > 1 && mir_tstrlen(Data) > opt.dUnit) + else if (!mir_wstrcmpi(UpdateData->Unit, L"DAY") || !mir_wstrcmpi(UpdateData->Unit, L"MONTH")) + if (opt.dUnit > 1 && mir_wstrlen(Data) > opt.dUnit) Data[opt.dUnit] = '\0'; } } @@ -261,7 +261,7 @@ void GetDataValue(WIDATAITEM *UpdateData, wchar_t *Data, wchar_t** szData) start = wcsstr(szInfo, UpdateData->Start); if (start != NULL) { // set the starting location for getting data - start += mir_tstrlen(UpdateData->Start); + start += mir_wstrlen(UpdateData->Start); szInfo = start; } } @@ -276,7 +276,7 @@ void GetDataValue(WIDATAITEM *UpdateData, wchar_t *Data, wchar_t** szData) // set the ending location startloc = 0; endloc = end - szInfo; - end += mir_tstrlen(UpdateData->End); + end += mir_wstrlen(UpdateData->End); last = '\n'; } @@ -315,8 +315,8 @@ void GetDataValue(WIDATAITEM *UpdateData, wchar_t *Data, wchar_t** szData) ++startloc; // prevent crashes if the string go over maximun length -> generate an error if (respos >= MAX_DATA_LEN) { - if (opt.ShowWarnings && UpdateData->Name[0] != 0 && mir_tstrcmp(UpdateData->Name, L"Ignore")) { - mir_sntprintf(Data, MAX_DATA_LEN, TranslateT("Error when obtaining data: %s"), UpdateData->Name); + if (opt.ShowWarnings && UpdateData->Name[0] != 0 && mir_wstrcmp(UpdateData->Name, L"Ignore")) { + mir_snwprintf(Data, MAX_DATA_LEN, TranslateT("Error when obtaining data: %s"), UpdateData->Name); WPShowMessage(Data, SM_WARNING); } wcsncpy(Data, TranslateT(""), MAX_DATA_LEN); diff --git a/plugins/Weather/src/weather_http.cpp b/plugins/Weather/src/weather_http.cpp index 5567dff83f..7b48509a4d 100644 --- a/plugins/Weather/src/weather_http.cpp +++ b/plugins/Weather/src/weather_http.cpp @@ -79,7 +79,7 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **s // if the data does not downloaded successfully (ie. disconnected), then return 1000 as error code *szData = (wchar_t*)mir_alloc(512); // store the error code in szData - mir_tstrcpy(*szData, L"NetLib error occurred!!"); + mir_wstrcpy(*szData, L"NetLib error occurred!!"); hNetlibHttp = NULL; return NLHRF_REDIRECT; } @@ -126,9 +126,9 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **s wchar_t *retVal = NULL; if (bIsUtf) - retVal = mir_utf8decodeT(nlhrReply->pData); + retVal = mir_utf8decodeW(nlhrReply->pData); if (retVal == NULL) - retVal = mir_a2t(nlhrReply->pData); + retVal = mir_a2u(nlhrReply->pData); *szData = retVal; } else result = DATA_EMPTY; @@ -137,7 +137,7 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **s else { *szData = (wchar_t*)mir_alloc(512); // store the error code in szData - mir_sntprintf(*szData, 512, L"Error occured! HTTP Error: %i\n", nlhrReply->resultCode); + mir_snwprintf(*szData, 512, L"Error occured! HTTP Error: %i\n", nlhrReply->resultCode); result = nlhrReply->resultCode; } diff --git a/plugins/Weather/src/weather_info.cpp b/plugins/Weather/src/weather_info.cpp index f0b3ca4eac..e6ed5291e9 100644 --- a/plugins/Weather/src/weather_info.cpp +++ b/plugins/Weather/src/weather_info.cpp @@ -147,54 +147,54 @@ void GetINIInfo(wchar_t *pszSvc) WIDATA *sData = GetWIData(pszSvc); // if the service does not exist among the loaded INI's if (sData == NULL) { - mir_sntprintf(str2, TranslateT("The corresponding INI file for \"%s\" is not found."), pszSvc); + mir_snwprintf(str2, TranslateT("The corresponding INI file for \"%s\" is not found."), pszSvc); MessageBox(NULL, str2, TranslateT("Weather INI information"), MB_OK | MB_ICONINFORMATION); } // if exist, get the information else { - mir_sntprintf(str2, TranslateT("Weather INI information for \"%s\":"), pszSvc); - mir_tstrncat(str2, L"\n\n", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, TranslateT("Name:"), _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\t\t", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, sData->DisplayName, _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, TranslateT("Internal Name:"), _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\t", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, sData->InternalName, _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, TranslateT("Author:"), _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\t\t", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, sData->Author, _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, TranslateT("Version:"), _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\t\t", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, sData->Version, _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, TranslateT("INI Version:"), _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\t", _countof(str2) - mir_tstrlen(str2)); + mir_snwprintf(str2, TranslateT("Weather INI information for \"%s\":"), pszSvc); + mir_wstrncat(str2, L"\n\n", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, TranslateT("Name:"), _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\t\t", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, sData->DisplayName, _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, TranslateT("Internal Name:"), _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\t", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, sData->InternalName, _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, TranslateT("Author:"), _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\t\t", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, sData->Author, _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, TranslateT("Version:"), _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\t\t", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, sData->Version, _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, TranslateT("INI Version:"), _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\t", _countof(str2) - mir_wstrlen(str2)); switch (sData->InternalVer) { - case 1: mir_tstrncat(str2, L"1.0", _countof(str2) - mir_tstrlen(str2)); break; - case 2: mir_tstrncat(str2, L"1.1", _countof(str2) - mir_tstrlen(str2)); break; - case 3: mir_tstrncat(str2, L"1.1a", _countof(str2) - mir_tstrlen(str2)); break; - case 4: mir_tstrncat(str2, L"1.2", _countof(str2) - mir_tstrlen(str2)); break; - case 5: mir_tstrncat(str2, L"1.3", _countof(str2) - mir_tstrlen(str2)); break; - case 6: mir_tstrncat(str2, L"1.4", _countof(str2) - mir_tstrlen(str2)); break; - case 7: mir_tstrncat(str2, L"1.5", _countof(str2) - mir_tstrlen(str2)); break; + case 1: mir_wstrncat(str2, L"1.0", _countof(str2) - mir_wstrlen(str2)); break; + case 2: mir_wstrncat(str2, L"1.1", _countof(str2) - mir_wstrlen(str2)); break; + case 3: mir_wstrncat(str2, L"1.1a", _countof(str2) - mir_wstrlen(str2)); break; + case 4: mir_wstrncat(str2, L"1.2", _countof(str2) - mir_wstrlen(str2)); break; + case 5: mir_wstrncat(str2, L"1.3", _countof(str2) - mir_wstrlen(str2)); break; + case 6: mir_wstrncat(str2, L"1.4", _countof(str2) - mir_wstrlen(str2)); break; + case 7: mir_wstrncat(str2, L"1.5", _countof(str2) - mir_wstrlen(str2)); break; } - mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, TranslateT("File Name:"), _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\t", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, sData->ShortFileName, _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, TranslateT("Item Count:"), _countof(str2) - mir_tstrlen(str2)); - mir_sntprintf(str2, L"%s\t%i\n", str2, sData->UpdateDataCount); - mir_tstrncat(str2, TranslateT("Memory Used:"), _countof(str2) - mir_tstrlen(str2)); - mir_sntprintf(str2, L"%s\t%i ", str2, sData->MemUsed); - mir_tstrncat(str2, TranslateT("bytes"), _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\n\n", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, TranslateT("Description:"), _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, L"\n", _countof(str2) - mir_tstrlen(str2)); - mir_tstrncat(str2, sData->Description, _countof(str2) - mir_tstrlen(str2)); + mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, TranslateT("File Name:"), _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\t", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, sData->ShortFileName, _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, TranslateT("Item Count:"), _countof(str2) - mir_wstrlen(str2)); + mir_snwprintf(str2, L"%s\t%i\n", str2, sData->UpdateDataCount); + mir_wstrncat(str2, TranslateT("Memory Used:"), _countof(str2) - mir_wstrlen(str2)); + mir_snwprintf(str2, L"%s\t%i ", str2, sData->MemUsed); + mir_wstrncat(str2, TranslateT("bytes"), _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\n\n", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, TranslateT("Description:"), _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, L"\n", _countof(str2) - mir_wstrlen(str2)); + mir_wstrncat(str2, sData->Description, _countof(str2) - mir_wstrlen(str2)); // display the message box and quit MessageBox(NULL, str2, TranslateT("Weather INI information"), MB_OK | MB_ICONINFORMATION); @@ -211,20 +211,20 @@ void MoreVarList(void) // heading wcsncpy(str, VARS_LIST, _countof(str) - 1); - mir_tstrncat(str, L"\n\n", _countof(str) - mir_tstrlen(str)); + mir_wstrncat(str, L"\n\n", _countof(str) - mir_wstrlen(str)); // loop through all weather services to find custom variables for (WIDATALIST *Item = WIHead; Item != NULL; Item = Item->next) { // loop through all update items in a service for (WIDATAITEMLIST *WItem = Item->Data.UpdateData; WItem != NULL; WItem = WItem->Next) { // the custom variable is defined as "%[]" // ignore the "hi" item and hidden items - if (mir_tstrcmp(WItem->Item.Name, L"Ignore") && WItem->Item.Name[0] != '#') { - mir_sntprintf(tempstr, L"%c[%s]", '%', WItem->Item.Name); + if (mir_wstrcmp(WItem->Item.Name, L"Ignore") && WItem->Item.Name[0] != '#') { + mir_snwprintf(tempstr, L"%c[%s]", '%', WItem->Item.Name); wchar_t *find = wcsstr(str, tempstr); // if the custom variable does not exist in the list, add it to the list if (find == NULL) { - mir_tstrncat(str, tempstr, _countof(str) - mir_tstrlen(str)); - mir_tstrncat(str, L", ", _countof(str) - mir_tstrlen(str)); + mir_wstrncat(str, tempstr, _countof(str) - mir_wstrlen(str)); + mir_wstrncat(str, L", ", _countof(str) - mir_wstrlen(str)); } } } diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index efa3fb7af2..62514148b2 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -53,7 +53,7 @@ WIDATA* GetWIData(wchar_t *pszServ) // loop through the list to find matching internal name for (WIDATALIST *Item = WIHead; Item != NULL; Item = Item->next) // if internal name found, return the data - if (mir_tstrcmp(Item->Data.InternalName, pszServ) == 0) + if (mir_wstrcmp(Item->Data.InternalName, pszServ) == 0) return &Item->Data; // return NULL when no match found @@ -78,7 +78,7 @@ void WIItemListAdd(WIDATAITEM *DataItem, WIDATA *Data) // name = the string to store in the "name" field void ResetDataItem(WIDATAITEM *Item, const wchar_t *name) { - Item->Name = mir_tstrdup(name); + Item->Name = mir_wstrdup(name); Item->Start = L""; Item->End = L""; Item->Unit = L""; @@ -113,7 +113,7 @@ void WICondListAdd(char *str, WICONDLIST *List) { WICONDITEM *newItem = (WICONDITEM*)mir_alloc(sizeof(WICONDITEM)); wSetData(&newItem->Item, str); - CharLowerBuff(newItem->Item, (DWORD)mir_tstrlen(newItem->Item)); + CharLowerBuff(newItem->Item, (DWORD)mir_wstrlen(newItem->Item)); newItem->Next = NULL; if (List->Tail == NULL) List->Head = newItem; else List->Tail->Next = newItem; @@ -183,7 +183,7 @@ static INT_PTR CALLBACK DlgProcSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR wchar_t *chop = wcsrchr(szPath, '\\'); if (chop) { *chop = '\0'; - mir_tstrncat(szPath, L"\\Plugins\\weather\\", _countof(szPath) - mir_tstrlen(szPath)); + mir_wstrncat(szPath, L"\\Plugins\\weather\\", _countof(szPath) - mir_wstrlen(szPath)); if (_wmkdir(szPath) == 0) ShellExecute((HWND)lParam, L"open", szPath, L"", L"", SW_SHOW); } @@ -270,7 +270,7 @@ static void LoadStationData(wchar_t *pszFile, wchar_t *pszShortFile, WIDATA *Dat Data->InternalVer = 7; else { wchar_t str[4096]; - mir_sntprintf(str, TranslateT("Invalid ini format for: %s"), pszFile); + mir_snwprintf(str, TranslateT("Invalid ini format for: %s"), pszFile); MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONERROR); fclose(pfile); return; @@ -323,7 +323,7 @@ static void LoadStationData(wchar_t *pszFile, wchar_t *pszShortFile, WIDATA *Dat // initialize the linked list for update items Data->UpdateDataCount = 0; - Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (mir_tstrlen(pszShortFile) + mir_tstrlen(pszFile) + 20)*sizeof(wchar_t); + Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (mir_wstrlen(pszShortFile) + mir_wstrlen(pszFile) + 20)*sizeof(wchar_t); Data->UpdateData = NULL; Data->UpdateDataTail = NULL; @@ -447,7 +447,7 @@ static void LoadStationData(wchar_t *pszFile, wchar_t *pszShortFile, WIDATA *Dat else if (!_stricmp(ValName, "HIDDEN")) { if (!_stricmp(Value, "TRUE")) { wchar_t *nm = Data->UpdateDataTail->Item.Name; - size_t len = mir_tstrlen(nm) + 1; + size_t len = mir_wstrlen(nm) + 1; Data->UpdateDataTail->Item.Name = nm = (wchar_t*)mir_realloc(nm, sizeof(wchar_t)*(len + 3)); memmove(nm + 1, nm, len*sizeof(wchar_t)); @@ -491,7 +491,7 @@ bool LoadWIData(bool dial) if (chop == NULL) return false; *chop = '\0'; - mir_tstrncat(szSearchPath, L"\\Plugins\\Weather\\*.ini", _countof(szSearchPath) - mir_tstrlen(szSearchPath)); + mir_wstrncat(szSearchPath, L"\\Plugins\\Weather\\*.ini", _countof(szSearchPath) - mir_wstrlen(szSearchPath)); wcsncpy(FileName, szSearchPath, MAX_PATH - 1); WIN32_FIND_DATA fd; @@ -503,8 +503,8 @@ bool LoadWIData(bool dial) do { chop = wcsrchr(FileName, '\\'); chop[1] = '\0'; - mir_tstrncat(FileName, fd.cFileName, _countof(FileName) - mir_tstrlen(FileName)); - if (mir_tstrcmpi(fd.cFileName, L"SAMPLE_INI.INI")) { + mir_wstrncat(FileName, fd.cFileName, _countof(FileName) - mir_wstrlen(FileName)); + if (mir_wstrcmpi(fd.cFileName, L"SAMPLE_INI.INI")) { WIDATA Data; LoadStationData(FileName, fd.cFileName, &Data); if (Data.Enabled) diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 1dd09bf864..aa47bb3580 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -158,15 +158,15 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara { FontIDT fntid = { 0 }; - mir_tstrcpy(fntid.group, _A2W(WEATHERPROTONAME)); - mir_tstrcpy(fntid.name, LPGENW("Frame Font")); + mir_wstrcpy(fntid.group, _A2W(WEATHERPROTONAME)); + mir_wstrcpy(fntid.name, LPGENW("Frame Font")); fntc = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt); - mir_tstrcpy(fntid.name, LPGENW("Frame Title Font")); + mir_wstrcpy(fntid.name, LPGENW("Frame Title Font")); fntc1 = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt1); } - ptrT tszInfo(db_get_tsa(data->hContact, WEATHERCONDITION, "WeatherInfo")); + ptrW tszInfo(db_get_tsa(data->hContact, WEATHERCONDITION, "WeatherInfo")); GetClientRect(hwnd, &rc); @@ -242,7 +242,7 @@ static void addWindow(MCONTACT hContact) return; wchar_t winname[512]; - mir_sntprintf(winname, L"Weather: %s", dbv.ptszVal); + mir_snwprintf(winname, L"Weather: %s", dbv.ptszVal); db_free(&dbv); HWND hWnd = CreateWindow(L"WeatherFrame", L"", WS_CHILD | WS_VISIBLE, @@ -328,8 +328,8 @@ void InitMwin(void) colourid.cbSize = sizeof(ColourIDT); mir_strcpy(colourid.dbSettingsGroup, WEATHERPROTONAME); mir_strcpy(colourid.setting, "ColorMwinFrame"); - mir_tstrcpy(colourid.name, LPGENW("Frame Background")); - mir_tstrcpy(colourid.group, _A2W(WEATHERPROTONAME)); + mir_wstrcpy(colourid.name, LPGENW("Frame Background")); + mir_wstrcpy(colourid.group, _A2W(WEATHERPROTONAME)); colourid.defcolour = GetSysColor(COLOR_3DFACE); ColourRegisterT(&colourid); @@ -337,8 +337,8 @@ void InitMwin(void) fontid.cbSize = sizeof(FontIDT); fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID; mir_strcpy(fontid.dbSettingsGroup, WEATHERPROTONAME); - mir_tstrcpy(fontid.group, _A2W(WEATHERPROTONAME)); - mir_tstrcpy(fontid.name, LPGENW("Frame Font")); + mir_wstrcpy(fontid.group, _A2W(WEATHERPROTONAME)); + mir_wstrcpy(fontid.name, LPGENW("Frame Font")); mir_strcpy(fontid.prefix, "fnt0"); HDC hdc = GetDC(NULL); @@ -346,13 +346,13 @@ void InitMwin(void) ReleaseDC(0, hdc); fontid.deffontsettings.charset = DEFAULT_CHARSET; - mir_tstrcpy(fontid.deffontsettings.szFace, L"Verdana"); - mir_tstrcpy(fontid.backgroundGroup, _A2W(WEATHERPROTONAME)); - mir_tstrcpy(fontid.backgroundName, LPGENW("Frame Background")); + mir_wstrcpy(fontid.deffontsettings.szFace, L"Verdana"); + mir_wstrcpy(fontid.backgroundGroup, _A2W(WEATHERPROTONAME)); + mir_wstrcpy(fontid.backgroundName, LPGENW("Frame Background")); FontRegisterT(&fontid); fontid.deffontsettings.style = DBFONTF_BOLD; - mir_tstrcpy(fontid.name, LPGENW("Frame Title Font")); + mir_wstrcpy(fontid.name, LPGENW("Frame Title Font")); mir_strcpy(fontid.prefix, "fnt1"); FontRegisterT(&fontid); diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index 6f866cd99a..c971ef7857 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -114,7 +114,7 @@ void LoadOptions(void) opt.dUnit = db_get_w(NULL, WEATHERPROTONAME, "dUnit", 1); opt.eUnit = db_get_w(NULL, WEATHERPROTONAME, "eUnit", 2); - ptrT szValue(db_get_tsa(NULL, WEATHERPROTONAME, "DegreeSign")); + ptrW szValue(db_get_tsa(NULL, WEATHERPROTONAME, "DegreeSign")); wcsncpy_s(opt.DegreeSign, (szValue == NULL) ? L"" : szValue, _TRUNCATE); opt.DoNotAppendUnit = db_get_b(NULL, WEATHERPROTONAME, "DoNotAppendUnit", 0); diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index 4e721a07a5..6e1ddba4ea 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -67,8 +67,8 @@ int WeatherError(WPARAM wParam, LPARAM lParam) // setup the popup ppd.lchIcon = (HICON)LoadImage(NULL, MAKEINTRESOURCE(OIC_BANG), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED); - mir_tstrcpy(ppd.lptzContactName, str1); - mir_tstrcpy(ppd.lptzText, str2); + mir_wstrcpy(ppd.lptzContactName, str1); + mir_wstrcpy(ppd.lptzText, str2); ppd.colorBack = (opt.UseWinColors) ? GetSysColor(COLOR_BTNFACE) : opt.BGColour; ppd.colorText = (opt.UseWinColors) ? GetSysColor(COLOR_WINDOWTEXT) : opt.TextColour; ppd.iSeconds = opt.pDelay; @@ -395,9 +395,9 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) case IDC_VAR3: // display variable list wcsncpy(str, L" \n", _countof(str) - 1); // to make the message box wider - mir_tstrncat(str, VAR_LIST_POPUP, _countof(str) - mir_tstrlen(str)); - mir_tstrncat(str, L"\n", _countof(str) - mir_tstrlen(str)); - mir_tstrncat(str, CUSTOM_VARS, _countof(str) - mir_tstrlen(str)); + mir_wstrncat(str, VAR_LIST_POPUP, _countof(str) - mir_wstrlen(str)); + mir_wstrncat(str, L"\n", _countof(str) - mir_wstrlen(str)); + mir_wstrncat(str, CUSTOM_VARS, _countof(str) - mir_wstrlen(str)); MessageBox(NULL, str, TranslateT("Variable List"), MB_OK | MB_ICONASTERISK | MB_TOPMOST); break; diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index cd283324bb..e301a0302d 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -147,12 +147,12 @@ INT_PTR WeatherGetAvatarInfo(WPARAM, LPARAM lParam) return GAIR_NOAVATAR; pai->format = PA_FORMAT_PNG; - mir_sntprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.png", szSearchPath, statusStr[i]); + mir_snwprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.png", szSearchPath, statusStr[i]); if (_waccess(pai->filename, 4) == 0) return GAIR_SUCCESS; pai->format = PA_FORMAT_GIF; - mir_sntprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.gif", szSearchPath, statusStr[i]); + mir_snwprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.gif", szSearchPath, statusStr[i]); if (_waccess(pai->filename, 4) == 0) return GAIR_SUCCESS; diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index 65c814dee1..c6159a10a3 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -56,11 +56,11 @@ int UpdateWeather(MCONTACT hContact) // error occurs if the return value is not equals to 0 if (opt.ShowWarnings) { // show warnings by popup - mir_sntprintf(str, _countof(str) - 105, + mir_snwprintf(str, _countof(str) - 105, TranslateT("Unable to retrieve weather information for %s"), dbv.ptszVal); - mir_tstrncat(str, L"\n", _countof(str) - mir_tstrlen(str)); + mir_wstrncat(str, L"\n", _countof(str) - mir_wstrlen(str)); wchar_t *tszError = GetError(code); - mir_tstrncat(str, tszError, _countof(str) - mir_tstrlen(str)); + mir_wstrncat(str, tszError, _countof(str) - mir_wstrlen(str)); WPShowMessage(str, SM_WARNING); mir_free(tszError); } @@ -76,24 +76,24 @@ int UpdateWeather(MCONTACT hContact) WEATHERINFO winfo = LoadWeatherInfo(hContact); // translate weather condition - mir_tstrcpy(winfo.cond, TranslateTS(winfo.cond)); + mir_wstrcpy(winfo.cond, TranslateTS(winfo.cond)); // 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 (mir_tstrcmpi(winfo.cond, dbv.ptszVal)) Ch = TRUE; // the weather condition is changed + if (mir_wstrcmpi(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 (mir_tstrcmpi(winfo.temp, dbv.ptszVal)) Ch = TRUE; // the temperature is changed + if (mir_wstrcmpi(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 (mir_tstrcmpi(winfo.update, dbv.ptszVal)) Ch = TRUE; // the update time is changed + if (mir_wstrcmpi(winfo.update, dbv.ptszVal)) Ch = TRUE; // the update time is changed db_free(&dbv); } else Ch = TRUE; @@ -104,7 +104,7 @@ int UpdateWeather(MCONTACT hContact) if (!dbres && dbv.ptszVal[0] != 0) { if (opt.AlertPopup && !db_get_b(hContact, WEATHERPROTONAME, "DPopUp", 0) && Ch) { // display alert popup - mir_sntprintf(str, L"Alert for %s%c%s", winfo.city, 255, dbv.ptszVal); + mir_snwprintf(str, L"Alert for %s%c%s", winfo.city, 255, dbv.ptszVal); WPShowMessage(str, SM_WEATHERALERT); } // alert issued, set display to italic @@ -150,7 +150,7 @@ int UpdateWeather(MCONTACT hContact) db_set_b(hContact, WEATHERPROTONAME, "IsUpdated", TRUE); // save info for default weather condition - if (!mir_tstrcmp(winfo.id, opt.Default) && !opt.NoProtoCondition) { + if (!mir_wstrcmp(winfo.id, opt.Default) && !opt.NoProtoCondition) { // save current condition for default station to be displayed after the update old_status = status; status = winfo.status; @@ -458,7 +458,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, L"Condition") && mir_tstrcmpi(Item->Item.Unit, L"Cond")) + if (mir_wstrcmp(Item->Item.Name, L"Condition") && mir_wstrcmpi(Item->Item.Unit, L"Cond")) wcsncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1); break; @@ -488,14 +488,14 @@ int GetWeatherData(MCONTACT hContact) case '[': // variable, add the value to the result string hasvar = TRUE; if (!DBGetData(hContact, _T2A(str2), &dbv)) { - mir_tstrncat(DataValue, dbv.ptszVal, _countof(DataValue) - mir_tstrlen(DataValue)); + mir_wstrncat(DataValue, dbv.ptszVal, _countof(DataValue) - mir_wstrlen(DataValue)); DataValue[_countof(DataValue) - 1] = 0; db_free(&dbv); } break; case'\"': // constant, add it to the result string - mir_tstrncat(DataValue, TranslateTS(str2), _countof(DataValue) - mir_tstrlen(DataValue)); + mir_wstrncat(DataValue, TranslateTS(str2), _countof(DataValue) - mir_wstrlen(DataValue)); DataValue[_countof(DataValue) - 1] = 0; break; } @@ -528,7 +528,7 @@ int GetWeatherData(MCONTACT hContact) break; // exit if break string is not found } *end = '\0'; - end += mir_tstrlen(Item->Item.Break); + end += mir_wstrlen(Item->Item.Break); while (end[0] == ' ') end++; // remove extra space @@ -542,28 +542,28 @@ int GetWeatherData(MCONTACT hContact) } // don't store data if it is not available - if ((DataValue[0] != 0 && mir_tstrcmp(DataValue, NODATA) && - mir_tstrcmp(DataValue, TranslateTS(NODATA)) && mir_tstrcmp(Item->Item.Name, L"Ignore")) || - (!mir_tstrcmp(Item->Item.Name, L"Alert") && i == 0)) { + if ((DataValue[0] != 0 && mir_wstrcmp(DataValue, NODATA) && + mir_wstrcmp(DataValue, TranslateTS(NODATA)) && mir_wstrcmp(Item->Item.Name, L"Ignore")) || + (!mir_wstrcmp(Item->Item.Name, L"Alert") && i == 0)) { // temporary workaround for mToolTip to show feel-like temperature - if (!mir_tstrcmp(Item->Item.Name, L"Feel")) + if (!mir_wstrcmp(Item->Item.Name, L"Feel")) db_set_ts(hContact, WEATHERCONDITION, "Heat Index", DataValue); GetStationID(hContact, Svc, _countof(Svc)); - if (!mir_tstrcmp(Svc, opt.Default)) + if (!mir_wstrcmp(Svc, opt.Default)) db_set_ts(NULL, DEFCURRENTWEATHER, _T2A(Item->Item.Name), DataValue); - if (!mir_tstrcmp(Item->Item.Name, L"Condition")) { + if (!mir_wstrcmp(Item->Item.Name, L"Condition")) { wchar_t buf[128], *cbuf; - mir_sntprintf(buf, L"#%s Weather", DataValue); + mir_snwprintf(buf, L"#%s Weather", DataValue); cbuf = TranslateTS(buf); if (cbuf[0] == '#') cbuf = TranslateTS(DataValue); db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf); - CharLowerBuff(DataValue, (DWORD)mir_tstrlen(DataValue)); + CharLowerBuff(DataValue, (DWORD)mir_wstrlen(DataValue)); cond = GetIcon(DataValue, Data); } - else if (mir_tstrcmpi(Item->Item.Unit, L"Cond") == 0) { + else if (mir_wstrcmpi(Item->Item.Unit, L"Cond") == 0) { wchar_t buf[128], *cbuf; - mir_sntprintf(buf, L"#%s Weather", DataValue); + mir_snwprintf(buf, L"#%s Weather", DataValue); cbuf = TranslateTS(buf); if (cbuf[0] == '#') cbuf = TranslateTS(DataValue); -- cgit v1.2.3