[Bf-blender-cvs] [097a375] master: Code cleanup: use bool

Campbell Barton noreply at git.blender.org
Mon Mar 31 14:39:49 CEST 2014


Commit: 097a3756c009f5cd9764c5ac1af14d80c2ebbfac
Author: Campbell Barton
Date:   Mon Mar 31 23:39:08 2014 +1100
https://developer.blender.org/rB097a3756c009f5cd9764c5ac1af14d80c2ebbfac

Code cleanup: use bool

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

M	source/blender/blenkernel/BKE_node.h
M	source/blender/blenkernel/BKE_object.h
M	source/blender/blenkernel/BKE_sequencer.h
M	source/blender/blenkernel/intern/node.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/sequencer.c
M	source/blender/blenlib/BLI_string_cursor_utf8.h
M	source/blender/blenlib/intern/string_cursor_utf8.c
M	source/blender/editors/animation/keyframing.c
M	source/blender/editors/armature/armature_edit.c
M	source/blender/editors/armature/armature_skinning.c
M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/include/ED_armature.h
M	source/blender/editors/include/ED_gpencil.h
M	source/blender/editors/include/ED_image.h
M	source/blender/editors/include/ED_keyframing.h
M	source/blender/editors/include/ED_node.h
M	source/blender/editors/include/ED_object.h
M	source/blender/editors/object/object_ops.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_intern.h
M	source/blender/editors/space_image/image_draw.c
M	source/blender/editors/space_image/image_intern.h
M	source/blender/editors/space_node/node_view.c
M	source/blender/windowmanager/wm_event_types.h

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

diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index af912b9..dc12213 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -469,7 +469,7 @@ int             nodeFindNode(struct bNodeTree *ntree, struct bNodeSocket *sock,
 struct bNodeLink *nodeFindLink(struct bNodeTree *ntree, struct bNodeSocket *from, struct bNodeSocket *to);
 int             nodeCountSocketLinks(struct bNodeTree *ntree, struct bNodeSocket *sock);
 
-void			nodeSetSelected(struct bNode *node, int select);
+void            nodeSetSelected(struct bNode *node, bool select);
 void            nodeSetActive(struct bNodeTree *ntree, struct bNode *node);
 struct bNode   *nodeGetActive(struct bNodeTree *ntree);
 struct bNode   *nodeGetActiveID(struct bNodeTree *ntree, short idtype);
@@ -520,7 +520,7 @@ int                    BKE_node_instance_hash_size(bNodeInstanceHash *hash);
 
 void                   BKE_node_instance_hash_clear_tags(bNodeInstanceHash *hash);
 void                   BKE_node_instance_hash_tag(bNodeInstanceHash *hash, void *value);
-int                    BKE_node_instance_hash_tag_key(bNodeInstanceHash *hash, bNodeInstanceKey key);
+bool                   BKE_node_instance_hash_tag_key(bNodeInstanceHash *hash, bNodeInstanceKey key);
 void                   BKE_node_instance_hash_remove_untagged(bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp);
 
 typedef GHashIterator bNodeInstanceHashIterator;
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index c1a76b6..ef28484 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -55,7 +55,7 @@ void BKE_object_workob_clear(struct Object *workob);
 void BKE_object_workob_calc_parent(struct Scene *scene, struct Object *ob, struct Object *workob);
 
 void BKE_object_transform_copy(struct Object *ob_tar, const struct Object *ob_src);
-struct SoftBody *copy_softbody(struct SoftBody *sb, int copy_caches);
+struct SoftBody *copy_softbody(struct SoftBody *sb, bool copy_caches);
 struct BulletSoftBody *copy_bulletsoftbody(struct BulletSoftBody *sb);
 void BKE_object_copy_particlesystems(struct Object *obn, struct Object *ob);
 void BKE_object_copy_softbody(struct Object *obn, struct Object *ob);
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h
index 4cca918..17193bb 100644
--- a/source/blender/blenkernel/BKE_sequencer.h
+++ b/source/blender/blenkernel/BKE_sequencer.h
@@ -331,7 +331,7 @@ bool BKE_sequence_is_valid_check(struct Sequence *seq);
 
 void BKE_sequencer_clear_scene_in_allseqs(struct Main *bmain, struct Scene *sce);
 
-struct Sequence *BKE_sequence_get_by_name(struct ListBase *seqbase, const char *name, int recursive);
+struct Sequence *BKE_sequence_get_by_name(struct ListBase *seqbase, const char *name, bool recursive);
 
 /* api for adding new sequence strips */
 typedef struct SeqLoadInfo {
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index d8d83cb..b2d6988 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -2425,7 +2425,7 @@ void nodeClearActiveID(bNodeTree *ntree, short idtype)
 			node->flag &= ~NODE_ACTIVE_ID;
 }
 
-void nodeSetSelected(bNode *node, int select)
+void nodeSetSelected(bNode *node, bool select)
 {
 	if (select) {
 		node->flag |= NODE_SELECT;
@@ -2757,7 +2757,7 @@ void BKE_node_instance_hash_tag(bNodeInstanceHash *UNUSED(hash), void *value)
 	entry->tag = 1;
 }
 
-int BKE_node_instance_hash_tag_key(bNodeInstanceHash *hash, bNodeInstanceKey key)
+bool BKE_node_instance_hash_tag_key(bNodeInstanceHash *hash, bNodeInstanceKey key)
 {
 	bNodeInstanceHashEntry *entry = BKE_node_instance_hash_lookup(hash, key);
 	
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index be91cb5..6a0ed27 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1181,7 +1181,7 @@ struct Object *BKE_object_lod_matob_get(Object *ob, Scene *scene)
 	return lod_ob_get(ob, scene, OB_LOD_USE_MAT);
 }
 
-SoftBody *copy_softbody(SoftBody *sb, int copy_caches)
+SoftBody *copy_softbody(SoftBody *sb, bool copy_caches)
 {
 	SoftBody *sbn;
 	
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 82d46fe..13d22cc 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -4109,7 +4109,7 @@ static void seq_free_animdata(Scene *scene, Sequence *seq)
 	}
 }
 
-Sequence *BKE_sequence_get_by_name(ListBase *seqbase, const char *name, int recursive)
+Sequence *BKE_sequence_get_by_name(ListBase *seqbase, const char *name, bool recursive)
 {
 	Sequence *iseq = NULL;
 	Sequence *rseq = NULL;
diff --git a/source/blender/blenlib/BLI_string_cursor_utf8.h b/source/blender/blenlib/BLI_string_cursor_utf8.h
index 4591066..b4d354b 100644
--- a/source/blender/blenlib/BLI_string_cursor_utf8.h
+++ b/source/blender/blenlib/BLI_string_cursor_utf8.h
@@ -41,8 +41,8 @@ typedef enum strCursorJumpDirection {
 	STRCUR_DIR_NEXT
 } strCursorJumpDirection;
 
-int BLI_str_cursor_step_next_utf8(const char *str, size_t maxlen, int *pos);
-int BLI_str_cursor_step_prev_utf8(const char *str, size_t maxlen, int *pos);
+bool BLI_str_cursor_step_next_utf8(const char *str, size_t maxlen, int *pos);
+bool BLI_str_cursor_step_prev_utf8(const char *str, size_t maxlen, int *pos);
 
 void BLI_str_cursor_step_utf8(const char *str, size_t maxlen,
                               int *pos, strCursorJumpDirection direction,
diff --git a/source/blender/blenlib/intern/string_cursor_utf8.c b/source/blender/blenlib/intern/string_cursor_utf8.c
index 2d2c03a..57913af 100644
--- a/source/blender/blenlib/intern/string_cursor_utf8.c
+++ b/source/blender/blenlib/intern/string_cursor_utf8.c
@@ -116,7 +116,7 @@ static strCursorDelimType cursor_delim_type_utf8(const char *ch_utf8)
 	return cursor_delim_type_unicode(uch);
 }
 
-int BLI_str_cursor_step_next_utf8(const char *str, size_t maxlen, int *pos)
+bool BLI_str_cursor_step_next_utf8(const char *str, size_t maxlen, int *pos)
 {
 	const char *str_end = str + (maxlen + 1);
 	const char *str_pos = str + (*pos);
@@ -132,7 +132,7 @@ int BLI_str_cursor_step_next_utf8(const char *str, size_t maxlen, int *pos)
 	return FALSE;
 }
 
-int BLI_str_cursor_step_prev_utf8(const char *str, size_t UNUSED(maxlen), int *pos)
+bool BLI_str_cursor_step_prev_utf8(const char *str, size_t UNUSED(maxlen), int *pos)
 {
 	if ((*pos) > 0) {
 		const char *str_pos = str + (*pos);
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 069f661..c2d8332 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -843,7 +843,7 @@ static float visualkey_get_value(PointerRNA *ptr, PropertyRNA *prop, int array_i
  *	the keyframe insertion. These include the 'visual' keyframing modes, quick refresh,
  *	and extra keyframe filtering.
  */
-short insert_keyframe_direct(ReportList *reports, PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, float cfra, short flag)
+bool insert_keyframe_direct(ReportList *reports, PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, float cfra, short flag)
 {
 	float curval = 0.0f;
 	
@@ -2049,7 +2049,7 @@ short id_frame_has_keyframe(ID *id, float frame, short filter)
 
 /* ************************************************** */
 
-int ED_autokeyframe_object(bContext *C, Scene *scene, Object *ob, KeyingSet *ks)
+bool ED_autokeyframe_object(bContext *C, Scene *scene, Object *ob, KeyingSet *ks)
 {
 	/* auto keyframing */
 	if (autokeyframe_cfra_can_key(scene, &ob->id)) {
@@ -2071,7 +2071,7 @@ int ED_autokeyframe_object(bContext *C, Scene *scene, Object *ob, KeyingSet *ks)
 	}
 }
 
-int ED_autokeyframe_pchan(bContext *C, Scene *scene, Object *ob, bPoseChannel *pchan, KeyingSet *ks)
+bool ED_autokeyframe_pchan(bContext *C, Scene *scene, Object *ob, bPoseChannel *pchan, KeyingSet *ks)
 {
 	if (autokeyframe_cfra_can_key(scene, &ob->id)) {
 		ListBase dsources = {NULL, NULL};
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index db57e76..63869f5 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -200,7 +200,7 @@ void ED_armature_origin_set(Scene *scene, Object *ob, float cursor[3], int cente
 /* adjust bone roll to align Z axis with vector
  * vec is in local space and is normalized
  */
-float ED_rollBoneToVector(EditBone *bone, const float align_axis[3], const short axis_only)
+float ED_rollBoneToVector(EditBone *bone, const float align_axis[3], const bool axis_only)
 {
 	float mat[3][3], nor[3];
 
diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c
index 2a36885..e3059e1 100644
--- a/source/blender/editors/armature/armature_skinning.c
+++ b/source/blender/editors/armature/armature_skinning.c
@@ -235,7 +235,7 @@ static void envelope_bone_weighting(Object *ob, Mesh *mesh, float (*verts)[3], i
 	}
 }
 
-static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object *par, int heat, int mirror)
+static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object *par, int heat, bool mirror)
 {
 	/* This functions implements the automatic computation of vertex group
 	 * weights, either through envelopes or using a heat equilibrium.
@@ -415,7 +415,7 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
 	MEM_freeN(verts);
 }
 
-void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob, Object *par, int mode, int mirror)
+void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob, Object *par, int mode, bool mirror)
 {
 	/* Lets try to create some vertex groups 
 	 * based on the bones of the parent armature.
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 971ab4d..c10f081 10064

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list