glsl: fix compiler warnings in link_uniforms.cpp
authorBrian Paul <brianp@vmware.com>
Wed, 5 Mar 2014 23:39:59 +0000 (16:39 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 6 Mar 2014 14:45:36 +0000 (07:45 -0700)
With a non-debug build, gcc has two complaints:
1. 'found' var not used.  Silence with '(void) found;'
2. 'id' not initialized.  It's assigned by the UniformHash->get()
   call, actually.  But init it to zero to silence gcc.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/link_uniforms.cpp

index 1cf376d5d2930174eff1bbbacb00dbab7bcafe6e..1c451e7f51c3bf22738bfbfe973603bfd79bae0b 100644 (file)
@@ -775,9 +775,10 @@ link_set_image_access_qualifiers(struct gl_shader_program *prog)
 
          if (var && var->data.mode == ir_var_uniform &&
              var->type->contains_image()) {
-            unsigned id;
+            unsigned id = 0;
             bool found = prog->UniformHash->get(id, var->name);
             assert(found);
+            (void) found;
             const gl_uniform_storage *storage = &prog->UniformStorage[id];
             const unsigned index = storage->image[i].index;
             const GLenum access = (var->data.image.read_only ? GL_READ_ONLY :