Mesa (master): intel: Suppress a compiler warning for an pointer->int cast

Chris Wilson ickle at kemper.freedesktop.org
Sat Oct 3 22:11:52 UTC 2009


Module: Mesa
Branch: master
Commit: f194d2737b059cf6b99caa18f8ec2d46a55ada88
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f194d2737b059cf6b99caa18f8ec2d46a55ada88

Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Oct  3 23:08:39 2009 +0100

intel: Suppress a compiler warning for an pointer->int cast

intel_pixel_read.c: In function ‘do_blit_readpixels’:
intel_pixel_read.c:221: warning: cast from pointer to integer of
different size

Cast via an intermediate (GLintptr) instead and hope the result fits
within GLuint... [It should as we simply do not support textures *that*
large!]

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

---

 src/mesa/drivers/dri/intel/intel_pixel_read.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c
index bc67f62..44a8695 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c
@@ -216,9 +216,8 @@ do_blit_readpixels(GLcontext * ctx,
       rowLength = -rowLength;
    }
 
-   /* XXX 64-bit cast? */
-   dst_offset = (GLuint) _mesa_image_address(2, pack, pixels, width, height,
-                                             format, type, 0, 0, 0);
+   dst_offset = (GLintptr) _mesa_image_address(2, pack, pixels, width, height,
+					       format, type, 0, 0, 0);
 
 
    /* Although the blits go on the command buffer, need to do this and




More information about the mesa-commit mailing list