aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-02-09 10:48:42 -0800
committerJason Ekstrand <[email protected]>2016-02-09 15:00:17 -0800
commit3f421849945d763b3e477ceb1c726c2dbed3bafd (patch)
tree0d8b9eef3664ee81a297373d516194bacee6d729 /src
parent830b075e86e3e9af1bf12316d0f9d888a85a973b (diff)
nir: Add some braces around loops and ifs
Diffstat (limited to 'src')
-rw-r--r--src/compiler/nir/nir.c15
1 files changed, 10 insertions, 5 deletions
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;
}