[Bf-blender-cvs] [e3f2034e7b9] master: Cleanup: Cleanup: style, use braces for collada

Campbell Barton noreply at git.blender.org
Mon Jun 3 16:19:01 CEST 2019


Commit: e3f2034e7b925bc7e31e65051842cf26d70a20bc
Author: Campbell Barton
Date:   Tue Jun 4 00:17:37 2019 +1000
Branches: master
https://developer.blender.org/rBe3f2034e7b925bc7e31e65051842cf26d70a20bc

Cleanup: Cleanup: style, use braces for collada

===================================================================

M	source/blender/collada/BCMath.cpp
M	source/blender/collada/collada_utils.h

===================================================================

diff --git a/source/blender/collada/BCMath.cpp b/source/blender/collada/BCMath.cpp
index 31f8bd1c2bc..c82ecbb7441 100644
--- a/source/blender/collada/BCMath.cpp
+++ b/source/blender/collada/BCMath.cpp
@@ -151,19 +151,22 @@ void BCMatrix::transpose(Matrix &mat)
 
 void BCMatrix::sanitize(Matrix &mat, int precision)
 {
-  for (int i = 0; i < 4; i++)
+  for (int i = 0; i < 4; i++) {
     for (int j = 0; j < 4; j++) {
       double val = (double)mat[i][j];
       val = double_round(val, precision);
       mat[i][j] = (float)val;
     }
+  }
 }
 
 void BCMatrix::sanitize(DMatrix &mat, int precision)
 {
-  for (int i = 0; i < 4; i++)
-    for (int j = 0; j < 4; j++)
+  for (int i = 0; i < 4; i++) {
+    for (int j = 0; j < 4; j++) {
       mat[i][j] = double_round(mat[i][j], precision);
+    }
+  }
 }
 
 void BCMatrix::unit()
@@ -177,13 +180,14 @@ void BCMatrix::unit()
  * precision = -1 indicates to not limit the precision. */
 void BCMatrix::get_matrix(DMatrix &mat, const bool transposed, const int precision) const
 {
-  for (int i = 0; i < 4; i++)
+  for (int i = 0; i < 4; i++) {
     for (int j = 0; j < 4; j++) {
       float val = (transposed) ? matrix[j][i] : matrix[i][j];
       if (precision >= 0)
         val = floor((val * pow(10, precision) + 0.5)) / pow(10, precision);
       mat[i][j] = val;
     }
+  }
 }
 
 void BCMatrix::get_matrix(Matrix &mat,
@@ -191,13 +195,14 @@ void BCMatrix::get_matrix(Matrix &mat,
                           const int precision,
                           const bool inverted) const
 {
-  for (int i = 0; i < 4; i++)
+  for (int i = 0; i < 4; i++) {
     for (int j = 0; j < 4; j++) {
       float val = (transposed) ? matrix[j][i] : matrix[i][j];
       if (precision >= 0)
         val = floor((val * pow(10, precision) + 0.5)) / pow(10, precision);
       mat[i][j] = val;
     }
+  }
 
   if (inverted) {
     invert_m4(mat);
diff --git a/source/blender/collada/collada_utils.h b/source/blender/collada/collada_utils.h
index dca8f414e5a..e142d4c77db 100644
--- a/source/blender/collada/collada_utils.h
+++ b/source/blender/collada/collada_utils.h
@@ -188,8 +188,9 @@ inline bool bc_startswith(std::string const &value, std::string const &starting)
 
 inline bool bc_endswith(const std::string &value, const std::string &ending)
 {
-  if (ending.size() > value.size())
+  if (ending.size() > value.size()) {
     return false;
+  }
 
   return value.compare(value.size() - ending.size(), ending.size(), ending) == 0;
 }



More information about the Bf-blender-cvs mailing list