diff options
author | Julian Eisel <julian@blender.org> | 2021-01-26 23:12:11 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-01-27 00:17:17 +0300 |
commit | 656f6ae6436ae10cae4820a5c957041a20d56995 (patch) | |
tree | eb5b29cf9d23dd228db69ff0cccc92647d50bff5 | |
parent | 733bcbed46ed46fba10bc95c09d4dab22f32ac69 (diff) |
Cleanup: Use const parameters for active button lookups/tests
Needed for const-correctness in the following commit.
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index f3c94fb7a28..dd5c92e5e0f 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -2480,7 +2480,7 @@ void UI_context_active_but_prop_get_templateID(struct bContext *C, struct PropertyRNA **r_prop); struct ID *UI_context_active_but_get_tab_ID(struct bContext *C); -uiBut *UI_region_active_but_get(struct ARegion *region); +uiBut *UI_region_active_but_get(const struct ARegion *region); uiBut *UI_region_but_find_rect_over(const struct ARegion *region, const struct rcti *rect_px); uiBlock *UI_region_block_find_mouse_over(const struct ARegion *region, const int xy[2], diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 377e55e7299..abb9d0dcc13 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -8317,7 +8317,7 @@ void ui_but_active_free(const bContext *C, uiBut *but) } /* returns the active button with an optional checking function */ -static uiBut *ui_context_button_active(ARegion *region, bool (*but_check_cb)(uiBut *)) +static uiBut *ui_context_button_active(const ARegion *region, bool (*but_check_cb)(const uiBut *)) { uiBut *but_found = NULL; @@ -8358,7 +8358,7 @@ static uiBut *ui_context_button_active(ARegion *region, bool (*but_check_cb)(uiB return but_found; } -static bool ui_context_rna_button_active_test(uiBut *but) +static bool ui_context_rna_button_active_test(const uiBut *but) { return (but->rnapoin.data != NULL); } @@ -8383,7 +8383,7 @@ uiBut *UI_context_active_but_get_respect_menu(const bContext *C) return ui_context_button_active(region_menu ? region_menu : CTX_wm_region(C), NULL); } -uiBut *UI_region_active_but_get(ARegion *region) +uiBut *UI_region_active_but_get(const ARegion *region) { return ui_context_button_active(region, NULL); } |