[Mesa-dev] [PATCH] Rename overloads of _mesa_glsl_shader_target_name().

Brian Paul brianp at vmware.com
Tue Dec 17 14:57:39 PST 2013


On 12/17/2013 02:32 PM, Paul Berry wrote:
> Previously, _mesa_glsl_shader_target_name() had an overload for GLenum
> and an overload for the gl_shader_type enum, each of which behaved
> differently.  However, since GLenum is a synonym for unsigned int, and
> unsigned ints are often used in place of gl_shader_type (e.g. in loop
> indices), there was a big risk of calling the wrong overload by
> mistake.  This patch gives the two overloads different names so that
> it's always clear which one we mean to call.
> ---
>   src/glsl/ast_to_hir.cpp                    | 10 +++++-----
>   src/glsl/glsl_parser_extras.cpp            | 17 ++++++++---------
>   src/glsl/glsl_parser_extras.h              |  7 ++++---
>   src/glsl/link_varyings.cpp                 | 24 ++++++++++++------------
>   src/glsl/linker.cpp                        |  2 +-
>   src/mesa/drivers/dri/i965/brw_shader.cpp   |  4 ++--
>   src/mesa/main/shaderapi.c                  |  6 +++---
>   src/mesa/main/uniform_query.cpp            |  2 +-
>   src/mesa/program/ir_to_mesa.cpp            |  2 +-
>   src/mesa/state_tracker/st_glsl_to_tgsi.cpp |  2 +-
>   10 files changed, 38 insertions(+), 38 deletions(-)
>


Reviewed-by: Brian Paul <brianp at vmware.com>

Nice clean-ups, Paul.



More information about the mesa-dev mailing list