From df42108d1f4c1628fe62874e48e87282fab6bc65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 20 Jul 2022 02:12:32 +0200 Subject: Fix bug in and rename throw_nil, warn_nil. In warn_nil, the return value was undefined on exception -- I think. While informative, the names throw_nil and warn_nil don't work very well in conditionals: if (warn_nil(...)) g(); sounds like g should be called if f returns nil and a warning is issued. But it is actually the other way around; g is called if f is successful. if (prefer(...)) g(); sounds less like that. --- c/episodelistview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'c/episodelistview.cpp') diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index e70cc06..6ed9146 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -90,7 +90,7 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam) { extern HFONT g_hfBold; if (!Pl("track_episodes","watched",pLvCd->nmcd.lItemlParam)) { - throw_nil(pLvCd->nmcd.hdc, g_hfBold); + require(pLvCd->nmcd.hdc, g_hfBold); return CDRF_NEWFONT; } break; @@ -125,7 +125,7 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam) { extern HMENU g_hPopupMenu; const DWORD dwPos = GetMessagePos(); - throw_nil(g_hPopupMenu, TPM_RIGHTBUTTON, + require(g_hPopupMenu, TPM_RIGHTBUTTON, LOWORD(dwPos), HIWORD(dwPos), 0, m_hWndParent, (const RECT*)NULL); break; -- cgit v1.2.3