Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-05-17 16:11:13 +0300
committerBastien Montagne <bastien@blender.org>2022-05-17 17:06:54 +0300
commitc6e3242e1840b3df977288e126f5d625db2a4920 (patch)
treea15469ea7395fe20bd5a1341235d3f7f1a8d0abc /source/blender/blenlib/intern/math_matrix.c
parentff2d6c2ba8e8f667a0aac7a79c77b58d87f45a73 (diff)
Cleanup: Use `switch` and `BLI_assert_unreachable()` more.
Replace some `if/else if` chains by proper `switch` statement. Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
Diffstat (limited to 'source/blender/blenlib/intern/math_matrix.c')
-rw-r--r--source/blender/blenlib/intern/math_matrix.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index f295734706f..ce9abc36cad 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -1496,7 +1496,7 @@ void orthogonalize_m3(float R[3][3], int axis)
}
break;
default:
- BLI_assert(0);
+ BLI_assert_unreachable();
break;
}
mul_v3_fl(R[0], size[0]);
@@ -1580,7 +1580,7 @@ void orthogonalize_m4(float R[4][4], int axis)
}
break;
default:
- BLI_assert(0);
+ BLI_assert_unreachable();
break;
}
mul_v3_fl(R[0], size[0]);
@@ -1654,7 +1654,7 @@ void orthogonalize_m3_stable(float R[3][3], int axis, bool normalize)
orthogonalize_stable(R[2], R[0], R[1], normalize);
break;
default:
- BLI_assert(0);
+ BLI_assert_unreachable();
break;
}
}
@@ -1672,7 +1672,7 @@ void orthogonalize_m4_stable(float R[4][4], int axis, bool normalize)
orthogonalize_stable(R[2], R[0], R[1], normalize);
break;
default:
- BLI_assert(0);
+ BLI_assert_unreachable();
break;
}
}
@@ -1734,7 +1734,7 @@ static bool orthogonalize_m3_zero_axes_impl(float *mat[3], const float unit_leng
break;
}
default: {
- BLI_assert(0); /* Unreachable! */
+ BLI_assert_unreachable();
}
}
@@ -2338,7 +2338,7 @@ void rotate_m4(float mat[4][4], const char axis, const float angle)
}
break;
default:
- BLI_assert(0);
+ BLI_assert_unreachable();
break;
}
}