glsl: Avoid GLboolean vs bool arithmetic MSVC warnings.
authorJose Fonseca <jfonseca@vmware.com>
Wed, 18 Mar 2015 14:21:15 +0000 (14:21 +0000)
committerJose Fonseca <jfonseca@vmware.com>
Sun, 22 Mar 2015 08:23:23 +0000 (08:23 +0000)
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@vmware.com>
v2: Change gl_shader::IsES and gl_shader_program::IsES to be bool as
recommended by Ian Romanick.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/linker.cpp
src/mesa/main/mtypes.h

index 0c4467779707fcc7b9fb90cb982ef051a242869f..4349f0973b9cec8cf7bda206edc0aa2c35d0028b 100644 (file)
@@ -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];
index 1b4549415e056af88b410ea1b28ea6067325e18c..8e1dba6f079051e2653ccd8240ec0aba1eff47de 100644 (file)
@@ -2548,7 +2548,7 @@ struct gl_shader
    GLchar *Label;   /**< GL_KHR_debug */
    GLboolean DeletePending;
    GLboolean CompileStatus;
-   GLboolean IsES;         /**< True if this shader uses GLSL ES */
+   bool IsES;              /**< True if this shader uses GLSL ES */
 
    GLuint SourceChecksum;       /**< for debug/logging purposes */
    const GLchar *Source;  /**< Source code string */
@@ -2924,7 +2924,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.