diff options
author | Bastien Montagne <bastien@blender.org> | 2022-05-17 16:12:12 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-05-17 17:06:54 +0300 |
commit | fb2ae6b8c5bcab778f8b07c9d527abf5c3c36e0d (patch) | |
tree | 035b4b15bb3c476de9664c28cddee18e50e5c124 | |
parent | 9a4cb7a7320c8b550d8fda0b47a559b850ed5e05 (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.
-rw-r--r-- | source/blender/modifiers/intern/MOD_solidify.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_weighted_normal.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvg_util.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index 48154a3670d..1f0aee7d689 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -75,7 +75,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * case MOD_SOLIDIFY_MODE_NONMANIFOLD: return MOD_solidify_nonmanifold_modifyMesh(md, ctx, mesh); default: - BLI_assert(0); + BLI_assert_unreachable(); } return mesh; } diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.c b/source/blender/modifiers/intern/MOD_weighted_normal.c index 4c06a77e719..d436acb8ad5 100644 --- a/source/blender/modifiers/intern/MOD_weighted_normal.c +++ b/source/blender/modifiers/intern/MOD_weighted_normal.c @@ -326,7 +326,7 @@ static void apply_weights_vertex_normal(WeightedNormalModifierData *wnmd, } break; default: - BLI_assert(0); + BLI_assert_unreachable(); } /* Validate computed weighted normals. */ diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index acff66e74e4..65393370268 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -96,7 +96,7 @@ void weightvg_do_map( BLI_assert(do_invert); break; default: - BLI_assert(0); + BLI_assert_unreachable(); } new_w[i] = do_invert ? 1.0f - fac : fac; |