Mesa (master): glsl: fix compiler warnings in link_uniforms.cpp

Brian Paul brianp at kemper.freedesktop.org
Thu Mar 6 14:50:51 UTC 2014


Module: Mesa
Branch: master
Commit: ef8a19ed4facf9769e1da1cbb9e741df23893ed5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef8a19ed4facf9769e1da1cbb9e741df23893ed5

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Mar  5 16:39:59 2014 -0700

glsl: fix compiler warnings in link_uniforms.cpp

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 at gmail.com>

---

 src/glsl/link_uniforms.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index 1cf376d..1c451e7 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -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 :




More information about the mesa-commit mailing list