diff options
Diffstat (limited to 'plugins/AutoShutdown/src/shutdownsvc.cpp')
-rw-r--r-- | plugins/AutoShutdown/src/shutdownsvc.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index c225d63e17..064c1fd843 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -67,7 +67,7 @@ static void BroadcastEndSession(DWORD dwRecipients, LPARAM lParam) }
/************************* Workers ************************************/
-static BOOL IsShutdownTypeEnabled(BYTE shutdownType)
+static BOOL IsShutdownTypeEnabled(uint8_t shutdownType)
{
BOOL bReturn = FALSE;
switch (shutdownType) {
@@ -128,7 +128,7 @@ static BOOL IsShutdownTypeEnabled(BYTE shutdownType) return bReturn;
}
-static DWORD ShutdownNow(BYTE shutdownType)
+static DWORD ShutdownNow(uint8_t shutdownType)
{
DWORD dwErrCode = ERROR_SUCCESS;
switch (shutdownType) {
@@ -297,7 +297,7 @@ static DWORD ShutdownNow(BYTE shutdownType) #define M_UPDATE_COUNTDOWN (WM_APP+112)
static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BYTE shutdownType = (BYTE)GetWindowLongPtr(hwndDlg, DWLP_USER);
+ uint8_t shutdownType = (uint8_t)GetWindowLongPtr(hwndDlg, DWLP_USER);
WORD countdown = (WORD)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TEXT_HEADER), GWLP_USERDATA);
switch (msg) {
@@ -417,7 +417,7 @@ INT_PTR ServiceShutdown(WPARAM wParam, LPARAM lParam) {
/* passing 0 as wParam is only to be used internally, undocumented */
if (!wParam) wParam = g_plugin.getByte("ShutdownType", SETTING_SHUTDOWNTYPE_DEFAULT);
- if (!IsShutdownTypeEnabled((BYTE)wParam)) return 1; /* does shutdownType range check */
+ if (!IsShutdownTypeEnabled((uint8_t)wParam)) return 1; /* does shutdownType range check */
if ((BOOL)lParam && hwndShutdownDlg != nullptr) return 2;
/* ask others if allowed */
@@ -429,11 +429,11 @@ INT_PTR ServiceShutdown(WPARAM wParam, LPARAM lParam) NotifyEventHooks(hEventShutdown, wParam, lParam);
/* show dialog */
if (lParam && g_plugin.getByte("ShowConfirmDlg", SETTING_SHOWCONFIRMDLG_DEFAULT))
- if (CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_SHUTDOWNNOW), nullptr, ShutdownDlgProc, (BYTE)wParam) != nullptr)
+ if (CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_SHUTDOWNNOW), nullptr, ShutdownDlgProc, (uint8_t)wParam) != nullptr)
return 0;
/* show error */
- DWORD dwErrCode = ShutdownNow((BYTE)wParam);
+ DWORD dwErrCode = ShutdownNow((uint8_t)wParam);
if (dwErrCode != ERROR_SUCCESS) {
char *pszErr = GetWinErrorDescription(dwErrCode);
ShowInfoMessage(NIIF_ERROR, Translate("Automatic shutdown error"), Translate("Initiating the shutdown process failed!\nReason: %s"), (pszErr != nullptr) ? pszErr : Translate("Unknown"));
@@ -447,7 +447,7 @@ INT_PTR ServiceShutdown(WPARAM wParam, LPARAM lParam) INT_PTR ServiceIsTypeEnabled(WPARAM wParam, LPARAM)
{
- return IsShutdownTypeEnabled((BYTE)wParam); /* does shutdownType range check */
+ return IsShutdownTypeEnabled((uint8_t)wParam); /* does shutdownType range check */
}
const wchar_t *apszShort[] = {
@@ -473,7 +473,7 @@ const wchar_t *apszLong[] = { INT_PTR ServiceGetTypeDescription(WPARAM wParam, LPARAM lParam)
{
/* shutdownType range check */
- if (!wParam || (BYTE)wParam > SDSDT_MAX) return 0;
+ if (!wParam || (uint8_t)wParam > SDSDT_MAX) return 0;
/* select description */
wchar_t *pszDesc = (wchar_t*)((lParam & GSTDF_LONGDESC) ? apszLong : apszShort)[wParam - 1];
if (!(lParam & GSTDF_UNTRANSLATED))
|