[Mesa-dev] [PATCH 10/17] nir: Silence unused parameter warnings in nir_constant_expression.c
Ian Romanick
idr at freedesktop.org
Wed Aug 26 10:19:59 PDT 2015
From: Ian Romanick <ian.d.romanick at intel.com>
nir/nir_constant_expressions.c:290:25: warning: unused parameter 'num_components' [-Wunused-parameter]
evaluate_ball3(unsigned num_components, nir_const_value *_src)
^
nir/nir_constant_expressions.c: In function 'evaluate_fddx':
nir/nir_constant_expressions.c:1282:57: warning: unused parameter '_src' [-Wunused-parameter]
evaluate_fddx(unsigned num_components, nir_const_value *_src)
^
Number of total warnings in my build reduced from 1588 to 1501
(reduction of 87).
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/glsl/nir/nir_constant_expressions.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/glsl/nir/nir_constant_expressions.py b/src/glsl/nir/nir_constant_expressions.py
index 087aab9..e2feff3 100644
--- a/src/glsl/nir/nir_constant_expressions.py
+++ b/src/glsl/nir/nir_constant_expressions.py
@@ -255,6 +255,16 @@ evaluate_${name}(unsigned num_components, nir_const_value *_src)
% endfor
};
% endfor
+ % if op.output_size != 0 or "src" not in op.const_expr:
+
+ /* Silence compiler warnings. */
+ % if op.output_size != 0:
+ (void) num_components;
+ % endif
+ % if "src" not in op.const_expr:
+ (void) _src;
+ % endif
+ % endif
% if op.output_size == 0:
## For per-component instructions, we need to iterate over the
--
2.1.0
More information about the mesa-dev
mailing list