From: Jason Ekstrand Date: Tue, 9 Feb 2016 18:48:42 +0000 (-0800) Subject: nir: Add some braces around loops and ifs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f421849945d763b3e477ceb1c726c2dbed3bafd;p=mesa.git nir: Add some braces around loops and ifs --- diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 21bf678c04e..7f343ee5e38 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -978,9 +978,10 @@ visit_deref_src(nir_deref_var *deref, nir_foreach_src_cb cb, void *state) { nir_deref *cur = &deref->deref; while (cur != NULL) { - if (cur->deref_type == nir_deref_type_array) + if (cur->deref_type == nir_deref_type_array) { if (!visit_deref_array_src(nir_deref_as_array(cur), cb, state)) return false; + } cur = cur->child; } @@ -1001,13 +1002,15 @@ visit_alu_src(nir_alu_instr *instr, nir_foreach_src_cb cb, void *state) static bool visit_tex_src(nir_tex_instr *instr, nir_foreach_src_cb cb, void *state) { - for (unsigned i = 0; i < instr->num_srcs; i++) + for (unsigned i = 0; i < instr->num_srcs; i++) { if (!visit_src(&instr->src[i].src, cb, state)) return false; + } - if (instr->sampler != NULL) + if (instr->sampler != NULL) { if (!visit_deref_src(instr->sampler, cb, state)) return false; + } return true; } @@ -1017,15 +1020,17 @@ visit_intrinsic_src(nir_intrinsic_instr *instr, nir_foreach_src_cb cb, void *state) { unsigned num_srcs = nir_intrinsic_infos[instr->intrinsic].num_srcs; - for (unsigned i = 0; i < num_srcs; i++) + for (unsigned i = 0; i < num_srcs; i++) { if (!visit_src(&instr->src[i], cb, state)) return false; + } unsigned num_vars = nir_intrinsic_infos[instr->intrinsic].num_variables; - for (unsigned i = 0; i < num_vars; i++) + for (unsigned i = 0; i < num_vars; i++) { if (!visit_deref_src(instr->variables[i], cb, state)) return false; + } return true; }