aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--c/main.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/c/main.cpp b/c/main.cpp
index a06002a..2f668c0 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -348,7 +348,7 @@ LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam,
const WORD group = ID_GROUP(command);
const wchar_t* tip = {0};
if (group) {
- const wchar_t** const vTip = group==IDG_MENU? vTipMenu: vTipCtx;
+ const wchar_t** const vTip = group == IDG_MENU? vTipMenu: vTipCtx;
tip = vTip[ID_INDEX(command)];
}
SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(0,0), reinterpret_cast<LPARAM>(tip));
@@ -490,7 +490,7 @@ void HandleContextMenu(const HWND, WORD command)
void WaitFor(const char* mod, const char* pred)
{
static atom_t aThread;
- static int bActive;
+ static bool bActive;
static int iTimer;
static WcharPtr activePred;
@@ -502,7 +502,7 @@ void WaitFor(const char* mod, const char* pred)
if (EBMessageBox(msg, L"Error", MB_YESNO|MB_ICONWARNING) != IDYES)
return;
KillTimer(nullptr, iTimer);
- bActive = 0;
+ bActive = false;
g_elv->Update();
}
@@ -512,15 +512,16 @@ void WaitFor(const char* mod, const char* pred)
static auto proc = [](HWND, UINT, UINT_PTR, DWORD) -> void
{
static int i = 0;
+ static const wchar_t* text[] = {L".", L"..", L"...", L""};
if (Pl("episode_data","thread_running",aThread)) {
- i = (i+1)%4;
+ i = (i+1)%(sizeof(text)/sizeof(*text));
SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(1,0),
- reinterpret_cast<LPARAM>(i==0? L".": i==1? L"..": i==2? L"...": L""));
+ reinterpret_cast<LPARAM>(text[i]));
} else {
KillTimer(nullptr, iTimer);
i = 0;
- bActive = 0;
+ bActive = false;
g_elv->Update();
}
};
@@ -529,7 +530,7 @@ void WaitFor(const char* mod, const char* pred)
SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(1,0), reinterpret_cast<LPARAM>(L"."));
if (Prefer(iTimer = SetTimer(nullptr, -1, 500, proc))) {
activePred = WcharPtr::FromNarrow(pred);
- bActive = 1;
+ bActive = true;
}
}