diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 13:30:43 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 14:38:06 +0300 |
commit | 1b272a649b40e99dba4185167f6cee7cbece1942 (patch) | |
tree | 2785f52c566b36cbdcbf9355f698dc520ffbb482 /source/blender/blenkernel/intern/fcurve_driver.c | |
parent | cfc6f9eb18e701f5be601b95c45004e8cf7fbc81 (diff) |
Cleanup: Blenkernel, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenkernel` module.
No functional changes.
Diffstat (limited to 'source/blender/blenkernel/intern/fcurve_driver.c')
-rw-r--r-- | source/blender/blenkernel/intern/fcurve_driver.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/source/blender/blenkernel/intern/fcurve_driver.c b/source/blender/blenkernel/intern/fcurve_driver.c index 87cb77930f5..b11a3cb9457 100644 --- a/source/blender/blenkernel/intern/fcurve_driver.c +++ b/source/blender/blenkernel/intern/fcurve_driver.c @@ -488,10 +488,9 @@ static float dvar_eval_transChan(ChannelDriver *driver, DriverVar *dvar) dtar->flag |= DTAR_FLAG_INVALID; return 0.0f; } - else { - /* Target should be valid now. */ - dtar->flag &= ~DTAR_FLAG_INVALID; - } + + /* Target should be valid now. */ + dtar->flag &= ~DTAR_FLAG_INVALID; /* Try to get pose-channel. */ pchan = BKE_pose_channel_find_name(ob->pose, dtar->pchan_name); @@ -560,20 +559,17 @@ static float dvar_eval_transChan(ChannelDriver *driver, DriverVar *dvar) /* Not valid channel. */ return 0.0f; } - else if (dtar->transChan == DTAR_TRANSCHAN_SCALE_AVG) { + if (dtar->transChan == DTAR_TRANSCHAN_SCALE_AVG) { /* Cubic root of the change in volume, equal to the geometric mean * of scale over all three axes unless the matrix includes shear. */ return cbrtf(mat4_to_volume_scale(mat)); } - else if (ELEM(dtar->transChan, - DTAR_TRANSCHAN_SCALEX, - DTAR_TRANSCHAN_SCALEY, - DTAR_TRANSCHAN_SCALEZ)) { + if (ELEM(dtar->transChan, DTAR_TRANSCHAN_SCALEX, DTAR_TRANSCHAN_SCALEY, DTAR_TRANSCHAN_SCALEZ)) { /* Extract scale, and choose the right axis, * inline 'mat4_to_size'. */ return len_v3(mat[dtar->transChan - DTAR_TRANSCHAN_SCALEX]); } - else if (dtar->transChan >= DTAR_TRANSCHAN_ROTX) { + if (dtar->transChan >= DTAR_TRANSCHAN_ROTX) { /* Extract rotation as eulers (if needed) * - definitely if rotation order isn't eulers already * - if eulers, then we have 2 options: @@ -602,10 +598,9 @@ static float dvar_eval_transChan(ChannelDriver *driver, DriverVar *dvar) return quat[channel]; } - else { - /* Extract location and choose right axis. */ - return mat[3][dtar->transChan]; - } + + /* Extract location and choose right axis. */ + return mat[3][dtar->transChan]; } /* Convert a quaternion to pseudo-angles representing the weighted amount of rotation. */ @@ -715,9 +710,8 @@ static const DriverVarTypeInfo *get_dvar_typeinfo(int type) if ((type >= 0) && (type < MAX_DVAR_TYPES)) { return &dvar_types[type]; } - else { - return NULL; - } + + return NULL; } /** \} */ @@ -1126,10 +1120,9 @@ bool BKE_driver_expression_depends_on_time(ChannelDriver *driver) /* Simple expressions can be checked exactly. */ return driver_check_simple_expr_depends_on_time(driver->expr_simple); } - else { - /* Otherwise, heuristically scan the expression string for certain patterns. */ - return python_driver_exression_depends_on_time(driver->expression); - } + + /* Otherwise, heuristically scan the expression string for certain patterns. */ + return python_driver_exression_depends_on_time(driver->expression); } /* Reset cached compiled expression data */ |