Cleanup: Use const parameters for active button lookups/tests

Needed for const-correctness in the following commit.
This commit is contained in:
Julian Eisel 2021-01-26 21:12:11 +01:00
parent 733bcbed46
commit 656f6ae643
2 changed files with 4 additions and 4 deletions

View File

@ -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],

View File

@ -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);
}