summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 17:06:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 17:06:04 +0300
commit1039b2829a264280493ba0fa979214fe024dc70c (patch)
tree8fa6a60eb46627582c372b56a4a1d4754d6732c3 /plugins/AutoShutdown/src
parent62a186697df33c96dc1a6dac0f4dfc38652fb96f (diff)
WORD -> uint16_t
Diffstat (limited to 'plugins/AutoShutdown/src')
-rw-r--r--plugins/AutoShutdown/src/frame.cpp6
-rw-r--r--plugins/AutoShutdown/src/frame.h2
-rw-r--r--plugins/AutoShutdown/src/options.cpp4
-rw-r--r--plugins/AutoShutdown/src/settingsdlg.cpp6
-rw-r--r--plugins/AutoShutdown/src/shutdownsvc.cpp4
-rw-r--r--plugins/AutoShutdown/src/utils.cpp14
-rw-r--r--plugins/AutoShutdown/src/watcher.cpp6
7 files changed, 21 insertions, 21 deletions
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp
index 6ff377a99a..b340a69db5 100644
--- a/plugins/AutoShutdown/src/frame.cpp
+++ b/plugins/AutoShutdown/src/frame.cpp
@@ -83,7 +83,7 @@ struct CountdownFrameWndData
HBRUSH hbrBackground;
COLORREF clrBackground, clrText;
HFONT hFont;
- WORD fTimeFlags;
+ uint16_t fTimeFlags;
uint8_t flags;
};
@@ -116,7 +116,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
dat = (struct CountdownFrameWndData*)mir_calloc(sizeof(*dat));
SetWindowLongPtr(hwndFrame, GWLP_USERDATA, (LONG_PTR)dat);
if (dat == nullptr) return FALSE; /* creation failed */
- dat->fTimeFlags = *(WORD*)((CREATESTRUCT*)lParam)->lpCreateParams;
+ dat->fTimeFlags = *(uint16_t*)((CREATESTRUCT*)lParam)->lpCreateParams;
dat->flags = FWPDF_COUNTDOWNINVALID;
break;
@@ -478,7 +478,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
/************************* Show Frame *********************************/
-void ShowCountdownFrame(WORD fTimeFlags)
+void ShowCountdownFrame(uint16_t fTimeFlags)
{
hwndCountdownFrame = CreateWindowEx(WS_EX_CONTROLPARENT | WS_EX_NOPARENTNOTIFY | WS_EX_TRANSPARENT,
COUNTDOWNFRAME_CLASS,
diff --git a/plugins/AutoShutdown/src/frame.h b/plugins/AutoShutdown/src/frame.h
index e8f642bbe8..3394252645 100644
--- a/plugins/AutoShutdown/src/frame.h
+++ b/plugins/AutoShutdown/src/frame.h
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma once
/* Show Frame */
-void ShowCountdownFrame(WORD fTimeFlags);
+void ShowCountdownFrame(uint16_t fTimeFlags);
void CloseCountdownFrame(void);
/* Misc */
diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp
index 06756a5407..4dcf972a56 100644
--- a/plugins/AutoShutdown/src/options.cpp
+++ b/plugins/AutoShutdown/src/options.cpp
@@ -31,7 +31,7 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- WORD setting = g_plugin.getWord("ConfirmDlgCountdown", SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT);
+ uint16_t setting = g_plugin.getWord("ConfirmDlgCountdown", SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT);
if (setting < 3)
setting = SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT;
SendDlgItemMessage(hwndDlg, IDC_SPIN_CONFIRMDLGCOUNTDOWN, UDM_SETRANGE, 0, MAKELPARAM(999, 3));
@@ -86,7 +86,7 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
switch (((NMHDR*)lParam)->code) {
case PSN_APPLY:
g_plugin.setByte("ShowConfirmDlg", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SHOWCONFIRMDLG) != 0));
- g_plugin.setWord("ConfirmDlgCountdown", (WORD)GetDlgItemInt(hwndDlg, IDC_EDIT_CONFIRMDLGCOUNTDOWN, nullptr, FALSE));
+ g_plugin.setWord("ConfirmDlgCountdown", (uint16_t)GetDlgItemInt(hwndDlg, IDC_EDIT_CONFIRMDLGCOUNTDOWN, nullptr, FALSE));
g_plugin.setByte("RememberOnRestart", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_REMEMBERONRESTART) != 0));
g_plugin.setByte("SmartOfflineCheck", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SMARTOFFLINECHECK) != 0));
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHECK_WEATHER)))
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp
index 8e1e9642ef..e162c374df 100644
--- a/plugins/AutoShutdown/src/settingsdlg.cpp
+++ b/plugins/AutoShutdown/src/settingsdlg.cpp
@@ -81,7 +81,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
}
/* read-in watcher flags */
{
- WORD watcherType = g_plugin.getWord("WatcherFlags", SETTING_WATCHERFLAGS_DEFAULT);
+ uint16_t watcherType = g_plugin.getWord("WatcherFlags", SETTING_WATCHERFLAGS_DEFAULT);
CheckRadioButton(hwndDlg, IDC_RADIO_STTIME, IDC_RADIO_STCOUNTDOWN, (watcherType&SDWTF_ST_TIME) ? IDC_RADIO_STTIME : IDC_RADIO_STCOUNTDOWN);
CheckDlgButton(hwndDlg, IDC_CHECK_SPECIFICTIME, (watcherType&SDWTF_SPECIFICTIME) != 0 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHECK_MESSAGE, (watcherType&SDWTF_MESSAGE) != 0 ? BST_CHECKED : BST_UNCHECKED);
@@ -313,7 +313,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
case IDC_EDIT_CPUUSAGE:
if (HIWORD(wParam) == EN_KILLFOCUS) {
- WORD val = (WORD)GetDlgItemInt(hwndDlg, IDC_EDIT_CPUUSAGE, nullptr, FALSE);
+ uint16_t val = (uint16_t)GetDlgItemInt(hwndDlg, IDC_EDIT_CPUUSAGE, nullptr, FALSE);
if (val < 1) val = 1;
else if (val>100) val = 100;
SendDlgItemMessage(hwndDlg, IDC_SPIN_CPUUSAGE, UDM_SETPOS, 0, MAKELPARAM(val, 0));
@@ -366,7 +366,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
}
/* watcher type */
{
- WORD watcherType = (WORD)(IsDlgButtonChecked(hwndDlg, IDC_RADIO_STTIME) ? SDWTF_ST_TIME : SDWTF_ST_COUNTDOWN);
+ uint16_t watcherType = (uint16_t)(IsDlgButtonChecked(hwndDlg, IDC_RADIO_STTIME) ? SDWTF_ST_TIME : SDWTF_ST_COUNTDOWN);
if (IsDlgButtonChecked(hwndDlg, IDC_CHECK_SPECIFICTIME)) watcherType |= SDWTF_SPECIFICTIME;
if (IsDlgButtonChecked(hwndDlg, IDC_CHECK_MESSAGE)) watcherType |= SDWTF_MESSAGE;
if (IsDlgButtonChecked(hwndDlg, IDC_CHECK_FILETRANSFER)) watcherType |= SDWTF_FILETRANSFER;
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp
index 064c1fd843..d071656ee0 100644
--- a/plugins/AutoShutdown/src/shutdownsvc.cpp
+++ b/plugins/AutoShutdown/src/shutdownsvc.cpp
@@ -298,7 +298,7 @@ static DWORD ShutdownNow(uint8_t shutdownType)
static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
uint8_t shutdownType = (uint8_t)GetWindowLongPtr(hwndDlg, DWLP_USER);
- WORD countdown = (WORD)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TEXT_HEADER), GWLP_USERDATA);
+ uint16_t countdown = (uint16_t)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TEXT_HEADER), GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
@@ -380,7 +380,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
PostMessage(hwndDlg, M_UPDATE_COUNTDOWN, 0, countdown);
return TRUE;
- case M_UPDATE_COUNTDOWN: /* lParam=(WORD)countdown */
+ case M_UPDATE_COUNTDOWN: /* lParam=(uint16_t)countdown */
{
wchar_t szText[256];
mir_snwprintf(szText, TranslateW(desc[shutdownType - 1]), lParam);
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp
index cd2b247703..ddd353f9aa 100644
--- a/plugins/AutoShutdown/src/utils.cpp
+++ b/plugins/AutoShutdown/src/utils.cpp
@@ -95,13 +95,13 @@ BOOL TimeStampToSystemTime(time_t timestamp, SYSTEMTIME *st)
return FALSE;
st->wMilliseconds = 0; /* 0-999 (not given in tm) */
- st->wSecond = (WORD)ts.tm_sec; /* 0-59 */
- st->wMinute = (WORD)ts.tm_min; /* 0-59 */
- st->wHour = (WORD)ts.tm_hour; /* 0-23 */
- st->wDay = (WORD)ts.tm_mday; /* 1-31 */
- st->wDayOfWeek = (WORD)ts.tm_wday; /* 0-6 (Sun-Sat) */
- st->wMonth = (WORD)(ts.tm_mon + 1); /* 1-12 (Jan-Dec) */
- st->wYear = (WORD)(ts.tm_year + 1900); /* 1601-30827 */
+ st->wSecond = (uint16_t)ts.tm_sec; /* 0-59 */
+ st->wMinute = (uint16_t)ts.tm_min; /* 0-59 */
+ st->wHour = (uint16_t)ts.tm_hour; /* 0-23 */
+ st->wDay = (uint16_t)ts.tm_mday; /* 1-31 */
+ st->wDayOfWeek = (uint16_t)ts.tm_wday; /* 0-6 (Sun-Sat) */
+ st->wMonth = (uint16_t)(ts.tm_mon + 1); /* 1-12 (Jan-Dec) */
+ st->wYear = (uint16_t)(ts.tm_year + 1900); /* 1601-30827 */
return TRUE;
}
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp
index 0d53d9deed..a84253b536 100644
--- a/plugins/AutoShutdown/src/watcher.cpp
+++ b/plugins/AutoShutdown/src/watcher.cpp
@@ -38,7 +38,7 @@ static HANDLE hHookModulesLoaded;
/************************* Shared *************************************/
-static WORD currentWatcherType;
+static uint16_t currentWatcherType;
static void __stdcall MainThreadMapping(void *param)
{
@@ -228,7 +228,7 @@ INT_PTR ServiceStartWatcher(WPARAM, LPARAM lParam)
if (lParam&SDWTF_SPECIFICTIME && !(lParam&SDWTF_ST_MASK))
return 2;
- if (currentWatcherType == (WORD)lParam)
+ if (currentWatcherType == (uint16_t)lParam)
return 3;
if (currentWatcherType != 0) {
@@ -239,7 +239,7 @@ INT_PTR ServiceStartWatcher(WPARAM, LPARAM lParam)
}
SetShutdownMenuItem(true);
SetShutdownToolbarButton(true);
- currentWatcherType = (WORD)lParam;
+ currentWatcherType = (uint16_t)lParam;
NotifyEventHooks(hEventWatcherChanged, TRUE, 0);
/* Time Shutdown */