On Wed, Mar 5, 2014 at 3:42 PM, Brian Paul <bri...@vmware.com> wrote: > 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. > --- > 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 : > -- > 1.7.10.4
Wow, we're passing id as a non-constant reference to ->get(), and then indirectly asserting that it was set. It might be nice to modify ::get to just return the new id as an int, where -1 means failure. That shouldn't block this patch though. Reviewed-by: Matt Turner <matts...@gmail.com> _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev