xserver: Branch 'master' - 13 commits

Keith Packard keithp at kemper.freedesktop.org
Tue Jul 7 09:55:15 PDT 2015


 hw/xwin/glx/indirect.c            |   12 ++++-----
 hw/xwin/glx/winpriv.c             |    2 -
 hw/xwin/winallpriv.c              |    4 +--
 hw/xwin/winclipboard/internal.h   |    4 +--
 hw/xwin/winclipboard/wndproc.c    |   12 ++++-----
 hw/xwin/winclipboard/xevents.c    |   16 ++++++------
 hw/xwin/wincmap.c                 |   10 +++----
 hw/xwin/winconfig.c               |    2 -
 hw/xwin/wincreatewnd.c            |    9 +++---
 hw/xwin/windialogs.c              |    8 +++---
 hw/xwin/winkeybd.c                |    4 +--
 hw/xwin/winkeyhook.c              |    2 -
 hw/xwin/winmsg.c                  |    8 +++---
 hw/xwin/winmultiwindowicons.c     |    9 +++---
 hw/xwin/winmultiwindowwindow.c    |   50 +++++++++++++++++++-------------------
 hw/xwin/winmultiwindowwm.c        |    4 +--
 hw/xwin/winmultiwindowwndproc.c   |   39 ++++++++++++++---------------
 hw/xwin/winrandr.c                |    5 ++-
 hw/xwin/winscrinit.c              |    4 +--
 hw/xwin/winshadddnl.c             |   15 ++++++-----
 hw/xwin/winshadgdi.c              |   10 +++----
 hw/xwin/winwin32rootlesswndproc.c |   18 ++++---------
 hw/xwin/winwndproc.c              |    2 -
 23 files changed, 125 insertions(+), 124 deletions(-)

New commits:
commit 0cd228073ad3b7eb72cef8b61128324895ee6cd4
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jun 29 15:08:51 2015 +0100

    hw/xwin: printf format fixes for Pixel type
    
    Pixel is CARD32, so inside the server has type unsigned int (x86_64) or unsigned
    long (x86)
    
    Cast to unsigned int and use a %u format
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/wincmap.c b/hw/xwin/wincmap.c
index 318bfac..000334c 100644
--- a/hw/xwin/wincmap.c
+++ b/hw/xwin/wincmap.c
@@ -360,8 +360,8 @@ winGetPaletteDIB(ScreenPtr pScreen, ColormapPtr pcmap)
         nBlue = rgbColors[i].rgbBlue << 8;
 
 #if CYGDEBUG
-        winDebug("winGetPaletteDIB - Allocating a color: %d; "
-                 "%d %d %d\n", pixel, nRed, nGreen, nBlue);
+        winDebug("winGetPaletteDIB - Allocating a color: %u; "
+                 "%d %d %d\n", (unsigned int)pixel, nRed, nGreen, nBlue);
 #endif
 
         /* Allocate a entry in the X colormap */
@@ -445,8 +445,8 @@ winGetPaletteDD(ScreenPtr pScreen, ColormapPtr pcmap)
         nGreen = ppeColors[i].peGreen << 8;
         nBlue = ppeColors[i].peBlue << 8;
 #if CYGDEBUG
-        winDebug("winGetPaletteDD - Allocating a color: %d; "
-                 "%d %d %d\n", pixel, nRed, nGreen, nBlue);
+        winDebug("winGetPaletteDD - Allocating a color: %u; "
+                 "%d %d %d\n", (unsigned int)pixel, nRed, nGreen, nBlue);
 #endif
         if (AllocColor(pcmap, &nRed, &nGreen, &nBlue, &pixel, 0) != Success) {
             ErrorF("winGetPaletteDD - AllocColor () failed, pixel %d\n", i);
commit e3cfeb949a9c9363beacdb00acdd9723ed54fac2
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 6 20:22:11 2015 +0000

    hw/xwin: printf format fixes for WPARAM and LPARAM types
    
    Some Win32 API types are different fundamental types in the 32-bit and 64-bit
    
    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, so we use some macros to provide the correct specifier for
    the target.
    
    LPARAM and WPARAM are integer types which can contain a pointer
    
    LPARAM is long in ILP32 and long long in LLP64
    WPARAM is unsigned int in ILP32 and unsigned long long in LLP64
    
    Generally, these are just used to passs integer parameters, so for simplicity,
    cast to int and use an int-compatible format
    
    In the specific case of WM_CHANGECBCHAIN, they are used to pass HWND, so cast to
    that type and print using an appropriate format.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winclipboard/wndproc.c b/hw/xwin/winclipboard/wndproc.c
index e1517f2..d17cf2e 100644
--- a/hw/xwin/winclipboard/wndproc.c
+++ b/hw/xwin/winclipboard/wndproc.c
@@ -194,9 +194,9 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
     case WM_CHANGECBCHAIN:
     {
-        winDebug("winClipboardWindowProc - WM_CHANGECBCHAIN: wParam(%x) "
-                 "lParam(%x) s_hwndNextViewer(%p)\n",
-                 wParam, lParam, s_hwndNextViewer);
+        winDebug("winClipboardWindowProc - WM_CHANGECBCHAIN: wParam(%p) "
+                 "lParam(%p) s_hwndNextViewer(%p)\n",
+                 (HWND)wParam, (HWND)lParam, s_hwndNextViewer);
 
         if ((HWND) wParam == s_hwndNextViewer) {
             s_hwndNextViewer = (HWND) lParam;
@@ -441,7 +441,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         int best_target = 0;
 
         winDebug("winClipboardWindowProc - WM_RENDERFORMAT %d - Hello.\n",
-                 wParam);
+                 (int)wParam);
 
         /* Flag whether to convert to Unicode or not */
         fConvertToUnicode = (CF_UNICODETEXT == wParam);
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index f034225..ab53af4 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -74,7 +74,7 @@ winTranslateKey(WPARAM wParam, LPARAM lParam)
     int iParamScanCode = LOBYTE(iParam);
     int iScanCode;
 
-    winDebug("winTranslateKey: wParam %08x lParam %08x\n", wParam, lParam);
+    winDebug("winTranslateKey: wParam %08x lParam %08x\n", (int)wParam, (int)lParam);
 
 /* WM_ key messages faked by Vista speech recognition (WSR) don't have a
  * scan code.
diff --git a/hw/xwin/winmsg.c b/hw/xwin/winmsg.c
index 79399a4..575bc47 100644
--- a/hw/xwin/winmsg.c
+++ b/hw/xwin/winmsg.c
@@ -158,8 +158,8 @@ winDebugWin32Message(const char *function, HWND hwnd, UINT message,
             getenv("WIN_DEBUG_WM_USER")) {
             winDebug("%s - Message WM_USER + %d\n", function,
                      message - WM_USER);
-            winDebug("\thwnd 0x%p wParam 0x%x lParam 0x%x\n", hwnd, wParam,
-                     lParam);
+            winDebug("\thwnd 0x%p wParam 0x%x lParam 0x%x\n", hwnd, (int)wParam,
+                     (int)lParam);
         }
     }
     else if (message < MESSAGE_NAMES_LEN && MESSAGE_NAMES[message]) {
@@ -170,8 +170,8 @@ winDebugWin32Message(const char *function, HWND hwnd, UINT message,
         buffer[63] = 0;
         if (force || getenv("WIN_DEBUG_MESSAGES") || getenv(buffer)) {
             winDebug("%s - Message %s\n", function, MESSAGE_NAMES[message]);
-            winDebug("\thwnd 0x%p wParam 0x%x lParam 0x%x\n", hwnd, wParam,
-                     lParam);
+            winDebug("\thwnd 0x%p wParam 0x%x lParam 0x%x\n", hwnd, (int)wParam,
+                     (int)lParam);
         }
     }
 }
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 3228fa4..123b84f 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -168,7 +168,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
         ErrorF("winWindowProc - WM_DISPLAYCHANGE - new width: %d "
                "new height: %d new bpp: %d\n",
-               LOWORD(lParam), HIWORD(lParam), wParam);
+               LOWORD(lParam), HIWORD(lParam), (int)wParam);
 
         /* 0 bpp has no defined meaning, ignore this message */
         if (wParam == 0)
commit 4f8661fac985306c56330cae69ffc19e5dd0af61
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 6 19:19:41 2015 +0000

    hw/xwin: printf format fixes for LONG 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 signed, 32-bit type.  It is defined in terms of a
    long, except in the LP64 data model, where it is an int.
    
    It should always be safe to cast it to int and use %d.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c
index 6c5b21d..b2f797c 100644
--- a/hw/xwin/wincreatewnd.c
+++ b/hw/xwin/wincreatewnd.c
@@ -357,10 +357,11 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
     }
 
     winDebug("winCreateBoundingWindowWindowed - WindowClient "
-             "w %ld h %ld r %ld l %ld b %ld t %ld\n",
-             rcClient.right - rcClient.left,
-             rcClient.bottom - rcClient.top,
-             rcClient.right, rcClient.left, rcClient.bottom, rcClient.top);
+             "w %d  h %d r %d l %d b %d t %d\n",
+             (int)(rcClient.right - rcClient.left),
+             (int)(rcClient.bottom - rcClient.top),
+             (int)rcClient.right, (int)rcClient.left,
+             (int)rcClient.bottom, (int)rcClient.top);
 
     /* We adjust the visual size if the user did not specify it */
     if (!
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 91bd956..f4de912 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -220,7 +220,7 @@ winPositionWindowMultiWindow(WindowPtr pWin, int x, int y)
 #if CYGMULTIWINDOW_DEBUG
     lpRc = &rcNew;
     ErrorF("winPositionWindowMultiWindow - drawable (%d, %d)-(%d, %d)\n",
-           lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+           (int)lpRc->left, (int)lpRc->top, (int)lpRc->right, (int)lpRc->bottom);
 #endif
 
     /*
@@ -238,15 +238,15 @@ winPositionWindowMultiWindow(WindowPtr pWin, int x, int y)
 
     lpRc = &rcNew;
     ErrorF("winPositionWindowMultiWindow - rcNew (%d, %d)-(%d, %d)\n",
-           lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+           (int)lpRc->left, (int)lpRc->top, (int)lpRc->right, (int)lpRc->bottom);
 
     lpRc = &rcOld;
     ErrorF("winPositionWindowMultiWindow - rcOld (%d, %d)-(%d, %d)\n",
-           lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+           (int)lpRc->left, (int)lpRc->top, (int)lpRc->right, (int)lpRc->bottom);
 
     lpRc = &rcClient;
     ErrorF("rcClient (%d, %d)-(%d, %d)\n",
-           lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+           (int)lpRc->left, (int)lpRc->top, (int)lpRc->right, (int)lpRc->bottom);
 #endif
 
     /* Check if the old rectangle and new rectangle are the same */
@@ -256,8 +256,8 @@ winPositionWindowMultiWindow(WindowPtr pWin, int x, int y)
 #endif
 
 #if CYGWINDOWING_DEBUG
-        ErrorF("\tMoveWindow to (%ld, %ld) - %ldx%ld\n", rcNew.left, rcNew.top,
-               rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
+        ErrorF("\tMoveWindow to (%d, %d) - %dx%d\n", (int)rcNew.left, (int)rcNew.top,
+               (int)(rcNew.right - rcNew.left), (int)(rcNew.bottom - rcNew.top));
 #endif
         /* Change the position and dimensions of the Windows window */
         MoveWindow(hWnd,
@@ -948,8 +948,8 @@ winAdjustXWindow(WindowPtr pWin, HWND hwnd)
     SetRect(&rcDraw, x, y, x + pDraw->width, y + pDraw->height);
 #ifdef CYGMULTIWINDOW_DEBUG
     winDebug("\tDrawable extend {%d, %d, %d, %d}, {%d, %d}\n",
-             rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom,
-             rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top);
+             (int)rcDraw.left, (int)rcDraw.top, (int)rcDraw.right, (int)rcDraw.bottom,
+             (int)(rcDraw.right - rcDraw.left), (int)(rcDraw.bottom - rcDraw.top));
 #endif
     dwExStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
     dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
@@ -962,11 +962,11 @@ winAdjustXWindow(WindowPtr pWin, HWND hwnd)
     GetWindowRect(hwnd, &rcWin);
 #ifdef CYGMULTIWINDOW_DEBUG
     winDebug("\tWindow extend {%d, %d, %d, %d}, {%d, %d}\n",
-             rcWin.left, rcWin.top, rcWin.right, rcWin.bottom,
-             rcWin.right - rcWin.left, rcWin.bottom - rcWin.top);
+             (int)rcWin.left, (int)rcWin.top, (int)rcWin.right, (int)rcWin.bottom,
+             (int)(rcWin.right - rcWin.left), (int)(rcWin.bottom - rcWin.top));
     winDebug("\tDraw extend {%d, %d, %d, %d}, {%d, %d}\n",
-             rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom,
-             rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top);
+             (int)rcDraw.left, (int)rcDraw.top, (int)rcDraw.right, (int)rcDraw.bottom,
+             (int)(rcDraw.right - rcDraw.left), (int)(rcDraw.bottom - rcDraw.top));
 #endif
 
     if (EqualRect(&rcDraw, &rcWin)) {
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index eb7b55e..656f6c2 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -770,20 +770,20 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
             ErrorF("\nCYGWINDOWING Dump:\n"
                    "\tdrawable: (%hd, %hd) - %hdx%hd\n", pDraw->x,
                    pDraw->y, pDraw->width, pDraw->height);
-            ErrorF("\twindPlace: (%ld, %ld) - %ldx%ld\n", pRect->left,
-                   pRect->top, pRect->right - pRect->left,
-                   pRect->bottom - pRect->top);
+            ErrorF("\twindPlace: (%d, %d) - %dx%d\n", (int)pRect->left,
+                   (int)pRect->top, (int)(pRect->right - pRect->left),
+                   (int)(pRect->bottom - pRect->top));
             if (GetClientRect(hwnd, &rc)) {
                 pRect = &rc;
-                ErrorF("\tClientRect: (%ld, %ld) - %ldx%ld\n", pRect->left,
-                       pRect->top, pRect->right - pRect->left,
-                       pRect->bottom - pRect->top);
+                ErrorF("\tClientRect: (%d, %d) - %dx%d\n", (int)pRect->left,
+                       (int)pRect->top, (int)(pRect->right - pRect->left),
+                       (int)(pRect->bottom - pRect->top));
             }
             if (GetWindowRect(hwnd, &rc)) {
                 pRect = &rc;
-                ErrorF("\tWindowRect: (%ld, %ld) - %ldx%ld\n", pRect->left,
-                       pRect->top, pRect->right - pRect->left,
-                       pRect->bottom - pRect->top);
+                ErrorF("\tWindowRect: (%d, %d) - %dx%d\n", (int)pRect->left,
+                       (int)pRect->top, (int)(pRect->right - pRect->left),
+                       (int)(pRect->bottom - pRect->top));
             }
             ErrorF("\n");
         }
@@ -1081,9 +1081,9 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
         winDebug
             ("winTopLevelWindowProc - WM_STYLECHANGING client area {%d, %d, %d, %d}, {%d x %d}\n",
-             wi.rcClient.left, wi.rcClient.top, wi.rcClient.right,
-             wi.rcClient.bottom, wi.rcClient.right - wi.rcClient.left,
-             wi.rcClient.bottom - wi.rcClient.top);
+             (int)wi.rcClient.left, (int)wi.rcClient.top, (int)wi.rcClient.right,
+             (int)wi.rcClient.bottom, (int)(wi.rcClient.right - wi.rcClient.left),
+             (int)(wi.rcClient.bottom - wi.rcClient.top));
 
         newWinRect = wi.rcClient;
         if (!AdjustWindowRectEx(&newWinRect, dwStyle, FALSE, dwExStyle))
@@ -1092,9 +1092,9 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
         winDebug
             ("winTopLevelWindowProc - WM_STYLECHANGING window area should be {%d, %d, %d, %d}, {%d x %d}\n",
-             newWinRect.left, newWinRect.top, newWinRect.right,
-             newWinRect.bottom, newWinRect.right - newWinRect.left,
-             newWinRect.bottom - newWinRect.top);
+             (int)newWinRect.left, (int)newWinRect.top, (int)newWinRect.right,
+             (int)newWinRect.bottom, (int)(newWinRect.right - newWinRect.left),
+             (int)(newWinRect.bottom - newWinRect.top));
 
         /*
            Style change hasn't happened yet, so we can't adjust the window size yet, as the winAdjustXWindow()
diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c
index 1b34085..7392507 100644
--- a/hw/xwin/winrandr.c
+++ b/hw/xwin/winrandr.c
@@ -178,8 +178,9 @@ winRandRScreenSetSize(ScreenPtr pScreen,
          */
         AdjustWindowRectEx(&rcClient, dwStyle, FALSE, dwExStyle);
 
-        ErrorF("winRandRScreenSetSize new window area w: %ld h: %ld\n",
-               rcClient.right - rcClient.left, rcClient.bottom - rcClient.top);
+        ErrorF("winRandRScreenSetSize new window area w: %d h: %d\n",
+               (int)(rcClient.right - rcClient.left),
+               (int)(rcClient.bottom - rcClient.top));
 
         SetWindowPos(pScreenPriv->hwndScreen, NULL,
                      0, 0, rcClient.right - rcClient.left,
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index 7c31175..bf65517 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -199,7 +199,7 @@ winQueryRGBBitsAndMasks(ScreenPtr pScreen)
         winDebug("%s - Masks: %08x %08x %08x\n", __FUNCTION__,
                  (unsigned int)pdw[0], (unsigned int)pdw[1], (unsigned int)pdw[2]);
         winDebug("%s - Bitmap: %dx%d %d bpp %d planes\n", __FUNCTION__,
-                 pbmih->biWidth, pbmih->biHeight, pbmih->biBitCount,
+                 (int)pbmih->biWidth, (int)pbmih->biHeight, pbmih->biBitCount,
                  pbmih->biPlanes);
         winDebug("%s - Compression: %u %s\n", __FUNCTION__,
                  (unsigned int)pbmih->biCompression,
commit aa83c61f510121da20b56e8f7de700193f7d16b5
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 6 19:46:45 2015 +0000

    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 at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 93cdb29..e4be642 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -253,7 +253,7 @@ pfdOut(const PIXELFORMATDESCRIPTOR * pfd)
     ErrorF("PIXELFORMATDESCRIPTOR:\n");
     ErrorF("nSize = %u\n", pfd->nSize);
     ErrorF("nVersion = %u\n", pfd->nVersion);
-    ErrorF("dwFlags = %lu = {", pfd->dwFlags);
+    ErrorF("dwFlags = %u = {", (unsigned int)pfd->dwFlags);
     DUMP_PFD_FLAG(PFD_DOUBLEBUFFER);
     DUMP_PFD_FLAG(PFD_STEREO);
     DUMP_PFD_FLAG(PFD_DRAW_TO_WINDOW);
@@ -297,9 +297,9 @@ pfdOut(const PIXELFORMATDESCRIPTOR * pfd)
     ErrorF("cAuxBuffers = %hhu\n", pfd->cAuxBuffers);
     ErrorF("iLayerType = %hhu\n", pfd->iLayerType);
     ErrorF("bReserved = %hhu\n", pfd->bReserved);
-    ErrorF("dwLayerMask = %lu\n", pfd->dwLayerMask);
-    ErrorF("dwVisibleMask = %lu\n", pfd->dwVisibleMask);
-    ErrorF("dwDamageMask = %lu\n", pfd->dwDamageMask);
+    ErrorF("dwLayerMask = %u\n", (unsigned int)pfd->dwLayerMask);
+    ErrorF("dwVisibleMask = %u\n", (unsigned int)pfd->dwVisibleMask);
+    ErrorF("dwDamageMask = %u\n", (unsigned int)pfd->dwDamageMask);
     ErrorF("\n");
 }
 
@@ -1862,8 +1862,8 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen)
         if (!(pfd.dwFlags & (PFD_DRAW_TO_WINDOW | PFD_DRAW_TO_BITMAP)) ||
             !(pfd.dwFlags & PFD_SUPPORT_OPENGL)) {
             GLWIN_DEBUG_MSG
-                ("pixelFormat %d has unsuitable flags 0x%08lx, skipping", i + 1,
-                 pfd.dwFlags);
+                ("pixelFormat %d has unsuitable flags 0x%08x, skipping", i + 1,
+                 (unsigned int)pfd.dwFlags);
             continue;
         }
 
diff --git a/hw/xwin/winclipboard/xevents.c b/hw/xwin/winclipboard/xevents.c
index bf44ac9..aee6c86 100644
--- a/hw/xwin/winclipboard/xevents.c
+++ b/hw/xwin/winclipboard/xevents.c
@@ -309,7 +309,7 @@ winClipboardFlushXEvents(HWND hwnd,
             /* Access the clipboard */
             if (!OpenClipboard(hwnd)) {
                 ErrorF("winClipboardFlushXEvents - SelectionRequest - "
-                       "OpenClipboard () failed: %08lx\n", GetLastError());
+                       "OpenClipboard () failed: %08x\n", (unsigned int)GetLastError());
 
                 /* Abort */
                 fAbort = TRUE;
@@ -369,7 +369,7 @@ winClipboardFlushXEvents(HWND hwnd,
             }
             if (!hGlobal) {
                 ErrorF("winClipboardFlushXEvents - SelectionRequest - "
-                       "GetClipboardData () failed: %08lx\n", GetLastError());
+                       "GetClipboardData () failed: %08x\n", (unsigned int)GetLastError());
 
                 /* Abort */
                 fAbort = TRUE;
@@ -706,7 +706,7 @@ winClipboardFlushXEvents(HWND hwnd,
             /* Check that global memory was allocated */
             if (!hGlobal) {
                 ErrorF("winClipboardFlushXEvents - SelectionNotify "
-                       "GlobalAlloc failed, aborting: %ld\n", GetLastError());
+                       "GlobalAlloc failed, aborting: %08x\n", (unsigned int)GetLastError());
 
                 /* Abort */
                 fAbort = TRUE;
diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index 6fe3fc4..c83b49b 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
 
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index e7202a6..f034225 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -504,7 +504,7 @@ winSendKeyEvent(DWORD dwKey, Bool fDown)
     QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease,
                         dwKey + MIN_KEYCODE);
 
-    winDebug("winSendKeyEvent: dwKey: %d, fDown: %d\n", dwKey, fDown);
+    winDebug("winSendKeyEvent: dwKey: %u, fDown: %u\n", (unsigned int)dwKey, fDown);
 }
 
 BOOL
diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c
index fe77b21..66d68f6 100644
--- a/hw/xwin/winkeyhook.c
+++ b/hw/xwin/winkeyhook.c
@@ -84,7 +84,7 @@ winKeyboardMessageHookLL(int iCode, WPARAM wParam, LPARAM lParam)
     /* Pass keystrokes on to our main message loop */
     if (iCode == HC_ACTION) {
         winDebug("winKeyboardMessageHook: vkCode: %08x scanCode: %08x\n",
-                 p->vkCode, p->scanCode);
+                 (unsigned int)p->vkCode, (unsigned int)p->scanCode);
 
         switch (wParam) {
         case WM_KEYDOWN:
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 4a208dd..91bd956 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -954,7 +954,7 @@ winAdjustXWindow(WindowPtr pWin, HWND hwnd)
     dwExStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
     dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
 #ifdef CYGMULTIWINDOW_DEBUG
-    winDebug("\tWindowStyle: %08x %08x\n", dwStyle, dwExStyle);
+    winDebug("\tWindowStyle: %08x %08x\n", (unsigned int)dwStyle, (unsigned int)dwExStyle);
 #endif
     AdjustWindowRectEx(&rcDraw, dwStyle, FALSE, dwExStyle);
 
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index ab892f2..eb7b55e 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);
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index e68ee12..735ce93 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -89,8 +89,8 @@ winScreenInit(ScreenPtr pScreen, int argc, char **argv)
     DWORD dwInitialBPP;
 
 #if CYGDEBUG || YES
-    winDebug("winScreenInit - dwWidth: %ld dwHeight: %ld\n",
-             pScreenInfo->dwWidth, pScreenInfo->dwHeight);
+    winDebug("winScreenInit - dwWidth: %u dwHeight: %u\n",
+             (unsigned int)pScreenInfo->dwWidth, (unsigned int)pScreenInfo->dwHeight);
 #endif
 
     /* Allocate privates for this screen */
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 48599b2..d4f940e 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -200,8 +200,10 @@ winAllocateFBShadowDDNL(ScreenPtr pScreen)
     DDPIXELFORMAT ddpfPrimary;
 
 #if CYGDEBUG
-    winDebug("winAllocateFBShadowDDNL - w %d h %d d %d\n",
-             pScreenInfo->dwWidth, pScreenInfo->dwHeight, pScreenInfo->dwDepth);
+    winDebug("winAllocateFBShadowDDNL - w %u h %u d %u\n",
+             (unsigned int)pScreenInfo->dwWidth,
+             (unsigned int)pScreenInfo->dwHeight,
+             (unsigned int)pScreenInfo->dwDepth);
 #endif
 
     /* Set the padded screen width */
@@ -400,10 +402,11 @@ winAllocateFBShadowDDNL(ScreenPtr pScreen)
 
 #if CYGDEBUG
     winDebug("winAllocateFBShadowDDNL - Primary masks: %08x %08x %08x "
-             "dwRGBBitCount: %d\n",
-             ddpfPrimary.u2.dwRBitMask,
-             ddpfPrimary.u3.dwGBitMask,
-             ddpfPrimary.u4.dwBBitMask, ddpfPrimary.u1.dwRGBBitCount);
+             "dwRGBBitCount: %u\n",
+             (unsigned int)ddpfPrimary.u2.dwRBitMask,
+             (unsigned int)ddpfPrimary.u3.dwGBitMask,
+             (unsigned int)ddpfPrimary.u4.dwBBitMask,
+             (unsigned int)ddpfPrimary.u1.dwRGBBitCount);
 #endif
 
     /* Describe the shadow surface to be created */
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index 3d222ad..7c31175 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -121,7 +121,7 @@ winQueryScreenDIBFormat(ScreenPtr pScreen, BITMAPINFOHEADER * pbmih)
     pdw = (DWORD *) ((CARD8 *) pbmih + sizeof(BITMAPINFOHEADER));
 
     winDebug("winQueryScreenDIBFormat - First call masks: %08x %08x %08x\n",
-             pdw[0], pdw[1], pdw[2]);
+             (unsigned int)pdw[0], (unsigned int)pdw[1], (unsigned int)pdw[2]);
 #endif
 
     /* Get optimal color table, or the optimal bitfields */
@@ -197,12 +197,12 @@ winQueryRGBBitsAndMasks(ScreenPtr pScreen)
 
 #if CYGDEBUG
         winDebug("%s - Masks: %08x %08x %08x\n", __FUNCTION__,
-                 pdw[0], pdw[1], pdw[2]);
+                 (unsigned int)pdw[0], (unsigned int)pdw[1], (unsigned int)pdw[2]);
         winDebug("%s - Bitmap: %dx%d %d bpp %d planes\n", __FUNCTION__,
                  pbmih->biWidth, pbmih->biHeight, pbmih->biBitCount,
                  pbmih->biPlanes);
-        winDebug("%s - Compression: %d %s\n", __FUNCTION__,
-                 pbmih->biCompression,
+        winDebug("%s - Compression: %u %s\n", __FUNCTION__,
+                 (unsigned int)pbmih->biCompression,
                  (pbmih->biCompression ==
                   BI_RGB ? "(BI_RGB)" : (pbmih->biCompression ==
                                          BI_RLE8 ? "(BI_RLE8)" : (pbmih->
commit 487f2595c9dd9a5c3c600168a108963e87602561
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 6 20:48:26 2015 +0000

    hw/xwin: printf format fixes in xevents.c
    
    Window and Atom types derive from XID, which is always unsigned long in client
    code, so use %ld format specifier
    
    XTextProperty.nitems is of type unsigned long, so use %lu format specifier
    
    ulReturnBytesLeft is of type unsigned long, so use %lu format specifier
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winclipboard/xevents.c b/hw/xwin/winclipboard/xevents.c
index 835195b..bf44ac9 100644
--- a/hw/xwin/winclipboard/xevents.c
+++ b/hw/xwin/winclipboard/xevents.c
@@ -107,7 +107,7 @@ MonitorSelection(XFixesSelectionNotifyEvent * e, unsigned int i)
 
     /* Save new selection owner or None */
     s_iOwners[i] = e->owner;
-    winDebug("MonitorSelection - %s - Now owned by XID %x\n",
+    winDebug("MonitorSelection - %s - Now owned by XID %lx\n",
              szSelectionNames[i], e->owner);
 }
 
@@ -172,7 +172,7 @@ winClipboardSelectionNotifyTargets(HWND hwnd, Window iWindow, Display *pDisplay,
         Atom atom = prop[i];
         char *pszAtomName = XGetAtomName(pDisplay, atom);
         data->targetList[i] = atom;
-        winDebug("winClipboardFlushXEvents - SelectionNotify - target[%d] %d = %s\n", i, atom, pszAtomName);
+        winDebug("winClipboardFlushXEvents - SelectionNotify - target[%d] %ld = %s\n", i, atom, pszAtomName);
         XFree(pszAtomName);
       }
 
@@ -231,7 +231,7 @@ winClipboardFlushXEvents(HWND hwnd,
         {
             char *pszAtomName = NULL;
 
-            winDebug("SelectionRequest - target %d\n",
+            winDebug("SelectionRequest - target %ld\n",
                      event.xselectionrequest.target);
 
             pszAtomName = XGetAtomName(pDisplay,
@@ -561,7 +561,7 @@ winClipboardFlushXEvents(HWND hwnd,
             */
             if (event.xselection.property == None) {
                     ErrorF("winClipboardFlushXEvents - SelectionNotify - "
-                           "Conversion to format %d refused.\n",
+                           "Conversion to format %ld refused.\n",
                            event.xselection.target);
                     return WIN_XEVENTS_FAILED;
                 }
@@ -591,7 +591,7 @@ winClipboardFlushXEvents(HWND hwnd,
             {
                 char *pszAtomName = NULL;
 
-                winDebug("SelectionNotify - returned data %d left %d\n",
+                winDebug("SelectionNotify - returned data %lu left %lu\n",
                          xtpText.nitems, ulReturnBytesLeft);
                 pszAtomName = XGetAtomName(pDisplay, xtpText.encoding);
                 winDebug("Notify atom name %s\n", pszAtomName);
commit 98798fcf0d1dc66c539abb2ecec0acc676d0b574
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 6 20:42:54 2015 +0000

    hw/xwin: printf format fix in winProcessXEventsTimeout()
    
    remainingTime is computed as a long int, so use %ld format specifier
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winclipboard/wndproc.c b/hw/xwin/winclipboard/wndproc.c
index 229a948..e1517f2 100644
--- a/hw/xwin/winclipboard/wndproc.c
+++ b/hw/xwin/winclipboard/wndproc.c
@@ -104,7 +104,7 @@ winProcessXEventsTimeout(HWND hwnd, Window iWindow, Display * pDisplay,
         remainingTime = dwStopTime - GetTickCount();
         tv.tv_sec = remainingTime / 1000;
         tv.tv_usec = (remainingTime % 1000) * 1000;
-        winDebug("winProcessXEventsTimeout () - %d milliseconds left\n",
+        winDebug("winProcessXEventsTimeout () - %ld milliseconds left\n",
                  remainingTime);
 
         /* Break out if no time left */
commit 5b6f511c2fcad4edaccedbeb9842680cf3aeffb1
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 6 20:40:46 2015 +0000

    hw/xwin: printf format fix in winCreateDefColormap()
    
    Use %lu for unsigned long
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/wincmap.c b/hw/xwin/wincmap.c
index 1bdc7df..318bfac 100644
--- a/hw/xwin/wincmap.c
+++ b/hw/xwin/wincmap.c
@@ -515,7 +515,7 @@ winCreateDefColormap(ScreenPtr pScreen)
      */
 
 #if CYGDEBUG
-    winDebug("winCreateDefColormap - defColormap: %d\n", pScreen->defColormap);
+    winDebug("winCreateDefColormap - defColormap: %lu\n", pScreen->defColormap);
 #endif
 
     /* Allocate an X colormap, owned by client 0 */
commit eb679671560b21206a47476dfbc23518d8d46588
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 6 20:38:26 2015 +0000

    hw/xwin: printf format fixes in winAllocatePrivates()
    
    serverGeneration is of type unsigned long, so use %lu format specifier
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winallpriv.c b/hw/xwin/winallpriv.c
index 629af92..816b030 100644
--- a/hw/xwin/winallpriv.c
+++ b/hw/xwin/winallpriv.c
@@ -48,8 +48,8 @@ winAllocatePrivates(ScreenPtr pScreen)
     winPrivScreenPtr pScreenPriv;
 
 #if CYGDEBUG
-    winDebug("winAllocateScreenPrivates - g_ulServerGeneration: %d "
-             "serverGeneration: %d\n", g_ulServerGeneration, serverGeneration);
+    winDebug("winAllocateScreenPrivates - g_ulServerGeneration: %lu "
+             "serverGeneration: %lu\n", g_ulServerGeneration, serverGeneration);
 #endif
 
     /* We need a new slot for our privates if the screen gen has changed */
commit 0d6c499b9976d305e13685eb79b4bb7cd4250f58
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 6 20:27:11 2015 +0000

    hw/xwin: printf format fixes in winConfigKeyboard()
    
    struct winInfoRec.keyboard members are of type long, not type int
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
index 321dfee..d26cc93 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -263,7 +263,7 @@ winConfigKeyboard(DeviceIntPtr pDevice)
                 break;
             }
             g_winInfo.keyboard.rate = (kbd_speed > 0) ? kbd_speed : 1;
-            winMsgVerb(X_PROBED, 1, "Setting autorepeat to delay=%d, rate=%d\n",
+            winMsgVerb(X_PROBED, 1, "Setting autorepeat to delay=%ld, rate=%ld\n",
                        g_winInfo.keyboard.delay, g_winInfo.keyboard.rate);
         }
     }
commit ba468e003e32c406f4885c8cb3deeb1c8175cd45
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jun 29 14:25:49 2015 +0100

    hw/xwin: printf format fixes for XID type
    
    XID inside the server has type unsigned int (x86_64) or unsigned long (x86)
    
    Follow the example of the rest of the server and cast to unsigned int and use
    a %u or %x format.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/glx/winpriv.c b/hw/xwin/glx/winpriv.c
index 9b4baf3..e6afbff 100644
--- a/hw/xwin/glx/winpriv.c
+++ b/hw/xwin/glx/winpriv.c
@@ -21,7 +21,7 @@ void
 HWND
 winGetWindowInfo(WindowPtr pWin)
 {
-    winTrace("%s: pWin %p XID 0x%x\n", __FUNCTION__, pWin, pWin->drawable.id);
+    winTrace("%s: pWin %p XID 0x%x\n", __FUNCTION__, pWin, (unsigned int)pWin->drawable.id);
 
     /* a real window was requested */
     if (pWin != NULL) {
diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c
index c22e688..cc45387 100644
--- a/hw/xwin/winmultiwindowicons.c
+++ b/hw/xwin/winmultiwindowicons.c
@@ -449,8 +449,9 @@ winXIconToHICON(Display * pDisplay, Window id, int iconSize)
 
         hints = XGetWMHints(pDisplay, id);
         if (hints) {
-            winDebug("winXIconToHICON: id 0x%x icon_pixmap hint %x\n", id,
-                     hints->icon_pixmap);
+            winDebug("winXIconToHICON: id 0x%x icon_pixmap hint 0x%x\n",
+                     (unsigned int)id,
+                     (unsigned int)hints->icon_pixmap);
 
             if (hints->icon_pixmap) {
                 Window root;
@@ -465,8 +466,8 @@ winXIconToHICON(Display * pDisplay, Window id, int iconSize)
                 xImageIcon =
                     XGetImage(pDisplay, hints->icon_pixmap, 0, 0, width, height,
                               0xFFFFFFFF, ZPixmap);
-                winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%p\n", id,
-                         xImageIcon);
+                winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%p\n",
+                         (unsigned int)id, xImageIcon);
 
                 if (hints->icon_mask)
                     xImageMask =
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 1ecf0b9..4a208dd 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -379,8 +379,9 @@ winReparentWindowMultiWindow(WindowPtr pWin, WindowPtr pPriorParent)
 
     winDebug
         ("winReparentMultiWindow - pWin:%p XID:0x%x, reparent from pWin:%p XID:0x%x to pWin:%p XID:0x%x\n",
-         pWin, pWin->drawable.id, pPriorParent, pPriorParent->drawable.id,
-         pWin->parent, pWin->parent->drawable.id);
+         pWin, (unsigned int)pWin->drawable.id,
+         pPriorParent, (unsigned int)pPriorParent->drawable.id,
+         pWin->parent, (unsigned int)pWin->parent->drawable.id);
 
     WIN_UNWRAP(ReparentWindow);
     if (pScreen->ReparentWindow)
@@ -493,7 +494,7 @@ winCreateWindowsWindow(WindowPtr pWin)
     winInitMultiWindowClass();
 
     winDebug("winCreateWindowsTopLevelWindow - pWin:%p XID:0x%x \n", pWin,
-             pWin->drawable.id);
+             (unsigned int)pWin->drawable.id);
 
     iX = pWin->drawable.x + GetSystemMetrics(SM_XVIRTUALSCREEN);
     iY = pWin->drawable.y + GetSystemMetrics(SM_YVIRTUALSCREEN);
@@ -619,7 +620,7 @@ winDestroyWindowsWindow(WindowPtr pWin)
     HICON hIconSm;
 
     winDebug("winDestroyWindowsWindow - pWin:%p XID:0x%x \n", pWin,
-             pWin->drawable.id);
+             (unsigned int)pWin->drawable.id);
 
     /* Bail out if the Windows window handle is invalid */
     if (pWinPriv->hWnd == NULL)
@@ -713,7 +714,7 @@ winGetWindowID(WindowPtr pWin)
     FindClientResourcesByType(c, RT_WINDOW, winFindWindow, &wi);
 
 #if CYGMULTIWINDOW_DEBUG
-    ErrorF("winGetWindowID - Window ID: %d\n", wi.id);
+    ErrorF("winGetWindowID - Window ID: %u\n", (unsigned int)wi.id);
 #endif
 
     return wi.id;
@@ -993,8 +994,9 @@ winAdjustXWindow(WindowPtr pWin, HWND hwnd)
     vlist[2] = pDraw->width + dW;
     vlist[3] = pDraw->height + dH;
 #if CYGWINDOWING_DEBUG
-    ErrorF("\tConfigureWindow to (%ld, %ld) - %ldx%ld\n", vlist[0], vlist[1],
-           vlist[2], vlist[3]);
+    ErrorF("\tConfigureWindow to (%u, %u) - %ux%u\n",
+           (unsigned int)vlist[0], (unsigned int)vlist[1],
+           (unsigned int)vlist[2], (unsigned int)vlist[3]);
 #endif
     return ConfigureWindow(pWin, CWX | CWY | CWWidth | CWHeight,
                            vlist, wClient(pWin));
commit dcb797b31f0affdc4b08b000dd92ec38fa261953
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Oct 2 14:28:46 2014 +0100

    hw/xwin: printf format fixes for HWND type
    
    HWND derives from HANDLE, a pointer type, so we should use the %p format
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winclipboard/wndproc.c b/hw/xwin/winclipboard/wndproc.c
index 1ea5bc6..229a948 100644
--- a/hw/xwin/winclipboard/wndproc.c
+++ b/hw/xwin/winclipboard/wndproc.c
@@ -195,7 +195,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     case WM_CHANGECBCHAIN:
     {
         winDebug("winClipboardWindowProc - WM_CHANGECBCHAIN: wParam(%x) "
-                 "lParam(%x) s_hwndNextViewer(%x)\n",
+                 "lParam(%x) s_hwndNextViewer(%p)\n",
                  wParam, lParam, s_hwndNextViewer);
 
         if ((HWND) wParam == s_hwndNextViewer) {
@@ -236,7 +236,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         first = GetClipboardViewer();   /* Get handle to first viewer in chain. */
         if (first == hwnd)
             return 0;           /* Make sure it's not us! */
-        winDebug("  WM_WM_REINIT: Replacing us(%x) with %x at head "
+        winDebug("  WM_WM_REINIT: Replacing us(%p) with %p at head "
                  "of chain\n", hwnd, s_hwndNextViewer);
         s_fCBCInitialized = FALSE;
         ChangeClipboardChain(hwnd, s_hwndNextViewer);
diff --git a/hw/xwin/winmsg.c b/hw/xwin/winmsg.c
index 56e7a09..79399a4 100644
--- a/hw/xwin/winmsg.c
+++ b/hw/xwin/winmsg.c
@@ -158,7 +158,7 @@ winDebugWin32Message(const char *function, HWND hwnd, UINT message,
             getenv("WIN_DEBUG_WM_USER")) {
             winDebug("%s - Message WM_USER + %d\n", function,
                      message - WM_USER);
-            winDebug("\thwnd 0x%x wParam 0x%x lParam 0x%x\n", hwnd, wParam,
+            winDebug("\thwnd 0x%p wParam 0x%x lParam 0x%x\n", hwnd, wParam,
                      lParam);
         }
     }
@@ -170,7 +170,7 @@ winDebugWin32Message(const char *function, HWND hwnd, UINT message,
         buffer[63] = 0;
         if (force || getenv("WIN_DEBUG_MESSAGES") || getenv(buffer)) {
             winDebug("%s - Message %s\n", function, MESSAGE_NAMES[message]);
-            winDebug("\thwnd 0x%x wParam 0x%x lParam 0x%x\n", hwnd, wParam,
+            winDebug("\thwnd 0x%p wParam 0x%x lParam 0x%x\n", hwnd, wParam,
                      lParam);
         }
     }
commit f1d14266672c8130e992dd9d0c08fd1cef0f08cb
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Wed Oct 1 22:12:26 2014 +0100

    hw/xwin: Ensure format warnings in winclipboard/
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winclipboard/internal.h b/hw/xwin/winclipboard/internal.h
index c6bde84..6c26caf 100644
--- a/hw/xwin/winclipboard/internal.h
+++ b/hw/xwin/winclipboard/internal.h
@@ -50,8 +50,8 @@
  * References to external symbols
  */
 
-extern void winDebug(const char *format, ...);
-extern void ErrorF(const char *format, ...);
+extern void winDebug(const char *format, ...) _X_ATTRIBUTE_PRINTF(1, 2);
+extern void ErrorF(const char *format, ...) _X_ATTRIBUTE_PRINTF(1, 2);
 
 /*
  * winclipboardtextconv.c
commit 38f340b13e693a0d456a9ab22a6474c8f55375fa
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jun 29 15:30:36 2015 +0100

    hw/xwin: Remove GetTickCount() from various pieces of debugging output
    
    The use of %d format for the DWORD return value of GetTickCount() isn't
    portable, but it doesn't seem to be worth fixing it when this information isn't
    very useful (and is redundant to the timestamping of log messages we now have)
    
    Instead just remove these uses of GetTickCount()
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index c22d690..1ecf0b9 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -219,8 +219,8 @@ winPositionWindowMultiWindow(WindowPtr pWin, int x, int y)
 
 #if CYGMULTIWINDOW_DEBUG
     lpRc = &rcNew;
-    ErrorF("winPositionWindowMultiWindow - (%d ms)drawable (%d, %d)-(%d, %d)\n",
-           GetTickCount(), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+    ErrorF("winPositionWindowMultiWindow - drawable (%d, %d)-(%d, %d)\n",
+           lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
 #endif
 
     /*
@@ -237,16 +237,16 @@ winPositionWindowMultiWindow(WindowPtr pWin, int x, int y)
     GetClientRect(hWnd, &rcClient);
 
     lpRc = &rcNew;
-    ErrorF("winPositionWindowMultiWindow - (%d ms)rcNew (%d, %d)-(%d, %d)\n",
-           GetTickCount(), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+    ErrorF("winPositionWindowMultiWindow - rcNew (%d, %d)-(%d, %d)\n",
+           lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
 
     lpRc = &rcOld;
-    ErrorF("winPositionWindowMultiWindow - (%d ms)rcOld (%d, %d)-(%d, %d)\n",
-           GetTickCount(), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+    ErrorF("winPositionWindowMultiWindow - rcOld (%d, %d)-(%d, %d)\n",
+           lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
 
     lpRc = &rcClient;
-    ErrorF("(%d ms)rcClient (%d, %d)-(%d, %d)\n",
-           GetTickCount(), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+    ErrorF("rcClient (%d, %d)-(%d, %d)\n",
+           lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
 #endif
 
     /* Check if the old rectangle and new rectangle are the same */
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 6599dfb..1efe96a 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -772,8 +772,8 @@ winMultiWindowWMProc(void *pArg)
         }
 
 #if CYGMULTIWINDOW_DEBUG
-        ErrorF("winMultiWindowWMProc - %d ms MSG: %d ID: %d\n",
-               GetTickCount(), (int) pNode->msg.msg, (int) pNode->msg.dwID);
+        ErrorF("winMultiWindowWMProc - MSG: %d ID: %d\n",
+               (int) pNode->msg.msg, (int) pNode->msg.dwID);
 #endif
 
         /* Branch on the message type */
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index d296f0f..ab892f2 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -1037,9 +1037,8 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         default:
             strcpy(buf, "UNKNOWN_FLAG");
         }
-        ErrorF("winTopLevelWindowProc - WM_SIZE to %dx%d (%s) - %d ms\n",
-               (int) LOWORD(lParam), (int) HIWORD(lParam), buf,
-               (int) (GetTickCount()));
+        ErrorF("winTopLevelWindowProc - WM_SIZE to %dx%d (%s)\n",
+               (int) LOWORD(lParam), (int) HIWORD(lParam), buf);
     }
 #endif
         if (!hasEnteredSizeMove) {
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
index f65811c..79d9591 100644
--- a/hw/xwin/winwin32rootlesswndproc.c
+++ b/hw/xwin/winwin32rootlesswndproc.c
@@ -858,8 +858,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
     case WM_MOVE:
 #if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_MOVE - %d ms\n",
-                 (unsigned int) GetTickCount());
+        winDebug("winMWExtWMWindowProc - WM_MOVE\n");
 #endif
         if (g_fNoConfigureWindow)
             break;
@@ -902,8 +901,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
     case WM_SHOWWINDOW:
 #if CYGMULTIWINDOW_DEBUG || TRUE
-        winDebug("winMWExtWMWindowProc - WM_SHOWWINDOW - %d ms\n",
-                 (unsigned int) GetTickCount());
+        winDebug("winMWExtWMWindowProc - WM_SHOWWINDOW\n");
 #endif
         /* Bail out if the window is being hidden */
         if (!wParam)
@@ -1155,8 +1153,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         /* see dix/window.c */
         /* FIXME: Maximize/Restore? */
 #if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_SIZE - %d ms\n",
-                 (unsigned int) GetTickCount());
+        winDebug("winMWExtWMWindowProc - WM_SIZE\n");
 #endif
 #if CYGMULTIWINDOW_DEBUG
         winDebug("\t(%d, %d) %d\n", (short) LOWORD(lParam),
@@ -1224,8 +1221,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
     case WM_ACTIVATEAPP:
 #if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_ACTIVATEAPP - %d ms\n",
-                 (unsigned int) GetTickCount());
+        winDebug("winMWExtWMWindowProc - WM_ACTIVATEAPP\n");
 #endif
         if (wParam) {
             if (winIsInternalWMRunning(pScreenInfo)) {
@@ -1257,16 +1253,14 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
     case WM_ENTERSIZEMOVE:
 #if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_ENTERSIZEMOVE - %d ms\n",
-                 (unsigned int) GetTickCount());
+        winDebug("winMWExtWMWindowProc - WM_ENTERSIZEMOVE\n");
 #endif
         pRLWinPriv->fMovingOrSizing = TRUE;
         break;
 
     case WM_EXITSIZEMOVE:
 #if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_EXITSIZEMOVE - %d ms\n",
-                 (unsigned int) GetTickCount());
+        winDebug("winMWExtWMWindowProc - WM_EXITSIZEMOVE\n");
 #endif
         pRLWinPriv->fMovingOrSizing = FALSE;
 


More information about the xorg-commit mailing list