diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 18:30:31 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 18:42:46 +0300 |
commit | 33a74941c5fd4efb6eefcaace3315d3e2b65681f (patch) | |
tree | 2d3da68b73e4419750c7f767bbb78bf1a303ad18 /source/blender/editors/physics | |
parent | 367034f210137754ab4f07a0e7793066d2b69e59 (diff) |
Cleanup: Editors, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors` module.
No functional changes.
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 18 | ||||
-rw-r--r-- | source/blender/editors/physics/rigidbody_constraint.c | 12 | ||||
-rw-r--r-- | source/blender/editors/physics/rigidbody_object.c | 35 |
3 files changed, 18 insertions, 47 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 457c8ba30e6..749c6cd640e 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -216,11 +216,9 @@ PTCacheEdit *PE_get_current_from_psys(ParticleSystem *psys) if ((psys->flag & PSYS_HAIR_DYNAMICS) != 0 && (psys->pointcache->flag & PTCACHE_BAKED) != 0) { return psys->pointcache->edit; } - else { - return psys->edit; - } + return psys->edit; } - else if (psys->pointcache->flag & PTCACHE_BAKED) { + if (psys->pointcache->flag & PTCACHE_BAKED) { return psys->pointcache->edit; } return NULL; @@ -561,9 +559,7 @@ static bool key_test_depth(const PEData *data, const float co[3], const int scre if (win[2] - 0.00001f > depth) { return 0; } - else { - return 1; - } + return 1; } static bool key_inside_circle(const PEData *data, float rad, const float co[3], float *distance) @@ -618,9 +614,7 @@ static bool key_inside_test(PEData *data, const float co[3]) if (data->mval) { return key_inside_circle(data, data->rad, co, NULL); } - else { - return key_inside_rect(data, co); - } + return key_inside_rect(data, co); } static bool point_is_selected(PTCacheEditPoint *point) @@ -3372,9 +3366,7 @@ static void PE_mirror_x(Depsgraph *depsgraph, Scene *scene, Object *ob, int tagg PE_mirror_particle(ob, psmd_eval->mesh_final, psys, pa, NULL); continue; } - else { - point->flag |= PEP_TAG; - } + point->flag |= PEP_TAG; } } diff --git a/source/blender/editors/physics/rigidbody_constraint.c b/source/blender/editors/physics/rigidbody_constraint.c index a59b031298c..4939bf0086b 100644 --- a/source/blender/editors/physics/rigidbody_constraint.c +++ b/source/blender/editors/physics/rigidbody_constraint.c @@ -68,9 +68,7 @@ static bool ED_operator_rigidbody_con_active_poll(bContext *C) Object *ob = ED_object_active_context(C); return (ob && ob->rigidbody_constraint); } - else { - return false; - } + return false; } static bool ED_operator_rigidbody_con_add_poll(bContext *C) @@ -151,9 +149,7 @@ static int rigidbody_con_add_exec(bContext *C, wmOperator *op) /* done */ return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + return OPERATOR_CANCELLED; } void RIGIDBODY_OT_constraint_add(wmOperatorType *ot) @@ -193,9 +189,7 @@ static int rigidbody_con_remove_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "Object has no Rigid Body Constraint to remove"); return OPERATOR_CANCELLED; } - else { - ED_rigidbody_constraint_remove(bmain, scene, ob); - } + ED_rigidbody_constraint_remove(bmain, scene, ob); /* send updates */ WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c index 78369345b9a..b91385c502c 100644 --- a/source/blender/editors/physics/rigidbody_object.c +++ b/source/blender/editors/physics/rigidbody_object.c @@ -73,9 +73,7 @@ static bool ED_operator_rigidbody_active_poll(bContext *C) Object *ob = ED_object_active_context(C); return (ob && ob->rigidbody_object); } - else { - return 0; - } + return 0; } static bool ED_operator_rigidbody_add_poll(bContext *C) @@ -91,9 +89,7 @@ static bool ED_operator_rigidbody_add_poll(bContext *C) Object *ob = ED_object_active_context(C); return (ob && ob->type == OB_MESH); } - else { - return false; - } + return false; } /* ----------------- */ @@ -135,9 +131,7 @@ static int rigidbody_object_add_exec(bContext *C, wmOperator *op) /* done */ return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + return OPERATOR_CANCELLED; } void RIGIDBODY_OT_object_add(wmOperatorType *ot) @@ -186,10 +180,9 @@ static int rigidbody_object_remove_exec(bContext *C, wmOperator *op) /* done */ return OPERATOR_FINISHED; } - else { - BKE_report(op->reports, RPT_ERROR, "Object has no Rigid Body settings to remove"); - return OPERATOR_CANCELLED; - } + + BKE_report(op->reports, RPT_ERROR, "Object has no Rigid Body settings to remove"); + return OPERATOR_CANCELLED; } void RIGIDBODY_OT_object_remove(wmOperatorType *ot) @@ -233,9 +226,7 @@ static int rigidbody_objects_add_exec(bContext *C, wmOperator *op) /* done */ return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + return OPERATOR_CANCELLED; } void RIGIDBODY_OT_objects_add(wmOperatorType *ot) @@ -286,9 +277,7 @@ static int rigidbody_objects_remove_exec(bContext *C, wmOperator *UNUSED(op)) /* done */ return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + return OPERATOR_CANCELLED; } void RIGIDBODY_OT_objects_remove(wmOperatorType *ot) @@ -340,9 +329,7 @@ static int rigidbody_objects_shape_change_exec(bContext *C, wmOperator *op) /* done */ return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + return OPERATOR_CANCELLED; } void RIGIDBODY_OT_shape_change(wmOperatorType *ot) @@ -531,9 +518,7 @@ static int rigidbody_objects_calc_mass_exec(bContext *C, wmOperator *op) /* done */ return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + return OPERATOR_CANCELLED; } void RIGIDBODY_OT_mass_calculate(wmOperatorType *ot) |