nir: Silence missing field initializer warnings for vectors in nir_constant_expressions
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 25 Aug 2015 16:21:47 +0000 (17:21 +0100)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 19 Dec 2016 23:55:44 +0000 (15:55 -0800)
nir/nir_constant_expressions.c: In function 'evaluate_ball2':
nir/nir_constant_expressions.c:279:7: warning: missing initializer for field 'z' of 'struct bool_vec' [-Wmissing-field-initializers]
       };
       ^
nir/nir_constant_expressions.c:234:10: note: 'z' declared here
    bool z;
          ^

Number of total warnings in my build reduced from 2532 to 2304
(reduction of 228).

v2: Initialize bool vectors with 0 instead of false to keep the
generator simpler.  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/nir/nir_constant_expressions.py

index 96d52557bd79aa948cb627b38777128f0258e119..6b4d071236c5e3ae75102d2cbe7f7cc02b313ae5 100644 (file)
@@ -299,6 +299,9 @@ evaluate_${name}(unsigned num_components, unsigned bit_size,
                _src[${j}].${get_const_field(input_types[j])}[${k}],
             % endif
          % endfor
+         % for k in range(op.input_sizes[j], 4):
+            0,
+         % endfor
          };
       % endfor