mesa/main: avoid warning when casting offset to pointer
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 8 Aug 2019 12:01:57 +0000 (14:01 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 15 Aug 2019 18:23:39 +0000 (20:23 +0200)
This generates a warning on some 64-bit systems, so let's cast to a
properly sized integer first.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/draw.c

index 98948a616f1ea0483fcbae54b22a5c3b560fc487..bfa318553f680788075d5bd7d3e81e46f33bc1df 100644 (file)
@@ -1640,7 +1640,7 @@ _mesa_exec_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect
 
          /* Convert offset to pointer */
          void *offset = (void *)
-            ((cmd->firstIndex * _mesa_sizeof_type(type)) & 0xffffffffUL);
+            (uintptr_t)((cmd->firstIndex * _mesa_sizeof_type(type)) & 0xffffffffUL);
 
          _mesa_exec_DrawElementsInstancedBaseVertexBaseInstance(mode, cmd->count,
                                                                 type, offset,