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/editors | |
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/editors')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 18 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 3 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 3 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_rip.c | 25 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_unwrap_ops.c | 6 |
5 files changed, 26 insertions, 29 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 517e791e8fa..8d6d2e3e31d 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -345,7 +345,8 @@ static bool object_modifier_remove( object_remove_particle_system(bmain, scene, ob); return true; } - else if (md->type == eModifierType_Softbody) { + + if (md->type == eModifierType_Softbody) { if (ob->soft) { sbFree(ob); ob->softflag = 0; /* TODO(Sybren): this should probably be moved into sbFree() */ @@ -888,12 +889,11 @@ int ED_object_modifier_copy( BLI_insertlinkafter(&ob->modifiers, md, nmd); return true; } - else { - nmd = BKE_modifier_new(md->type); - BKE_modifier_copydata(md, nmd); - BLI_insertlinkafter(&ob->modifiers, md, nmd); - BKE_modifier_unique_name(&ob->modifiers, nmd); - } + + nmd = BKE_modifier_new(md->type); + BKE_modifier_copydata(md, nmd); + BLI_insertlinkafter(&ob->modifiers, md, nmd); + BKE_modifier_unique_name(&ob->modifiers, nmd); return 1; } @@ -1458,9 +1458,7 @@ static int modifier_apply_as_shapekey_invoke(bContext *C, wmOperator *op, const if (edit_modifier_invoke_properties(C, op, event, &retval)) { return modifier_apply_as_shapekey_exec(C, op); } - else { - return retval; - } + return retval; } static char *modifier_apply_as_shapekey_get_description(struct bContext *UNUSED(C), diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 9520b03f3a6..f4de8f712c8 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2283,7 +2283,8 @@ static int make_override_library_invoke(bContext *C, wmOperator *op, const wmEve /* This invoke just calls another instance of this operator... */ return OPERATOR_INTERFACE; } - else if (ID_IS_LINKED(obact)) { + + if (ID_IS_LINKED(obact)) { /* Show menu with list of directly linked collections containing the active object. */ WM_enum_search_invoke(C, op, event); return OPERATOR_CANCELLED; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 89fc0ac1a58..d0b834a3dc0 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -581,7 +581,8 @@ static bool sculpt_check_unique_face_set_for_edge_in_base_mesh(SculptSession *ss p1 = vert_map->indices[i]; break; } - else if (p2 == -1) { + + if (p2 == -1) { p2 = vert_map->indices[i]; break; } diff --git a/source/blender/editors/uvedit/uvedit_rip.c b/source/blender/editors/uvedit/uvedit_rip.c index 07bec2da1ae..421e58b1cb5 100644 --- a/source/blender/editors/uvedit/uvedit_rip.c +++ b/source/blender/editors/uvedit/uvedit_rip.c @@ -538,23 +538,22 @@ static bool uv_rip_pairs_loop_change_sides_test(BMLoop *l_switch, if (count_a + count_b == 4) { return count_a > count_b; } - else { - const float angle_a_before = uv_rip_pairs_calc_uv_angle( - l_switch, side_a, aspect_y, cd_loop_uv_offset); - const float angle_b_before = uv_rip_pairs_calc_uv_angle( - l_target, side_b, aspect_y, cd_loop_uv_offset); - UL(l_switch)->side = side_b; + const float angle_a_before = uv_rip_pairs_calc_uv_angle( + l_switch, side_a, aspect_y, cd_loop_uv_offset); + const float angle_b_before = uv_rip_pairs_calc_uv_angle( + l_target, side_b, aspect_y, cd_loop_uv_offset); - const float angle_a_after = uv_rip_pairs_calc_uv_angle( - l_switch, side_a, aspect_y, cd_loop_uv_offset); - const float angle_b_after = uv_rip_pairs_calc_uv_angle( - l_target, side_b, aspect_y, cd_loop_uv_offset); + UL(l_switch)->side = side_b; - UL(l_switch)->side = side_a; + const float angle_a_after = uv_rip_pairs_calc_uv_angle( + l_switch, side_a, aspect_y, cd_loop_uv_offset); + const float angle_b_after = uv_rip_pairs_calc_uv_angle( + l_target, side_b, aspect_y, cd_loop_uv_offset); - return fabsf(angle_a_before - angle_b_before) > fabsf(angle_a_after - angle_b_after); - } + UL(l_switch)->side = side_a; + + return fabsf(angle_a_before - angle_b_before) > fabsf(angle_a_after - angle_b_after); } /** diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 2f30ef1caa6..9f77bf31481 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -1885,12 +1885,10 @@ static int smart_uv_project_thickface_area_cmp_fn(const void *tf_a_p, const void if (tf_a->area < tf_b->area) { return 1; } - else if (tf_a->area > tf_b->area) { + if (tf_a->area > tf_b->area) { return -1; } - else { - return 0; - } + return 0; } static uint smart_uv_project_calculate_project_normals(const ThickFace *thick_faces, |