diff options
author | George Hazan <ghazan@miranda.im> | 2021-12-26 17:06:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-12-26 17:06:04 +0300 |
commit | 1039b2829a264280493ba0fa979214fe024dc70c (patch) | |
tree | 8fa6a60eb46627582c372b56a4a1d4754d6732c3 /protocols/CurrencyRates | |
parent | 62a186697df33c96dc1a6dac0f4dfc38652fb96f (diff) |
WORD -> uint16_t
Diffstat (limited to 'protocols/CurrencyRates')
-rw-r--r-- | protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp | 4 | ||||
-rw-r--r-- | protocols/CurrencyRates/src/CurrencyRatesProviders.cpp | 6 | ||||
-rw-r--r-- | protocols/CurrencyRates/src/ImportExport.cpp | 2 | ||||
-rw-r--r-- | protocols/CurrencyRates/src/SettingsDlg.cpp | 16 | ||||
-rw-r--r-- | protocols/CurrencyRates/src/SettingsDlg.h | 12 |
5 files changed, 20 insertions, 20 deletions
diff --git a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp index 5cf1ab001d..3a9b13cff5 100644 --- a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp +++ b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp @@ -525,8 +525,8 @@ void CCurrencyRatesProviderBase::WriteContactRate(MCONTACT hContact, double dRat CAdvProviderSettings global_settings(this); - WORD dwMode = (bUseContactSpecific) - ? g_plugin.getWord(hContact, DB_STR_CURRENCYRATE_LOG, static_cast<WORD>(lmDisabled)) + uint16_t dwMode = (bUseContactSpecific) + ? g_plugin.getWord(hContact, DB_STR_CURRENCYRATE_LOG, static_cast<uint16_t>(lmDisabled)) : global_settings.GetLogMode(); if (dwMode&lmExternalFile) { bool bAdd = true; diff --git a/protocols/CurrencyRates/src/CurrencyRatesProviders.cpp b/protocols/CurrencyRates/src/CurrencyRatesProviders.cpp index 2e0e1e584e..1b744d01ec 100644 --- a/protocols/CurrencyRates/src/CurrencyRatesProviders.cpp +++ b/protocols/CurrencyRates/src/CurrencyRatesProviders.cpp @@ -23,7 +23,7 @@ void ClearProviders() void convert_contact_settings(MCONTACT hContact) { - WORD dwLogMode = g_plugin.getWord(hContact, DB_STR_CURRENCYRATE_LOG, static_cast<WORD>(lmDisabled)); + uint16_t dwLogMode = g_plugin.getWord(hContact, DB_STR_CURRENCYRATE_LOG, static_cast<uint16_t>(lmDisabled)); if ((dwLogMode&lmInternalHistory) || (dwLogMode&lmExternalFile)) g_plugin.setByte(hContact, DB_STR_CONTACT_SPEC_SETTINGS, 1); } @@ -32,8 +32,8 @@ void InitProviders() { CreateProviders(); - const WORD nCurrentVersion = 17; - WORD nVersion = g_plugin.getWord(LAST_RUN_VERSION, 1); + const uint16_t nCurrentVersion = 17; + uint16_t nVersion = g_plugin.getWord(LAST_RUN_VERSION, 1); for (auto &hContact : Contacts(MODULENAME)) { ICurrencyRatesProvider *pProvider = GetContactProviderPtr(hContact); diff --git a/protocols/CurrencyRates/src/ImportExport.cpp b/protocols/CurrencyRates/src/ImportExport.cpp index f2091a3d0b..dce9989367 100644 --- a/protocols/CurrencyRates/src/ImportExport.cpp +++ b/protocols/CurrencyRates/src/ImportExport.cpp @@ -319,7 +319,7 @@ bool handle_module(MCONTACT hContact, const TiXmlElement *pXmlModule) mir_ptr<uint8_t> buf((uint8_t*)mir_base64_decode(sValue, &bufLen)); if (buf) { dbs.value.pbVal = buf; - dbs.value.cpbVal = (WORD)bufLen; + dbs.value.cpbVal = (uint16_t)bufLen; dbs.value.type = DBVT_BLOB; if (set_contact_settings(hContact, dbs)) diff --git a/protocols/CurrencyRates/src/SettingsDlg.cpp b/protocols/CurrencyRates/src/SettingsDlg.cpp index 70e9b2fe9f..f3134e29be 100644 --- a/protocols/CurrencyRates/src/SettingsDlg.cpp +++ b/protocols/CurrencyRates/src/SettingsDlg.cpp @@ -242,13 +242,13 @@ INT_PTR CALLBACK EditSettingsPerContactDlgProc(HWND hWnd, UINT msg, WPARAM wp, L auto pProvider = GetContactProviderPtr(hContact); CAdvProviderSettings setGlobal(pProvider); // log to history - WORD dwLogMode = g_plugin.getWord(hContact, DB_STR_CURRENCYRATE_LOG, setGlobal.GetLogMode()); + uint16_t dwLogMode = g_plugin.getWord(hContact, DB_STR_CURRENCYRATE_LOG, setGlobal.GetLogMode()); UINT nCheck = (dwLogMode & lmInternalHistory) ? 1 : 0; ::CheckDlgButton(hWnd, IDC_CHECK_INTERNAL_HISTORY, nCheck ? BST_CHECKED : BST_UNCHECKED); ::SetDlgItemText(hWnd, IDC_EDIT_HISTORY_FORMAT, g_plugin.getMStringW(hContact, DB_STR_CURRENCYRATE_FORMAT_HISTORY, setGlobal.GetHistoryFormat())); - WORD wOnlyIfChanged = g_plugin.getWord(hContact, DB_STR_CURRENCYRATE_HISTORY_CONDITION, setGlobal.GetHistoryOnlyChangedFlag()); + uint16_t wOnlyIfChanged = g_plugin.getWord(hContact, DB_STR_CURRENCYRATE_HISTORY_CONDITION, setGlobal.GetHistoryOnlyChangedFlag()); ::CheckDlgButton(hWnd, IDC_CHECK_HISTORY_CONDITION, (1 == wOnlyIfChanged) ? BST_CHECKED : BST_UNCHECKED); // log to file @@ -335,7 +335,7 @@ INT_PTR CALLBACK EditSettingsPerContactDlgProc(HWND hWnd, UINT msg, WPARAM wp, L bool bUseContactSpec = 1 == ::IsDlgButtonChecked(hWnd, IDC_CHECK_CONTACT_SPECIFIC); - WORD nLogMode = lmDisabled; + uint16_t nLogMode = lmDisabled; UINT nCheck = ::IsDlgButtonChecked(hWnd, IDC_CHECK_EXTERNAL_FILE); if (1 == nCheck) nLogMode |= lmExternalFile; @@ -456,7 +456,7 @@ INT_PTR CALLBACK EditSettingsPerProviderDlgProc(HWND hWnd, UINT msg, WPARAM wp, ::SetDlgItemText(hWnd, IDC_EDIT_NAME, pAdvSettings->GetProviderPtr()->GetInfo().m_sName.c_str()); // log to history - WORD dwLogMode = pAdvSettings->GetLogMode(); + uint16_t dwLogMode = pAdvSettings->GetLogMode(); UINT nCheck = (dwLogMode & lmInternalHistory) ? 1 : 0; ::CheckDlgButton(hWnd, IDC_CHECK_INTERNAL_HISTORY, nCheck ? BST_CHECKED : BST_UNCHECKED); ::SetDlgItemText(hWnd, IDC_EDIT_HISTORY_FORMAT, pAdvSettings->GetHistoryFormat().c_str()); @@ -488,7 +488,7 @@ INT_PTR CALLBACK EditSettingsPerProviderDlgProc(HWND hWnd, UINT msg, WPARAM wp, switch (LOWORD(wp)) { case IDOK: { - WORD nLogMode = lmDisabled; + uint16_t nLogMode = lmDisabled; UINT nCheck = ::IsDlgButtonChecked(hWnd, IDC_CHECK_EXTERNAL_FILE); if (1 == nCheck) { nLogMode |= lmExternalFile; @@ -613,7 +613,7 @@ CAdvProviderSettings::CAdvProviderSettings(const ICurrencyRatesProvider *pCurren { assert(m_pCurrencyRatesProvider); - m_wLogMode = g_plugin.getWord(DB_KEY_LogMode, static_cast<WORD>(lmDisabled)); + m_wLogMode = g_plugin.getWord(DB_KEY_LogMode, static_cast<uint16_t>(lmDisabled)); m_sFormatHistory = g_plugin.getMStringW(DB_KEY_HistoryFormat, DB_DEF_HistoryFormat); m_bIsOnlyChangedHistory = 1 == g_plugin.getByte(DB_KEY_HistoryCondition, 0); @@ -778,12 +778,12 @@ void CPopupSettings::SetDelayMode(EDelayMode nMode) m_modeDelay = nMode; } -WORD CPopupSettings::GetDelayTimeout() const +uint16_t CPopupSettings::GetDelayTimeout() const { return m_wDelay; } -void CPopupSettings::SetDelayTimeout(WORD delay) +void CPopupSettings::SetDelayTimeout(uint16_t delay) { m_wDelay = delay; } diff --git a/protocols/CurrencyRates/src/SettingsDlg.h b/protocols/CurrencyRates/src/SettingsDlg.h index b3cf8c0114..76c0868493 100644 --- a/protocols/CurrencyRates/src/SettingsDlg.h +++ b/protocols/CurrencyRates/src/SettingsDlg.h @@ -38,8 +38,8 @@ public: EDelayMode GetDelayMode() const; void SetDelayMode(EDelayMode nMode); - WORD GetDelayTimeout() const; - void SetDelayTimeout(WORD delay); + uint16_t GetDelayTimeout() const; + void SetDelayTimeout(uint16_t delay); bool GetHistoryFlag() const; void SetHistoryFlag(bool flag); @@ -49,7 +49,7 @@ private: EDelayMode m_modeDelay; COLORREF m_rgbBkg; COLORREF m_rgbText; - WORD m_wDelay; + uint16_t m_wDelay; bool m_bUseHistory; }; @@ -57,7 +57,7 @@ private: class CAdvProviderSettings { const ICurrencyRatesProvider *m_pCurrencyRatesProvider; - WORD m_wLogMode; + uint16_t m_wLogMode; bool m_bIsOnlyChangedHistory; bool m_bIsOnlyChangedLogFile; bool m_bShowPopupIfValueChanged; @@ -73,8 +73,8 @@ public: void SaveToDb() const; - __forceinline WORD GetLogMode() const { return m_wLogMode; } - __forceinline void SetLogMode(WORD wMode) { m_wLogMode = wMode; } + __forceinline uint16_t GetLogMode() const { return m_wLogMode; } + __forceinline void SetLogMode(uint16_t wMode) { m_wLogMode = wMode; } __forceinline const CMStringW& GetHistoryFormat() const { return m_sFormatHistory; } __forceinline void SetHistoryFormat(const CMStringW &rsFormat) { m_sFormatHistory = rsFormat; } |