nir: Add some braces around loops and ifs
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 9 Feb 2016 18:48:42 +0000 (10:48 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 9 Feb 2016 23:00:17 +0000 (15:00 -0800)
src/compiler/nir/nir.c

index 21bf678c04e1b0cc798a6ee0fb2638fee232d2d0..7f343ee5e3812d8628a114a390f0ad5965f5e033 100644 (file)
@@ -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;
 }