From 36daee1c7bec44b9d3641f056c84b3b2f39fabd9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 12:44:05 -0700 Subject: [PATCH] intel: asst. casts to silence warnings --- src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 ++-- src/mesa/drivers/dri/intel/intel_tex.c | 2 +- src/mesa/drivers/dri/intel/intel_tex_image.c | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index f89c0c2ba48..02998d59571 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -296,7 +296,7 @@ copy_array_to_vbo_array( struct brw_context *brw, } else { void *data; char *dest; - const char *src = element->glarray->Ptr; + const unsigned char *src = element->glarray->Ptr; int i; data = _mesa_malloc(dst_stride * element->count); @@ -565,7 +565,7 @@ static void brw_prepare_indices(struct brw_context *brw) */ dri_bo_subdata(bo, offset, ib_size, index_buffer->ptr); } else { - offset = (GLuint)index_buffer->ptr; + offset = (GLuint) (unsigned long) index_buffer->ptr; /* If the index buffer isn't aligned to its element size, we have to * rebase it into a temporary. diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index e64d8a1556d..ae0994b183a 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -93,7 +93,7 @@ intelFreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage) static void * do_memcpy(void *dest, const void *src, size_t n) { - if ((((unsigned) src) & 63) || (((unsigned) dest) & 63)) { + if ((((unsigned long) src) & 63) || (((unsigned long) dest) & 63)) { return __memcpy(dest, src, n); } else diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 2ac7dceb0fc..866022d0ce2 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -209,7 +209,8 @@ try_pbo_upload(struct intel_context *intel, return GL_FALSE; } - src_offset = (GLuint) pixels; + /* note: potential 64-bit ptr to 32-bit int cast */ + src_offset = (GLuint) (unsigned long) pixels; if (unpack->RowLength > 0) src_stride = unpack->RowLength; @@ -264,7 +265,8 @@ try_pbo_zcopy(struct intel_context *intel, return GL_FALSE; } - src_offset = (GLuint) pixels; + /* note: potential 64-bit ptr to 32-bit int cast */ + src_offset = (GLuint) (unsigned long) pixels; if (unpack->RowLength > 0) src_stride = unpack->RowLength; -- 2.30.2