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/windialogs.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/windialogs.c')
-rw-r--r-- | hw/xwin/windialogs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c index 6fe3fc442..c83b49bab 100644 --- a/hw/xwin/windialogs.c +++ b/hw/xwin/windialogs.c @@ -443,9 +443,9 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message, #endif #if CYGDEBUG - winDebug("winChangeDepthDlgProc - WM_INITDIALOG - orig bpp: %d, " + winDebug("winChangeDepthDlgProc - WM_INITDIALOG - orig bpp: %u, " "current bpp: %d\n", - s_pScreenInfo->dwBPP, + (unsigned int)s_pScreenInfo->dwBPP, GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL)); #endif @@ -455,9 +455,9 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message, case WM_DISPLAYCHANGE: #if CYGDEBUG - winDebug("winChangeDepthDlgProc - WM_DISPLAYCHANGE - orig bpp: %d, " + winDebug("winChangeDepthDlgProc - WM_DISPLAYCHANGE - orig bpp: %u, " "new bpp: %d\n", - s_pScreenInfo->dwBPP, + (unsigned int)s_pScreenInfo->dwBPP, GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL)); #endif |