From 5fd7a33246d786ee3c7a8d643ff332af793ffa5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 11 Aug 2022 23:25:15 +0200 Subject: Minor formatting. --- c/main.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/c/main.cpp b/c/main.cpp index 1d5bf7b..b0fd7d3 100644 --- a/c/main.cpp +++ b/c/main.cpp @@ -534,20 +534,20 @@ void WaitFor(const char* mod, const char* pred) /* WaitFor uses a thread on the Prolog side to execute a * predicate asynchronously. */ - static WcharPtr activePred; + static WcharPtr predActive; static UINT_PTR iTimer; static atom_t aThread; - if (activePred) { + if (predActive) { wchar_t msg[256] = {0}; Swprintf(msg, L"Another task (%s) is active. " L"Do you want to cancel the existing task and start a new one?", - static_cast(activePred)); + static_cast(predActive)); if (EBMessageBox(msg, L"Error", MB_YESNO|MB_ICONWARNING) != IDYES) return; KillTimer(nullptr, iTimer); - activePred = nullptr; + predActive = nullptr; g_elv->Update(); } @@ -566,7 +566,7 @@ void WaitFor(const char* mod, const char* pred) } else { KillTimer(nullptr, iTimer); i = 0; - activePred = nullptr; + predActive = nullptr; g_elv->Update(); } }; @@ -574,7 +574,7 @@ void WaitFor(const char* mod, const char* pred) Plx(mod,"thread_create",pred,&aThread); SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(1,0), reinterpret_cast(L".")); if (Prefer(iTimer = SetTimer(nullptr, -1, 500, proc))) - activePred = WcharPtr::FromNarrow(pred); + predActive = WcharPtr::FromNarrow(pred); } INT_PTR CALLBACK AboutDlgProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, const LPARAM) @@ -585,11 +585,8 @@ INT_PTR CALLBACK AboutDlgProc(const HWND hWnd, const UINT uMsg, const WPARAM wPa return TRUE; case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: + if (LOWORD(wParam) == IDOK) EndDialog(hWnd, IDOK); - break; - } return TRUE; default: @@ -599,8 +596,9 @@ INT_PTR CALLBACK AboutDlgProc(const HWND hWnd, const UINT uMsg, const WPARAM wPa void UpdateTheme() { - if (!IsThemeActive) return; - const bool bThemeActive = IsThemeActive(); - g_dlv->UpdateTheme(bThemeActive); - g_elv->UpdateTheme(bThemeActive); + if (IsThemeActive) { + const bool bThemeActive = IsThemeActive(); + g_dlv->UpdateTheme(bThemeActive); + g_elv->UpdateTheme(bThemeActive); + } } -- cgit v1.2.3