diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-17 01:35:16 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-17 01:35:16 +0200 |
commit | 26bc41099c10b3a63fd744690df5c25cb713718b (patch) | |
tree | 4f314216ec3b6c9f75f003282ca9cb87505772ce /c/listview.cpp | |
parent | da04598319bf3ab9d240bbec993222623a4ab85d (diff) | |
download | EpisodeBrowser-26bc41099c10b3a63fd744690df5c25cb713718b.tar.gz |
Add const to places.
Note that I did NOT add const to non-pointer/non-reference arguments
in function declarations (without a following definition), as they do
not mean anything there.
Diffstat (limited to 'c/listview.cpp')
-rw-r--r-- | c/listview.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/c/listview.cpp b/c/listview.cpp index 27529e0..5791226 100644 --- a/c/listview.cpp +++ b/c/listview.cpp @@ -9,7 +9,7 @@ extern HFONT g_hfNormal; static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); -ListView::ListView(HWND hWndParent, HMENU hMenu, DWORD dwStyle) +ListView::ListView(const HWND hWndParent, const HMENU hMenu, const DWORD dwStyle) { m_hWndParent = hWndParent; m_bHeader = !(dwStyle & LVS_NOCOLUMNHEADER); @@ -21,13 +21,11 @@ ListView::ListView(HWND hWndParent, HMENU hMenu, DWORD dwStyle) 0, 0, 0, 0, m_hWndParent, hMenu, GetModuleHandle(NULL), this ); - if (SetProp(m_hWnd, TEXT("this"), (HANDLE)this)) m_prevProc = (WNDPROC)SetWindowLongPtr(m_hWnd, GWLP_WNDPROC, (LONG_PTR)::WndProc); ListView_SetExtendedListViewStyle(m_hWnd, LVS_EX_FULLROWSELECT); - SendMessage(m_hWnd, WM_SETFONT, (WPARAM)g_hfNormal, MAKELPARAM(FALSE, 0)); } @@ -36,7 +34,7 @@ int ListView::Height(int bHeader) { if (bHeader == -1) bHeader = m_bHeader; - int iCount = ListView_GetItemCount(m_hWnd); + const int iCount = ListView_GetItemCount(m_hWnd); return iCount? Dpi(bHeader? 27: 4)+iCount*Dpi(19): 0; } @@ -45,7 +43,7 @@ HWND ListView::Handle() const return m_hWnd; } -void ListView::UpdateTheme(BOOL bThemeActive) +void ListView::UpdateTheme(const BOOL bThemeActive) { DWORD dwStyle; LPTSTR tszTheme; @@ -73,7 +71,8 @@ void ListView::UpdateTheme(BOOL bThemeActive) SendMessage(m_hWnd, WM_UPDATEUISTATE, MAKEWPARAM(wAction, UISF_HIDEFOCUS), 0); } -LRESULT CALLBACK ListView::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK ListView::WndProc(const HWND hWnd, const UINT uMsg, + const WPARAM wParam, const LPARAM lParam) { switch (uMsg) { case WM_NOTIFY: @@ -88,7 +87,8 @@ LRESULT CALLBACK ListView::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l return CallWindowProc(m_prevProc, hWnd, uMsg, wParam, lParam); } -LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, + const LPARAM lParam) { ListView *lpLv = (ListView *)GetProp(hWnd, TEXT("this")); |