From 4e09fd76bcabb602f1bd31c2bbd5dd2b09e4b64a Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 5 Nov 2021 14:56:22 +0100 Subject: Cleanup (UI): Add/use type for operator context enum Adds a `wmOperatorCallContext` typedef for the existing `WM_OP_XXX` operator context enum. This adds type safety, allows the compiler to produce better warnings and helps understanding what a variable is for. Differential Revision: https://developer.blender.org/D13113 Reviewed by: Campbell Barton --- source/blender/editors/interface/interface_handlers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/interface/interface_handlers.c') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 51ebe5399b3..35e1526d079 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -492,7 +492,7 @@ typedef struct uiAfterFunc { wmOperator *popup_op; wmOperatorType *optype; - int opcontext; + wmOperatorCallContext opcontext; PointerRNA *opptr; PointerRNA rnapoin; @@ -775,7 +775,7 @@ static uiAfterFunc *ui_afterfunc_new(void) */ static void ui_handle_afterfunc_add_operator_ex(wmOperatorType *ot, PointerRNA **properties, - int opcontext, + wmOperatorCallContext opcontext, const uiBut *context_but) { uiAfterFunc *after = ui_afterfunc_new(); @@ -796,7 +796,7 @@ static void ui_handle_afterfunc_add_operator_ex(wmOperatorType *ot, } } -void ui_handle_afterfunc_add_operator(wmOperatorType *ot, int opcontext) +void ui_handle_afterfunc_add_operator(wmOperatorType *ot, wmOperatorCallContext opcontext) { ui_handle_afterfunc_add_operator_ex(ot, NULL, opcontext, NULL); } -- cgit v1.2.3