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/physics/particle_edit.c | 10 +++++----- source/blender/editors/physics/particle_object.c | 6 +++--- source/blender/editors/physics/physics_pointcache.c | 4 ++-- source/blender/editors/physics/rigidbody_constraint.c | 2 +- source/blender/editors/physics/rigidbody_object.c | 4 ++-- source/blender/editors/physics/rigidbody_world.c | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) (limited to 'source/blender/editors/physics') diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index dabdea34381..73ed8b016ef 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -86,7 +86,7 @@ /**************************** utilities *******************************/ -int PE_poll(bContext *C) +bool PE_poll(bContext *C) { Main *bmain = CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -98,7 +98,7 @@ int PE_poll(bContext *C) return (PE_get_current(bmain, scene, ob) != NULL); } -int PE_hair_poll(bContext *C) +bool PE_hair_poll(bContext *C) { Main *bmain = CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -113,7 +113,7 @@ int PE_hair_poll(bContext *C) return (edit && edit->psys); } -int PE_poll_view3d(bContext *C) +bool PE_poll_view3d(bContext *C) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); @@ -4071,7 +4071,7 @@ void PARTICLE_OT_brush_edit(wmOperatorType *ot) /*********************** cut shape ***************************/ -static int shape_cut_poll(bContext *C) +static bool shape_cut_poll(bContext *C) { if (PE_hair_poll(C)) { Scene *scene = CTX_data_scene(C); @@ -4397,7 +4397,7 @@ void PE_create_particle_edit(Main *bmain, Scene *scene, Object *ob, PointCache * } } -static int particle_edit_toggle_poll(bContext *C) +static bool particle_edit_toggle_poll(bContext *C) { Object *ob = CTX_data_active_object(C); diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 873ea196c35..087d3182d8c 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -154,7 +154,7 @@ void OBJECT_OT_particle_system_remove(wmOperatorType *ot) /********************** new particle settings operator *********************/ -static int psys_poll(bContext *C) +static bool psys_poll(bContext *C) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); return (ptr.data != NULL); @@ -1105,7 +1105,7 @@ static bool copy_particle_systems_to_object(Main *bmain, return true; } -static int copy_particle_systems_poll(bContext *C) +static bool copy_particle_systems_poll(bContext *C) { Object *ob; if (!ED_operator_object_active_editable(C)) @@ -1182,7 +1182,7 @@ void PARTICLE_OT_copy_particle_systems(wmOperatorType *ot) RNA_def_boolean(ot->srna, "use_active", false, "Use Active", "Use the active particle system from the context"); } -static int duplicate_particle_systems_poll(bContext *C) +static bool duplicate_particle_systems_poll(bContext *C) { if (!ED_operator_object_active_editable(C)) { return false; diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index abd95cc37f1..51c5955d507 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -56,12 +56,12 @@ #include "physics_intern.h" -static int ptcache_bake_all_poll(bContext *C) +static bool ptcache_bake_all_poll(bContext *C) { return CTX_data_scene(C) != NULL; } -static int ptcache_poll(bContext *C) +static bool ptcache_poll(bContext *C) { PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); return (ptr.data && ptr.id.data); diff --git a/source/blender/editors/physics/rigidbody_constraint.c b/source/blender/editors/physics/rigidbody_constraint.c index 85478673f96..0c612cc5855 100644 --- a/source/blender/editors/physics/rigidbody_constraint.c +++ b/source/blender/editors/physics/rigidbody_constraint.c @@ -59,7 +59,7 @@ /* ********************************************** */ /* Helper API's for RigidBody Constraint Editing */ -static int ED_operator_rigidbody_con_active_poll(bContext *C) +static bool ED_operator_rigidbody_con_active_poll(bContext *C) { if (ED_operator_object_active_editable(C)) { Object *ob = CTX_data_active_object(C); diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c index fa7298489b1..ec6de52ebc1 100644 --- a/source/blender/editors/physics/rigidbody_object.c +++ b/source/blender/editors/physics/rigidbody_object.c @@ -65,7 +65,7 @@ /* ********************************************** */ /* Helper API's for RigidBody Objects Editing */ -static int ED_operator_rigidbody_active_poll(bContext *C) +static bool ED_operator_rigidbody_active_poll(bContext *C) { if (ED_operator_object_active_editable(C)) { Object *ob = ED_object_active_context(C); @@ -75,7 +75,7 @@ static int ED_operator_rigidbody_active_poll(bContext *C) return 0; } -static int ED_operator_rigidbody_add_poll(bContext *C) +static bool ED_operator_rigidbody_add_poll(bContext *C) { if (ED_operator_object_active_editable(C)) { Object *ob = ED_object_active_context(C); diff --git a/source/blender/editors/physics/rigidbody_world.c b/source/blender/editors/physics/rigidbody_world.c index 8d5258a7522..fe2be86dd98 100644 --- a/source/blender/editors/physics/rigidbody_world.c +++ b/source/blender/editors/physics/rigidbody_world.c @@ -58,12 +58,12 @@ /* API */ /* check if there is an active rigid body world */ -static int ED_rigidbody_world_active_poll(bContext *C) +static bool ED_rigidbody_world_active_poll(bContext *C) { Scene *scene = CTX_data_scene(C); return (scene && scene->rigidbody_world); } -static int ED_rigidbody_world_add_poll(bContext *C) +static bool ED_rigidbody_world_add_poll(bContext *C) { Scene *scene = CTX_data_scene(C); return (scene && scene->rigidbody_world == NULL); -- cgit v1.2.3