From f056173f7c330e0a25348932bf20c45e1bf38a0e Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 11 May 2014 14:40:07 +0100 Subject: [PATCH 1/3] darwin: Suppress type conversion warnings for GLhandleARB 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. main/shader_query.cpp:49:7: error: no matching function for call to '_mesa_lookup_shader_program_err' _mesa_lookup_shader_program_err(ctx, program, "glBindAttribLocation"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../src/mesa/main/shaderobj.h:81:1: note: candidate function not viable: cannot convert argument of incomplete type 'GLhandleARB' (aka 'void *') to 'GLuint' (aka 'unsigned int') _mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name, ^ main/shader_query.cpp:111:13: error: no matching function for call to '_mesa_lookup_shader_program_err' shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../src/mesa/main/shaderobj.h:81:1: note: candidate function not viable: cannot convert argument of incomplete type 'GLhandleARB' (aka 'void *') to 'GLuint' (aka 'unsigned int') _mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name, ^ main/shader_query.cpp:218:7: error: no matching function for call to '_mesa_lookup_shader_program_err' _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../src/mesa/main/shaderobj.h:81:1: note: candidate function not viable: cannot convert argument of incomplete type 'GLhandleARB' (aka 'void *') to 'GLuint' (aka 'unsigned int') _mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name, Signed-off-by: Jon TURNEY (cherry picked from commit 6a74bac7137219d8bba9e1dc2738f76151e618ae) --- 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 d2ca49b..9a8977e 100644 --- a/src/mesa/main/shader_query.cpp +++ b/src/mesa/main/shader_query.cpp @@ -68,7 +68,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; @@ -136,7 +136,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; @@ -250,7 +250,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)