summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-05-30 17:41:32 +0200
committerSamuel Pitoiset <[email protected]>2017-05-31 09:19:54 +0200
commitd8debc6aad85094baeba2014b46b6613c4a35ee7 (patch)
treea87b8b6086b758af5bbae5d0674e694faf791a03 /src/util
parent4e93da30f0e5efe4ba7f54a5af2b9e58bd74c98d (diff)
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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/u_vector.h2
1 files changed, 1 insertions, 1 deletions
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)