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 {