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_console | |
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_console')
-rw-r--r-- | source/blender/editors/space_console/console_ops.c | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 981e056fa63..f0d4a45a3dd 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -287,12 +287,11 @@ static bool console_line_column_from_index( *r_col = offset - pos; return true; } - else { - *r_cl = NULL; - *r_cl_offset = -1; - *r_col = -1; - return false; - } + + *r_cl = NULL; + *r_cl_offset = -1; + *r_col = -1; + return false; } /* static funcs for text editing */ @@ -403,9 +402,8 @@ static int console_insert_exec(bContext *C, wmOperator *op) if (len == 0) { return OPERATOR_CANCELLED; } - else { - console_select_offset(sc, len); - } + + console_select_offset(sc, len); console_textview_update_rect(sc, region); ED_area_tag_redraw(CTX_wm_area(C)); @@ -426,21 +424,20 @@ static int console_insert_invoke(bContext *C, wmOperator *op, const wmEvent *eve if ((event->ctrl || event->oskey) && !event->utf8_buf[0]) { return OPERATOR_PASS_THROUGH; } - else { - char str[BLI_UTF8_MAX + 1]; - size_t len; - if (event->utf8_buf[0]) { - len = BLI_str_utf8_size_safe(event->utf8_buf); - memcpy(str, event->utf8_buf, len); - } - else { - /* in theory, ghost can set value to extended ascii here */ - len = BLI_str_utf8_from_unicode(event->ascii, str); - } - str[len] = '\0'; - RNA_string_set(op->ptr, "text", str); + char str[BLI_UTF8_MAX + 1]; + size_t len; + + if (event->utf8_buf[0]) { + len = BLI_str_utf8_size_safe(event->utf8_buf); + memcpy(str, event->utf8_buf, len); + } + else { + /* in theory, ghost can set value to extended ascii here */ + len = BLI_str_utf8_from_unicode(event->ascii, str); } + str[len] = '\0'; + RNA_string_set(op->ptr, "text", str); } return console_insert_exec(C, op); } @@ -674,9 +671,8 @@ static int console_delete_exec(bContext *C, wmOperator *op) if (!done) { return OPERATOR_CANCELLED; } - else { - console_select_offset(sc, -stride); - } + + console_select_offset(sc, -stride); console_textview_update_rect(sc, region); ED_area_tag_redraw(CTX_wm_area(C)); |