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

Campbell Barton noreply at git.blender.org
Fri Apr 11 03:33:52 CEST 2014


Commit: a15b3c4d111613993eca23d5f99600c2052469e7
Author: Campbell Barton
Date:   Fri Apr 11 11:25:41 2014 +1000
https://developer.blender.org/rBa15b3c4d111613993eca23d5f99600c2052469e7

Code cleanup: use bool

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

M	source/blender/blenfont/intern/blf_font.c
M	source/blender/blenkernel/BKE_animsys.h
M	source/blender/blenkernel/BKE_constraint.h
M	source/blender/blenkernel/BKE_nla.h
M	source/blender/blenkernel/intern/anim_sys.c
M	source/blender/blenkernel/intern/constraint.c
M	source/blender/blenkernel/intern/fcurve.c
M	source/blender/blenkernel/intern/lattice.c
M	source/blender/blenkernel/intern/library_query.c
M	source/blender/blenkernel/intern/mball.c
M	source/blender/blenkernel/intern/mesh_validate.c
M	source/blender/blenkernel/intern/nla.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/pbvh_bmesh.c
M	source/blender/blenkernel/intern/pbvh_intern.h
M	source/blender/blenkernel/intern/smoke.c
M	source/blender/blenkernel/intern/text.c
M	source/blender/blenlib/intern/scanfill_utils.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/bmesh/operators/bmo_edgenet.c
M	source/blender/editors/animation/anim_channels_edit.c
M	source/blender/editors/animation/anim_draw.c
M	source/blender/editors/animation/fmodifier_ui.c
M	source/blender/editors/animation/keyframes_edit.c
M	source/blender/editors/armature/pose_edit.c
M	source/blender/editors/armature/pose_lib.c
M	source/blender/editors/curve/editcurve.c
M	source/blender/editors/curve/editfont.c
M	source/blender/editors/include/ED_anim_api.h
M	source/blender/editors/interface/interface.c
M	source/blender/editors/interface/interface_draw.c
M	source/blender/editors/mask/mask_ops.c
M	source/blender/editors/mask/mask_select.c
M	source/blender/editors/mesh/editmesh_select.c
M	source/blender/editors/mesh/editmesh_tools.c
M	source/blender/editors/mesh/meshtools.c
M	source/blender/editors/metaball/mball_edit.c
M	source/blender/editors/object/object_add.c
M	source/blender/editors/object/object_edit.c
M	source/blender/editors/object/object_group.c
M	source/blender/editors/object/object_hook.c
M	source/blender/editors/object/object_transform.c
M	source/blender/editors/render/render_opengl.c
M	source/blender/editors/render/render_preview.c
M	source/blender/editors/render/render_update.c
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/sculpt_paint/paint_utils.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_undo.c
M	source/blender/editors/space_clip/tracking_ops.c
M	source/blender/editors/space_console/console_ops.c
M	source/blender/editors/space_file/file_ops.c
M	source/blender/editors/space_graph/graph_edit.c
M	source/blender/editors/space_image/image_buttons.c
M	source/blender/editors/space_image/image_ops.c
M	source/blender/editors/space_logic/logic_window.c
M	source/blender/editors/space_nla/nla_edit.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_relationships.c
M	source/blender/editors/space_node/node_view.c
M	source/blender/editors/space_sequencer/sequencer_add.c
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/editors/space_sequencer/sequencer_edit.c
M	source/blender/editors/space_sequencer/sequencer_select.c
M	source/blender/editors/space_text/text_ops.c
M	source/blender/editors/space_view3d/view3d_ruler.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/editors/space_view3d/view3d_snap.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/transform/transform_manipulator.c
M	source/blender/editors/transform/transform_orientations.c
M	source/blender/editors/uvedit/uvedit_ops.c
M	source/blender/gpu/GPU_material.h
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/imbuf/IMB_imbuf.h
M	source/blender/imbuf/intern/divers.c
M	source/blender/imbuf/intern/filter.c
M	source/blender/imbuf/intern/targa.c
M	source/blender/makesrna/intern/makesrna.c
M	source/blender/python/intern/bpy_rna_array.c
M	source/blender/render/intern/source/convertblender.c

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

diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 324d20b..a06f4a2 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -150,7 +150,7 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
 
 
 #define BLF_KERNING_VARS(_font, _has_kerning, _kern_mode)                        \
-	const short _has_kerning = FT_HAS_KERNING((_font)->face);                    \
+	const bool _has_kerning = FT_HAS_KERNING((_font)->face);                     \
 	const FT_UInt _kern_mode = (_has_kerning == 0) ? 0 :                         \
 	                         (((_font)->flags & BLF_KERNING_DEFAULT) ?           \
 	                          ft_kerning_default : FT_KERNING_UNFITTED)          \
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h
index a0ec6c7..80d2750 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -48,7 +48,7 @@ struct AnimMapper;
 /* AnimData API */
 
 /* Check if the given ID-block can have AnimData */
-short id_type_can_have_animdata(struct ID *id);
+bool id_type_can_have_animdata(struct ID *id);
 
 /* Get AnimData from the given ID-block */
 struct AnimData *BKE_animdata_from_id(struct ID *id);
@@ -57,7 +57,7 @@ struct AnimData *BKE_animdata_from_id(struct ID *id);
 struct AnimData *BKE_id_add_animdata(struct ID *id);
 
 /* Set active action used by AnimData from the given ID-block */
-short BKE_animdata_set_action(struct ReportList *reports, struct ID *id, struct bAction *act);
+bool BKE_animdata_set_action(struct ReportList *reports, struct ID *id, struct bAction *act);
 
 /* Free AnimData */
 void BKE_free_animdata(struct ID *id);
@@ -66,7 +66,7 @@ void BKE_free_animdata(struct ID *id);
 struct AnimData *BKE_copy_animdata(struct AnimData *adt, const bool do_action);
 
 /* Copy AnimData */
-int BKE_copy_animdata_id(struct ID *id_to, struct ID *id_from, const bool do_action);
+bool BKE_copy_animdata_id(struct ID *id_to, struct ID *id_from, const bool do_action);
 
 /* Copy AnimData Actions */
 void BKE_copy_animdata_id_action(struct ID *id);
@@ -106,12 +106,12 @@ void BKE_keyingsets_free(struct ListBase *list);
 
 /* Fix all the paths for the the given ID + Action */
 void BKE_action_fix_paths_rename(struct ID *owner_id, struct bAction *act, const char *prefix, const char *oldName,
-                                 const char *newName, int oldSubscript, int newSubscript, int verify_paths);
+                                 const char *newName, int oldSubscript, int newSubscript, bool verify_paths);
 
 /* Fix all the paths for the given ID+AnimData */
 void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, struct ID *ref_id, const char *prefix,
                                    const char *oldName, const char *newName, int oldSubscript, int newSubscript,
-                                   int verify_paths);
+                                   bool verify_paths);
 
 /* Fix all the paths for the entire database... */
 void BKE_all_animdata_fix_paths_rename(ID *ref_id, const char *prefix, const char *oldName, const char *newName);
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h
index 8a9d358..2aee502 100644
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@ -62,7 +62,7 @@ typedef struct bConstraintOb {
 /* ---------------------------------------------------------------------------- */
 
 /* Callback format for performing operations on ID-pointers for Constraints */
-typedef void (*ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, short isReference, void *userdata);
+typedef void (*ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, bool is_reference, void *userdata);
 
 /* ....... */
 
@@ -98,7 +98,7 @@ typedef struct bConstraintTypeInfo {
 	/* for multi-target constraints: return that list; otherwise make a temporary list (returns number of targets) */
 	int (*get_constraint_targets)(struct bConstraint *con, struct ListBase *list);
 	/* for single-target constraints only: flush data back to source data, and the free memory used */
-	void (*flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, short nocopy);
+	void (*flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, bool no_copy);
 	
 	/* evaluation */
 	/* set the ct->matrix for the given constraint target (at the given ctime) */
@@ -136,12 +136,12 @@ struct bConstraint *BKE_constraints_findByName(struct ListBase *list, const char
 struct bConstraint *BKE_add_ob_constraint(struct Object *ob, const char *name, short type);
 struct bConstraint *BKE_add_pose_constraint(struct Object *ob, struct bPoseChannel *pchan, const char *name, short type);
 
-int BKE_remove_constraint(ListBase *list, struct bConstraint *con);
-void BKE_remove_constraints_type(ListBase *list, short type, short last_only);
+bool BKE_remove_constraint(ListBase *list, struct bConstraint *con);
+void BKE_remove_constraints_type(ListBase *list, short type, bool last_only);
 
 /* Constraints + Proxies function prototypes */
 void BKE_extract_proxylocal_constraints(struct ListBase *dst, struct ListBase *src);
-short BKE_proxylocked_constraints_owner(struct Object *ob, struct bPoseChannel *pchan);
+bool BKE_proxylocked_constraints_owner(struct Object *ob, struct bPoseChannel *pchan);
 
 /* Constraint Evaluation function prototypes */
 struct bConstraintOb *BKE_constraints_make_evalob(struct Scene *scene, struct Object *ob, void *subdata, short datatype);
diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h
index 344797d..7823efc 100644
--- a/source/blender/blenkernel/BKE_nla.h
+++ b/source/blender/blenkernel/BKE_nla.h
@@ -62,13 +62,13 @@ struct NlaStrip *add_nla_soundstrip(struct Scene *scene, struct Speaker *spk);
 bool BKE_nlastrips_has_space(ListBase *strips, float start, float end);
 void BKE_nlastrips_sort_strips(ListBase *strips);
 
-short BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip);
+bool BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip);
 
 
-void BKE_nlastrips_make_metas(ListBase *strips, short temp);
-void BKE_nlastrips_clear_metas(ListBase *strips, short onlySel, short onlyTemp);
+void BKE_nlastrips_make_metas(ListBase *strips, bool is_temp);
+void BKE_nlastrips_clear_metas(ListBase *strips, bool only_sel, bool only_temp);
 void BKE_nlastrips_clear_metastrip(ListBase *strips, struct NlaStrip *strip);
-short BKE_nlameta_add_strip(struct NlaStrip *mstrip, struct NlaStrip *strip);
+bool BKE_nlameta_add_strip(struct NlaStrip *mstrip, struct NlaStrip *strip);
 void BKE_nlameta_flush_transforms(struct NlaStrip *mstrip);
 
 /* ............ */
@@ -81,24 +81,24 @@ void BKE_nlatrack_solo_toggle(struct AnimData *adt, struct NlaTrack *nlt);
 bool BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end);
 void BKE_nlatrack_sort_strips(struct NlaTrack *nlt);
 
-short BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip);
+bool BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip);
 
-short BKE_nlatrack_get_bounds(struct NlaTrack *nlt, float bounds[2]);
+bool BKE_nlatrack_get_bounds(struct NlaTrack *nlt, float bounds[2]);
 
 /* ............ */
 
 struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt);
 void BKE_nlastrip_set_active(struct AnimData *adt, struct NlaStrip *strip);
 
-short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max);
+bool BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max);
 void BKE_nlastrip_recalculate_bounds(struct NlaStrip *strip);
 
 void BKE_nlastrip_validate_name(struct AnimData *adt, struct NlaStrip *strip);
 
 /* ............ */
 
-short BKE_nlatrack_has_animated_strips(struct NlaTrack *nlt);
-short BKE_nlatracks_have_animated_strips(ListBase *tracks);
+bool BKE_nlatrack_has_animated_strips(struct NlaTrack *nlt);
+bool BKE_nlatracks_have_animated_strips(ListBase *tracks);
 void BKE_nlastrip_validate_fcurves(struct NlaStrip *strip);
 
 void BKE_nla_validate_state(struct AnimData *adt);
@@ -107,7 +107,7 @@ void BKE_nla_validate_state(struct AnimData *adt);
 
 void BKE_nla_action_pushdown(struct AnimData *adt);
 
-short BKE_nla_tweakmode_enter(struct AnimData *adt);
+bool BKE_nla_tweakmode_enter(struct AnimData *adt);
 void BKE_nla_tweakmode_exit(struct AnimData *adt);
 
 /* ----------------------------- */
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 8692ff2..8542bd6 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -74,7 +74,7 @@
 /* Getter/Setter -------------------------------------------- */
 
 /* Check if ID can have AnimData */
-short id_type_can_have_animdata(ID *id)
+bool id_type_can_have_animdata(ID *id)
 {
 	/* sanity check */
 	if (id == NULL)
@@ -157,10 +157,10 @@ AnimData *BKE_id_add_animdata(ID *id)
 /* Action Setter --------------------------------------- */
 
 /* Called when user tries to change the active action of an AnimData block (via RNA, Outliner, etc.) */
-short BKE_animdata_set_action(ReportList *reports, ID *id, bAction *act)
+bool BKE_animdata_set_action(ReportList *reports, ID *id, bAction *act)
 {
 	AnimData *adt = BKE_animdata_from_id(id);
-	short ok = 0;
+	bool ok = false;
 	
 	/* animdata validity check */
 	if (adt == NULL) {
@@ -279,7 +279,7 @@ AnimData *BKE_copy_animdata(AnimData *adt, const bool do_action)
 	return dadt;
 }
 
-int BKE_copy_animdata_id(ID *id_to, ID *id_from, const bool do_action)
+bool BKE_copy_animdata_id(ID *id_to, ID *id_from, const bool do_action)
 {
 	AnimData *adt;
 
@@ -567,7 +567,7 @@ static bool check_rna_path_is_valid(ID *owner_id, const char *path)
 /* Check if some given RNA Path needs fixing - free the given path and set a new one as appropriate 
  * NOTE: we assume that oldName and newName have [" "] padding around them
  */
-static char *rna_path_rename_fix(ID *owner_id, const char *prefix, const char *oldName, const char *newName, char *oldpath, int verify_paths)


@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list