diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2015-02-06 19:46:45 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2015-07-07 16:52:44 +0100 |
commit | aa83c61f510121da20b56e8f7de700193f7d16b5 (patch) | |
tree | 4891f0972cb8a4375f52bbaf8d1e316e37d1bda6 /hw/xwin/winmultiwindowwndproc.c | |
parent | 487f2595c9dd9a5c3c600168a108963e87602561 (diff) |
hw/xwin: printf format fixes for DWORD type
Some Win32 API types are different fundamental types in the 32-bit and 64-bit
versions.
This problem is then further compounded by the fact that whilst both 32-bit
Cygwin and 32-bit MinGW use the ILP32 data model, 64-bit MinGW uses the LLP64
data model, but 64-bit Cygwin uses the LP64 data model.
This makes it impossible to write printf format specifiers which are correct for
all those targets
In the Win32 API, DWORD is an unsigned, 32-bit type. It is defined in terms of
an unsigned long, except in the LP64 data model, where it is an unsigned int.
It should always be safe to cast it to unsigned int and use %u or %x.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Diffstat (limited to 'hw/xwin/winmultiwindowwndproc.c')
-rw-r--r-- | hw/xwin/winmultiwindowwndproc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index ab892f291..eb7b55e4d 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -1064,7 +1064,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE); winDebug("winTopLevelWindowProc - WM_STYLECHANGING from %08x %08x\n", - dwStyle, dwExStyle); + (unsigned int)dwStyle, (unsigned int)dwExStyle); if (wParam == GWL_EXSTYLE) dwExStyle = newStyle; @@ -1073,7 +1073,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) dwStyle = newStyle; winDebug("winTopLevelWindowProc - WM_STYLECHANGING to %08x %08x\n", - dwStyle, dwExStyle); + (unsigned int)dwStyle, (unsigned int)dwExStyle); /* Get client rect in screen coordinates */ wi.cbSize = sizeof(WINDOWINFO); |