diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 12:23:02 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 12:23:02 +0300 |
commit | a29686eeb3af051a00fbb8a8b9be06bcd050ec8c (patch) | |
tree | 9da60e7257e3e2dafda3e9b565b77c9c6f37675b /source/blender/blenlib/intern/math_rotation.c | |
parent | e0c51b466f3b23a1fc114690be2b008e19637ea6 (diff) |
Cleanup: Blenlib, Clang-Tidy else-after-return fixes (incomplete)
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenlib` module. Not all warnings are
addressed in this commit.
No functional changes.
Diffstat (limited to 'source/blender/blenlib/intern/math_rotation.c')
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index a2f7cc24dd3..a6368981050 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -644,9 +644,8 @@ float angle_signed_normalized_qt(const float q[4]) if (q[0] >= 0.0f) { return 2.0f * saacos(q[0]); } - else { - return -2.0f * saacos(-q[0]); - } + + return -2.0f * saacos(-q[0]); } float angle_signed_normalized_qtqt(const float q1[4], const float q2[4]) @@ -654,11 +653,10 @@ float angle_signed_normalized_qtqt(const float q1[4], const float q2[4]) if (dot_qtqt(q1, q2) >= 0.0f) { return angle_normalized_qtqt(q1, q2); } - else { - float q2_copy[4]; - negate_v4_v4(q2_copy, q2); - return -angle_normalized_qtqt(q1, q2_copy); - } + + float q2_copy[4]; + negate_v4_v4(q2_copy, q2); + return -angle_normalized_qtqt(q1, q2_copy); } float angle_signed_qt(const float q[4]) @@ -675,11 +673,10 @@ float angle_signed_qtqt(const float q1[4], const float q2[4]) if (dot_qtqt(q1, q2) >= 0.0f) { return angle_qtqt(q1, q2); } - else { - float q2_copy[4]; - negate_v4_v4(q2_copy, q2); - return -angle_qtqt(q1, q2_copy); - } + + float q2_copy[4]; + negate_v4_v4(q2_copy, q2); + return -angle_qtqt(q1, q2_copy); } /** \} */ @@ -1594,12 +1591,11 @@ static const RotOrderInfo *get_rotation_order_info(const short order) if (order < 1) { return &rotOrders[0]; } - else if (order < 6) { + if (order < 6) { return &rotOrders[order - 1]; } - else { - return &rotOrders[5]; - } + + return &rotOrders[5]; } /* Construct quaternion from Euler angles (in radians). */ |