From ecd312be96d417e70eaf4717fe64912ecbe8f713 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 8 Aug 2019 14:01:57 +0200 Subject: [PATCH] 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 --- src/mesa/main/draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.30.2