From 1039b2829a264280493ba0fa979214fe024dc70c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 17:06:04 +0300 Subject: WORD -> uint16_t --- protocols/CloudFile/src/utils.cpp | 2 +- protocols/ConnectionNotify/src/stdafx.h | 2 +- .../src/CurrencyRatesProviderBase.cpp | 4 +-- .../CurrencyRates/src/CurrencyRatesProviders.cpp | 6 ++-- protocols/CurrencyRates/src/ImportExport.cpp | 2 +- protocols/CurrencyRates/src/SettingsDlg.cpp | 16 +++++----- protocols/CurrencyRates/src/SettingsDlg.h | 12 ++++---- protocols/EmLanProto/src/mlan.h | 2 +- protocols/Gadu-Gadu/src/core.cpp | 16 +++++----- protocols/Gadu-Gadu/src/filetransfer.cpp | 4 +-- protocols/Gadu-Gadu/src/gg_proto.cpp | 2 +- protocols/Gadu-Gadu/src/options.h | 4 +-- protocols/ICQCorp/src/options.cpp | 2 +- protocols/ICQCorp/src/services.cpp | 2 +- protocols/IRCG/src/irclib.cpp | 6 ++-- protocols/IRCG/src/ircproto.cpp | 2 +- protocols/IRCG/src/ircproto.h | 4 +-- protocols/IRCG/src/options.cpp | 4 +-- protocols/JabberG/src/jabber_byte.cpp | 8 ++--- protocols/JabberG/src/jabber_ibb.cpp | 2 +- protocols/JabberG/src/jabber_ibb.h | 2 +- protocols/JabberG/src/jabber_icolib.cpp | 2 +- protocols/JabberG/src/jabber_iq_handlers.cpp | 2 +- protocols/JabberG/src/jabber_iqid.cpp | 4 +-- protocols/JabberG/src/jabber_list.h | 2 +- protocols/JabberG/src/jabber_opt.cpp | 12 ++++---- protocols/JabberG/src/jabber_privacy.cpp | 2 +- protocols/JabberG/src/jabber_proto.cpp | 2 +- protocols/JabberG/src/jabber_proto.h | 2 +- protocols/JabberG/src/jabber_thread.cpp | 6 ++-- protocols/JabberG/src/jabber_util.cpp | 2 +- protocols/JabberG/src/jabber_vcard.cpp | 12 ++++---- protocols/JabberG/src/jabber_ws.cpp | 2 +- protocols/JabberG/src/stdafx.h | 2 +- protocols/LotusNotify/src/LotusNotify.cpp | 30 +++++++++--------- protocols/LotusNotify/src/lotusnotes.h | 36 +++++++++++----------- protocols/Non-IM Contact/src/contactinfo.cpp | 10 +++--- protocols/Non-IM Contact/src/dialog.cpp | 21 +------------ protocols/Non-IM Contact/src/files.cpp | 4 +-- protocols/Non-IM Contact/src/namereplacing.cpp | 6 ++-- protocols/Non-IM Contact/src/services.cpp | 12 ++++---- protocols/Non-IM Contact/src/stdafx.h | 16 +--------- protocols/Non-IM Contact/src/timer.cpp | 2 +- protocols/Sametime/src/options.cpp | 4 +-- protocols/Sametime/src/sametime_proto.h | 4 +-- protocols/Sametime/src/sametime_session.cpp | 8 ++--- protocols/SkypeWeb/src/skype_contacts.cpp | 6 ++-- protocols/SkypeWeb/src/skype_db.cpp | 2 +- protocols/SkypeWeb/src/skype_proto.h | 6 ++-- protocols/Steam/src/steam_contacts.cpp | 10 +++--- protocols/Steam/src/steam_proto.h | 4 +-- protocols/Steam/src/steam_utils.cpp | 2 +- protocols/Tox/src/tox_contacts.cpp | 6 ++-- protocols/Tox/src/tox_proto.h | 6 ++-- protocols/Tox/src/tox_utils.cpp | 2 +- protocols/Weather/src/stdafx.h | 22 ++++++------- protocols/Weather/src/weather_conv.cpp | 4 +-- protocols/Weather/src/weather_data.cpp | 2 +- protocols/Weather/src/weather_opt.cpp | 2 +- protocols/Weather/src/weather_popup.cpp | 2 +- protocols/Weather/src/weather_update.cpp | 2 +- protocols/WebView/src/main.cpp | 2 +- protocols/YAMN/src/account.cpp | 10 +++--- protocols/YAMN/src/browser/mailbrowser.cpp | 2 +- protocols/YAMN/src/proto/pop3/pop3comm.cpp | 6 ++-- protocols/YAMN/src/proto/pop3/pop3comm.h | 2 +- protocols/YAMN/src/proto/pop3/pop3opt.cpp | 4 +-- protocols/YAMN/src/stdafx.h | 2 +- protocols/YAMN/src/synchro.cpp | 2 +- protocols/YAMN/src/yamn.cpp | 2 +- 70 files changed, 193 insertions(+), 226 deletions(-) (limited to 'protocols') diff --git a/protocols/CloudFile/src/utils.cpp b/protocols/CloudFile/src/utils.cpp index 8ddaafaf04..da5ca75595 100644 --- a/protocols/CloudFile/src/utils.cpp +++ b/protocols/CloudFile/src/utils.cpp @@ -23,7 +23,7 @@ void ShowNotification(const wchar_t *message, int flags, MCONTACT hContact) ShowNotification(_A2W(MODULENAME), message, flags, hContact); } -MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD flags, DWORD cbBlob, uint8_t *pBlob) +MEVENT AddEventToDb(MCONTACT hContact, uint16_t type, DWORD flags, DWORD cbBlob, uint8_t *pBlob) { DBEVENTINFO dbei = {}; dbei.szModule = MODULENAME; diff --git a/protocols/ConnectionNotify/src/stdafx.h b/protocols/ConnectionNotify/src/stdafx.h index 2de755f4ce..cbb3bb9ef0 100644 --- a/protocols/ConnectionNotify/src/stdafx.h +++ b/protocols/ConnectionNotify/src/stdafx.h @@ -46,7 +46,7 @@ struct CMPlugin : public PLUGIN int iStatus[MAX_STATUS_COUNT]; int iFiltersCount; int iDefaultAction = TRUE; - WORD iStatusMask; + uint16_t iStatusMask; CMPlugin(); 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(lmDisabled)) + uint16_t dwMode = (bUseContactSpecific) + ? g_plugin.getWord(hContact, DB_STR_CURRENCYRATE_LOG, static_cast(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(lmDisabled)); + uint16_t dwLogMode = g_plugin.getWord(hContact, DB_STR_CURRENCYRATE_LOG, static_cast(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 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(lmDisabled)); + m_wLogMode = g_plugin.getWord(DB_KEY_LogMode, static_cast(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; } diff --git a/protocols/EmLanProto/src/mlan.h b/protocols/EmLanProto/src/mlan.h index 9a2e257720..05623bd4a6 100644 --- a/protocols/EmLanProto/src/mlan.h +++ b/protocols/EmLanProto/src/mlan.h @@ -19,7 +19,7 @@ class CMLan; struct EMPSEARCHRESULT : public PROTOSEARCHRESULT { u_long ipaddr; - WORD stat; + uint16_t stat; u_long ver; }; diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 32d7629a7a..b3f8567b14 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -703,8 +703,8 @@ retry: int br = atoi(__birthyear); if (br > 0) { - setWord(hContact, GG_KEY_PD_AGE, (WORD)(lt->tm_year + 1900 - br)); - setWord(hContact, GG_KEY_PD_BIRTHYEAR, (WORD)br); + setWord(hContact, GG_KEY_PD_AGE, (uint16_t)(lt->tm_year + 1900 - br)); + setWord(hContact, GG_KEY_PD_BIRTHYEAR, (uint16_t)br); } } else if (res->seq == GG_SEQ_CHINFO) { @@ -758,7 +758,7 @@ retry: case GG_EVENT_STATUS60: { MCONTACT hContact = getcontact(e->event.status60.uin, 0, 0, nullptr); - int oldstatus = getWord(hContact, GG_KEY_STATUS, (WORD)ID_STATUS_OFFLINE); + int oldstatus = getWord(hContact, GG_KEY_STATUS, (uint16_t)ID_STATUS_OFFLINE); uin_t uin = (uin_t)getDword(GG_KEY_UIN, 0); wchar_t *descrT = mir_utf8decodeW(e->event.status60.descr); @@ -775,7 +775,7 @@ retry: mir_free(descrT); - if (oldstatus == ID_STATUS_OFFLINE && getWord(hContact, GG_KEY_STATUS, (WORD)ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) + if (oldstatus == ID_STATUS_OFFLINE && getWord(hContact, GG_KEY_STATUS, (uint16_t)ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) requestAvatarInfo(hContact, 0); } break; @@ -1367,7 +1367,7 @@ void GaduProto::notifyuser(MCONTACT hContact, int refresh) { // Check if user should be invisible // Or be blocked ? - if ((getWord(hContact, GG_KEY_APPARENT, (WORD)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact_OnList(hContact)) + if ((getWord(hContact, GG_KEY_APPARENT, (uint16_t)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact_OnList(hContact)) { gg_EnterCriticalSection(&sess_mutex, "notifyuser", 77, "sess_mutex", 1); if (refresh) { @@ -1422,7 +1422,7 @@ void GaduProto::notifyall() int cc = 0; for (auto &hContact : AccContacts()) { if (uins[cc] = getDword(hContact, GG_KEY_UIN, 0)) { - if ((getWord(hContact, GG_KEY_APPARENT, (WORD)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact_OnList(hContact)) + if ((getWord(hContact, GG_KEY_APPARENT, (uint16_t)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact_OnList(hContact)) types[cc] = GG_USER_OFFLINE; else if (getByte(hContact, GG_KEY_BLOCK, 0)) types[cc] = GG_USER_BLOCKED; @@ -1612,7 +1612,7 @@ void GaduProto::changecontactstatus(uin_t uin, int status, const wchar_t *idescr return; // Write contact status - setWord(hContact, GG_KEY_STATUS, (WORD)status_gg2m(status)); + setWord(hContact, GG_KEY_STATUS, (uint16_t)status_gg2m(status)); // Check if there's description and if it's not empty if (idescr && *idescr) { @@ -1628,7 +1628,7 @@ void GaduProto::changecontactstatus(uin_t uin, int status, const wchar_t *idescr if (remote_ip) setDword(hContact, GG_KEY_CLIENTIP, (DWORD)swap32(remote_ip)); if (remote_port) - setWord(hContact, GG_KEY_CLIENTPORT, (WORD)remote_port); + setWord(hContact, GG_KEY_CLIENTPORT, (uint16_t)remote_port); if (version) { char sversion[48]; setDword(hContact, GG_KEY_CLIENTVERSION, (DWORD)version); diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index dac2149fb1..e7d512683a 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -72,7 +72,7 @@ void GaduProto::dccconnect(uin_t uin) // Read user IP and port DWORD ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 0)); - WORD port = getWord(hContact, GG_KEY_CLIENTPORT, 0); + uint16_t port = getWord(hContact, GG_KEY_CLIENTPORT, 0); DWORD myuin = getDword(GG_KEY_UIN, 0); // If not port nor ip nor my uin (?) specified @@ -916,7 +916,7 @@ HANDLE GaduProto::SendFile(MCONTACT hContact, const wchar_t *, wchar_t** ppszFil // Read user IP and port DWORD ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 0)); - WORD port = getWord(hContact, GG_KEY_CLIENTPORT, 0); + uint16_t port = getWord(hContact, GG_KEY_CLIENTPORT, 0); uin_t myuin = getDword(GG_KEY_UIN, 0); uin_t uin = getDword(hContact, GG_KEY_UIN, 0); DWORD ver = getDword(hContact, GG_KEY_CLIENTVERSION, 0); diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index ca86284ffc..42a3bcc935 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -521,7 +521,7 @@ int GaduProto::SendMsg(MCONTACT hContact, int, const char *msg) // int GaduProto::SetApparentMode(MCONTACT hContact, int mode) { - setWord(hContact, GG_KEY_APPARENT, (WORD)mode); + setWord(hContact, GG_KEY_APPARENT, (uint16_t)mode); notifyuser(hContact, 1); return 0; diff --git a/protocols/Gadu-Gadu/src/options.h b/protocols/Gadu-Gadu/src/options.h index 6e8d7502ac..8061b8731a 100644 --- a/protocols/Gadu-Gadu/src/options.h +++ b/protocols/Gadu-Gadu/src/options.h @@ -13,8 +13,8 @@ struct GaduOptions CMOption useMsgDeliveryAcknowledge; CMOption useSslConnection; - CMOption directConnectionPort; - CMOption forwardPort; + CMOption directConnectionPort; + CMOption forwardPort; CMOption forwardHost; CMOption serverHosts; diff --git a/protocols/ICQCorp/src/options.cpp b/protocols/ICQCorp/src/options.cpp index 79c9fda410..16fc69713a 100644 --- a/protocols/ICQCorp/src/options.cpp +++ b/protocols/ICQCorp/src/options.cpp @@ -50,7 +50,7 @@ static INT_PTR CALLBACK icqOptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP g_plugin.setString("Password", str); GetDlgItemTextA(hWnd, IDC_OPT_SERVER, str, sizeof(str)); g_plugin.setString("Server", str); - g_plugin.setWord("Port", (WORD)GetDlgItemInt(hWnd, IDC_OPT_PORT, nullptr, FALSE)); + g_plugin.setWord("Port", (uint16_t)GetDlgItemInt(hWnd, IDC_OPT_PORT, nullptr, FALSE)); return TRUE; } break; diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp index 01cf703d8f..825f277f9d 100644 --- a/protocols/ICQCorp/src/services.cpp +++ b/protocols/ICQCorp/src/services.cpp @@ -409,7 +409,7 @@ static INT_PTR icqSetApparentMode(WPARAM, LPARAM) Netlib_Logf(hNetlibUser, "[ ] set apparent mode\n"); - if (newMode == ID_STATUS_ONLINE || newMode == ID_STATUS_OFFLINE) db_set_w(u->hContact, ICQCORP_PROTONAME, "ApparentMode", (WORD)newMode); + if (newMode == ID_STATUS_ONLINE || newMode == ID_STATUS_OFFLINE) db_set_w(u->hContact, ICQCORP_PROTONAME, "ApparentMode", (uint16_t)newMode); else db_unset(u->hContact, ICQCORP_PROTONAME, "ApparentMode"); if (icq.statusVal <= ID_STATUS_OFFLINE) return 0; diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index d23c9c7991..67625b3ccd 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -859,7 +859,7 @@ int CDccSession::SetupConnection() if (di->iType == DCC_CHAT && !di->bSender || di->iType == DCC_SEND && di->bSender && di->bReverse) { NETLIBOPENCONNECTION ncon = {}; ncon.szHost = ConvertIntegerToIP(di->dwAdr); - ncon.wPort = (WORD)di->iPort; + ncon.wPort = (uint16_t)di->iPort; con = Netlib_OpenConnection(m_proto->hNetlibDCC, &ncon); } @@ -953,7 +953,7 @@ int CDccSession::SetupConnection() // connect to the remote computer from which you are receiving the file (now all actions to take (resume/overwrite etc) have been decided NETLIBOPENCONNECTION ncon = {}; ncon.szHost = ConvertIntegerToIP(di->dwAdr); - ncon.wPort = (WORD)di->iPort; + ncon.wPort = (uint16_t)di->iPort; con = Netlib_OpenConnection(m_proto->hNetlibDCC, &ncon); } @@ -1024,7 +1024,7 @@ void CDccSession::DoSendFile() ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, (void *)di, 0); ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (void *)di, 0); - WORD wPacketSize = m_proto->getWord("DCCPacketSize", 1024 * 4); + uint16_t wPacketSize = m_proto->getWord("DCCPacketSize", 1024 * 4); if (wPacketSize < 256) wPacketSize = 256; diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 8c55fc7fc8..28f5e032f7 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -596,7 +596,7 @@ HANDLE CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** ppszFile int CIrcProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) { uint8_t bDcc = getByte(hContact, "DCC", 0); - WORD wStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE); + uint16_t wStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE); if (bDcc && wStatus != ID_STATUS_ONLINE) { ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, nullptr, (LPARAM)TranslateT("The dcc chat connection is not active")); return 0; diff --git a/protocols/IRCG/src/ircproto.h b/protocols/IRCG/src/ircproto.h index f0792daf08..efc465f31f 100644 --- a/protocols/IRCG/src/ircproto.h +++ b/protocols/IRCG/src/ircproto.h @@ -118,7 +118,7 @@ struct CIrcProto : public PROTO char m_mySpecifiedHost[500]; char m_mySpecifiedHostIP[50]; char m_myLocalHost[50]; - WORD m_myLocalPort; + uint16_t m_myLocalPort; wchar_t *m_alias; int m_quickComboSelection; int m_onlineNotificationTime; @@ -146,7 +146,7 @@ struct CIrcProto : public PROTO uint8_t m_DCCChatIgnore; uint8_t m_DCCPassive; uint8_t m_DCCMode; - WORD m_DCCPacketSize; + uint16_t m_DCCPacketSize; uint8_t m_manualHost; uint8_t m_oldStyleModes; uint8_t m_channelAwayNotification; diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 3c5285309c..9961f0be81 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -45,7 +45,7 @@ void CIrcProto::ReadSettings(TDbSetting *sets, int count) *(uint8_t*)ptr = getByte(p->name, p->defValue); break; case DBVT_WORD: - *(WORD*)ptr = getWord(p->name, p->defValue); + *(uint16_t*)ptr = getWord(p->name, p->defValue); break; case DBVT_DWORD: *(DWORD*)ptr = getDword(p->name, p->defValue); @@ -100,7 +100,7 @@ void CIrcProto::WriteSettings(TDbSetting *sets, int count) uint8_t *ptr = base + p->offset; switch (p->type) { case DBVT_BYTE: setByte(p->name, *(uint8_t*)ptr); break; - case DBVT_WORD: setWord(p->name, *(WORD*)ptr); break; + case DBVT_WORD: setWord(p->name, *(uint16_t*)ptr); break; case DBVT_DWORD: setDword(p->name, *(DWORD*)ptr); break; case DBVT_ASCIIZ: diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index 13691315d6..c9c9088aca 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -365,7 +365,7 @@ int CJabberProto::ByteSendParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jbt, ch // 03-03 address type (1=IPv4 address) // 04-07 bnd.addr server bound address // 08-09 bnd.port server bound port - if (datalen == 47 && *((DWORD*)buffer) == 0x03000105 && buffer[4] == 40 && *((WORD*)(buffer + 45)) == 0) { + if (datalen == 47 && *((DWORD*)buffer) == 0x03000105 && buffer[4] == 40 && *((uint16_t*)(buffer + 45)) == 0) { ptrA szInitiatorJid(JabberPrepareJid(jbt->srcJID)); ptrA szTargetJid(JabberPrepareJid(jbt->dstJID)); CMStringA szAuthString(FORMAT, "%s%s%s", jbt->sid, szInitiatorJid.get(), szTargetJid.get()); @@ -438,7 +438,7 @@ void CJabberProto::ByteSendViaProxy(JABBER_BYTE_TRANSFER *jbt) char *szPort = jbt->szProxyPort; char *szHost = jbt->szProxyHost; - WORD port = (WORD)atoi(szPort); + uint16_t port = (uint16_t)atoi(szPort); replaceStr(jbt->streamhostJID, jbt->szProxyJid); NETLIBOPENCONNECTION nloc = {}; @@ -575,7 +575,7 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt) return; const TiXmlElement *iqNode, *queryNode = nullptr; - WORD port; + uint16_t port; char data[3]; char* buffer; int datalen, bytesParsed, recvResult; @@ -606,7 +606,7 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt) const char *szHost = XmlGetAttr(n, "host"); const char *szPort = XmlGetAttr(n, "port"); if (str != nullptr && szHost != nullptr && szPort != nullptr) { - port = (WORD)atoi(szPort); + port = (uint16_t)atoi(szPort); replaceStr(jbt->streamhostJID, str); debugLogA("bytestream_recv connecting to %s:%d", szHost, port); diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp index 7a20c70760..3fefc2f186 100644 --- a/protocols/JabberG/src/jabber_ibb.cpp +++ b/protocols/JabberG/src/jabber_ibb.cpp @@ -171,7 +171,7 @@ bool CJabberProto::OnIbbRecvdData(const char *data, const char *sid, const char if (item == nullptr) return false; - WORD wSeq = (WORD)atoi(seq); + uint16_t wSeq = (uint16_t)atoi(seq); if (wSeq != item->jibb->wPacketId) { if (item->jibb->hEvent) SetEvent(item->jibb->hEvent); diff --git a/protocols/JabberG/src/jabber_ibb.h b/protocols/JabberG/src/jabber_ibb.h index 44312bb816..a9e7905237 100644 --- a/protocols/JabberG/src/jabber_ibb.h +++ b/protocols/JabberG/src/jabber_ibb.h @@ -38,7 +38,7 @@ struct JABBER_IBB_TRANSFER HANDLE hEvent; bool bStreamInitialized; bool bStreamClosed; - WORD wPacketId; + uint16_t wPacketId; bool (CJabberProto::*pfnSend)(int blocksize, filetransfer *ft); int (CJabberProto::*pfnRecv)(HNETLIBCONN hConn, filetransfer *ft, char* buffer, int datalen); void (CJabberProto::*pfnFinal)(bool success, filetransfer *ft); diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index d50c2e541f..93b287e016 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -340,7 +340,7 @@ INT_PTR __cdecl CJabberProto::OnGetAdvancedStatusIcon(WPARAM hContact, LPARAM) if (iID < 0) return -1; - WORD Status = getWord(hContact, "Status", ID_STATUS_OFFLINE); + uint16_t Status = getWord(hContact, "Status", ID_STATUS_OFFLINE); if (Status < ID_STATUS_OFFLINE) Status = ID_STATUS_OFFLINE; else if (Status > ID_STATUS_INVISIBLE) diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index a1b7fb9a43..cef7f3a195 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -283,7 +283,7 @@ bool CJabberProto::OnIqRequestOOB(const TiXmlElement*, CJabberIqInfo *pInfo) strncpy_s(text, p, q - p); text[q - p] = '\0'; if (char *d = strchr(text, ':')) { - ft->httpPort = (WORD)atoi(d + 1); + ft->httpPort = (uint16_t)atoi(d + 1); *d = '\0'; } ft->httpHostName = mir_strdup(text); diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 32449881be..07931a08ad 100755 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -703,7 +703,7 @@ void CJabberProto::OnIqResultGetVcard(const TiXmlElement *iqNode, CJabberIqInfo* if (hContact != 0) { if (sscanf(n->GetText(), "%d-%d-%d", &nYear, &nMonth, &nDay) == 3) { hasBday = true; - setWord(hContact, "BirthYear", (WORD)nYear); + setWord(hContact, "BirthYear", (uint16_t)nYear); setByte(hContact, "BirthMonth", (uint8_t)nMonth); setByte(hContact, "BirthDay", (uint8_t)nDay); @@ -713,7 +713,7 @@ void CJabberProto::OnIqResultGetVcard(const TiXmlElement *iqNode, CJabberIqInfo* if (sToday.wMonth < nMonth || (sToday.wMonth == nMonth && sToday.wDay < nDay)) nAge--; if (nAge) - setWord(hContact, "Age", (WORD)nAge); + setWord(hContact, "Age", (uint16_t)nAge); } } else { diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h index 6ad73e6490..05d65fdb23 100644 --- a/protocols/JabberG/src/jabber_list.h +++ b/protocols/JabberG/src/jabber_list.h @@ -190,7 +190,7 @@ struct JABBER_LIST_ITEM : public MZeroedObject // LIST_FILE // jid = string representation of port number filetransfer *ft; - WORD port; + uint16_t port; // LIST_BYTE // jid = string representation of port number diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 1f4bfd91b4..97a821e275 100755 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -550,11 +550,11 @@ private: m_txtPassword.GetTextU(regInfo.password, _countof(regInfo.password)); m_cbServer.GetTextA(regInfo.server, _countof(regInfo.server)); if (m_chkManualHost.GetState() == BST_CHECKED) { - regInfo.port = (WORD)m_txtManualPort.GetInt(); + regInfo.port = (uint16_t)m_txtManualPort.GetInt(); m_txtManualHost.GetTextA(regInfo.manualHost, _countof(regInfo.manualHost)); } else { - regInfo.port = (WORD)m_txtPort.GetInt(); + regInfo.port = (uint16_t)m_txtPort.GetInt(); regInfo.manualHost[0] = '\0'; } @@ -669,11 +669,11 @@ private: m_txtPassword.GetTextU(regInfo.password, _countof(regInfo.password)); m_cbServer.GetTextA(regInfo.server, _countof(regInfo.server)); if (m_chkManualHost.GetState() == BST_CHECKED) { - regInfo.port = (WORD)m_txtManualPort.GetInt(); + regInfo.port = (uint16_t)m_txtManualPort.GetInt(); m_txtManualHost.GetTextA(regInfo.manualHost, _countof(regInfo.manualHost)); } else { - regInfo.port = (WORD)m_txtPort.GetInt(); + regInfo.port = (uint16_t)m_txtPort.GetInt(); regInfo.manualHost[0] = '\0'; } @@ -830,7 +830,7 @@ public: if (hContact != 0) { if (bChecked) { if (item->getTemp()->m_iStatus != m_proto->getWord(hContact, "Status", ID_STATUS_OFFLINE)) { - m_proto->setWord(hContact, "Status", (WORD)item->getTemp()->m_iStatus); + m_proto->setWord(hContact, "Status", (uint16_t)item->getTemp()->m_iStatus); } } else if (m_proto->getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) @@ -1251,7 +1251,7 @@ private: m_txtUsername.GetTextU(regInfo.username, _countof(regInfo.username)); m_txtPassword.GetTextU(regInfo.password, _countof(regInfo.password)); m_cbServer.GetTextA(regInfo.server, _countof(regInfo.server)); - regInfo.port = (WORD)m_txtPort.GetInt(); + regInfo.port = (uint16_t)m_txtPort.GetInt(); if (m_chkManualHost.GetState() == BST_CHECKED) m_txtManualHost.GetTextA(regInfo.manualHost, _countof(regInfo.manualHost)); else diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index a92d005d29..6559ac437e 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -1866,7 +1866,7 @@ public: PostMessage(m_hwnd, WM_PROTO_REFRESH, 0, 0); } - void OnCommand_Close(HWND /*hwndCtrl*/, WORD /*idCtrl*/, WORD /*idCode*/) + void OnCommand_Close(HWND /*hwndCtrl*/, uint16_t /*idCtrl*/, uint16_t /*idCode*/) { if (IsWindowVisible(m_clcClist.GetHwnd())) CListBuildList(clc_info.pList); diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 7beb4d6a42..9ff764ecdc 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -989,7 +989,7 @@ int CJabberProto::SetApparentMode(MCONTACT hContact, int mode) if (mode == oldMode) return 1; - setWord(hContact, "ApparentMode", (WORD)mode); + setWord(hContact, "ApparentMode", (uint16_t)mode); if (!m_bJabberOnline) return 0; diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 4ac9cf3ee3..b82abb54e4 100755 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -884,7 +884,7 @@ struct CJabberProto : public PROTO, public IJabberInterface //---- jabber_ws.c ------------------------------------------------- - HNETLIBCONN WsConnect(char* host, WORD port); + HNETLIBCONN WsConnect(char* host, uint16_t port); bool WsInit(void); int WsSend(HNETLIBCONN s, char* data, int datalen, int flags); diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index cff0eb6468..38cb49427c 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -51,7 +51,7 @@ struct JabberPasswordDlgParam CJabberProto *pro; BOOL saveOnlinePassword; - WORD dlgResult; + uint16_t dlgResult; wchar_t onlinePassword[128]; HANDLE hEventPasswdDlg; char *pszJid; @@ -188,7 +188,7 @@ void ThreadData::xmpp_client_query(void) dnsList.insert(&rec->Data.Srv); for (auto &it : dnsList) { - WORD dnsPort = (conn.port == 0 || conn.port == 5222) ? it->wPort : conn.port; + uint16_t dnsPort = (conn.port == 0 || conn.port == 5222) ? it->wPort : conn.port; char* dnsHost = it->pNameTarget; proto->debugLogA("%s%s resolved to %s:%d", "_xmpp-client._tcp.", conn.server, dnsHost, dnsPort); @@ -1514,7 +1514,7 @@ void CJabberProto::UpdateJidDbSettings(const char *jid) if (strchr(jid, '@') != nullptr || m_bShowTransport == TRUE) if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != status) - setWord(hContact, "Status", (WORD)status); + setWord(hContact, "Status", (uint16_t)status); // remove x-status icon if (status == ID_STATUS_OFFLINE) { diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index b2d1856ce9..b8ddd22545 100755 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -338,7 +338,7 @@ void CJabberProto::SendVisibleInvisiblePresence(bool invisible) if (hContact == 0) continue; - WORD apparentMode = getWord(hContact, "ApparentMode", 0); + uint16_t apparentMode = getWord(hContact, "ApparentMode", 0); if (invisible && apparentMode == ID_STATUS_OFFLINE) m_ThreadInfo->send(XmlNode("presence") << XATTR("to", item->jid) << XATTR("type", "invisible")); else if (!invisible && apparentMode == ID_STATUS_ONLINE) diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index f2c75e7112..d01fcb4d3b 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -563,7 +563,7 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, SetDlgItemTextA(hwndDlg, IDC_EMAIL, email); mir_snprintf(idstr, "e-mailFlag%d", (int)lParam); - WORD nFlag = dat->ppro->getWord(idstr, 0); + uint16_t nFlag = dat->ppro->getWord(idstr, 0); if (nFlag & JABBER_VCEMAIL_HOME) CheckDlgButton(hwndDlg, IDC_HOME, BST_CHECKED); if (nFlag & JABBER_VCEMAIL_WORK) CheckDlgButton(hwndDlg, IDC_WORK, BST_CHECKED); if (nFlag & JABBER_VCEMAIL_INTERNET) CheckDlgButton(hwndDlg, IDC_INTERNET, BST_CHECKED); @@ -588,7 +588,7 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, mir_snprintf(idstr, "e-mail%d", dat->id); dat->ppro->setWString(idstr, text); { - WORD nFlag = 0; + uint16_t nFlag = 0; if (IsDlgButtonChecked(hwndDlg, IDC_HOME)) nFlag |= JABBER_VCEMAIL_HOME; if (IsDlgButtonChecked(hwndDlg, IDC_WORK)) nFlag |= JABBER_VCEMAIL_WORK; if (IsDlgButtonChecked(hwndDlg, IDC_INTERNET)) nFlag |= JABBER_VCEMAIL_INTERNET; @@ -659,7 +659,7 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, mir_snprintf(idstr, "Phone%d", dat->id); dat->ppro->setString(idstr, text); { - WORD nFlag = 0; + uint16_t nFlag = 0; if (IsDlgButtonChecked(hwndDlg, IDC_HOME)) nFlag |= JABBER_VCTEL_HOME; if (IsDlgButtonChecked(hwndDlg, IDC_WORK)) nFlag |= JABBER_VCTEL_WORK; if (IsDlgButtonChecked(hwndDlg, IDC_VOICE)) nFlag |= JABBER_VCTEL_VOICE; @@ -872,7 +872,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP ppro->setString(idstr, fieldVal); mir_snprintf(idstr, szFlagTemplate, i + 1); - WORD nFlag = ppro->getWord(idstr, 0); + uint16_t nFlag = ppro->getWord(idstr, 0); mir_snprintf(idstr, szFlagTemplate, i); ppro->setWord(idstr, nFlag); } @@ -1043,7 +1043,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t *szPhotoFileName) AppendVcardFromDB(e, "USERID", idstr); mir_snprintf(idstr, "e-mailFlag%d", i); - WORD nFlag = getWord(idstr, 0); + uint16_t nFlag = getWord(idstr, 0); if (nFlag & JABBER_VCEMAIL_HOME) e << XCHILD("HOME"); if (nFlag & JABBER_VCEMAIL_WORK) e << XCHILD("WORK"); if (nFlag & JABBER_VCEMAIL_INTERNET) e << XCHILD("INTERNET"); @@ -1091,7 +1091,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t *szPhotoFileName) AppendVcardFromDB(n, "NUMBER", idstr); mir_snprintf(idstr, "PhoneFlag%d", i); - WORD nFlag = getWord(idstr, 0); + uint16_t nFlag = getWord(idstr, 0); if (nFlag & JABBER_VCTEL_HOME) n << XCHILD("HOME"); if (nFlag & JABBER_VCTEL_WORK) n << XCHILD("WORK"); if (nFlag & JABBER_VCTEL_VOICE) n << XCHILD("VOICE"); diff --git a/protocols/JabberG/src/jabber_ws.cpp b/protocols/JabberG/src/jabber_ws.cpp index 79bffb948d..467e02d8f8 100644 --- a/protocols/JabberG/src/jabber_ws.cpp +++ b/protocols/JabberG/src/jabber_ws.cpp @@ -39,7 +39,7 @@ bool CJabberProto::WsInit(void) return m_hNetlibUser != nullptr; } -HNETLIBCONN CJabberProto::WsConnect(char* host, WORD port) +HNETLIBCONN CJabberProto::WsConnect(char* host, uint16_t port) { NETLIBOPENCONNECTION nloc = {}; nloc.szHost = host; diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index c007b351a7..2cc9550b8f 100755 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -432,7 +432,7 @@ struct filetransfer : public MZeroedObject // Used by file receiving only char* httpHostName; - WORD httpPort; + uint16_t httpPort; char* httpPath; unsigned __int64 dwExpectedRecvFileSize; diff --git a/protocols/LotusNotify/src/LotusNotify.cpp b/protocols/LotusNotify/src/LotusNotify.cpp index 73bd54a92a..28bf497693 100644 --- a/protocols/LotusNotify/src/LotusNotify.cpp +++ b/protocols/LotusNotify/src/LotusNotify.cpp @@ -493,10 +493,10 @@ void ErMsgByLotusCode(STATUS erno) char far error_text_LMBCS[200]; char far error_text_UNICODEatCHAR[400]; wchar_t far error_text_UNICODE[200]; - WORD text_len; + uint16_t text_len; text_len = OSLoadString1(NULLHANDLE, erno, error_text_LMBCS, sizeof(error_text_LMBCS)-1); - OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, error_text_LMBCS, (WORD)mir_strlen(error_text_LMBCS), error_text_UNICODEatCHAR, sizeof(error_text_UNICODEatCHAR)-1); + OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, error_text_LMBCS, (uint16_t)mir_strlen(error_text_LMBCS), error_text_UNICODEatCHAR, sizeof(error_text_UNICODEatCHAR)-1); memcpy(error_text_UNICODE, error_text_UNICODEatCHAR, sizeof(error_text_UNICODE)); ErMsgW(error_text_UNICODE); @@ -548,7 +548,7 @@ void checkthread(void*) BOOL fFirst = TRUE; NOTEHANDLE note_handle; - WORD field_len; + uint16_t field_len; char field_date[MAXALPHATIMEDATE + 1]; char field_lotus_LMBCS[MAX_FIELD]; @@ -601,7 +601,7 @@ void checkthread(void*) #endif /* Get the unread list */ - if (error = NSFDbGetUnreadNoteTable1(db_handle, UserName, (WORD)mir_strlen(UserName), TRUE, &hTable)) { + if (error = NSFDbGetUnreadNoteTable1(db_handle, UserName, (uint16_t)mir_strlen(UserName), TRUE, &hTable)) { goto errorblock0; } #ifdef _DEBUG @@ -621,13 +621,13 @@ void checkthread(void*) while (IDScan1(hTable, fFirst, ¬eID)) { - WORD Att; + uint16_t Att; BLOCKID bhAttachment; DWORD cSize = 0; DWORD attSize = 0; OID retNoteOID; TIMEDATE retModified; /* modified timedate */ - WORD retNoteClass; /* note class */ + uint16_t retNoteClass; /* note class */ TIMEDATE sendDate; char strLink[4 * 16]; @@ -704,7 +704,7 @@ void checkthread(void*) log_p(L"checkthread: got noteInfo, built link: %S", strLink); - field_len = NSFItemGetText1(note_handle, MAIL_FROM_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS)); + field_len = NSFItemGetText1(note_handle, MAIL_FROM_ITEM, field_lotus_LMBCS, (uint16_t)sizeof(field_lotus_LMBCS)); OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR)); memcpy(field_from_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t)); field_from_UNICODE[field_len] = '\0'; @@ -713,17 +713,17 @@ void checkthread(void*) error = ConvertTIMEDATEToText1(nullptr, nullptr, &sendDate, field_date, MAXALPHATIMEDATE, &field_len); field_date[field_len] = '\0'; - field_len = NSFItemGetText1(note_handle, MAIL_SUBJECT_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS)); + field_len = NSFItemGetText1(note_handle, MAIL_SUBJECT_ITEM, field_lotus_LMBCS, (uint16_t)sizeof(field_lotus_LMBCS)); OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR)); memcpy(field_subject_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t)); field_subject_UNICODE[field_len] = '\0'; - field_len = NSFItemGetText1(note_handle, MAIL_SENDTO_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS)); + field_len = NSFItemGetText1(note_handle, MAIL_SENDTO_ITEM, field_lotus_LMBCS, (uint16_t)sizeof(field_lotus_LMBCS)); OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR)); memcpy(field_to_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t)); field_to_UNICODE[field_len] = '\0'; - field_len = NSFItemGetText1(note_handle, MAIL_COPYTO_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS)); + field_len = NSFItemGetText1(note_handle, MAIL_COPYTO_ITEM, field_lotus_LMBCS, (uint16_t)sizeof(field_lotus_LMBCS)); OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR)); memcpy(field_copy_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t)); field_copy_UNICODE[field_len] = '\0'; @@ -888,8 +888,8 @@ void fillServersList(HWND hwndDlg) { HANDLE hServerList = NULLHANDLE; uint8_t far *pServerList; /* Pointer to start of Server List */ - WORD wServerCount; /* Number of servers in list. */ - WORD far *pwServerLength; /* Index to array of servername lens */ + uint16_t wServerCount; /* Number of servers in list. */ + uint16_t far *pwServerLength; /* Index to array of servername lens */ uint8_t far *pServerName; STATUS error = NOERROR; /* Error return from API routines. */ char ServerString[MAXPATH]; /* String to hold server names. */ @@ -903,11 +903,11 @@ void fillServersList(HWND hwndDlg) if (error == NOERROR) { pServerList = (uint8_t far *) OSLockObject1(hServerList); - wServerCount = (WORD)*pServerList; + wServerCount = (uint16_t)*pServerList; - pwServerLength = (WORD *)(pServerList + sizeof(WORD)); + pwServerLength = (uint16_t *)(pServerList + sizeof(uint16_t)); - pServerName = (uint8_t far *) pServerList + sizeof(wServerCount) + ((wServerCount)* sizeof(WORD)); + pServerName = (uint8_t far *) pServerList + sizeof(wServerCount) + ((wServerCount)* sizeof(uint16_t)); for (USHORT i = 0; i < wServerCount; pServerName += pwServerLength[i], i++) { memmove(szServerString, pServerName, pwServerLength[i]); diff --git a/protocols/LotusNotify/src/lotusnotes.h b/protocols/LotusNotify/src/lotusnotes.h index 620aab2822..ba8288a014 100644 --- a/protocols/LotusNotify/src/lotusnotes.h +++ b/protocols/LotusNotify/src/lotusnotes.h @@ -27,7 +27,7 @@ extern SECKFMGETUSERNAME SECKFMGetUserName1; typedef STATUS (CALLBACK LNPUBLIC *NSFDBGETUNREADNOTETABLE)( DBHANDLE hDB, char far *UserName, - WORD UserNameLength, + uint16_t UserNameLength, BOOL fCreateIfNotAvailable, HANDLE far *rethUnreadList); extern NSFDBGETUNREADNOTETABLE NSFDbGetUnreadNoteTable1; @@ -46,7 +46,7 @@ extern IDSCAN IDScan1; typedef STATUS (CALLBACK LNPUBLIC *NSFNOTEOPEN)( DBHANDLE db_handle, NOTEID note_id, - WORD open_flags, + uint16_t open_flags, NOTEHANDLE far *note_handle); extern NSFNOTEOPEN NSFNoteOpen1; @@ -55,14 +55,14 @@ typedef STATUS (CALLBACK LNPUBLIC *NSFDBGETNOTEINFO)( NOTEID NoteID, OID far *retNoteOID, TIMEDATE far *retModified, - WORD far *retNoteClass); + uint16_t far *retNoteClass); extern NSFDBGETNOTEINFO NSFDbGetNoteInfo1; -typedef WORD (CALLBACK LNPUBLIC *NSFITEMGETTEXT)( +typedef uint16_t (CALLBACK LNPUBLIC *NSFITEMGETTEXT)( NOTEHANDLE note_handle, const char far *item_name, char far *item_text, - WORD text_len); + uint16_t text_len); extern NSFITEMGETTEXT NSFItemGetText1; typedef BOOL (CALLBACK LNPUBLIC *NSFITEMGETTIME)( @@ -76,26 +76,26 @@ typedef STATUS (CALLBACK LNPUBLIC *CONVERTTIMEDATETOTEXT)( const TFMT far *TextFormat, const TIMEDATE far *InputTime, char far *retTextBuffer, - WORD TextBufferLength, - WORD far *retTextLength); + uint16_t TextBufferLength, + uint16_t far *retTextLength); extern CONVERTTIMEDATETOTEXT ConvertTIMEDATEToText1; -typedef WORD (CALLBACK LNPUBLIC *OSTRANSLATE)( - WORD TranslateMode, +typedef uint16_t (CALLBACK LNPUBLIC *OSTRANSLATE)( + uint16_t TranslateMode, const char far *In, - WORD InLength, + uint16_t InLength, char far *Out, - WORD OutLength); + uint16_t OutLength); extern OSTRANSLATE OSTranslate1; typedef BOOL (CALLBACK LNPUBLIC *MAILGETMESSAGEATTACHMENTINFO)( HANDLE hMessage, ///DHANDLE - WORD Num, + uint16_t Num, BLOCKID far *bhItem, char far *FileName, DWORD far *FileSize, - WORD far *FileAttributes, - WORD far *FileHostType, + uint16_t far *FileAttributes, + uint16_t far *FileHostType, TIMEDATE *FileCreated, TIMEDATE far *FileModified); extern MAILGETMESSAGEATTACHMENTINFO MailGetMessageAttachmentInfo1; @@ -112,11 +112,11 @@ typedef STATUS (CALLBACK LNPUBLIC *NSFDBCLOSE)( DBHANDLE hDB); extern NSFDBCLOSE NSFDbClose1; -typedef WORD (CALLBACK LNPUBLIC *OSLOADSTRING)( +typedef uint16_t (CALLBACK LNPUBLIC *OSLOADSTRING)( HMODULE hModule, STATUS StringCode, char far *retBuffer, - WORD BufferLength); + uint16_t BufferLength); extern OSLOADSTRING OSLoadString1; typedef void (CALLBACK LNPUBLIC *NOTESTERM)(void); @@ -125,7 +125,7 @@ extern NOTESTERM NotesTerm1; typedef BOOL (CALLBACK LNPUBLIC *OSGETENVIRONMENTSTRING)( const char far *VariableName, char far *retValueBuffer, - WORD BufferLength); + uint16_t BufferLength); extern OSGETENVIRONMENTSTRING OSGetEnvironmentString1; typedef void (CALLBACK LNPUBLIC *OSSETENVIRONMENTVARIABLE)( @@ -154,7 +154,7 @@ typedef STATUS (CALLBACK LNPUBLIC *EMREGISTER)( EID EmID, DWORD Flags, EMHANDLER Proc, - WORD RecursionID, + uint16_t RecursionID, HEMREGISTRATION far *rethRegistration); extern EMREGISTER EMRegister1; diff --git a/protocols/Non-IM Contact/src/contactinfo.cpp b/protocols/Non-IM Contact/src/contactinfo.cpp index 47effee3e7..551bee412b 100644 --- a/protocols/Non-IM Contact/src/contactinfo.cpp +++ b/protocols/Non-IM Contact/src/contactinfo.cpp @@ -242,11 +242,11 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP for (int i = ID_STATUS_ONLINE; i <= ID_STATUS_MAX; i++) if (IsDlgButtonChecked(hwnd, i)) - g_plugin.setWord(hContact, "Icon", (WORD)i); + g_plugin.setWord(hContact, "Icon", (uint16_t)i); /* set correct status */ if (status == ID_STATUS_ONLINE || status == ID_STATUS_AWAY || (status == g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE))) - g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); + g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); else g_plugin.setWord(hContact, "Status", ID_STATUS_OFFLINE); @@ -254,7 +254,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER))) { wchar_t text[512]; GetDlgItemText(hwnd, IDC_TIMER, text, _countof(text)); - g_plugin.setWord(hContact, "Timer", (WORD)_wtoi(text)); + g_plugin.setWord(hContact, "Timer", (uint16_t)_wtoi(text)); } else g_plugin.setWord(hContact, "Timer", 15); } @@ -645,9 +645,9 @@ INT_PTR ImportContacts(WPARAM, LPARAM) // timer g_plugin.setByte(hContact, "UseTimer", (uint8_t)usetimer); g_plugin.setByte(hContact, "Minutes", (uint8_t)minutes); - g_plugin.setWord(hContact, "Timer", (WORD)timer); + g_plugin.setWord(hContact, "Timer", (uint16_t)timer); //icon - g_plugin.setWord(hContact, "Icon", (WORD)icon); + g_plugin.setWord(hContact, "Icon", (uint16_t)icon); replaceAllStrings(hContact); } free(msg); diff --git a/protocols/Non-IM Contact/src/dialog.cpp b/protocols/Non-IM Contact/src/dialog.cpp index 8549d7cecc..1676198969 100644 --- a/protocols/Non-IM Contact/src/dialog.cpp +++ b/protocols/Non-IM Contact/src/dialog.cpp @@ -61,7 +61,7 @@ INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar g_plugin.setByte("AwayAsStatus", (uint8_t)IsDlgButtonChecked(hwnd, IDC_AWAYISNOTONLINE)); if (BST_UNCHECKED == IsDlgButtonChecked(hwnd, IDC_DISABLETIMER) && GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER_INT))) { GetDlgItemText(hwnd, IDC_TIMER_INT, tmp, _countof(tmp)); - g_plugin.setWord("Timer", (WORD)_wtoi(tmp)); + g_plugin.setWord("Timer", (uint16_t)_wtoi(tmp)); } else g_plugin.setWord("Timer", 0); return TRUE; @@ -217,22 +217,6 @@ INT_PTR LoadFilesDlg(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// -static int CALLBACK PropSheetProc(HWND, UINT uMsg, LPARAM lParam) -{ - if (uMsg == PSCB_PRECREATE) { - // Remove the DS_CONTEXTHELP style from the - // dialog box template - if (((DLGTEMPLATEEX*)lParam)->signature == 0xFFFF) - ((DLGTEMPLATEEX*)lParam)->style &= ~DS_CONTEXTHELP; - else - ((LPDLGTEMPLATE)lParam)->style &= ~DS_CONTEXTHELP; - - return TRUE; - } - - return 0; -} - void DoPropertySheet(MCONTACT hContact) { char nick[256]; @@ -294,9 +278,6 @@ void DoPropertySheet(MCONTACT hContact) } psh.nPages = _countof(psp); psh.ppsp = (LPCPROPSHEETPAGEA)&psp; - psh.pfnCallback = PropSheetProc; - - // Now do it and return PropertySheetA(&psh); } diff --git a/protocols/Non-IM Contact/src/files.cpp b/protocols/Non-IM Contact/src/files.cpp index 17a11edd3c..76302f3b9f 100644 --- a/protocols/Non-IM Contact/src/files.cpp +++ b/protocols/Non-IM Contact/src/files.cpp @@ -193,7 +193,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) timer = atoi(text); } mir_snprintf(fn, "fn%d_timer", i); - g_plugin.setWord(fn, (WORD)timer); + g_plugin.setWord(fn, (uint16_t)timer); SendMessage(hwnd, WM_RELOADWINDOW, 0, 0); } break; @@ -302,7 +302,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (!db_get_static(NULL, MODNAME, fn, string, _countof(string))) if (!strncmp("http://", string, mir_strlen("http://")) || !strncmp("https://", string, mir_strlen("https://"))) { mir_snprintf(fn, "fn%d_timer", i); - g_plugin.setWord(fn, (WORD)timer); + g_plugin.setWord(fn, (uint16_t)timer); } return TRUE; diff --git a/protocols/Non-IM Contact/src/namereplacing.cpp b/protocols/Non-IM Contact/src/namereplacing.cpp index 00a9ca07ab..d1a678d446 100644 --- a/protocols/Non-IM Contact/src/namereplacing.cpp +++ b/protocols/Non-IM Contact/src/namereplacing.cpp @@ -306,7 +306,7 @@ void checkStringForSaveN(CMStringA &str) break; case '1': case 'w': - db_set_w(0, A, B, (WORD)atoi(C)); + db_set_w(0, A, B, (uint16_t)atoi(C)); break; case '2': case 'd': @@ -433,7 +433,7 @@ void checkIcon(MCONTACT hContact, char* string) if (str) { int icon = getNumber(str + 5); if (icon >= 0) - g_plugin.setWord(hContact, "Status", (WORD)(ID_STATUS_OFFLINE + icon)); + g_plugin.setWord(hContact, "Status", (uint16_t)(ID_STATUS_OFFLINE + icon)); } } @@ -606,7 +606,7 @@ void WriteSetting(MCONTACT hContact, char* module1, char* setting1, char* module if ((status == ID_STATUS_ONLINE) || (status == ID_STATUS_AWAY) || (status == g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)) || g_plugin.getByte(hContact, "AlwaysVisible", 0)) - g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); + g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); else g_plugin.setWord(hContact, "Status", ID_STATUS_OFFLINE); } diff --git a/protocols/Non-IM Contact/src/services.cpp b/protocols/Non-IM Contact/src/services.cpp index 4a584e653a..4fda75ac4a 100644 --- a/protocols/Non-IM Contact/src/services.cpp +++ b/protocols/Non-IM Contact/src/services.cpp @@ -55,7 +55,7 @@ int SetLCStatus(WPARAM wParam, LPARAM) { int oldStatus = LCStatus; LCStatus = wParam; - g_plugin.setWord("Status", (WORD)wParam); + g_plugin.setWord("Status", (uint16_t)wParam); g_plugin.setWord("timerCount", 0); if (LCStatus == ID_STATUS_OFFLINE || (LCStatus == ID_STATUS_AWAY && !g_plugin.getByte("AwayAsStatus", 0)) || !g_plugin.getWord("Timer", 1)) killTimer(); @@ -69,27 +69,27 @@ int SetLCStatus(WPARAM wParam, LPARAM) switch (LCStatus) { case ID_STATUS_OFFLINE: if (g_plugin.getByte(hContact, "AlwaysVisible", 0) && !g_plugin.getByte(hContact, "VisibleUnlessOffline", 1)) - g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); + g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); else g_plugin.setWord(hContact, "Status", ID_STATUS_OFFLINE); break; case ID_STATUS_ONLINE: - g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); + g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); break; case ID_STATUS_AWAY: if (g_plugin.getByte("AwayAsStatus", 0) && (g_plugin.getByte(hContact, "AlwaysVisible", 0) || (g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE) == ID_STATUS_AWAY))) - g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); + g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); else if (!g_plugin.getByte("AwayAsStatus", 0)) - g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); + g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); else g_plugin.setWord(hContact, "Status", ID_STATUS_OFFLINE); break; default: if (g_plugin.getByte(hContact, "AlwaysVisible", 0) || LCStatus == g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)) - g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); + g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)); break; } } diff --git a/protocols/Non-IM Contact/src/stdafx.h b/protocols/Non-IM Contact/src/stdafx.h index d98b8e9607..eea3c27698 100644 --- a/protocols/Non-IM Contact/src/stdafx.h +++ b/protocols/Non-IM Contact/src/stdafx.h @@ -16,20 +16,6 @@ #include #include -struct DLGTEMPLATEEX -{ - WORD dlgVer; - WORD signature; - DWORD helpID; - DWORD exStyle; - DWORD style; - WORD cDlgItems; - short x; - short y; - short cx; - short cy; -}; - #include #include #include @@ -50,7 +36,7 @@ struct DLGTEMPLATEEX //======================================================= // Definitions //======================================================= -#define MODNAME "NIM_Contact" +#define MODNAME "NIM_Contact" #define modFullname "Non-IM Contact" #define MAXLINES 10000 #define MAX_STRING_LENGTH 10000 diff --git a/protocols/Non-IM Contact/src/timer.cpp b/protocols/Non-IM Contact/src/timer.cpp index c0c292dcc9..91359ef387 100644 --- a/protocols/Non-IM Contact/src/timer.cpp +++ b/protocols/Non-IM Contact/src/timer.cpp @@ -19,7 +19,7 @@ void timerFunc(void*) killTimer(); return; } - g_plugin.setWord("timerCount", (WORD)timerCount); + g_plugin.setWord("timerCount", (uint16_t)timerCount); /* update the web pages*/ for (int i = 0;; i++) { diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index 44fddd4a4d..185e7d947e 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -100,14 +100,14 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); proto = (CSametimeProto*)lParam; - WORD client_ver = proto->GetClientVersion(); + uint16_t client_ver = proto->GetClientVersion(); if (client_ver) { wchar_t verbuf[100]; mir_snwprintf(verbuf, TranslateT("Client protocol version: %03d.%03d"), (client_ver & 0xFF00) >> 8, client_ver & 0xFF); SetDlgItemText(hwndDlg, IDC_ST_CLIENTVER, verbuf); } - WORD server_ver = proto->GetServerVersion(); + uint16_t server_ver = proto->GetServerVersion(); if (server_ver) { wchar_t verbuf[100]; mir_snwprintf(verbuf, TranslateT("Server protocol version: %03d.%03d"), (server_ver & 0xFF00) >> 8, server_ver & 0xFF); diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h index 2f1cf45750..d38daef4ae 100644 --- a/protocols/Sametime/src/sametime_proto.h +++ b/protocols/Sametime/src/sametime_proto.h @@ -108,8 +108,8 @@ struct CSametimeProto : public PROTO void UpdateSelfStatus(); int SetIdle(bool idle); void SetSessionAwayMessage(int status, const wchar_t* msg); - WORD GetClientVersion(); - WORD GetServerVersion(); + uint16_t GetClientVersion(); + uint16_t GetServerVersion(); INT_PTR __cdecl SessionAnnounce(WPARAM wParam, LPARAM lParam); void InitAwayMsg(); void DeinitAwayMsg(); diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index 2eef58c14a..925681abdd 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -449,21 +449,21 @@ void __cdecl CSametimeProto::SessionThread(LPVOID) return; } -WORD CSametimeProto::GetClientVersion() +uint16_t CSametimeProto::GetClientVersion() { if (!session) return 0; - WORD retval = 0; + uint16_t retval = 0; retval = (UINT_PTR)mwSession_getProperty(session, mwSession_CLIENT_VER_MAJOR) << 8; retval |= (UINT_PTR)mwSession_getProperty(session, mwSession_CLIENT_VER_MINOR); return retval; } -WORD CSametimeProto::GetServerVersion() +uint16_t CSametimeProto::GetServerVersion() { if (!session) return 0; - WORD retval = 0; + uint16_t retval = 0; retval = (UINT_PTR)mwSession_getProperty(session, mwSession_SERVER_VER_MAJOR) << 8; retval |= (UINT_PTR)mwSession_getProperty(session, mwSession_SERVER_VER_MINOR); return retval; diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index afca4738ae..24135327e2 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -17,14 +17,14 @@ along with this program. If not, see . #include "stdafx.h" -WORD CSkypeProto::GetContactStatus(MCONTACT hContact) +uint16_t CSkypeProto::GetContactStatus(MCONTACT hContact) { return getWord(hContact, "Status", ID_STATUS_OFFLINE); } -void CSkypeProto::SetContactStatus(MCONTACT hContact, WORD status) +void CSkypeProto::SetContactStatus(MCONTACT hContact, uint16_t status) { - WORD oldStatus = GetContactStatus(hContact); + uint16_t oldStatus = GetContactStatus(hContact); if (oldStatus != status) { setWord(hContact, "Status", status); if (status == ID_STATUS_OFFLINE) diff --git a/protocols/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp index 9d30f6f8a6..9e3b013a20 100644 --- a/protocols/SkypeWeb/src/skype_db.cpp +++ b/protocols/SkypeWeb/src/skype_db.cpp @@ -38,7 +38,7 @@ MEVENT CSkypeProto::GetMessageFromDb(const char *messageId) return db_event_getById(m_szModuleName, messageId); } -MEVENT CSkypeProto::AddDbEvent(WORD type, MCONTACT hContact, DWORD timestamp, DWORD flags, const CMStringW &content, const CMStringA &msgId) +MEVENT CSkypeProto::AddDbEvent(uint16_t type, MCONTACT hContact, DWORD timestamp, DWORD flags, const CMStringW &content, const CMStringA &msgId) { if (MEVENT hDbEvent = GetMessageFromDb(msgId)) return hDbEvent; diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 4e0782f5a4..8720fa7a46 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -248,8 +248,8 @@ private: void __cdecl CSkypeProto::SendFileThread(void *p); // contacts - WORD GetContactStatus(MCONTACT hContact); - void SetContactStatus(MCONTACT hContact, WORD status); + uint16_t GetContactStatus(MCONTACT hContact); + void SetContactStatus(MCONTACT hContact, uint16_t status); void SetAvatarUrl(MCONTACT hContact, CMStringW &tszUrl); void ReloadAvatarInfo(MCONTACT hContact); @@ -266,7 +266,7 @@ private: std::map m_mpOutMessagesIds; MEVENT GetMessageFromDb(const char *messageId); - MEVENT AddDbEvent(WORD type, MCONTACT hContact, DWORD timestamp, DWORD flags, const CMStringW &content, const CMStringA &msgId); + MEVENT AddDbEvent(uint16_t type, MCONTACT hContact, DWORD timestamp, DWORD flags, const CMStringW &content, const CMStringA &msgId); void EditEvent(MCONTACT hContact, MEVENT hEvent, const CMStringW &content, time_t edit_time); int OnSendMessage(MCONTACT hContact, int flags, const char *message); diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 7f1862408a..987ad50528 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -6,12 +6,12 @@ void CSteamProto::SetAllContactStatuses(int status) SetContactStatus(hContact, status); } -void CSteamProto::SetContactStatus(MCONTACT hContact, WORD status) +void CSteamProto::SetContactStatus(MCONTACT hContact, uint16_t status) { if (!hContact) return; - WORD oldStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE); + uint16_t oldStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE); if (oldStatus == status) return; @@ -152,10 +152,10 @@ void CSteamProto::UpdateContactDetails(MCONTACT hContact, const JSONNode &data) // status // note: this here is often wrong info, probably depending on publicity of steam profile // but sometimes polling does not get status at all - WORD oldStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE); + uint16_t oldStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE); // so, set status only if contact is offline if (oldStatus == ID_STATUS_OFFLINE) { - WORD status = SteamToMirandaStatus((PersonaState)data["personastate"].as_int()); + uint16_t status = SteamToMirandaStatus((PersonaState)data["personastate"].as_int()); SetContactStatus(hContact, status); } @@ -165,7 +165,7 @@ void CSteamProto::UpdateContactDetails(MCONTACT hContact, const JSONNode &data) if (stateflags == PersonaStateFlag::None) { // nothing special, either standard client or in different status (only online, I want to play, I want to trade statuses support this flags) - WORD status = getWord(hContact, "Status", ID_STATUS_OFFLINE); + uint16_t status = getWord(hContact, "Status", ID_STATUS_OFFLINE); if (status == ID_STATUS_ONLINE || status == ID_STATUS_FREECHAT) setWString(hContact, "MirVer", L"Steam"); } diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index 8e4596c8ae..4c72b97c57 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -153,7 +153,7 @@ protected: // contacts void SetAllContactStatuses(int status); - void SetContactStatus(MCONTACT hContact, WORD status); + void SetContactStatus(MCONTACT hContact, uint16_t status); MCONTACT GetContactFromAuthEvent(MEVENT hEvent); @@ -239,7 +239,7 @@ protected: INT_PTR __cdecl OnAccountManagerInit(WPARAM wParam, LPARAM lParam); // utils - static WORD SteamToMirandaStatus(PersonaState state); + static uint16_t SteamToMirandaStatus(PersonaState state); static PersonaState MirandaToSteamState(int status); static int RsaEncrypt(const char *pszModulus, DWORD &exponent, const char *data, uint8_t *encrypted, DWORD &encryptedSize); diff --git a/protocols/Steam/src/steam_utils.cpp b/protocols/Steam/src/steam_utils.cpp index ad6b8b3732..7322aaf092 100644 --- a/protocols/Steam/src/steam_utils.cpp +++ b/protocols/Steam/src/steam_utils.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -WORD CSteamProto::SteamToMirandaStatus(PersonaState state) +uint16_t CSteamProto::SteamToMirandaStatus(PersonaState state) { switch (state) { case PersonaState::Offline: diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index bf0ba87a1c..7f80531fee 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -1,13 +1,13 @@ #include "stdafx.h" -WORD CToxProto::GetContactStatus(MCONTACT hContact) +uint16_t CToxProto::GetContactStatus(MCONTACT hContact) { return getWord(hContact, "Status", ID_STATUS_OFFLINE); } -void CToxProto::SetContactStatus(MCONTACT hContact, WORD status) +void CToxProto::SetContactStatus(MCONTACT hContact, uint16_t status) { - WORD oldStatus = GetContactStatus(hContact); + uint16_t oldStatus = GetContactStatus(hContact); if (oldStatus != status) setWord(hContact, "Status", status); } diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 8367c8c71f..e3713c9de6 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -140,8 +140,8 @@ private: int __cdecl OnUserInfoInit(WPARAM wParam, LPARAM lParam); // contacts - WORD GetContactStatus(MCONTACT hContact); - void SetContactStatus(MCONTACT hContact, WORD status); + uint16_t GetContactStatus(MCONTACT hContact); + void SetContactStatus(MCONTACT hContact, uint16_t status); MCONTACT GetContact(const Tox *tox, const int friendNumber); MCONTACT GetContact(const char *pubKey); @@ -236,7 +236,7 @@ private: static bool IsFileExists(const wchar_t* path); - MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, uint8_t *pBlob, size_t cbBlob); + MEVENT AddEventToDb(MCONTACT hContact, uint16_t type, DWORD timestamp, DWORD flags, uint8_t *pBlob, size_t cbBlob); }; struct CMPlugin : public ACCPROTOPLUGIN diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index 96e7934b2b..4620f5726c 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -126,7 +126,7 @@ bool CToxProto::IsFileExists(const wchar_t* path) return _waccess(path, 0) == 0; } -MEVENT CToxProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, uint8_t *pBlob, size_t cbBlob) +MEVENT CToxProto::AddEventToDb(MCONTACT hContact, uint16_t type, DWORD timestamp, DWORD flags, uint8_t *pBlob, size_t cbBlob) { DBEVENTINFO dbei = {}; dbei.szModule = this->m_szModuleName; diff --git a/protocols/Weather/src/stdafx.h b/protocols/Weather/src/stdafx.h index bb8f288541..5d8597247e 100644 --- a/protocols/Weather/src/stdafx.h +++ b/protocols/Weather/src/stdafx.h @@ -187,16 +187,16 @@ struct MYOPTIONS uint8_t RemoveOldData; uint8_t MakeItalic; - WORD UpdateTime; - WORD AvatarSize; + uint16_t UpdateTime; + uint16_t AvatarSize; // units - WORD tUnit; - WORD wUnit; - WORD vUnit; - WORD pUnit; - WORD dUnit; - WORD eUnit; + uint16_t tUnit; + uint16_t wUnit; + uint16_t vUnit; + uint16_t pUnit; + uint16_t dUnit; + uint16_t eUnit; wchar_t DegreeSign[4]; uint8_t DoNotAppendUnit; uint8_t NoFrac; @@ -407,7 +407,7 @@ int MapCondToStatus(MCONTACT hContact); HICON GetStatusIcon(MCONTACT hContact); HICON GetStatusIconBig(MCONTACT hContact); -WORD GetIcon(const wchar_t* cond, WIDATA *Data); +uint16_t GetIcon(const wchar_t* cond, WIDATA *Data); void CaseConv(wchar_t *str); void TrimString(char *str); void TrimString(wchar_t *str); @@ -437,7 +437,7 @@ void wSetData(wchar_t *&Data, const wchar_t *Value); void wfree(char *&Data); void wfree(wchar_t *&Data); -void DBDataManage(MCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM lParam); +void DBDataManage(MCONTACT hContact, uint16_t Mode, WPARAM wParam, LPARAM lParam); // functions in weather_http.c int InternetDownloadFile (char *szUrl, char *cookie, char *userAgent, wchar_t** szData); @@ -471,7 +471,7 @@ const wchar_t* GetDefaultText(int c); // functions in weather_popup.c int WeatherPopup(WPARAM wParam, LPARAM lParam); int WeatherError(WPARAM wParam, LPARAM lParam); -int WPShowMessage(const wchar_t* lpzText, WORD kind); +int WPShowMessage(const wchar_t* lpzText, uint16_t kind); LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); diff --git a/protocols/Weather/src/weather_conv.cpp b/protocols/Weather/src/weather_conv.cpp index 2c29e1865f..dc1dfa4f03 100644 --- a/protocols/Weather/src/weather_conv.cpp +++ b/protocols/Weather/src/weather_conv.cpp @@ -317,9 +317,9 @@ void GetElev(wchar_t *tempchar, wchar_t *unit, wchar_t *str) // return value = status for the icon (ONLINE, OFFLINE, etc) static const wchar_t *statusStr[MAX_COND] = { L"Lightning", L"Fog", L"Snow", L"Rain", L"Partly Cloudy", L"Cloudy", L"Sunny", L"N/A", L"Rain Shower", L"Snow Shower"}; -static const WORD statusValue[MAX_COND] = { LIGHT, FOG, SNOW, RAIN, PCLOUDY, CLOUDY, SUNNY, NA, RSHOWER, SSHOWER }; +static const uint16_t statusValue[MAX_COND] = { LIGHT, FOG, SNOW, RAIN, PCLOUDY, CLOUDY, SUNNY, NA, RSHOWER, SSHOWER }; -WORD GetIcon(const wchar_t *cond, WIDATA *Data) +uint16_t GetIcon(const wchar_t *cond, WIDATA *Data) { // set the icon using ini for (int i = 0; i < _countof(statusValue); i++) diff --git a/protocols/Weather/src/weather_data.cpp b/protocols/Weather/src/weather_data.cpp index 69c92d8cda..0f3cf9ccc9 100644 --- a/protocols/Weather/src/weather_data.cpp +++ b/protocols/Weather/src/weather_data.cpp @@ -402,7 +402,7 @@ int GetWeatherDataFromDB(const char *szSetting, void *lparam) // remove or display the weather information for a contact // hContact - the contact in which the info is going to be removed // -void DBDataManage(MCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM) +void DBDataManage(MCONTACT hContact, uint16_t Mode, WPARAM wParam, LPARAM) { // get all the settings and store them in a temporary list LIST arSettings(10); diff --git a/protocols/Weather/src/weather_opt.cpp b/protocols/Weather/src/weather_opt.cpp index 3a8d7f26dd..9dd186f751 100644 --- a/protocols/Weather/src/weather_opt.cpp +++ b/protocols/Weather/src/weather_opt.cpp @@ -268,7 +268,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l // get update time and remove the old timer GetDlgItemText(hdlg, IDC_UPDATETIME, str, _countof(str)); - opt.UpdateTime = (WORD)_wtoi(str); + opt.UpdateTime = (uint16_t)_wtoi(str); if (opt.UpdateTime < 1) opt.UpdateTime = 1; KillTimer(nullptr, timerId); timerId = SetTimer(nullptr, 0, opt.UpdateTime * 60000, timerProc); diff --git a/protocols/Weather/src/weather_popup.cpp b/protocols/Weather/src/weather_popup.cpp index 94ed3508a4..f0be40f798 100644 --- a/protocols/Weather/src/weather_popup.cpp +++ b/protocols/Weather/src/weather_popup.cpp @@ -81,7 +81,7 @@ int WeatherError(WPARAM wParam, LPARAM lParam) // (threaded) // lpzText = error text // kind = display type (see m_popup.h) -int WPShowMessage(const wchar_t* lpzText, WORD kind) +int WPShowMessage(const wchar_t* lpzText, uint16_t kind) { NotifyEventHooks(hHookWeatherError, (WPARAM)lpzText, (LPARAM)kind); return 0; diff --git a/protocols/Weather/src/weather_update.cpp b/protocols/Weather/src/weather_update.cpp index 93a519f495..37d75a01f8 100644 --- a/protocols/Weather/src/weather_update.cpp +++ b/protocols/Weather/src/weather_update.cpp @@ -398,7 +398,7 @@ int GetWeatherData(MCONTACT hContact) if (Data == nullptr) return SVC_NOT_FOUND; // the ini for the station cannot be found - WORD cond = NA; + uint16_t cond = NA; char loc[256]; for (int i = 0; i < 4; ++i) { // generate update URL diff --git a/protocols/WebView/src/main.cpp b/protocols/WebView/src/main.cpp index 48411337cc..2c5c97fc9a 100644 --- a/protocols/WebView/src/main.cpp +++ b/protocols/WebView/src/main.cpp @@ -71,7 +71,7 @@ void InitServices() void ChangeContactStatus(int con_stat) { - WORD status_code = 0; + uint16_t status_code = 0; if (con_stat == 0) status_code = ID_STATUS_OFFLINE; if (con_stat == 1) diff --git a/protocols/YAMN/src/account.cpp b/protocols/YAMN/src/account.cpp index 43af27579c..302249841e 100644 --- a/protocols/YAMN/src/account.cpp +++ b/protocols/YAMN/src/account.cpp @@ -505,8 +505,8 @@ DWORD ReadAccountFromMemory(CAccount *Which, char **Parser, char *End) if (Stat = ReadStringFromMemory(Parser, End, &Which->Server->Name)) #endif return Stat; - Which->Server->Port = *(WORD *)(*Parser); - (*Parser) += sizeof(WORD); + Which->Server->Port = *(uint16_t *)(*Parser); + (*Parser) += sizeof(uint16_t); if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD @@ -550,9 +550,9 @@ DWORD ReadAccountFromMemory(CAccount *Which, char **Parser, char *End) #endif //Read account miscellaneous parameters - Which->Interval = *(WORD *)(*Parser); + Which->Interval = *(uint16_t *)(*Parser); Which->TimeLeft = Which->Interval; //check on loading - (*Parser) += sizeof(WORD); + (*Parser) += sizeof(uint16_t); if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD @@ -885,7 +885,7 @@ static INT_PTR PerformAccountWriting(HYAMNPROTOPLUGIN Plugin, HANDLE File) (!WriteFile(File, (char *)&ActualAccount->PluginFlags, sizeof(DWORD), &WrittenBytes, nullptr)))) throw (DWORD)EACC_SYSTEM; - if (!WriteFile(File, (char *)&ActualAccount->Interval, sizeof(WORD), &WrittenBytes, nullptr)) + if (!WriteFile(File, (char *)&ActualAccount->Interval, sizeof(uint16_t), &WrittenBytes, nullptr)) throw (DWORD)EACC_SYSTEM; if ((!WriteFile(File, (char *)&ActualAccount->NewMailN.Flags, sizeof(DWORD), &WrittenBytes, nullptr)) || diff --git a/protocols/YAMN/src/browser/mailbrowser.cpp b/protocols/YAMN/src/browser/mailbrowser.cpp index 4c0b3c285f..80b379d2f2 100644 --- a/protocols/YAMN/src/browser/mailbrowser.cpp +++ b/protocols/YAMN/src/browser/mailbrowser.cpp @@ -1084,7 +1084,7 @@ void FileTimeToLocalizedDateTime(LONGLONG filetime, wchar_t *dateout, int lendat return; } SYSTEMTIME st; - WORD wTodayYear = 0, wTodayMonth = 0, wTodayDay = 0; + uint16_t wTodayYear = 0, wTodayMonth = 0, wTodayDay = 0; FILETIME ft; BOOL willShowDate = !(optDateTime&SHOWDATENOTODAY); if (!willShowDate) { diff --git a/protocols/YAMN/src/proto/pop3/pop3comm.cpp b/protocols/YAMN/src/proto/pop3/pop3comm.cpp index 526ffaad03..bd6b72bd11 100644 --- a/protocols/YAMN/src/proto/pop3/pop3comm.cpp +++ b/protocols/YAMN/src/proto/pop3/pop3comm.cpp @@ -354,7 +354,7 @@ DWORD WINAPI WritePOP3Options(HANDLE File, CAccount *Which) DWORD Ver = POP3_FILEVERSION; if ((!WriteFile(File, (char *)&Ver, sizeof(DWORD), &WrittenBytes, nullptr)) || - (!WriteFile(File, (char *)&((HPOP3ACCOUNT)Which)->CP, sizeof(WORD), &WrittenBytes, nullptr))) + (!WriteFile(File, (char *)&((HPOP3ACCOUNT)Which)->CP, sizeof(uint16_t), &WrittenBytes, nullptr))) return EACC_SYSTEM; return 0; } @@ -372,8 +372,8 @@ DWORD WINAPI ReadPOP3Options(CAccount *Which, char **Parser, char *End) if (Ver != POP3_FILEVERSION) return EACC_FILECOMPATIBILITY; - ((HPOP3ACCOUNT)Which)->CP = *(WORD *)(*Parser); - (*Parser) += sizeof(WORD); + ((HPOP3ACCOUNT)Which)->CP = *(uint16_t *)(*Parser); + (*Parser) += sizeof(uint16_t); if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD diff --git a/protocols/YAMN/src/proto/pop3/pop3comm.h b/protocols/YAMN/src/proto/pop3/pop3comm.h index 3d98675d3c..4abae49281 100644 --- a/protocols/YAMN/src/proto/pop3/pop3comm.h +++ b/protocols/YAMN/src/proto/pop3/pop3comm.h @@ -15,7 +15,7 @@ typedef struct CPOP3Account: public CAccount class CPop3Client Client; // This member is usefull for MIME headers. It is default codepage, if no other codepage found - WORD CP; //access only through AccountAccessSO + uint16_t CP; //access only through AccountAccessSO // In this memeber last error code is stored DWORD SystemError; //access through UseInternetFree diff --git a/protocols/YAMN/src/proto/pop3/pop3opt.cpp b/protocols/YAMN/src/proto/pop3/pop3opt.cpp index a24eba24e2..dd85484a37 100644 --- a/protocols/YAMN/src/proto/pop3/pop3opt.cpp +++ b/protocols/YAMN/src/proto/pop3/pop3opt.cpp @@ -78,7 +78,7 @@ INT_PTR CALLBACK DlgProcPluginOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM) case WM_COMMAND: { - WORD wNotifyCode = HIWORD(wParam); + uint16_t wNotifyCode = HIWORD(wParam); switch (LOWORD(wParam)) { case IDC_COMBOPLUGINS: if (wNotifyCode == CBN_SELCHANGE) { @@ -1158,7 +1158,7 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM case WM_COMMAND: { - WORD wNotifyCode = HIWORD(wParam); + uint16_t wNotifyCode = HIWORD(wParam); switch (LOWORD(wParam)) { LONG Result; case IDC_COMBOACCOUNT: diff --git a/protocols/YAMN/src/stdafx.h b/protocols/YAMN/src/stdafx.h index 3c9f07cd79..1925042acb 100644 --- a/protocols/YAMN/src/stdafx.h +++ b/protocols/YAMN/src/stdafx.h @@ -134,7 +134,7 @@ INT_PTR UnloadMailDataSvc(WPARAM wParam, LPARAM); INT_PTR SaveMailDataSvc(WPARAM wParam, LPARAM lParam); //From mime.cpp -//void WINAPI ExtractHeaderFcn(char *,int,WORD,HYAMNMAIL); //already in MailExported +//void WINAPI ExtractHeaderFcn(char *,int,uint16_t,HYAMNMAIL); //already in MailExported struct _tcptable { char *NameBase, *NameSub; diff --git a/protocols/YAMN/src/synchro.cpp b/protocols/YAMN/src/synchro.cpp index 433f0768b6..b6007d992d 100644 --- a/protocols/YAMN/src/synchro.cpp +++ b/protocols/YAMN/src/synchro.cpp @@ -59,7 +59,7 @@ void WINAPI ReadDoneFcn(PSWMRG SObject); // Note you must not read the number from memory directly, because // CPU can stop reading thread when it has read HI-Word, then another thread // can change the value and then OS starts the previous thread, that reads the -// LO-WORD of DWORD. And the return value HI+LO-WORD is corrupted +// LO-uint16_t of DWORD. And the return value HI+LO-uint16_t is corrupted DWORD WINAPI SCGetNumberFcn(PSCOUNTER SCounter); // Increments SCOUNTER and unsets event diff --git a/protocols/YAMN/src/yamn.cpp b/protocols/YAMN/src/yamn.cpp index d355ed3b13..ff5ddfceee 100644 --- a/protocols/YAMN/src/yamn.cpp +++ b/protocols/YAMN/src/yamn.cpp @@ -224,7 +224,7 @@ ChangeIsCountingStatusLabel: #endif if (((ActualAccount->isCounting) != 0) != isAccountCounting) { ActualAccount->isCounting=isAccountCounting; - WORD cStatus = g_plugin.getWord(ActualAccount->hContact, "Status"); + uint16_t cStatus = g_plugin.getWord(ActualAccount->hContact, "Status"); switch (cStatus) { case ID_STATUS_ONLINE: case ID_STATUS_OFFLINE: -- cgit v1.2.3