diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 15:20:10 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 15:48:37 +0300 |
commit | f3b8792b963b0b2a00fe7fe173f1beb85c209fbb (patch) | |
tree | 55ffa18ad4a6f2f03a127469780d47c54ad9bd74 /source/blender/editors/interface/interface_region_menu_popup.c | |
parent | 86e7648f0edc13d613d8fc39af7758e08cfdf9e2 (diff) |
Cleanup: Interface, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/interface` module.
No functional changes.
Diffstat (limited to 'source/blender/editors/interface/interface_region_menu_popup.c')
-rw-r--r-- | source/blender/editors/interface/interface_region_menu_popup.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/source/blender/editors/interface/interface_region_menu_popup.c b/source/blender/editors/interface/interface_region_menu_popup.c index 65f5798bdce..077e8888d53 100644 --- a/source/blender/editors/interface/interface_region_menu_popup.c +++ b/source/blender/editors/interface/interface_region_menu_popup.c @@ -77,11 +77,10 @@ int ui_but_menu_step(uiBut *but, int direction) if (but->menu_step_func) { return but->menu_step_func(but->block->evil_C, direction, but->poin); } - else { - const int curval = RNA_property_enum_get(&but->rnapoin, but->rnaprop); - return RNA_property_enum_step( - but->block->evil_C, &but->rnapoin, but->rnaprop, curval, direction); - } + + const int curval = RNA_property_enum_get(&but->rnapoin, but->rnaprop); + return RNA_property_enum_step( + but->block->evil_C, &but->rnapoin, but->rnaprop, curval, direction); } printf("%s: cannot cycle button '%s'\n", __func__, but->str); @@ -129,16 +128,15 @@ static uiBut *ui_popup_menu_memory__internal(uiBlock *block, uiBut *but) mem[hash_mod] = ui_popup_string_hash(but->str, but->flag & UI_BUT_HAS_SEP_CHAR); return NULL; } - else { - /* get */ - for (but = block->buttons.first; but; but = but->next) { - if (mem[hash_mod] == ui_popup_string_hash(but->str, but->flag & UI_BUT_HAS_SEP_CHAR)) { - return but; - } - } - return NULL; + /* get */ + for (but = block->buttons.first; but; but = but->next) { + if (mem[hash_mod] == ui_popup_string_hash(but->str, but->flag & UI_BUT_HAS_SEP_CHAR)) { + return but; + } } + + return NULL; } uiBut *ui_popup_menu_memory_get(uiBlock *block) @@ -488,13 +486,11 @@ bool UI_popup_menu_end_or_cancel(bContext *C, uiPopupMenu *pup) UI_popup_menu_end(C, pup); return true; } - else { - UI_block_layout_resolve(pup->block, NULL, NULL); - MEM_freeN(pup->block->handle); - UI_block_free(C, pup->block); - MEM_freeN(pup); - return false; - } + UI_block_layout_resolve(pup->block, NULL, NULL); + MEM_freeN(pup->block->handle); + UI_block_free(C, pup->block); + MEM_freeN(pup); + return false; } uiLayout *UI_popup_menu_layout(uiPopupMenu *pup) |