YaGL: cast GLint to a pointer type right way for 64 bit machines
authorIgor Mitsyanko <i.mitsyanko@samsung.com>
Wed, 17 Oct 2012 11:43:34 +0000 (15:43 +0400)
committerEvgeny Voevodin <e.voevodin@samsung.com>
Mon, 26 Nov 2012 09:25:30 +0000 (13:25 +0400)
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 <i.mitsyanko@samsung.com>
hw/yagl_apis/gles/yagl_host_gles_calls.c
hw/yagl_apis/gles2/yagl_gles2_context.c

index 22e73fc..d0fba5a 100644 (file)
@@ -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);
 
index 50f366a..6405291 100644 (file)
@@ -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,