From 7624e31a950a1ef584d1d9a61442f28cbf10d9e4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 May 2018 22:43:12 +0200 Subject: [PATCH] Stop passing WNDPROC argument to wxCheckWindowWndProc() This parameter wasn't used anyhow and casting wxWndProc or m_oldWndProc to WXFARPROC just resulted in gcc8 -Wcast-function-type warnings. Get rid of them by not passing the window proc to this function at all. --- include/wx/msw/private.h | 5 ++++- src/msw/window.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 1e4d0f8fcd..40f6bcf6e6 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -936,7 +936,10 @@ extern WXDLLIMPEXP_CORE int wxGetWindowId(WXHWND hWnd); // check if hWnd's WNDPROC is wndProc. Return true if yes, false if they are // different -extern WXDLLIMPEXP_CORE bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc); +// +// wndProc parameter is unused and only kept for compatibility +extern WXDLLIMPEXP_CORE +bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc = NULL); // Does this window style specify any border? inline bool wxStyleHasBorder(long style) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index f55b8be586..db5e757c7f 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1252,7 +1252,7 @@ void wxWindowMSW::SubclassWin(WXHWND hWnd) // we don't need to subclass the window of our own class (in the Windows // sense of the word) - if ( !wxCheckWindowWndProc(hWnd, (WXFARPROC)wxWndProc) ) + if ( !wxCheckWindowWndProc(hWnd) ) { wxSetWindowProc(hwnd, wxWndProc); @@ -1289,7 +1289,7 @@ void wxWindowMSW::UnsubclassWin() if ( m_oldWndProc ) { - if ( !wxCheckWindowWndProc((WXHWND)hwnd, m_oldWndProc) ) + if ( !wxCheckWindowWndProc((WXHWND)hwnd) ) { wxSetWindowProc(hwnd, (WNDPROC)m_oldWndProc); }