diff options
author | George Hazan <ghazan@miranda.im> | 2021-12-26 16:39:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-12-26 16:39:04 +0300 |
commit | 62a186697df33c96dc1a6dac0f4dfc38652fb96f (patch) | |
tree | 1437d0906218fae8827aed384026f2b7e656f4ac /protocols/Weather | |
parent | fcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (diff) |
BYTE -> uint8_t
Diffstat (limited to 'protocols/Weather')
-rw-r--r-- | protocols/Weather/src/stdafx.h | 32 | ||||
-rw-r--r-- | protocols/Weather/src/weather_contacts.cpp | 20 | ||||
-rw-r--r-- | protocols/Weather/src/weather_data.cpp | 2 | ||||
-rw-r--r-- | protocols/Weather/src/weather_opt.cpp | 34 | ||||
-rw-r--r-- | protocols/Weather/src/weather_popup.cpp | 12 | ||||
-rw-r--r-- | protocols/Weather/src/weather_svcs.cpp | 4 |
6 files changed, 52 insertions, 52 deletions
diff --git a/protocols/Weather/src/stdafx.h b/protocols/Weather/src/stdafx.h index 5d358de96b..bb8f288541 100644 --- a/protocols/Weather/src/stdafx.h +++ b/protocols/Weather/src/stdafx.h @@ -179,13 +179,13 @@ enum EWeatherCondition struct MYOPTIONS { // main options - BYTE AutoUpdate; - BYTE CAutoUpdate; - BYTE StartupUpdate; - BYTE NoProtoCondition; - BYTE UpdateOnlyConditionChanged; - BYTE RemoveOldData; - BYTE MakeItalic; + uint8_t AutoUpdate; + uint8_t CAutoUpdate; + uint8_t StartupUpdate; + uint8_t NoProtoCondition; + uint8_t UpdateOnlyConditionChanged; + uint8_t RemoveOldData; + uint8_t MakeItalic; WORD UpdateTime; WORD AvatarSize; @@ -198,21 +198,21 @@ struct MYOPTIONS WORD dUnit; WORD eUnit; wchar_t DegreeSign[4]; - BYTE DoNotAppendUnit; - BYTE NoFrac; + uint8_t DoNotAppendUnit; + uint8_t NoFrac; // advanced - BYTE DisCondIcon; + uint8_t DisCondIcon; // popup options - BYTE UsePopup; - BYTE UpdatePopup; - BYTE AlertPopup; - BYTE PopupOnChange; - BYTE ShowWarnings; + uint8_t UsePopup; + uint8_t UpdatePopup; + uint8_t AlertPopup; + uint8_t PopupOnChange; + uint8_t ShowWarnings; // popup colors - BYTE UseWinColors; + uint8_t UseWinColors; COLORREF BGColour; COLORREF TextColour; diff --git a/protocols/Weather/src/weather_contacts.cpp b/protocols/Weather/src/weather_contacts.cpp index 559238410b..2833521275 100644 --- a/protocols/Weather/src/weather_contacts.cpp +++ b/protocols/Weather/src/weather_contacts.cpp @@ -175,7 +175,7 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA db_free(&dbv); } // enable/disable the browse button depending on the value of external log checkbox - EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), (BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_External)); // other checkbox options CheckDlgButton(hwndDlg, IDC_DPop, g_plugin.getByte(hContact, "DPopUp", FALSE) ? BST_CHECKED : BST_UNCHECKED); @@ -256,8 +256,8 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case IDC_External: // enable/disable the borwse button depending if the external log is enabled - EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), (BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)); - if (!(BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)) + EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_External)); + if (!(uint8_t)IsDlgButtonChecked(hwndDlg, IDC_External)) return TRUE; __fallthrough; @@ -333,7 +333,7 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // start writing the new settings to database GetDlgItemText(hwndDlg, IDC_ID, str, _countof(str)); g_plugin.setWString(hContact, "ID", str); - if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_DEFA)) { // if default station is set + if ((uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DEFA)) { // if default station is set mir_wstrcpy(opt.Default, str); opt.DefStn = hContact; g_plugin.setWString("Default", opt.Default); @@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA GetDlgItemText(hwndDlg, IDC_NAME, city, _countof(city)); g_plugin.setWString(hContact, "Nick", city); mir_snwprintf(str2, TranslateT("Current weather information for %s."), city); - if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)) { + if ((uint8_t)IsDlgButtonChecked(hwndDlg, IDC_External)) { GetDlgItemText(hwndDlg, IDC_LOG, str, _countof(str)); g_plugin.setWString(hContact, "Log", str); } @@ -356,11 +356,11 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA g_plugin.setWord(hContact, "StatusIcon", -1); AvatarDownloaded(hContact); g_plugin.setWString(hContact, "About", str2); - g_plugin.setByte(hContact, "History", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_Internal)); - g_plugin.setByte(hContact, "Overwrite", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_Overwrite)); - g_plugin.setByte(hContact, "File", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)); - g_plugin.setByte(hContact, "DPopUp", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DPop)); - g_plugin.setByte(hContact, "DAutoUpdate", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DAutoUpdate)); + g_plugin.setByte(hContact, "History", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_Internal)); + g_plugin.setByte(hContact, "Overwrite", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_Overwrite)); + g_plugin.setByte(hContact, "File", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_External)); + g_plugin.setByte(hContact, "DPopUp", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DPop)); + g_plugin.setByte(hContact, "DAutoUpdate", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DAutoUpdate)); // re-enable the protocol and update the data for the station g_plugin.setString(hContact, "LastCondition", "None"); diff --git a/protocols/Weather/src/weather_data.cpp b/protocols/Weather/src/weather_data.cpp index fe668dbfe8..69c92d8cda 100644 --- a/protocols/Weather/src/weather_data.cpp +++ b/protocols/Weather/src/weather_data.cpp @@ -129,7 +129,7 @@ void EraseAllInfo() g_plugin.setByte(hContact, "IsUpdated", FALSE); // reset logging settings if (!g_plugin.getWString(hContact, "Log", &dbv)) { - g_plugin.setByte(hContact, "File", (BYTE)(dbv.pwszVal[0] != 0)); + g_plugin.setByte(hContact, "File", (uint8_t)(dbv.pwszVal[0] != 0)); db_free(&dbv); } else g_plugin.setByte(hContact, "File", FALSE); diff --git a/protocols/Weather/src/weather_opt.cpp b/protocols/Weather/src/weather_opt.cpp index 19173b430b..3a8d7f26dd 100644 --- a/protocols/Weather/src/weather_opt.cpp +++ b/protocols/Weather/src/weather_opt.cpp @@ -137,14 +137,14 @@ void LoadOptions(void) void SaveOptions(void) { // main options - g_plugin.setByte("StartupUpdate", (BYTE)opt.StartupUpdate); - g_plugin.setByte("AutoUpdate", (BYTE)opt.AutoUpdate); + g_plugin.setByte("StartupUpdate", (uint8_t)opt.StartupUpdate); + g_plugin.setByte("AutoUpdate", (uint8_t)opt.AutoUpdate); g_plugin.setWord("UpdateTime", opt.UpdateTime); - g_plugin.setByte("NoStatus", (BYTE)opt.NoProtoCondition); - g_plugin.setByte("CondChangeAsUpdate", (BYTE)opt.UpdateOnlyConditionChanged); - g_plugin.setByte("RemoveOld", (BYTE)opt.RemoveOldData); - g_plugin.setByte("MakeItalic", (BYTE)opt.MakeItalic); - g_plugin.setByte("AvatarSize", (BYTE)opt.AvatarSize); + g_plugin.setByte("NoStatus", (uint8_t)opt.NoProtoCondition); + g_plugin.setByte("CondChangeAsUpdate", (uint8_t)opt.UpdateOnlyConditionChanged); + g_plugin.setByte("RemoveOld", (uint8_t)opt.RemoveOldData); + g_plugin.setByte("MakeItalic", (uint8_t)opt.MakeItalic); + g_plugin.setByte("AvatarSize", (uint8_t)opt.AvatarSize); // units g_plugin.setWord("tUnit", opt.tUnit); @@ -154,23 +154,23 @@ void SaveOptions(void) g_plugin.setWord("dUnit", opt.dUnit); g_plugin.setWord("eUnit", opt.eUnit); g_plugin.setWString("DegreeSign", opt.DegreeSign); - g_plugin.setByte("DoNotAppendUnit", (BYTE)opt.DoNotAppendUnit); - g_plugin.setByte("NoFractions", (BYTE)opt.NoFrac); + g_plugin.setByte("DoNotAppendUnit", (uint8_t)opt.DoNotAppendUnit); + g_plugin.setByte("NoFractions", (uint8_t)opt.NoFrac); // advanced - g_plugin.setByte("DisableConditionIcon", (BYTE)opt.DisCondIcon); + g_plugin.setByte("DisableConditionIcon", (uint8_t)opt.DisCondIcon); // popup options - g_plugin.setByte("UsePopUp", (BYTE)opt.UsePopup); - g_plugin.setByte("UpdatePopup", (BYTE)opt.UpdatePopup); - g_plugin.setByte("AlertPopup", (BYTE)opt.AlertPopup); - g_plugin.setByte("PopUpOnChange", (BYTE)opt.PopupOnChange); - g_plugin.setByte("ShowWarnings", (BYTE)opt.ShowWarnings); + g_plugin.setByte("UsePopUp", (uint8_t)opt.UsePopup); + g_plugin.setByte("UpdatePopup", (uint8_t)opt.UpdatePopup); + g_plugin.setByte("AlertPopup", (uint8_t)opt.AlertPopup); + g_plugin.setByte("PopUpOnChange", (uint8_t)opt.PopupOnChange); + g_plugin.setByte("ShowWarnings", (uint8_t)opt.ShowWarnings); // popup colors g_plugin.setDword("BackgroundColour", opt.BGColour); g_plugin.setDword("TextColour", opt.TextColour); - g_plugin.setByte("UseWinColors", (BYTE)opt.UseWinColors); + g_plugin.setByte("UseWinColors", (uint8_t)opt.UseWinColors); // popup actions g_plugin.setDword("LeftClickAction", opt.LeftClickAction); @@ -279,7 +279,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l opt.AutoUpdate = IsDlgButtonChecked(hdlg, IDC_UPDATE); opt.NoProtoCondition = BST_UNCHECKED == IsDlgButtonChecked(hdlg, IDC_PROTOCOND); opt.DisCondIcon = IsDlgButtonChecked(hdlg, IDC_DISCONDICON); - opt.UpdateOnlyConditionChanged = (BYTE)IsDlgButtonChecked(hdlg, IDC_UPDCONDCHG); + opt.UpdateOnlyConditionChanged = (uint8_t)IsDlgButtonChecked(hdlg, IDC_UPDCONDCHG); opt.RemoveOldData = IsDlgButtonChecked(hdlg, IDC_REMOVEOLD); opt.MakeItalic = IsDlgButtonChecked(hdlg, IDC_MAKEI); opt.AvatarSize = GetDlgItemInt(hdlg, IDC_AVATARSIZE, nullptr, FALSE); diff --git a/protocols/Weather/src/weather_popup.cpp b/protocols/Weather/src/weather_popup.cpp index 1ad47de9fd..94ed3508a4 100644 --- a/protocols/Weather/src/weather_popup.cpp +++ b/protocols/Weather/src/weather_popup.cpp @@ -234,12 +234,12 @@ void ReadPopupOpt(HWND hdlg) opt.pDelay = num; // other options - opt.UseWinColors = (BYTE)IsDlgButtonChecked(hdlg, IDC_USEWINCOLORS); - opt.UsePopup = (BYTE)IsDlgButtonChecked(hdlg, IDC_E); - opt.UpdatePopup = (BYTE)IsDlgButtonChecked(hdlg, IDC_POP1); - opt.AlertPopup = (BYTE)IsDlgButtonChecked(hdlg, IDC_POP2); - opt.PopupOnChange = (BYTE)IsDlgButtonChecked(hdlg, IDC_CH); - opt.ShowWarnings = (BYTE)IsDlgButtonChecked(hdlg, IDC_W); + opt.UseWinColors = (uint8_t)IsDlgButtonChecked(hdlg, IDC_USEWINCOLORS); + opt.UsePopup = (uint8_t)IsDlgButtonChecked(hdlg, IDC_E); + opt.UpdatePopup = (uint8_t)IsDlgButtonChecked(hdlg, IDC_POP1); + opt.AlertPopup = (uint8_t)IsDlgButtonChecked(hdlg, IDC_POP2); + opt.PopupOnChange = (uint8_t)IsDlgButtonChecked(hdlg, IDC_CH); + opt.ShowWarnings = (uint8_t)IsDlgButtonChecked(hdlg, IDC_W); } // copied and modified from NewStatusNotify diff --git a/protocols/Weather/src/weather_svcs.cpp b/protocols/Weather/src/weather_svcs.cpp index 2d143d5172..113669d968 100644 --- a/protocols/Weather/src/weather_svcs.cpp +++ b/protocols/Weather/src/weather_svcs.cpp @@ -288,7 +288,7 @@ void UpdateMenu(BOOL State) { // update option setting opt.CAutoUpdate = State; - g_plugin.setByte("AutoUpdate", (BYTE)State); + g_plugin.setByte("AutoUpdate", (uint8_t)State); if (State) { // to enable auto-update Menu_ModifyItem(hEnableDisableMenu, LPGENW("Auto Update Enabled"), g_plugin.getIconHandle(IDI_ICON)); @@ -306,7 +306,7 @@ void UpdatePopupMenu(BOOL State) { // update option setting opt.UsePopup = State; - g_plugin.setByte("UsePopup", (BYTE)opt.UsePopup); + g_plugin.setByte("UsePopup", (uint8_t)opt.UsePopup); if (State) // to enable popup Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Disable &weather notification"), g_plugin.getIconHandle(IDI_POPUP)); |