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/SeenPlugin/src/options.cpp | 8 ++++---- plugins/SeenPlugin/src/stdafx.h | 8 ++++---- plugins/SeenPlugin/src/utils.cpp | 28 ++++++++++++++-------------- 3 files changed, 22 insertions(+), 22 deletions(-) (limited to 'plugins/SeenPlugin') diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index 01b8237256..af07e1fee6 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -112,7 +112,7 @@ public: for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_MAX; i++) { char szSetting[100]; mir_snprintf(szSetting, "Col_%d", i - ID_STATUS_OFFLINE); - DWORD sett = g_plugin.getDword(szSetting, StatusColors15bits[i - ID_STATUS_OFFLINE]); + uint32_t sett = g_plugin.getDword(szSetting, StatusColors15bits[i - ID_STATUS_OFFLINE]); COLORREF back, text; GetColorsFromDWord(&back, &text, sett); @@ -137,7 +137,7 @@ public: for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_MAX; i++) { COLORREF back = SendDlgItemMessage(m_hwnd, i, CPM_GETCOLOUR, 0, 0); COLORREF text = SendDlgItemMessage(m_hwnd, i + 20, CPM_GETCOLOUR, 0, 0); - DWORD sett = GetDWordFromColors(back, text); + uint32_t sett = GetDWordFromColors(back, text); char szSetting[100]; mir_snprintf(szSetting, "Col_%d", i - ID_STATUS_OFFLINE); @@ -161,7 +161,7 @@ public: POPUPDATAW ppd; ppd.colorBack = SendDlgItemMessage(m_hwnd, idBack, CPM_GETCOLOUR, 0, 0); ppd.colorText = SendDlgItemMessage(m_hwnd, idText, CPM_GETCOLOUR, 0, 0); - DWORD temp = GetDWordFromColors(ppd.colorBack, ppd.colorText); + uint32_t temp = GetDWordFromColors(ppd.colorBack, ppd.colorText); GetColorsFromDWord(&ppd.colorBack, &ppd.colorText, temp); SendDlgItemMessage(m_hwnd, idBack, CPM_SETCOLOUR, 0, ppd.colorBack); SendDlgItemMessage(m_hwnd, idText, CPM_SETCOLOUR, 0, ppd.colorText); @@ -194,7 +194,7 @@ public: void onClick_Reset(CCtrlButton *) { for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_MAX; i++) { - DWORD sett = StatusColors15bits[i - ID_STATUS_OFFLINE]; + uint32_t sett = StatusColors15bits[i - ID_STATUS_OFFLINE]; COLORREF back, text; GetColorsFromDWord(&back, &text, sett); SendDlgItemMessage(m_hwnd, i, CPM_SETCOLOUR, 0, back); diff --git a/plugins/SeenPlugin/src/stdafx.h b/plugins/SeenPlugin/src/stdafx.h index 167289d503..c636358661 100644 --- a/plugins/SeenPlugin/src/stdafx.h +++ b/plugins/SeenPlugin/src/stdafx.h @@ -106,8 +106,8 @@ typedef struct{ int IsWatchedProtocol(const char* szProto); CMStringW ParseString(const wchar_t *pwszFormat, MCONTACT); -void GetColorsFromDWord(LPCOLORREF First, LPCOLORREF Second, DWORD colDword); -DWORD GetDWordFromColors(COLORREF First, COLORREF Second); +void GetColorsFromDWord(LPCOLORREF First, LPCOLORREF Second, uint32_t colDword); +uint32_t GetDWordFromColors(COLORREF First, COLORREF Second); int OptionsInit(WPARAM,LPARAM); int UserinfoInit(WPARAM,LPARAM); void InitMenuitem(void); @@ -129,12 +129,12 @@ struct logthread_info uint16_t currStatus; }; -extern DWORD StatusColors15bits[]; +extern uint32_t StatusColors15bits[]; extern BOOL includeIdle; extern HANDLE ehmissed, ehuserinfo, ehmissed_proto; extern MWindowList g_pUserInfo; extern HGENMENU hmenuitem; -extern DWORD dwmirver; +extern uint32_t dwmirver; extern bool g_bFileActive; diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 45d47447ad..ee2089f5a5 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -75,16 +75,16 @@ bool isJabber(const char *protoname) return false; } -DWORD isSeen(MCONTACT hcontact, SYSTEMTIME *st) +uint32_t isSeen(MCONTACT hcontact, SYSTEMTIME *st) { FILETIME ft; ULONGLONG ll; - DWORD res = g_plugin.getDword(hcontact, "seenTS", 0); + uint32_t res = g_plugin.getDword(hcontact, "seenTS", 0); if (res) { if (st) { ll = UInt32x32To64(TimeZone_ToLocal(res), 10000000) + NUM100NANOSEC; - ft.dwLowDateTime = (DWORD)ll; - ft.dwHighDateTime = (DWORD)(ll >> 32); + ft.dwLowDateTime = (uint32_t)ll; + ft.dwHighDateTime = (uint32_t)(ll >> 32); FileTimeToSystemTime(&ft, st); } return res; @@ -104,7 +104,7 @@ DWORD isSeen(MCONTACT hcontact, SYSTEMTIME *st) ll -= NUM100NANOSEC; ll /= 10000000; //perform LOCALTOTIMESTAMP - res = (DWORD)ll - TimeZone_ToLocal(0); + res = (uint32_t)ll - TimeZone_ToLocal(0); //nevel look for Year/Month/Day/Hour/Minute/Second again g_plugin.setDword(hcontact, "seenTS", res); } @@ -324,13 +324,13 @@ LBL_noData: return res; } -void DBWriteTimeTS(DWORD t, MCONTACT hcontact) +void DBWriteTimeTS(uint32_t t, MCONTACT hcontact) { ULONGLONG ll = UInt32x32To64(TimeZone_ToLocal(t), 10000000) + NUM100NANOSEC; FILETIME ft; - ft.dwLowDateTime = (DWORD)ll; - ft.dwHighDateTime = (DWORD)(ll >> 32); + ft.dwLowDateTime = (uint32_t)ll; + ft.dwHighDateTime = (uint32_t)(ll >> 32); SYSTEMTIME st; FileTimeToSystemTime(&ft, &st); @@ -344,7 +344,7 @@ void DBWriteTimeTS(DWORD t, MCONTACT hcontact) g_plugin.setWord(hcontact, "WeekDay", st.wDayOfWeek); } -void GetColorsFromDWord(LPCOLORREF First, LPCOLORREF Second, DWORD colDword) +void GetColorsFromDWord(LPCOLORREF First, LPCOLORREF Second, uint32_t colDword) { uint16_t temp; COLORREF res = 0; @@ -361,7 +361,7 @@ void GetColorsFromDWord(LPCOLORREF First, LPCOLORREF Second, DWORD colDword) if (Second) *Second = res; } -DWORD StatusColors15bits[] = { +uint32_t StatusColors15bits[] = { 0x63180000, // 0x00C0C0C0, 0x00000000, Offline - LightGray 0x7B350000, // 0x00F0C8A8, 0x00000000, Online - LightBlue 0x33fe0000, // 0x0070E0E0, 0x00000000, Away - LightOrange @@ -372,9 +372,9 @@ DWORD StatusColors15bits[] = { 0x76AF0000, // 0x00E8A878, 0x00000000, Invisible }; -DWORD GetDWordFromColors(COLORREF First, COLORREF Second) +uint32_t GetDWordFromColors(COLORREF First, COLORREF Second) { - DWORD res = 0; + uint32_t res = 0; res |= (First & 0xF8) >> 3; res |= (First & 0xF800) >> 6; res |= (First & 0xF80000) >> 9; @@ -412,7 +412,7 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus) char szSetting[10]; mir_snprintf(szSetting, "Col_%d", newStatus - ID_STATUS_OFFLINE); - DWORD sett = g_plugin.getDword(szSetting, StatusColors15bits[newStatus - ID_STATUS_OFFLINE]); + uint32_t sett = g_plugin.getDword(szSetting, StatusColors15bits[newStatus - ID_STATUS_OFFLINE]); POPUPDATAW ppd; GetColorsFromDWord(&ppd.colorBack, &ppd.colorText, sett); @@ -511,7 +511,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) char str[MAXMODULELABELLENGTH + 9]; mir_snprintf(str, "OffTime-%s", szProto); - DWORD t = g_plugin.getDword(str, 0); + uint32_t t = g_plugin.getDword(str, 0); if (!t) t = time(0); DBWriteTimeTS(t, hContact); -- cgit v1.2.3