[PATCH 05/10] fb: Be screechingly correct about interpreting a pointer as integer

Adam Jackson ajax at redhat.com
Mon Mar 10 08:04:29 PDT 2014


fbblt.c: In function 'fbSetBltOdd':
fbblt.c:719:19: error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
     srcAdjust = (((int) stip) & (FB_MASK >> 3));

Probably this would have been broken on big-endian.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 fb/fbblt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fb/fbblt.c b/fb/fbblt.c
index 8c32b65..37bd912 100644
--- a/fb/fbblt.c
+++ b/fb/fbblt.c
@@ -710,13 +710,13 @@ fbSetBltOdd(FbStip * stip,
             FbStride * strideEven,
             FbStride * strideOdd, int *srcXEven, int *srcXOdd)
 {
-    int srcAdjust;
+    uintptr_t srcAdjust;
     int strideAdjust;
 
     /*
      * bytes needed to align source
      */
-    srcAdjust = (((int) stip) & (FB_MASK >> 3));
+    srcAdjust = (((uintptr_t) stip) & (FB_MASK >> 3));
     /*
      * FbStip units needed to align stride
      */
-- 
1.8.5.3



More information about the xorg-devel mailing list