From acf0fe9d99fe15a84e45878efb569cdb41dc6f7b Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 23 Feb 2021 17:34:33 +0900 Subject: [PATCH] Remove GNU extension codes They were detected with clang-1200.0.32.29. Signed-off-by: Akihiko Odaki Reviewed-by: Gert Wollny --- src/vrend_debug.h | 2 +- src/vrend_renderer.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/vrend_debug.h b/src/vrend_debug.h index 9103831..f4efefa 100644 --- a/src/vrend_debug.h +++ b/src/vrend_debug.h @@ -97,7 +97,7 @@ virgl_debug_callback_type vrend_set_debug_callback(virgl_debug_callback_type cb) } while (0) #else -#define VREND_DEBUG(flag, ctx, fmt, ...) +#define VREND_DEBUG(flag, ctx, ...) #define VREND_DEBUG_EXT(flag, ctx, X) #define VREND_DEBUG_NOCTX(flag, ctx, ...) #endif diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index df766c8..6bbbba9 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -9514,7 +9514,11 @@ void vrend_get_query_result(struct vrend_context *ctx, uint32_t handle, if (buf) memcpy(buf, &value, size); \ glUnmapBuffer(GL_QUERY_BUFFER); -#define BUFFER_OFFSET(i) ((void *)((char *)NULL + i)) +static inline void *buffer_offset(intptr_t i) +{ + return (void *)i; +} + void vrend_get_query_result_qbo(struct vrend_context *ctx, uint32_t handle, uint32_t qbo_handle, uint32_t wait, uint32_t result_type, uint32_t offset, @@ -9549,16 +9553,16 @@ void vrend_get_query_result_qbo(struct vrend_context *ctx, uint32_t handle, glBindBuffer(GL_QUERY_BUFFER, res->id); switch ((enum pipe_query_value_type)result_type) { case PIPE_QUERY_TYPE_I32: - glGetQueryObjectiv(q->id, qtype, BUFFER_OFFSET(offset)); + glGetQueryObjectiv(q->id, qtype, buffer_offset(offset)); break; case PIPE_QUERY_TYPE_U32: - glGetQueryObjectuiv(q->id, qtype, BUFFER_OFFSET(offset)); + glGetQueryObjectuiv(q->id, qtype, buffer_offset(offset)); break; case PIPE_QUERY_TYPE_I64: - glGetQueryObjecti64v(q->id, qtype, BUFFER_OFFSET(offset)); + glGetQueryObjecti64v(q->id, qtype, buffer_offset(offset)); break; case PIPE_QUERY_TYPE_U64: - glGetQueryObjectui64v(q->id, qtype, BUFFER_OFFSET(offset)); + glGetQueryObjectui64v(q->id, qtype, buffer_offset(offset)); break; } } else {