diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-25 03:28:05 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-25 03:28:05 +0200 |
commit | 160b5ac92a846038372225ab79e29166fd152949 (patch) | |
tree | ada5441269dbd13f57479180bcafe60cc6fa7525 /c | |
parent | 158e54f071a3b2b41e6105fc3064ce8297fe532a (diff) | |
download | EpisodeBrowser-160b5ac92a846038372225ab79e29166fd152949.tar.gz |
Fix MSVC compatibility.
Diffstat (limited to 'c')
-rw-r--r-- | c/data.cpp | 2 | ||||
-rw-r--r-- | c/datalistview.cpp | 2 | ||||
-rw-r--r-- | c/episodelistview.cpp | 4 | ||||
-rw-r--r-- | c/ext.cpp | 6 | ||||
-rw-r--r-- | c/layout.cpp | 2 | ||||
-rw-r--r-- | c/main.cpp | 10 | ||||
-rw-r--r-- | c/resource.rc | 6 |
7 files changed, 19 insertions, 13 deletions
@@ -112,7 +112,7 @@ void WaitFor(void (*f)(unsigned char*)) static int i = 0; if (sig & DONE) { - extern EpisodeListView* const g_elv; + extern EpisodeListView* g_elv; KillTimer(nullptr, iTimer); i = 0; sig = READY; /* Reset signals. */ diff --git a/c/datalistview.cpp b/c/datalistview.cpp index ec9592d..b63a342 100644 --- a/c/datalistview.cpp +++ b/c/datalistview.cpp @@ -88,7 +88,7 @@ void DataListView::ShowEpisode(const int iEpisode) LVFINDINFO lvfi; lvfi.flags = LVFI_PARAM; lvfi.lParam = iEpisode; - extern EpisodeListView* const g_elv; + extern EpisodeListView* g_elv; int iItem = ListView_FindItem(g_elv->hWnd, -1, &lvfi); if (iItem != -1) ListView_EnsureVisible(g_elv->hWnd, iItem, TRUE); diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index 72a8618..8185b51 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -121,7 +121,7 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam) case LVN_ITEMCHANGED: /* Select/focus episode. */ if ((nm->uChanged & LVIF_STATE) && (nm->uNewState & LVIS_FOCUSED)) { - extern DataListView* const g_dlv; + extern DataListView* g_dlv; g_dlv->ShowEpisode(nm->lParam); } return 0; @@ -217,7 +217,7 @@ void EpisodeListView::RestoreFocus() { int i, iEpisode, iItem; LVFINDINFO lvfi; - extern DataListView* const g_dlv; + extern DataListView* g_dlv; iItem = 0; iEpisode = g_cfg.iFocus; @@ -8,7 +8,7 @@ extern CfgA& g_cfg; extern FileView<ElvDataA> g_fvElv; extern FileView<DlvDataA> g_fvDlv; -void OpenOnline(int iEp) +bool OpenOnline(int iEp) { wchar_t url[sizeof(g_cfg.url)+4]; Swprintf(url, L"%s%d", g_cfg.url, iEp); @@ -16,9 +16,10 @@ void OpenOnline(int iEp) ShellExecute(nullptr, L"open", url, nullptr, nullptr, SW_SHOWNORMAL)); if (r <= 32) throw Win32Error(); + return true; } -void OpenWiki(int iEp) +bool OpenWiki(int iEp) { const DlvDataA& d = g_fvDlv.At(iEp-1); wchar_t url[sizeof(d.wiki)+35]; @@ -27,6 +28,7 @@ void OpenWiki(int iEp) ShellExecute(nullptr, L"open", url, nullptr, nullptr, SW_SHOWNORMAL)); if (r <= 32) throw Win32Error(); + return true; } static inline bool MatchFileName(wchar_t (&file)[MAX_PATH], const wchar_t* const siEp) noexcept diff --git a/c/layout.cpp b/c/layout.cpp index 5b3ff00..36edf32 100644 --- a/c/layout.cpp +++ b/c/layout.cpp @@ -32,7 +32,7 @@ void UpdateLayout(int w, int h) /* Resize status bar parts. */ const int aParts[] = {rc.right-Dpi(55), rc.right}; SendMessage(g_hWndStatus, SB_SETPARTS, - reinterpret_cast<WPARAM>(sizeof(aParts)), reinterpret_cast<LPARAM>(aParts)); + sizeof(aParts), reinterpret_cast<LPARAM>(aParts)); SendMessage(g_hWnd, WM_SETREDRAW, TRUE, 0); RedrawWindow(g_hWnd, nullptr, nullptr, @@ -12,7 +12,7 @@ #include "test.h" #include "util.h" -#ifdef DEBUG +#ifdef _DEBUG #define XMAIN 30 #define YMAIN 30 #else @@ -79,7 +79,11 @@ static INT_PTR CALLBACK AboutDlgProc(HWND, UINT, WPARAM, LPARAM); /* Try to style application according to current Windows theme. */ static void UpdateTheme(); -int WINAPI WinMain(const HINSTANCE hInstance, const HINSTANCE, char* const, const int nCmdShow) +int WINAPI WinMain( + _In_ const HINSTANCE hInstance, + _In_opt_ const HINSTANCE, + _In_ char* const, + _In_ const int nCmdShow) { setbuf(stdout, nullptr); LIBXML_TEST_VERSION; @@ -129,7 +133,7 @@ int WINAPI WinMain(const HINSTANCE hInstance, const HINSTANCE, char* const, cons g_elv->Update(); g_elv->RestoreFocus(); -#ifdef DEBUG +#ifdef _DEBUG RunTests(); #endif diff --git a/c/resource.rc b/c/resource.rc index 37df1e1..f25bb63 100644 --- a/c/resource.rc +++ b/c/resource.rc @@ -65,7 +65,7 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "About" FONT 8, "MS Shell Dlg 2" BEGIN - DEFPUSHBUTTON "&OK", IDOK, ABOUTW-OKW-HPAD, ABOUTH-OKH-VPAD, OKW, OKH - LTEXT "Episode Browser\r\nCopyright 2021 John Ankarström", - IDC_ABOUTTEXT, HPAD, VPAD, ABOUTW-OKW-HPAD*2, ABOUTH-VPAD +DEFPUSHBUTTON "&OK", IDOK, ABOUTW-OKW-HPAD, ABOUTH-OKH-VPAD, OKW, OKH +LTEXT "Episode Browser\r\nCopyright 2021 John Ankarström", +IDC_ABOUTTEXT, HPAD, VPAD, ABOUTW-OKW-HPAD-HPAD, ABOUTH-VPAD END
\ No newline at end of file |