From 725deb9d7c7a0ef0f6f88b366a8f9e83b5846823 Mon Sep 17 00:00:00 2001 From: Igor Mitsyanko Date: Wed, 17 Oct 2012 15:43:34 +0400 Subject: [PATCH] YaGL: cast GLint to a pointer type right way for 64 bit machines Direct cast of int to pointer causes warning on 64 bit machines, use uitptr_t cast first. Note that here we're not casting guest address to host address, its just an offset within an array. Signed-off-by: Igor Mitsyanko --- hw/yagl_apis/gles/yagl_host_gles_calls.c | 3 ++- hw/yagl_apis/gles2/yagl_gles2_context.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/yagl_apis/gles/yagl_host_gles_calls.c b/hw/yagl_apis/gles/yagl_host_gles_calls.c index 22e73fcabb..d0fba5afd7 100644 --- a/hw/yagl_apis/gles/yagl_host_gles_calls.c +++ b/hw/yagl_apis/gles/yagl_host_gles_calls.c @@ -792,7 +792,8 @@ bool yagl_host_glDrawElements(GLenum mode, mode, count, type, - (ctx->ebo ? (GLvoid*)indices_ : indices)); + (ctx->ebo ? + (GLvoid *)(uintptr_t)indices_ : indices)); ctx->post_draw(ctx, mode); diff --git a/hw/yagl_apis/gles2/yagl_gles2_context.c b/hw/yagl_apis/gles2/yagl_gles2_context.c index 50f366aa79..64052918b0 100644 --- a/hw/yagl_apis/gles2/yagl_gles2_context.c +++ b/hw/yagl_apis/gles2/yagl_gles2_context.c @@ -33,7 +33,7 @@ static void yagl_gles2_array_apply(struct yagl_gles_array *array) array->type, array->normalized, array->stride, - (GLvoid*)array->offset); + (GLvoid*)(uintptr_t)array->offset); gles2_ctx->driver_ps->common->BindBuffer(gles2_ctx->driver_ps->common, GL_ARRAY_BUFFER, -- 2.34.1