Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2020-07-03 18:30:31 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-07-03 18:42:46 +0300
commit33a74941c5fd4efb6eefcaace3315d3e2b65681f (patch)
tree2d3da68b73e4419750c7f767bbb78bf1a303ad18 /source/blender/editors/mask
parent367034f210137754ab4f07a0e7793066d2b69e59 (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/mask')
-rw-r--r--source/blender/editors/mask/mask_add.c8
-rw-r--r--source/blender/editors/mask/mask_ops.c12
-rw-r--r--source/blender/editors/mask/mask_select.c67
-rw-r--r--source/blender/editors/mask/mask_shapekey.c16
4 files changed, 43 insertions, 60 deletions
diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c
index 767976b5ae6..b7fd661d8e6 100644
--- a/source/blender/editors/mask/mask_add.c
+++ b/source/blender/editors/mask/mask_add.c
@@ -210,7 +210,7 @@ static void finSelectedSplinePoint(MaskLayer *mask_layer,
*point = NULL;
return;
}
- else if (*point) {
+ if (*point) {
*point = NULL;
}
else {
@@ -319,9 +319,7 @@ static bool add_vertex_extrude(const bContext *C,
if (!mask_layer) {
return false;
}
- else {
- finSelectedSplinePoint(mask_layer, &spline, &point, true);
- }
+ finSelectedSplinePoint(mask_layer, &spline, &point, true);
ED_mask_select_toggle_all(mask, SEL_DESELECT);
@@ -502,7 +500,7 @@ static int add_vertex_handle_cyclic(
if (is_last_point_active) {
return add_vertex_handle_cyclic_at_point(C, mask, spline, active_point, first_point, co);
}
- else if (is_first_point_active) {
+ if (is_first_point_active) {
return add_vertex_handle_cyclic_at_point(C, mask, spline, active_point, last_point, co);
}
return OPERATOR_PASS_THROUGH;
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c
index 68dfe0d151f..d953a8f9d42 100644
--- a/source/blender/editors/mask/mask_ops.c
+++ b/source/blender/editors/mask/mask_ops.c
@@ -1710,9 +1710,7 @@ static int mask_hide_view_clear_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
- else {
- return OPERATOR_CANCELLED;
- }
+ return OPERATOR_CANCELLED;
}
void MASK_OT_hide_view_clear(wmOperatorType *ot)
@@ -1773,9 +1771,7 @@ static int mask_hide_view_set_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
- else {
- return OPERATOR_CANCELLED;
- }
+ return OPERATOR_CANCELLED;
}
void MASK_OT_hide_view_set(wmOperatorType *ot)
@@ -1827,9 +1823,7 @@ static int mask_feather_weight_clear_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
- else {
- return OPERATOR_CANCELLED;
- }
+ return OPERATOR_CANCELLED;
}
void MASK_OT_feather_weight_clear(wmOperatorType *ot)
diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c
index c8cddced99c..82d8a1dc85f 100644
--- a/source/blender/editors/mask/mask_select.c
+++ b/source/blender/editors/mask/mask_select.c
@@ -331,53 +331,52 @@ static int select_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
- else {
- MaskSplinePointUW *uw;
- if (ED_mask_feather_find_nearest(
- C, mask, co, threshold, &mask_layer, &spline, &point, &uw, NULL)) {
+ MaskSplinePointUW *uw;
- if (extend) {
- mask_layer->act_spline = spline;
- mask_layer->act_point = point;
+ if (ED_mask_feather_find_nearest(
+ C, mask, co, threshold, &mask_layer, &spline, &point, &uw, NULL)) {
- if (uw) {
- uw->flag |= SELECT;
- }
+ if (extend) {
+ mask_layer->act_spline = spline;
+ mask_layer->act_point = point;
+
+ if (uw) {
+ uw->flag |= SELECT;
}
- else if (deselect) {
- if (uw) {
- uw->flag &= ~SELECT;
- }
+ }
+ else if (deselect) {
+ if (uw) {
+ uw->flag &= ~SELECT;
}
- else {
- mask_layer->act_spline = spline;
- mask_layer->act_point = point;
+ }
+ else {
+ mask_layer->act_spline = spline;
+ mask_layer->act_point = point;
- if (uw) {
- if (!(uw->flag & SELECT)) {
- uw->flag |= SELECT;
- }
- else if (toggle) {
- uw->flag &= ~SELECT;
- }
+ if (uw) {
+ if (!(uw->flag & SELECT)) {
+ uw->flag |= SELECT;
+ }
+ else if (toggle) {
+ uw->flag &= ~SELECT;
}
}
+ }
- ED_mask_select_flush_all(mask);
+ ED_mask_select_flush_all(mask);
- DEG_id_tag_update(&mask->id, ID_RECALC_SELECT);
- WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask);
+ DEG_id_tag_update(&mask->id, ID_RECALC_SELECT);
+ WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask);
+ return OPERATOR_FINISHED;
+ }
+ if (deselect_all) {
+ /* For clip editor tracks, leave deselect all to clip editor. */
+ if (!ED_clip_can_select(C)) {
+ ED_mask_deselect_all(C);
return OPERATOR_FINISHED;
}
- else if (deselect_all) {
- /* For clip editor tracks, leave deselect all to clip editor. */
- if (!ED_clip_can_select(C)) {
- ED_mask_deselect_all(C);
- return OPERATOR_FINISHED;
- }
- }
}
return OPERATOR_PASS_THROUGH;
diff --git a/source/blender/editors/mask/mask_shapekey.c b/source/blender/editors/mask/mask_shapekey.c
index f264e67d35c..74348f2c8cf 100644
--- a/source/blender/editors/mask/mask_shapekey.c
+++ b/source/blender/editors/mask/mask_shapekey.c
@@ -71,9 +71,7 @@ static int mask_shape_key_insert_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
- else {
- return OPERATOR_CANCELLED;
- }
+ return OPERATOR_CANCELLED;
}
void MASK_OT_shape_key_insert(wmOperatorType *ot)
@@ -119,9 +117,7 @@ static int mask_shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
- else {
- return OPERATOR_CANCELLED;
- }
+ return OPERATOR_CANCELLED;
}
void MASK_OT_shape_key_clear(wmOperatorType *ot)
@@ -205,9 +201,7 @@ static int mask_shape_key_feather_reset_exec(bContext *C, wmOperator *UNUSED(op)
return OPERATOR_FINISHED;
}
- else {
- return OPERATOR_CANCELLED;
- }
+ return OPERATOR_CANCELLED;
}
void MASK_OT_shape_key_feather_reset(wmOperatorType *ot)
@@ -365,9 +359,7 @@ static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
- else {
- return OPERATOR_CANCELLED;
- }
+ return OPERATOR_CANCELLED;
}
void MASK_OT_shape_key_rekey(wmOperatorType *ot)