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/space_nla/nla_edit.c | |
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/space_nla/nla_edit.c')
-rw-r--r-- | source/blender/editors/space_nla/nla_edit.c | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index dec7a0fd93c..bc9bd0e18f2 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -269,9 +269,7 @@ static int nlaedit_disable_tweakmode_exec(bContext *C, wmOperator *op) if (ok) { return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + return OPERATOR_CANCELLED; } void NLA_OT_tweakmode_exit(wmOperatorType *ot) @@ -373,9 +371,8 @@ static int nlaedit_previewrange_exec(bContext *C, wmOperator *UNUSED(op)) if (ac.scene == NULL) { return OPERATOR_CANCELLED; } - else { - scene = ac.scene; - } + + scene = ac.scene; /* set the range directly */ get_nlastrip_extents(&ac, &min, &max, true); @@ -616,7 +613,7 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op) // printf("Add strip - actname = '%s'\n", actname); return OPERATOR_CANCELLED; } - else if (act->idroot == 0) { + if (act->idroot == 0) { /* hopefully in this case (i.e. library of userless actions), * the user knows what they're doing... */ BKE_reportf(op->reports, @@ -830,12 +827,11 @@ static int nlaedit_add_transition_exec(bContext *C, wmOperator *op) /* done */ return OPERATOR_FINISHED; } - else { - BKE_report(op->reports, - RPT_ERROR, - "Needs at least a pair of adjacent selected strips with a gap between them"); - return OPERATOR_CANCELLED; - } + + BKE_report(op->reports, + RPT_ERROR, + "Needs at least a pair of adjacent selected strips with a gap between them"); + return OPERATOR_CANCELLED; } void NLA_OT_transition_add(wmOperatorType *ot) @@ -1146,9 +1142,8 @@ static int nlaedit_duplicate_exec(bContext *C, wmOperator *op) /* done */ return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + + return OPERATOR_CANCELLED; } static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) @@ -1293,9 +1288,8 @@ static void nlaedit_split_strip_actclip( if (IS_EQF(len, 0.0f)) { return; } - else { - splitframe = strip->start + (len / 2.0f); - } + + splitframe = strip->start + (len / 2.0f); /* action range */ len = strip->actend - strip->actstart; @@ -2504,10 +2498,9 @@ static int nla_fmodifier_copy_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "No F-Modifiers available to be copied"); return OPERATOR_CANCELLED; } - else { - /* no updates needed - copy is non-destructive operation */ - return OPERATOR_FINISHED; - } + + /* no updates needed - copy is non-destructive operation */ + return OPERATOR_FINISHED; } void NLA_OT_fmodifier_copy(wmOperatorType *ot) @@ -2591,10 +2584,9 @@ static int nla_fmodifier_paste_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); return OPERATOR_FINISHED; } - else { - BKE_report(op->reports, RPT_ERROR, "No F-Modifiers to paste"); - return OPERATOR_CANCELLED; - } + + BKE_report(op->reports, RPT_ERROR, "No F-Modifiers to paste"); + return OPERATOR_CANCELLED; } void NLA_OT_fmodifier_paste(wmOperatorType *ot) |