On Monday, December 14, 2015 03:34:28 PM Ian Romanick wrote:
> From: Ian Romanick <ian.d.roman...@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 1643 to 1574
> (reduction of 69).
> 
> Signed-off-by: Ian Romanick <ian.d.roman...@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 32784f6..81dd67f 100644
> --- a/src/glsl/nir/nir_constant_expressions.py
> +++ b/src/glsl/nir/nir_constant_expressions.py
> @@ -239,6 +239,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

I'd be tempted to simplify this to:

      % for k in range(op.input_sizes[j], 4):
         0,
      % endfor

0 will be implicitly converted to bool.  (I'd rather keep the generator
as simple as possible, since it's the code that people actually read and
maintain...)

With that change,
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

>        };
>     % endfor
>  
> 

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to