[Mesa-dev] [PATCH 1/5] darwin: Suppress type conversion warnings for GLhandleARB

Julien Isorce julien.isorce at gmail.com
Wed Jun 17 22:53:50 PDT 2015


From: Jon TURNEY <jon.turney at dronecode.org.uk>

On darwin, GLhandleARB is defined as a void *, not the unsigned int it is on
linux.

For the moment, apply a cast to supress the warning

Possibly this is safe, as for the mesa software renderer the shader program
handle is not a real pointer, but a integer handle

Probably this is not the right thing to do, and we should pay closer attention
to how the GLhandlerARB type is used.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66346
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 src/mesa/main/shader_query.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index a6246a3..e3a1213 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -69,7 +69,7 @@ _mesa_BindAttribLocation(GLhandleARB program, GLuint index,
    GET_CURRENT_CONTEXT(ctx);
 
    struct gl_shader_program *const shProg =
-      _mesa_lookup_shader_program_err(ctx, program, "glBindAttribLocation");
+      _mesa_lookup_shader_program_err(ctx, (uintptr_t)program, "glBindAttribLocation");
    if (!shProg)
       return;
 
@@ -137,7 +137,7 @@ _mesa_GetActiveAttrib(GLhandleARB program, GLuint desired_index,
       return;
    }
 
-   shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
+   shProg = _mesa_lookup_shader_program_err(ctx, (uintptr_t)program, "glGetActiveAttrib");
    if (!shProg)
       return;
 
@@ -251,7 +251,7 @@ _mesa_GetAttribLocation(GLhandleARB program, const GLcharARB * name)
 {
    GET_CURRENT_CONTEXT(ctx);
    struct gl_shader_program *const shProg =
-      _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation");
+      _mesa_lookup_shader_program_err(ctx, (uintptr_t)program, "glGetAttribLocation");
 
    if (!shProg) {
       return -1;
-- 
1.9.5 (Apple Git-50.3)



More information about the mesa-dev mailing list