[Mesa-dev] [PATCH 2/3] st/mesa: silence unused/uninitialized var warnings

Brian Paul brianp at vmware.com
Thu Apr 6 18:50:37 UTC 2017


---
 src/mesa/state_tracker/st_glsl_to_nir.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 674ccd0..72fd70b 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -181,10 +181,11 @@ st_nir_assign_uniform_locations(struct gl_program *prog,
          continue;
 
       if (uniform->type->is_sampler()) {
-         unsigned val;
+         unsigned val = 0;
          bool found = shader_program->UniformHash->get(val, uniform->name);
          loc = shaderidx++;
          assert(found);
+         (void) found; /* silence unused var warning */
          /* this ensure that nir_lower_samplers looks at the correct
           * shader_program->UniformStorage[location]:
           */
-- 
1.9.1



More information about the mesa-dev mailing list