diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 16:42:22 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 17:15:01 +0300 |
commit | de7c9f41e613a704f8e3258050b952d2ada60083 (patch) | |
tree | 2fa974caba4f9450e22f8d4da9400387b536dd16 /source/blender/editors/object/object_add.c | |
parent | 19483125f8da79cb270cb8d6df76b2e67100c089 (diff) |
Cleanup: Editors/Object, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/object` module.
No functional changes.
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r-- | source/blender/editors/object/object_add.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 4850764eecd..48b50be411e 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1642,7 +1642,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) ob->id.name + 2); continue; } - else if (is_indirectly_used && ID_REAL_USERS(ob) <= 1 && ID_EXTRA_USERS(ob) == 0) { + if (is_indirectly_used && ID_REAL_USERS(ob) <= 1 && ID_EXTRA_USERS(ob) == 0) { BKE_reportf(op->reports, RPT_WARNING, "Cannot delete object '%s' from scene '%s', indirectly used objects need at " @@ -1866,7 +1866,7 @@ static bool dupliobject_cmp(const void *a_, const void *b_) if (a->persistent_id[i] != b->persistent_id[i]) { return true; } - else if (a->persistent_id[i] == INT_MAX) { + if (a->persistent_id[i] == INT_MAX) { break; } } @@ -1891,7 +1891,7 @@ static bool dupliobject_instancer_cmp(const void *a_, const void *b_) if (a->persistent_id[i] != b->persistent_id[i]) { return true; } - else if (a->persistent_id[i] == INT_MAX) { + if (a->persistent_id[i] == INT_MAX) { break; } } @@ -3097,9 +3097,7 @@ static bool object_join_poll(bContext *C) if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_ARMATURE, OB_GPENCIL)) { return ED_operator_screenactive(C); } - else { - return false; - } + return false; } static int object_join_exec(bContext *C, wmOperator *op) @@ -3110,11 +3108,11 @@ static int object_join_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "This data does not support joining in edit mode"); return OPERATOR_CANCELLED; } - else if (BKE_object_obdata_is_libdata(ob)) { + if (BKE_object_obdata_is_libdata(ob)) { BKE_report(op->reports, RPT_ERROR, "Cannot edit external library data"); return OPERATOR_CANCELLED; } - else if (ob->type == OB_GPENCIL) { + if (ob->type == OB_GPENCIL) { bGPdata *gpd = (bGPdata *)ob->data; if ((!gpd) || GPENCIL_ANY_MODE(gpd)) { BKE_report(op->reports, RPT_ERROR, "This data does not support joining in this mode"); @@ -3125,13 +3123,13 @@ static int object_join_exec(bContext *C, wmOperator *op) if (ob->type == OB_MESH) { return ED_mesh_join_objects_exec(C, op); } - else if (ELEM(ob->type, OB_CURVE, OB_SURF)) { + if (ELEM(ob->type, OB_CURVE, OB_SURF)) { return ED_curve_join_objects_exec(C, op); } - else if (ob->type == OB_ARMATURE) { + if (ob->type == OB_ARMATURE) { return ED_armature_join_objects_exec(C, op); } - else if (ob->type == OB_GPENCIL) { + if (ob->type == OB_GPENCIL) { return ED_gpencil_join_objects_exec(C, op); } @@ -3172,9 +3170,7 @@ static bool join_shapes_poll(bContext *C) if (ob->type == OB_MESH) { return ED_operator_screenactive(C); } - else { - return false; - } + return false; } static int join_shapes_exec(bContext *C, wmOperator *op) @@ -3185,7 +3181,7 @@ static int join_shapes_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "This data does not support joining in edit mode"); return OPERATOR_CANCELLED; } - else if (BKE_object_obdata_is_libdata(ob)) { + if (BKE_object_obdata_is_libdata(ob)) { BKE_report(op->reports, RPT_ERROR, "Cannot edit external library data"); return OPERATOR_CANCELLED; } |