From: Vadim Zeitlin Date: Thu, 9 Mar 2006 13:18:50 +0000 (+0000) Subject: fix gcc4 warning for wndproc casts (patch 1431939) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/315a49a10edd3000d30a14114cbb6c15b58e4c19 fix gcc4 warning for wndproc casts (patch 1431939) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 075ce5f3a9..c1b5e3e4cf 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -896,9 +896,9 @@ inline void *wxSetWindowUserData(HWND hwnd, void *data) // note that the casts to LONG_PTR here are required even on 32-bit machines // for the 64-bit warning mode of later versions of MSVC (C4311/4312) -inline void *wxGetWindowProc(HWND hwnd) +inline WNDPROC wxGetWindowProc(HWND hwnd) { - return (void *)(LONG_PTR)::GetWindowLong(hwnd, GWL_WNDPROC); + return (WNDPROC)(LONG_PTR)::GetWindowLong(hwnd, GWL_WNDPROC); } inline void *wxGetWindowUserData(HWND hwnd) diff --git a/src/msw/fdrepdlg.cpp b/src/msw/fdrepdlg.cpp index 7c6884739a..86c8606c56 100644 --- a/src/msw/fdrepdlg.cpp +++ b/src/msw/fdrepdlg.cpp @@ -38,8 +38,8 @@ // functions prototypes // ---------------------------------------------------------------------------- -LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg, - WPARAM wParam, LPARAM lParam); +LRESULT CALLBACK wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg, + WPARAM wParam, LPARAM lParam); UINT_PTR CALLBACK wxFindReplaceDialogHookProc(HWND hwnd, UINT uiMsg, @@ -190,7 +190,7 @@ void wxFindReplaceDialogImpl::SubclassDialog(HWND hwnd) // check that we don't subclass the parent twice: this would be a bad idea // as then we'd have infinite recursion in wxFindReplaceWindowProc - wxCHECK_RET( wxGetWindowProc(hwnd) != (void *)wxFindReplaceWindowProc, + wxCHECK_RET( wxGetWindowProc(hwnd) != &wxFindReplaceWindowProc, _T("can't have more than one find dialog currently") ); // set the new one and save the old as user data to allow access to it @@ -216,7 +216,7 @@ wxFindReplaceDialogImpl::~wxFindReplaceDialogImpl() // Window Proc for handling RegisterWindowMessage(FINDMSGSTRING) // ---------------------------------------------------------------------------- -LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg, +LRESULT CALLBACK wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg, WPARAM wParam, LPARAM lParam) { #if wxUSE_UNICODE_MSLU