From a3139fc57f7d7f6a2d0cbcd6a38041848f24d203 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 24 Jan 2025 19:47:16 +0300 Subject: more code removed --- protocols/Weather/src/stdafx.h | 6 ----- protocols/Weather/src/weather_data.cpp | 47 ---------------------------------- 2 files changed, 53 deletions(-) diff --git a/protocols/Weather/src/stdafx.h b/protocols/Weather/src/stdafx.h index ac1f1bd16f..ebfb15e6f6 100644 --- a/protocols/Weather/src/stdafx.h +++ b/protocols/Weather/src/stdafx.h @@ -165,12 +165,6 @@ wchar_t *GetError(int code); int DBGetData(MCONTACT hContact, char *setting, DBVARIANT *dbv); -void wSetData(char *&Data, const char *Value); -void wSetData(wchar_t *&Data, const char *Value); -void wSetData(wchar_t *&Data, const wchar_t *Value); -void wfree(char *&Data); -void wfree(wchar_t *&Data); - void DBDataManage(MCONTACT hContact, uint16_t Mode, WPARAM wParam, LPARAM lParam); ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/Weather/src/weather_data.cpp b/protocols/Weather/src/weather_data.cpp index 88c1572f43..c926787c81 100644 --- a/protocols/Weather/src/weather_data.cpp +++ b/protocols/Weather/src/weather_data.cpp @@ -345,53 +345,6 @@ void CWeatherProto::GetDataValue(WIDATAITEM *UpdateData, wchar_t *Data, wchar_t *szData = szInfo; } -///////////////////////////////////////////////////////////////////////////////////////// -// copy a string into a new memory location -// Data = the field the data is copied to -// Value = the original string, the string where data is copied from - -bool g_bIsUtf = false; - -void wSetData(char *&Data, const char *Value) -{ - if (Value[0] != 0) - Data = mir_strdup(Value); - else - Data = ""; -} - -void wSetData(wchar_t *&Data, const char *Value) -{ - if (Value[0] != 0) - Data = (g_bIsUtf) ? mir_utf8decodeW(Value) : mir_a2u(Value); - else - Data = L""; -} - -void wSetData(wchar_t *&Data, const wchar_t *Value) -{ - if (Value[0] != 0) - Data = mir_wstrdup(Value); - else - Data = L""; -} - -// A safer free function that free memory for a string -// Data = the string occuping the data to be freed -void wfree(char *&Data) -{ - if (Data && mir_strlen(Data) > 0) - mir_free(Data); - Data = nullptr; -} - -void wfree(wchar_t *&Data) -{ - if (Data && mir_wstrlen(Data) > 0) - mir_free(Data); - Data = nullptr; -} - ///////////////////////////////////////////////////////////////////////////////////////// // get single setting that is found // szSetting = the setting name -- cgit v1.2.3