[Bf-blender-cvs] [b88e51dd55c] master: Cleanup: use bool for poll functions

Campbell Barton noreply at git.blender.org
Mon Jul 2 11:52:39 CEST 2018


Commit: b88e51dd55c62bdc160f33f9b2ae1727a892560a
Author: Campbell Barton
Date:   Mon Jul 2 11:47:00 2018 +0200
Branches: master
https://developer.blender.org/rBb88e51dd55c62bdc160f33f9b2ae1727a892560a

Cleanup: use bool for poll functions

===================================================================

M	source/blender/blenkernel/BKE_node.h
M	source/blender/blenkernel/BKE_screen.h
M	source/blender/blenkernel/intern/node.c
M	source/blender/editors/animation/anim_channels_edit.c
M	source/blender/editors/animation/anim_markers.c
M	source/blender/editors/animation/anim_ops.c
M	source/blender/editors/animation/drivers.c
M	source/blender/editors/animation/keyframing.c
M	source/blender/editors/animation/keyingsets.c
M	source/blender/editors/armature/armature_select.c
M	source/blender/editors/armature/editarmature_sketch.c
M	source/blender/editors/armature/pose_edit.c
M	source/blender/editors/armature/pose_lib.c
M	source/blender/editors/armature/pose_select.c
M	source/blender/editors/curve/editcurve.c
M	source/blender/editors/gpencil/gpencil_brush.c
M	source/blender/editors/gpencil/gpencil_convert.c
M	source/blender/editors/gpencil/gpencil_data.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_intern.h
M	source/blender/editors/gpencil/gpencil_interpolate.c
M	source/blender/editors/gpencil/gpencil_ops.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_select.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/include/ED_armature.h
M	source/blender/editors/include/ED_clip.h
M	source/blender/editors/include/ED_image.h
M	source/blender/editors/include/ED_keyframing.h
M	source/blender/editors/include/ED_physics.h
M	source/blender/editors/include/ED_screen.h
M	source/blender/editors/include/ED_sequencer.h
M	source/blender/editors/include/ED_transverts.h
M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/interface/interface_eyedropper_color.c
M	source/blender/editors/interface/interface_eyedropper_colorband.c
M	source/blender/editors/interface/interface_eyedropper_datablock.c
M	source/blender/editors/interface/interface_eyedropper_depth.c
M	source/blender/editors/interface/interface_eyedropper_driver.c
M	source/blender/editors/interface/interface_ops.c
M	source/blender/editors/interface/view2d_ops.c
M	source/blender/editors/lattice/editlattice_tools.c
M	source/blender/editors/mask/mask_edit.c
M	source/blender/editors/mask/mask_intern.h
M	source/blender/editors/mask/mask_ops.c
M	source/blender/editors/mesh/editmesh_select.c
M	source/blender/editors/mesh/editmesh_utils.c
M	source/blender/editors/mesh/mesh_data.c
M	source/blender/editors/mesh/mesh_intern.h
M	source/blender/editors/mesh/mesh_navmesh.c
M	source/blender/editors/object/object_add.c
M	source/blender/editors/object/object_constraint.c
M	source/blender/editors/object/object_data_transfer.c
M	source/blender/editors/object/object_edit.c
M	source/blender/editors/object/object_hook.c
M	source/blender/editors/object/object_intern.h
M	source/blender/editors/object/object_modifier.c
M	source/blender/editors/object/object_ops.c
M	source/blender/editors/object/object_relations.c
M	source/blender/editors/object/object_select.c
M	source/blender/editors/object/object_shapekey.c
M	source/blender/editors/object/object_vgroup.c
M	source/blender/editors/physics/particle_edit.c
M	source/blender/editors/physics/particle_object.c
M	source/blender/editors/physics/physics_pointcache.c
M	source/blender/editors/physics/rigidbody_constraint.c
M	source/blender/editors/physics/rigidbody_object.c
M	source/blender/editors/physics/rigidbody_world.c
M	source/blender/editors/render/render_shading.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/screen/screendump.c
M	source/blender/editors/sculpt_paint/paint_cursor.c
M	source/blender/editors/sculpt_paint/paint_curve.c
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/sculpt_paint/paint_intern.h
M	source/blender/editors/sculpt_paint/paint_ops.c
M	source/blender/editors/sculpt_paint/paint_stroke.c
M	source/blender/editors/sculpt_paint/paint_utils.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
M	source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_intern.h
M	source/blender/editors/sculpt_paint/sculpt_uv.c
M	source/blender/editors/sound/sound_ops.c
M	source/blender/editors/space_action/action_data.c
M	source/blender/editors/space_action/action_edit.c
M	source/blender/editors/space_clip/clip_dopesheet_ops.c
M	source/blender/editors/space_clip/clip_editor.c
M	source/blender/editors/space_clip/clip_graph_ops.c
M	source/blender/editors/space_clip/clip_ops.c
M	source/blender/editors/space_clip/clip_toolbar.c
M	source/blender/editors/space_clip/space_clip.c
M	source/blender/editors/space_clip/tracking_ops.c
M	source/blender/editors/space_clip/tracking_ops_orient.c
M	source/blender/editors/space_clip/tracking_ops_stabilize.c
M	source/blender/editors/space_clip/tracking_select.c
M	source/blender/editors/space_console/space_console.c
M	source/blender/editors/space_file/file_ops.c
M	source/blender/editors/space_file/file_panels.c
M	source/blender/editors/space_file/space_file.c
M	source/blender/editors/space_graph/graph_buttons.c
M	source/blender/editors/space_graph/graph_edit.c
M	source/blender/editors/space_graph/graph_intern.h
M	source/blender/editors/space_graph/graph_ops.c
M	source/blender/editors/space_graph/graph_utils.c
M	source/blender/editors/space_image/image_edit.c
M	source/blender/editors/space_image/image_intern.h
M	source/blender/editors/space_image/image_ops.c
M	source/blender/editors/space_image/space_image.c
M	source/blender/editors/space_logic/logic_ops.c
M	source/blender/editors/space_nla/nla_buttons.c
M	source/blender/editors/space_nla/nla_channels.c
M	source/blender/editors/space_nla/nla_intern.h
M	source/blender/editors/space_nla/nla_ops.c
M	source/blender/editors/space_node/node_add.c
M	source/blender/editors/space_node/node_buttons.c
M	source/blender/editors/space_node/node_edit.c
M	source/blender/editors/space_node/node_group.c
M	source/blender/editors/space_node/node_intern.h
M	source/blender/editors/space_node/node_toolbar.c
M	source/blender/editors/space_node/space_node.c
M	source/blender/editors/space_outliner/outliner_edit.c
M	source/blender/editors/space_outliner/space_outliner.c
M	source/blender/editors/space_sequencer/sequencer_buttons.c
M	source/blender/editors/space_sequencer/sequencer_edit.c
M	source/blender/editors/space_sequencer/sequencer_intern.h
M	source/blender/editors/space_sequencer/sequencer_modifier.c
M	source/blender/editors/space_sequencer/sequencer_view.c
M	source/blender/editors/space_sequencer/space_sequencer.c
M	source/blender/editors/space_text/space_text.c
M	source/blender/editors/space_text/text_header.c
M	source/blender/editors/space_text/text_intern.h
M	source/blender/editors/space_text/text_ops.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/space_view3d/view3d_buttons.c
M	source/blender/editors/space_view3d/view3d_edit.c
M	source/blender/editors/space_view3d/view3d_header.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/editors/space_view3d/view3d_view.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_ops.c
M	source/blender/editors/undo/ed_undo.c
M	source/blender/editors/util/ed_transverts.c
M	source/blender/editors/uvedit/uvedit_buttons.c
M	source/blender/editors/uvedit/uvedit_ops.c
M	source/blender/editors/uvedit/uvedit_unwrap_ops.c
M	source/blender/makesdna/DNA_windowmanager_types.h
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/RNA_enum_types.h
M	source/blender/makesrna/intern/rna_access.c
M	source/blender/makesrna/intern/rna_action.c
M	source/blender/makesrna/intern/rna_animation.c
M	source/blender/makesrna/intern/rna_constraint.c
M	source/blender/makesrna/intern/rna_curve.c
M	source/blender/makesrna/intern/rna_internal.h
M	source/blender/makesrna/intern/rna_internal_types.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c
M	source/blender/makesrna/intern/rna_sequencer.c
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/makesrna/intern/rna_ui.c
M	source/blender/makesrna/intern/rna_wm.c
M	source/blender/nodes/composite/node_composite_util.c
M	source/blender/nodes/composite/node_composite_util.h
M	source/blender/nodes/composite/nodes/node_composite_image.c
M	source/blender/nodes/intern/node_common.c
M	source/blender/nodes/intern/node_common.h
M	source/blender/nodes/shader/node_shader_tree.c
M	source/blender/nodes/shader/node_shader_util.c
M	source/blender/nodes/shader/node_shader_util.h
M	source/blender/nodes/texture/node_texture_util.c
M	source/blender/nodes/texture/node_texture_util.h
M	source/blender/python/intern/bpy_props.c
M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/WM_types.h
M	source/blender/windowmanager/intern/wm_dragdrop.c
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_files.c
M	source/blender/windowmanager/intern/wm_files_link.c
M	source/blender/windowmanager/intern/wm_operators.c
M	source/blender/windowmanager/wm.h
M	source/blenderplayer/bad_level_call_stubs/stubs.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index a8459387b14..eca7f82541f 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -202,9 +202,9 @@ typedef struct bNodeType {
 	void (*copyfunc_api)(struct PointerRNA *ptr, struct bNode *src_node);
 
 	/* can this node type be added to a node tree */
-	int (*poll)(struct bNodeType *ntype, struct bNodeTree *nodetree);
+	bool (*poll)(struct bNodeType *ntype, struct bNodeTree *nodetree);
 	/* can this node be added to a node tree */
-	int (*poll_instance)(struct bNode *node, struct bNodeTree *nodetree);
+	bool (*poll_instance)(struct bNode *node, struct bNodeTree *nodetree);
 
 	/* optional handling of link insertion */
 	void (*insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link);
@@ -283,7 +283,7 @@ typedef struct bNodeTreeType {
 	void (*free_node_cache)(struct bNodeTree *ntree, struct bNode *node);
 	void (*foreach_nodeclass)(struct Scene *scene, void *calldata, bNodeClassCallback func);	/* iteration over all node classes */
 	/* Check visibility in the node editor */
-	int (*poll)(const struct bContext *C, struct bNodeTreeType *ntreetype);
+	bool (*poll)(const struct bContext *C, struct bNodeTreeType *ntreetype);
 	/* Select a node tree from the context */
 	void (*get_from_context)(const struct bContext *C, struct bNodeTreeType *ntreetype,
 	                         struct bNodeTree **r_ntree, struct ID **r_id, struct ID **r_from);
@@ -296,7 +296,7 @@ typedef struct bNodeTreeType {
 	/* Tree update. Overrides nodetype->updatetreefunc! */
 	void (*update)(struct bNodeTree *ntree);
 
-	int (*validate_link)(struct bNodeTree *ntree, struct bNodeLink *link);
+	bool (*validate_link)(struct bNodeTree *ntree, struct bNodeLink *link);
 
 	void (*node_add_init)(struct bNodeTree *ntree, struct bNode *bnode);
 
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index 09390ab8776..b33b9e455f1 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -185,7 +185,7 @@ typedef struct PanelType {
 	int flag;
 
 	/* verify if the panel should draw or not */
-	int (*poll)(const struct bContext *C, struct PanelType *pt);
+	bool (*poll)(const struct bContext *C, struct PanelType *pt);
 	/* draw header (optional) */
 	void (*draw_header)(const struct bContext *C, struct Panel *pa);
 	/* draw entirely, view changes should be handled here */
@@ -256,7 +256,7 @@ typedef struct MenuType {
 	const char *description;
 
 	/* verify if the menu should draw or not */
-	int (*poll)(const struct bContext *C, struct MenuType *mt);
+	bool (*poll)(const struct bContext *C, struct MenuType *mt);
 	/* draw entirely, view changes should be handled here */
 	void (*draw)(const struct bContext *C, struct Menu *menu);
 
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 5b279de4d8f..499f92b3878 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -3232,13 +3232,13 @@ static void node_type_base_defaults(bNodeType *ntype)
 }
 
 /* allow this node for any tree type */
-static int node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(ntree))
+static bool node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(ntree))
 {
 	return true;
 }
 
 /* use the basic poll function */
-static int node_poll_instance_default(bNode *node, bNodeTree *ntree)
+static bool node_poll_instance_default(bNode *node, bNodeTree *ntree)
 {
 	return node->typeinfo->poll(node->typeinfo, ntree);
 }
@@ -3431,7 +3431,7 @@ void node_type_compatibility(struct bNodeType *ntype, short compatibility)
 
 /* callbacks for undefined types */
 
-static int node_undefined_poll(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(nodetree))
+static bool node_undefined_poll(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(nodetree))
 {
 	/* this type can not be added deliberately, it's just a placeholder */
 	return false;
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index 1158145ad6b..75557e60e21 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -657,7 +657,7 @@ void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *f
 /* ****************** Operator Utilities ********************************** */
 
 /* poll callback for being in an Animation Editor channels list region */
-static int animedit_poll_channels_active(bContext *C)
+static bool animedit_poll_channels_active(bContext *C)
 {
 	ScrArea *sa = CTX_wm_area(C);
 
@@ -673,7 +673,7 @@ static int animedit_poll_channels_active(bContext *C)
 }
 
 /* poll callback for Animation Editor channels list region + not in NLA-tweakmode for NLA */
-static int animedit_poll_channels_nla_tweakmode_off(bContext *C)
+static bool animedit_poll_channels_nla_tweakmode_off(bContext *C)
 {
 	ScrArea *sa = CTX_wm_area(C);
 	Scene *scene = CTX_data_scene(C);
@@ -1413,7 +1413,7 @@ static void ANIM_OT_channels_move(wmOperatorType *ot)
 
 /* ******************** Group Channel Operator ************************ */
 
-static int animchannels_grouping_poll(bContext *C)
+static bool animchannels_grouping_poll(bContext *C)
 {
 	ScrArea *sa = CTX_wm_area(C);
 	SpaceLink *sl;
@@ -2188,7 +2188,7 @@ static void ANIM_OT_channels_clean_empty(wmOperatorType *ot)
 
 /* ******************* Reenable Disabled Operator ******************* */
 
-static int animchannels_enable_poll(bContext *C)
+static bool animchannels_enable_poll(bContext *C)
 {
 	ScrArea *sa = CTX_wm_area(C);
 
@@ -2262,7 +2262,7 @@ static void ANIM_OT_channels_fcurves_enable(wmOperatorType *ot)
 /* ****************** Find / Set Filter Operator ******************** */
 
 /* XXX: make this generic? */
-static int animchannels_find_poll(bContext *C)
+static bool animchannels_find_poll(bContext *C)
 {
 	ScrArea *sa = CTX_wm_area(C);
 
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 2450d0740f2..88166ac65c8 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -492,7 +492,7 @@ void ED_markers_draw(const bContext *C, int flag)
 /* ------------------------ */
 
 /* special poll() which checks if there are selected markers first */
-static int ed_markers_poll_selected_markers(bContext *C)
+static bool ed_markers_poll_selected_markers(bContext *C)
 {
 	ListBase *markers = ED_context_get_markers(C);
 
@@ -504,7 +504,7 @@ static int ed_markers_poll_selected_markers(bContext *C)
 	return ED_markers_get_first_selected(markers) != NULL;
 }
 
-static int ed_markers_poll_selected_no_locked_markers(bContext *C)
+static bool ed_markers_poll_selected_no_locked_markers(bContext *C)
 {
 	ListBase *markers = ED_context_get_markers(C);
 	ToolSettings *ts = CTX_data_tool_settings(C);
@@ -522,7 +522,7 @@ static int ed_markers_poll_selected_no_locked_markers(bContext *C)
 
 
 /* special poll() which checks if there are any markers at all first */
-static int ed_markers_poll_markers_exist(bContext *C)
+static bool ed_markers_poll_markers_exist(bContext *C)
 {
 	ListBase *markers = ED_context_get_markers(C);
 	ToolSettings *ts = CTX_data_tool_settings(C);
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index ea8ba76ffb6..8612f5944bb 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -64,7 +64,7 @@
 /* ********************** frame change operator ***************************/
 
 /* Check if the operator can be run from the current context */
-static int change_frame_poll(bContext *C)
+static bool change_frame_poll(bContext *C)
 {
 	ScrArea *sa = CTX_wm_area(C);
 
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index be9875ef95a..3e4e3a551fe 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -806,7 +806,7 @@ static const EnumPropertyItem *driver_mapping_type_itemsf(bContext *C, PointerRN
 
 /* Add Driver Button Operator ------------------------ */
 
-static int add_driver_button_poll(bContext *C)
+static bool add_driver_button_poll(bContext *C)
 {
 	PointerRNA ptr = {{NULL}};
 	PropertyRNA *prop = NULL;
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 6386ad09e80..f7cfec4d48a 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1312,7 +1312,7 @@ enum {
  * This is based on the standard ED_operator_areaactive callback,
  * except that it does special checks for a few spacetypes too...
  */
-static int modify_key_op_poll(bContext *C)
+static bool modify_key_op_poll(bContext *C)
 {
 	ScrArea *sa = CTX_wm_area(C);
 	Scene *scene = CTX_data_scene(C);
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index a2a384832be..5e4db3ca61c 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -73,14 +73,14 @@
  */
 
 /* poll callback for adding default KeyingSet */
-static int keyingset_poll_default_add(bContext *C)
+static bool keyingset_poll_default_add(bContext *C)
 {
 	/* as long as there's an active Scene, it's fine */
 	return (CTX_data_scene(C) != NULL);
 }
 
 /* poll callback for editing active KeyingSet */
-static int keyingset_poll_active_edit(bContext *C)
+static bool keyingset_poll_active_edit(bContext *C)
 {
 	Scene *scene = CTX_data_scene(C);
 
@@ -92,7 +92,7 @@ static int keyingset_poll_active_edit(bContext *C)
 }
 
 /* poll callback for editing active KeyingSet Path */
-static int keyingset_poll_activePath_edit(bContext *C)
+static bool keyingset_poll_activePath_edit(bContext *C)
 {
 	Scene *scene = CTX_data_scene(C);
 	KeyingSet *ks;
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index a4e916b8e63..eb72367

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list