From cddcd7483a7c472598af098e759e5d309024f606 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 20:31:39 +0300 Subject: DWORD -> uint32_t --- plugins/NewAwaySysMod/src/AwayOpt.cpp | 4 ++-- plugins/NewAwaySysMod/src/AwaySys.cpp | 6 +++--- plugins/NewAwaySysMod/src/Client.cpp | 2 +- plugins/NewAwaySysMod/src/ContactList.cpp | 4 ++-- plugins/NewAwaySysMod/src/ContactList.h | 4 ++-- plugins/NewAwaySysMod/src/MsgEventAdded.cpp | 10 +++++----- plugins/NewAwaySysMod/src/Options.cpp | 2 +- plugins/NewAwaySysMod/src/Options.h | 4 ++-- plugins/NewAwaySysMod/src/Properties.h | 4 ++-- plugins/NewAwaySysMod/src/SetAwayMsg.cpp | 7 ++++--- plugins/NewAwaySysMod/src/stdafx.h | 4 ++-- 11 files changed, 26 insertions(+), 25 deletions(-) (limited to 'plugins/NewAwaySysMod/src') diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp index a6b248ccb7..b12c350604 100644 --- a/plugins/NewAwaySysMod/src/AwayOpt.cpp +++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp @@ -858,7 +858,7 @@ static LRESULT CALLBACK ContactsSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, { switch (Msg) { case WM_LBUTTONDBLCLK: - DWORD hitFlags; + uint32_t hitFlags; HANDLE hItem = (HANDLE)SendMessage(hWnd, CLM_HITTEST, (WPARAM)&hitFlags, lParam); if (hItem && (hitFlags & CLCHT_ONITEMEXTRA)) Msg = WM_LBUTTONDOWN; // may be considered as a hack, but it's needed to make clicking on extra icons more convenient @@ -946,7 +946,7 @@ INT_PTR CALLBACK ContactsOptDlg(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) if (nm->iColumn == -1) break; - DWORD hitFlags; + uint32_t hitFlags; HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y)); if (!hItem || !(hitFlags & CLCHT_ONITEMEXTRA)) break; diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index cb5dbbd74e..eb50f63ee7 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -91,7 +91,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRAWAY ///////////////////////////////////////////////////////////////////////////////////////// -TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto, DWORD UIN, int iStatus) +TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto, uint32_t UIN, int iStatus) { // hContact is the contact that requests the status message if (hContact != INVALID_CONTACT_ID) @@ -139,8 +139,8 @@ int StatusChanged(WPARAM wParam, LPARAM lParam) g_fNoProcessing = false; // take it off return 0; } - DWORD Flag1 = 0; - DWORD Flag3 = 0; + uint32_t Flag1 = 0; + uint32_t Flag3 = 0; if (lParam) { Flag1 = CallProtoService((char*)lParam, PS_GETCAPS, PFLAGNUM_1, 0); Flag3 = CallProtoService((char*)lParam, PS_GETCAPS, PFLAGNUM_3, 0); diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index b99f28bf58..ad25887e96 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -33,7 +33,7 @@ void __cdecl UpdateMsgsThreadProc(void *) Thread_SetName("NewAwaySysMod: UpdateMsgsThreadProc"); while (WaitForSingleObject(g_hTerminateUpdateMsgsThread, 0) == WAIT_TIMEOUT && !Miranda_IsTerminated()) { - DWORD MinUpdateTimeDifference = (DWORD)g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_UPDATEMSGSPERIOD) * 1000; // in milliseconds + uint32_t MinUpdateTimeDifference = (uint32_t)g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_UPDATEMSGSPERIOD) * 1000; // in milliseconds for (auto &p : Accounts()) { if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) { int Status = Proto_GetStatus(p->szModuleName); diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp index e10229465e..43a5dabb66 100644 --- a/plugins/NewAwaySysMod/src/ContactList.cpp +++ b/plugins/NewAwaySysMod/src/ContactList.cpp @@ -499,13 +499,13 @@ int CCList::GetItemType(HTREEITEM hItem) // returns a MCLCIT_ (see below) return (IsHContactInfo(hContact)) ? MCLCIT_INFO : ((IsHContactGroup(hContact)) ? MCLCIT_GROUP : MCLCIT_CONTACT); } -DWORD CCList::GetItemTypeAsCLGNFlag(HTREEITEM hItem) +uint32_t CCList::GetItemTypeAsCLGNFlag(HTREEITEM hItem) { MCONTACT hContact = GetItemData(hItem).hContact; return (IsHContactInfo(hContact)) ? MCLGN_INFO : ((IsHContactGroup(hContact)) ? MCLGN_GROUP : MCLGN_CONTACT); } -HTREEITEM CCList::GetNextItem(DWORD Flags, HTREEITEM hItem) +HTREEITEM CCList::GetNextItem(uint32_t Flags, HTREEITEM hItem) { switch (Flags & ~(MCLGN_MULTILEVEL | MCLGN_NOTCHILD | MCLGN_ANY)) { case MCLGN_ROOT: diff --git a/plugins/NewAwaySysMod/src/ContactList.h b/plugins/NewAwaySysMod/src/ContactList.h index df629133ee..5ffa8de589 100644 --- a/plugins/NewAwaySysMod/src/ContactList.h +++ b/plugins/NewAwaySysMod/src/ContactList.h @@ -57,7 +57,7 @@ public: void SetExtraImage(HTREEITEM hItem, int iColumn, int iImage); // set iImage to CLC_EXTRAICON_EMPTY to reset image void SetExtraImageList(HIMAGELIST hImgList); int GetItemType(HTREEITEM hItem); // returns a MCLCIT_ (see below) - HTREEITEM GetNextItem(DWORD Flags, HTREEITEM hItem); + HTREEITEM GetNextItem(uint32_t Flags, HTREEITEM hItem); void SortContacts(); MCONTACT GethContact(HTREEITEM hItem); // returns hContact, hGroup or hInfo HTREEITEM HitTest(LPPOINT pt, PDWORD hitFlags); // pt is relative to control; returns hItem or NULL @@ -78,7 +78,7 @@ private: HTREEITEM TreeView_GetLastChild(HWND hTreeView, HTREEITEM hItem); HTREEITEM FindContact(MCONTACT hContact); // returns NULL if not found void SelectGroups(HTREEITEM hCurItem, bool bSelected); - DWORD GetItemTypeAsCLGNFlag(HTREEITEM hItem); // returns MCLGN_CONTACT, MCLGN_GROUP or MCLGN_INFO + uint32_t GetItemTypeAsCLGNFlag(HTREEITEM hItem); // returns MCLGN_CONTACT, MCLGN_GROUP or MCLGN_INFO HWND hTreeView; WNDPROC OrigTreeViewProc; diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 4338e1f4b6..7851b535db 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -93,10 +93,10 @@ int IsSRMsgWindowOpen(MCONTACT hContact) class CMetacontactEvent { public: - CMetacontactEvent(MCONTACT hMetaContact, DWORD timestamp, int bMsgWindowIsOpen) : hMetaContact(hMetaContact), timestamp(timestamp), bMsgWindowIsOpen(bMsgWindowIsOpen) {}; + CMetacontactEvent(MCONTACT hMetaContact, uint32_t timestamp, int bMsgWindowIsOpen) : hMetaContact(hMetaContact), timestamp(timestamp), bMsgWindowIsOpen(bMsgWindowIsOpen) {}; MCONTACT hMetaContact; - DWORD timestamp; + uint32_t timestamp; int bMsgWindowIsOpen; }; @@ -119,7 +119,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) if (!szProto) return 0; - DWORD Flags1 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0); + uint32_t Flags1 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0); if (!(Flags1 & PF1_IMSEND)) // don't reply to protocols that don't support outgoing messages return 0; @@ -131,7 +131,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) return 0; // remove outdated events first - DWORD CurTime = time(0); + uint32_t CurTime = time(0); int i; for (i = MetacontactEvents.GetSize() - 1; i >= 0; i--) if (CurTime - MetacontactEvents[i].timestamp > MAX_REPLY_TIMEDIFF) @@ -153,7 +153,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) // ugly workaround for metacontacts, part i; store all metacontacts' events to a temporary array, so we'll be able to get the 'source' protocol when subcontact event happens later. we need the protocol to get its status and per-status settings properly if (!mir_strcmp(szProto, META_PROTO)) { // remove outdated events first - DWORD CurTime = time(0); + uint32_t CurTime = time(0); for (int i = MetacontactEvents.GetSize() - 1; i >= 0; i--) if (CurTime - MetacontactEvents[i].timestamp > MAX_REPLY_TIMEDIFF) MetacontactEvents.RemoveElem(i); diff --git a/plugins/NewAwaySysMod/src/Options.cpp b/plugins/NewAwaySysMod/src/Options.cpp index 223b678f81..ee7fa7edbd 100644 --- a/plugins/NewAwaySysMod/src/Options.cpp +++ b/plugins/NewAwaySysMod/src/Options.cpp @@ -352,7 +352,7 @@ void COptItem_TreeCtrl::WndToMem(HWND hWnd) { HWND hTreeView = GetDlgItem(hWnd, m_dlgItemID); for (int i = 0; i < m_value.GetSize(); i++) { - DWORD State = TreeView_GetItemState(hTreeView, m_value[i].hItem, TVIS_EXPANDED | TVIS_STATEIMAGEMASK); + uint32_t State = TreeView_GetItemState(hTreeView, m_value[i].hItem, TVIS_EXPANDED | TVIS_STATEIMAGEMASK); int OldFlags = m_value[i].Flags; if (State & TVIS_EXPANDED) m_value[i].Flags |= TIF_EXPANDED; diff --git a/plugins/NewAwaySysMod/src/Options.h b/plugins/NewAwaySysMod/src/Options.h index c73ba45420..4dd6b22432 100644 --- a/plugins/NewAwaySysMod/src/Options.h +++ b/plugins/NewAwaySysMod/src/Options.h @@ -237,8 +237,8 @@ public: virtual COptItem* Copy() { return new COptItem_Colourpicker(*this); } - DWORD m_defValue; - DWORD m_value; + uint32_t m_defValue; + uint32_t m_value; }; diff --git a/plugins/NewAwaySysMod/src/Properties.h b/plugins/NewAwaySysMod/src/Properties.h index c17ce00a82..ab6a80596a 100644 --- a/plugins/NewAwaySysMod/src/Properties.h +++ b/plugins/NewAwaySysMod/src/Properties.h @@ -117,13 +117,13 @@ public: return *this; } operator TCString() { return CurStatusMsg; } - DWORD GetUpdateTimeDifference() + uint32_t GetUpdateTimeDifference() { ULARGE_INTEGER CurTime; SYSTEMTIME st; GetLocalTime(&st); SystemTimeToFileTime(&st, (LPFILETIME)&CurTime); - return (DWORD)((CurTime.QuadPart - LastUpdateTime.QuadPart) / 10000); // in milliseconds + return (uint32_t)((CurTime.QuadPart - LastUpdateTime.QuadPart) / 10000); // in milliseconds } private: TCString CurStatusMsg; diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index 10a6260029..9645eae32e 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -73,7 +73,7 @@ static LRESULT CALLBACK MsgEditSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, return 0; } if (wParam == 127) { // ctrl-backspace - DWORD start, end; + uint32_t start, end; SendMessage(hWnd, EM_GETSEL, (WPARAM)&end, NULL); SendMessage(hWnd, WM_KEYDOWN, VK_LEFT, 0); SendMessage(hWnd, EM_GETSEL, (WPARAM)&start, NULL); @@ -130,18 +130,19 @@ static LRESULT CALLBACK SplitterSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, static LRESULT CALLBACK CListSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { CCList *dat = CWndUserData(GetParent(hWnd)).GetCList(); + DWORD hitFlags; + switch (Msg) { case WM_MOUSEMOVE: { - DWORD hitFlags; POINT pt = { (short)LOWORD(lParam), (short)HIWORD(lParam) }; if (dat->HitTest(&pt, &hitFlags) && hitFlags & MCLCHT_ONITEMEXTRA) lParam = 0; // reset mouse coordinates, so TreeView's wndproc will not draw any item in a hovered state } break; + case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: - DWORD hitFlags; POINT pt = { (short)LOWORD(lParam), (short)HIWORD(lParam) }; if (dat->HitTest(&pt, &hitFlags) && hitFlags & MCLCHT_ONITEMEXTRA) { SetFocus(hWnd); diff --git a/plugins/NewAwaySysMod/src/stdafx.h b/plugins/NewAwaySysMod/src/stdafx.h index c7cab6df0d..26d2ba01f6 100644 --- a/plugins/NewAwaySysMod/src/stdafx.h +++ b/plugins/NewAwaySysMod/src/stdafx.h @@ -230,7 +230,7 @@ struct VAR_PARSE_DATA { char *szProto; TCString Message; - DWORD UIN; + uint32_t UIN; int Flags; // a combination of VPF_ flags }; @@ -274,7 +274,7 @@ extern bool g_fNoProcessing; extern int g_bIsIdle; // AwaySys.cpp -TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto = nullptr, DWORD UIN = 0, int iStatus = 0); +TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto = nullptr, uint32_t UIN = 0, int iStatus = 0); // Client.cpp void InitUpdateMsgs(); -- cgit v1.2.3