From b88e51dd55c62bdc160f33f9b2ae1727a892560a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 2 Jul 2018 11:47:00 +0200 Subject: Cleanup: use bool for poll functions --- source/blender/editors/space_view3d/space_view3d.c | 14 +++++++------- source/blender/editors/space_view3d/view3d_buttons.c | 4 ++-- source/blender/editors/space_view3d/view3d_edit.c | 4 ++-- source/blender/editors/space_view3d/view3d_header.c | 2 +- source/blender/editors/space_view3d/view3d_select.c | 2 +- source/blender/editors/space_view3d/view3d_view.c | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 1bd1973a4db..63ae3bbb657 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -579,7 +579,7 @@ static void view3d_main_region_exit(wmWindowManager *wm, ARegion *ar) } } -static int view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) +static bool view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_ID) { ID *id = drag->poin; @@ -589,7 +589,7 @@ static int view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent return 0; } -static int view3d_group_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) +static bool view3d_group_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_ID) { ID *id = drag->poin; @@ -599,7 +599,7 @@ static int view3d_group_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEve return 0; } -static int view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) +static bool view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_ID) { ID *id = drag->poin; @@ -609,7 +609,7 @@ static int view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent return 0; } -static int view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) +static bool view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_ID) { ID *id = drag->poin; @@ -623,7 +623,7 @@ static int view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent return 0; } -static int view3d_ima_bg_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) +static bool view3d_ima_bg_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { if (event->ctrl) return false; @@ -634,7 +634,7 @@ static int view3d_ima_bg_drop_poll(bContext *C, wmDrag *drag, const wmEvent *eve return 0; } -static int view3d_ima_empty_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) +static bool view3d_ima_empty_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { Base *base = ED_view3d_give_base_under_cursor(C, event->mval); @@ -648,7 +648,7 @@ static int view3d_ima_empty_drop_poll(bContext *C, wmDrag *drag, const wmEvent * return 0; } -static int view3d_ima_mesh_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) +static bool view3d_ima_mesh_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { Base *base = ED_view3d_give_base_under_cursor(C, event->mval); diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index fbbc5bd7bb9..63786e87b1f 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -784,7 +784,7 @@ static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event) } } -static int view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt)) +static bool view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt)) { Scene *scene = CTX_data_scene(C); Object *ob = OBACT; @@ -1117,7 +1117,7 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); } -static int view3d_panel_transform_poll(const bContext *C, PanelType *UNUSED(pt)) +static bool view3d_panel_transform_poll(const bContext *C, PanelType *UNUSED(pt)) { Scene *scene = CTX_data_scene(C); return (scene->basact != NULL); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 5cf167165cd..f34866b00cd 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -928,7 +928,7 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, const wmEvent *event) } /* test for unlocked camera view in quad view */ -static int view3d_camera_user_poll(bContext *C) +static bool view3d_camera_user_poll(bContext *C) { View3D *v3d; ARegion *ar; @@ -943,7 +943,7 @@ static int view3d_camera_user_poll(bContext *C) return 0; } -static int view3d_lock_poll(bContext *C) +static bool view3d_lock_poll(bContext *C) { View3D *v3d = CTX_wm_view3d(C); if (v3d) { diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 124bd33f227..27dda99e715 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -200,7 +200,7 @@ static int view3d_layers_invoke(bContext *C, wmOperator *op, const wmEvent *even return OPERATOR_FINISHED; } -static int view3d_layers_poll(bContext *C) +static bool view3d_layers_poll(bContext *C) { return (ED_operator_view3d_active(C) && CTX_wm_view3d(C)->localvd == NULL); } diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index c3a8374d82e..12eb2fc0f2b 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -269,7 +269,7 @@ static void view3d_userdata_lassoselect_init( r_data->is_changed = false; } -static int view3d_selectable_data(bContext *C) +static bool view3d_selectable_data(bContext *C) { Object *ob = CTX_data_active_object(C); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 3cab43ba463..a812950254f 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -460,7 +460,7 @@ static int view3d_camera_to_view_exec(bContext *C, wmOperator *UNUSED(op)) } -static int view3d_camera_to_view_poll(bContext *C) +static bool view3d_camera_to_view_poll(bContext *C) { View3D *v3d; ARegion *ar; @@ -658,7 +658,7 @@ static int view3d_setobjectascamera_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -int ED_operator_rv3d_user_region_poll(bContext *C) +bool ED_operator_rv3d_user_region_poll(bContext *C) { View3D *v3d_dummy; ARegion *ar_dummy; @@ -1398,7 +1398,7 @@ static void game_set_commmandline_options(GameData *gm) #endif /* WITH_GAMEENGINE */ -static int game_engine_poll(bContext *C) +static bool game_engine_poll(bContext *C) { bScreen *screen; /* we need a context and area to launch BGE -- cgit v1.2.3