From ef787038ecc3f071169e5400cf4202ad2a7d6e5c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 18 Jul 2010 13:39:20 +0000 Subject: [PATCH] Correct printf parameter mismatch in wxWndProc. LPARAM is a 64 bit type in Win64 and doesn't match the size expected by "%l" printf format specifier. Instead of showing it as a 32 bit number in 32 bit build and 64 bit in 64 bits, just truncate it to the lower 32 bits in any case for now, this should be enough for the diagnostic messages. Closes #12242. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 3d117a6969..d0cb9beda2 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2716,9 +2716,14 @@ LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM w // trace all messages: useful for the debugging but noticeably slows down // the code so don't do it by default #if wxDEBUG_LEVEL >= 2 + // notice that we cast wParam and lParam to long to avoid mismatch with + // format specifiers in 64 bit builds where they are both int64 quantities + // + // casting like this loses information, of course, but it shouldn't matter + // much for this diagnostic code and it keeps the code simple wxLogTrace("winmsg", wxT("Processing %s(hWnd=%p, wParam=%08lx, lParam=%08lx)"), - wxGetMessageName(message), hWnd, (long)wParam, lParam); + wxGetMessageName(message), hWnd, (long)wParam, (long)lParam); #endif // wxDEBUG_LEVEL >= 2 wxWindowMSW *wnd = wxFindWinFromHandle(hWnd); -- 2.45.2