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/space_action/action_data.c
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/space_action/action_data.c')
-rw-r--r--source/blender/editors/space_action/action_data.c81
1 files changed, 39 insertions, 42 deletions
diff --git a/source/blender/editors/space_action/action_data.c b/source/blender/editors/space_action/action_data.c
index b5a0c4a9e22..bffd6cc421d 100644
--- a/source/blender/editors/space_action/action_data.c
+++ b/source/blender/editors/space_action/action_data.c
@@ -337,10 +337,9 @@ static int action_pushdown_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_WARNING, "Action must have at least one keyframe or F-Modifier");
return OPERATOR_CANCELLED;
}
- else {
- /* action can be safely added */
- BKE_nla_action_pushdown(adt);
- }
+
+ /* action can be safely added */
+ BKE_nla_action_pushdown(adt);
/* Stop displaying this action in this editor
* NOTE: The editor itself doesn't set a user...
@@ -383,24 +382,23 @@ static int action_stash_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_WARNING, "Action must have at least one keyframe or F-Modifier");
return OPERATOR_CANCELLED;
}
- else {
- /* stash the action */
- if (BKE_nla_action_stash(adt)) {
- /* The stash operation will remove the user already,
- * so the flushing step later shouldn't double up
- * the user-count fixes. Hence, we must unset this ref
- * first before setting the new action.
- */
- saction->action = NULL;
- }
- else {
- /* action has already been added - simply warn about this, and clear */
- BKE_report(op->reports, RPT_ERROR, "Action has already been stashed");
- }
- /* clear action refs from editor, and then also the backing data (not necessary) */
- actedit_change_action(C, NULL);
+ /* stash the action */
+ if (BKE_nla_action_stash(adt)) {
+ /* The stash operation will remove the user already,
+ * so the flushing step later shouldn't double up
+ * the user-count fixes. Hence, we must unset this ref
+ * first before setting the new action.
+ */
+ saction->action = NULL;
+ }
+ else {
+ /* action has already been added - simply warn about this, and clear */
+ BKE_report(op->reports, RPT_ERROR, "Action has already been stashed");
}
+
+ /* clear action refs from editor, and then also the backing data (not necessary) */
+ actedit_change_action(C, NULL);
}
/* Send notifiers that stuff has changed */
@@ -486,28 +484,27 @@ static int action_stash_create_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_WARNING, "Action must have at least one keyframe or F-Modifier");
return OPERATOR_CANCELLED;
}
- else {
- /* stash the action */
- if (BKE_nla_action_stash(adt)) {
- bAction *new_action = NULL;
- /* Create new action not based on the old one
- * (since the "new" operator already does that). */
- new_action = action_create_new(C, NULL);
+ /* stash the action */
+ if (BKE_nla_action_stash(adt)) {
+ bAction *new_action = NULL;
- /* The stash operation will remove the user already,
- * so the flushing step later shouldn't double up
- * the user-count fixes. Hence, we must unset this ref
- * first before setting the new action.
- */
- saction->action = NULL;
- actedit_change_action(C, new_action);
- }
- else {
- /* action has already been added - simply warn about this, and clear */
- BKE_report(op->reports, RPT_ERROR, "Action has already been stashed");
- actedit_change_action(C, NULL);
- }
+ /* Create new action not based on the old one
+ * (since the "new" operator already does that). */
+ new_action = action_create_new(C, NULL);
+
+ /* The stash operation will remove the user already,
+ * so the flushing step later shouldn't double up
+ * the user-count fixes. Hence, we must unset this ref
+ * first before setting the new action.
+ */
+ saction->action = NULL;
+ actedit_change_action(C, new_action);
+ }
+ else {
+ /* action has already been added - simply warn about this, and clear */
+ BKE_report(op->reports, RPT_ERROR, "Action has already been stashed");
+ actedit_change_action(C, NULL);
}
}
@@ -709,11 +706,11 @@ static NlaStrip *action_layer_get_nlastrip(ListBase *strips, float ctime)
/* in range - use this one */
return strip;
}
- else if ((ctime < strip->start) && (strip->prev == NULL)) {
+ if ((ctime < strip->start) && (strip->prev == NULL)) {
/* before first - use this one */
return strip;
}
- else if ((ctime > strip->end) && (strip->next == NULL)) {
+ if ((ctime > strip->end) && (strip->next == NULL)) {
/* after last - use this one */
return strip;
}