From d8debc6aad85094baeba2014b46b6613c4a35ee7 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 30 May 2017 17:41:32 +0200 Subject: mesa/util: fix arithmetic use of 'void *' in u_vector_foreach u_vector_foreach is currently only used by the Intel Vulkan driver but when this macro is used in mesa core, GCC reports a compile-time error. Probably because some compiler options are different. Signed-off-by: Samuel Pitoiset Reviewed-by: Kenneth Graunke --- src/util/u_vector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/util/u_vector.h') diff --git a/src/util/u_vector.h b/src/util/u_vector.h index c7fcb37a052..c0e199cfa5a 100644 --- a/src/util/u_vector.h +++ b/src/util/u_vector.h @@ -84,7 +84,7 @@ u_vector_finish(struct u_vector *queue) #define u_vector_foreach(elem, queue) \ STATIC_ASSERT(__builtin_types_compatible_p(__typeof__(queue), struct u_vector *)); \ for (uint32_t __u_vector_offset = (queue)->tail; \ - elem = (queue)->data + (__u_vector_offset & ((queue)->size - 1)), __u_vector_offset < (queue)->head; \ + elem = (void *)((char *)(queue)->data + (__u_vector_offset & ((queue)->size - 1))), __u_vector_offset < (queue)->head; \ __u_vector_offset += (queue)->element_size) -- cgit v1.2.3