[Mesa-dev] [PATCH 08/17] nir: Silence missing field initializer warnings for vectors in nir_constant_expressions
Ian Romanick
idr at freedesktop.org
Wed Aug 26 10:19:57 PDT 2015
From: Ian Romanick <ian.d.romanick at intel.com>
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 1651 to 1588
(reduction of 63).
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/glsl/nir/nir_constant_expressions.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/glsl/nir/nir_constant_expressions.py b/src/glsl/nir/nir_constant_expressions.py
index 8fd9b10..6006358 100644
--- a/src/glsl/nir/nir_constant_expressions.py
+++ b/src/glsl/nir/nir_constant_expressions.py
@@ -246,6 +246,13 @@ evaluate_${name}(unsigned num_components, nir_const_value *_src)
_src[${j}].${op.input_types[j][:1]}[${k}],
% endif
% endfor
+ % for k in range(op.input_sizes[j], 4):
+ % if op.input_types[j] == "bool":
+ false,
+ % else:
+ 0,
+ % endif
+ % endfor
};
% endfor
--
2.1.0
More information about the mesa-dev
mailing list