Fix LP64 bug 39/9439/1
authorPär Lidberg <par.lidberg@elekta.com>
Mon, 3 Oct 2011 07:24:06 +0000 (00:24 -0700)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 3 Sep 2013 04:11:34 +0000 (00:11 -0400)
https://bugs.freedesktop.org/show_bug.cgi?id=14321

Change-Id: I329c3ddc82af99d22cb497be5439d74a4cbcf1c6
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
multiVis.c
wsutils.h

index 7ac5780..086aacd 100644 (file)
@@ -38,6 +38,7 @@ from The Open Group.
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/X.h>
+#include <X11/Intrinsic.h>
 #include <stdio.h>
 #include "list.h"
 #include "wsutils.h"
@@ -1088,10 +1089,10 @@ int GetXVisualInfo(/* Which X server (aka "display"). */
         * do-while loop makes sure we get the entire list from the X server.
         */
        bytesAfter = 0;
-       numLongs = sizeof(OverlayVisualPropertyRec) / 4;
+       numLongs = sizeof(OverlayVisualPropertyRec) / sizeof(long);
        do
        {
-           numLongs += bytesAfter * 4;
+           numLongs += bytesAfter * sizeof(long);
            XGetWindowProperty(display, RootWindow(display, screen),
                               overlayVisualsAtom, 0, numLongs, False,
                               overlayVisualsAtom, &actualType, &actualFormat,
@@ -1100,7 +1101,7 @@ int GetXVisualInfo(/* Which X server (aka "display"). */
 
 
        /* Calculate the number of overlay visuals in the list. */
-       *numOverlayVisuals = numLongs / (sizeof(OverlayVisualPropertyRec) / 4);
+       *numOverlayVisuals = numLongs / (sizeof(OverlayVisualPropertyRec) / sizeof(long));
     }
     else
     {
index 26b4469..67aba90 100644 (file)
--- a/wsutils.h
+++ b/wsutils.h
@@ -49,7 +49,7 @@ typedef struct
   VisualID     visualID;               /* The VisualID of the overlay visual */
   int          transparentType;        /* Can be None, TransparentPixel or
                                         * TransparentMask */
-  int          value;                  /* Pixel value */
+  Pixel                value;                  /* Pixel value */
   int          layer;                  /* Overlay planes will always be in
                                         * layer 1 */
 } OverlayVisualPropertyRec;
@@ -65,7 +65,7 @@ typedef struct
   XVisualInfo  *pOverlayVisualInfo;    /* Pointer to the XVisualInfo struct */
   int          transparentType;        /* Can be None, TransparentPixel or
                                         * TransparentMask */
-  int          value;                  /* Pixel value */
+  Pixel                value;                  /* Pixel value */
   int          layer;                  /* Overlay planes will always be in
                                         * layer 1 */
 } OverlayInfo;