[Mesa-dev] [PATCH 01/15] glsl: Avoid GLboolean vs bool arithmetic MSVC warnings.

Ian Romanick idr at freedesktop.org
Fri Mar 20 14:20:15 PDT 2015


This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 03/20/2015 06:59 AM, Jose Fonseca wrote:
> Note that GLboolean is an alias for unsigned char, which lacks the
> implicit true/false semantics that C++/C99 bool have.
> 
> Reviewed-by: Brian Paul <brianp at vmware.com>
> 
> v2: Change gl_shader::IsES and gl_shader_program::IsES to be bool as
> recommended by Ian Romanick.
> ---
>  src/glsl/linker.cpp    | 5 +++--
>  src/mesa/main/mtypes.h | 4 ++--
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index 0c44677..4349f09 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -2542,8 +2542,9 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
>  	 goto done;
>        }
>  
> -      prog->ARB_fragment_coord_conventions_enable |=
> -         prog->Shaders[i]->ARB_fragment_coord_conventions_enable;
> +      if (prog->Shaders[i]->ARB_fragment_coord_conventions_enable) {
> +         prog->ARB_fragment_coord_conventions_enable = true;
> +      }
>  
>        gl_shader_stage shader_type = prog->Shaders[i]->Stage;
>        shader_list[shader_type][num_shaders[shader_type]] = prog->Shaders[i];
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index c43c6ac..5023f58 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -2544,7 +2544,7 @@ struct gl_shader
>     struct gl_sl_pragmas Pragmas;
>  
>     unsigned Version;       /**< GLSL version used for linking */
> -   GLboolean IsES;         /**< True if this shader uses GLSL ES */
> +   bool IsES;              /**< True if this shader uses GLSL ES */
>  
>     /**
>      * \name Sampler tracking
> @@ -2911,7 +2911,7 @@ struct gl_shader_program
>     GLchar *InfoLog;
>  
>     unsigned Version;       /**< GLSL version used for linking */
> -   GLboolean IsES;         /**< True if this program uses GLSL ES */
> +   bool IsES;              /**< True if this program uses GLSL ES */
>  
>     /**
>      * Per-stage shaders resulting from the first stage of linking.
> 



More information about the mesa-dev mailing list