[Mesa-dev] [PATCH 3/8] nir: Silence missing field initializer warnings for nir_alu_src
Ian Romanick
idr at freedesktop.org
Mon Dec 14 15:34:27 PST 2015
From: Ian Romanick <ian.d.romanick at intel.com>
nir/nir_builder.h:234:4: warning: missing initializer for field 'use_link' of 'n
ir_src' [-Wmissing-field-initializers]
nir_alu_src alu_src = { NIR_SRC_INIT };
^
Number of total warnings in my build reduced from 1676 to 1643
(reduction of 33).
Patch generated by:
egrep -lr 'nir_alu_src .* = \{ NIR_SRC_INIT \}' src/ | while read f
do
sed --in-place -e 's/nir_alu_src \(.*\) = { NIR_SRC_INIT }/nir_alu_src \1 = { NIR_SRC_INIT, false, false, { 0, } }/' $f
done
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/glsl/nir/nir_builder.h | 4 ++--
src/glsl/nir/nir_search.c | 2 +-
src/mesa/program/prog_to_nir.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/glsl/nir/nir_builder.h b/src/glsl/nir/nir_builder.h
index b909f483..2a68883 100644
--- a/src/glsl/nir/nir_builder.h
+++ b/src/glsl/nir/nir_builder.h
@@ -240,7 +240,7 @@ static inline nir_ssa_def *
nir_swizzle(nir_builder *build, nir_ssa_def *src, unsigned swiz[4],
unsigned num_components, bool use_fmov)
{
- nir_alu_src alu_src = { NIR_SRC_INIT };
+ nir_alu_src alu_src = { NIR_SRC_INIT, false, false, { 0, } };
alu_src.src = nir_src_for_ssa(src);
for (unsigned i = 0; i < num_components; i++)
alu_src.swizzle[i] = swiz[i];
@@ -268,7 +268,7 @@ nir_ssa_for_src(nir_builder *build, nir_src src, int num_components)
if (src.is_ssa && src.ssa->num_components == num_components)
return src.ssa;
- nir_alu_src alu = { NIR_SRC_INIT };
+ nir_alu_src alu = { NIR_SRC_INIT, false, false, { 0, } };
alu.src = src;
for (int j = 0; j < 4; j++)
alu.swizzle[j] = j;
diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c
index 56d7e81..ab8a7d6 100644
--- a/src/glsl/nir/nir_search.c
+++ b/src/glsl/nir/nir_search.c
@@ -289,7 +289,7 @@ construct_value(const nir_search_value *value, nir_alu_type type,
const nir_search_variable *var = nir_search_value_as_variable(value);
assert(state->variables_seen & (1 << var->variable));
- nir_alu_src val = { NIR_SRC_INIT };
+ nir_alu_src val = { NIR_SRC_INIT, false, false, { 0, } };
nir_alu_src_copy(&val, &state->variables[var->variable], mem_ctx);
assert(!var->is_constant);
diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c
index 539e3c0..c5d5687 100644
--- a/src/mesa/program/prog_to_nir.c
+++ b/src/mesa/program/prog_to_nir.c
@@ -183,7 +183,7 @@ ptn_get_src(struct ptn_compile *c, const struct prog_src_register *prog_src)
if (prog_src->RelAddr) {
deref_arr->deref_array_type = nir_deref_array_type_indirect;
- nir_alu_src addr_src = { NIR_SRC_INIT };
+ nir_alu_src addr_src = { NIR_SRC_INIT, false, false, { 0, } };
addr_src.src = nir_src_for_reg(c->addr_reg);
nir_ssa_def *reladdr = nir_imov_alu(b, addr_src, 1);
@@ -936,7 +936,7 @@ ptn_add_output_stores(struct ptn_compile *c)
* a vec4 with undefined .xyw components. We resolve it to a scalar, to
* match GLSL's gl_FragDepth and the expectations of most backends.
*/
- nir_alu_src alu_src = { NIR_SRC_INIT };
+ nir_alu_src alu_src = { NIR_SRC_INIT, false, false, { 0, } };
alu_src.src = nir_src_for_reg(c->output_regs[FRAG_RESULT_DEPTH]);
alu_src.swizzle[0] = SWIZZLE_Z;
store->src[0] = nir_src_for_ssa(nir_fmov_alu(b, alu_src, 1));
--
2.5.0
More information about the mesa-dev
mailing list