From: Erik Faye-Lund Date: Thu, 8 Aug 2019 12:01:57 +0000 (+0200) Subject: mesa/main: avoid warning when casting offset to pointer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ecd312be96d417e70eaf4717fe64912ecbe8f713;p=mesa.git mesa/main: avoid warning when casting offset to pointer 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 Reviewed-by: Eric Anholt --- diff --git a/src/mesa/main/draw.c b/src/mesa/main/draw.c index 98948a616f1..bfa318553f6 100644 --- a/src/mesa/main/draw.c +++ b/src/mesa/main/draw.c @@ -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,