[Bf-blender-cvs] [6734936] master: RNA API: use bool's for enum itemf callbacks.

Campbell Barton noreply at git.blender.org
Sat Jan 4 08:10:56 CET 2014


Commit: 6734936c13b379e299bfb45915a99b605ae450c6
Author: Campbell Barton
Date:   Sat Jan 4 18:08:43 2014 +1100
https://developer.blender.org/rB6734936c13b379e299bfb45915a99b605ae450c6

RNA API: use bool's for enum itemf callbacks.

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

M	source/blender/editors/animation/keyingsets.c
M	source/blender/editors/armature/pose_lib.c
M	source/blender/editors/curve/editcurve.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/include/ED_keyframing.h
M	source/blender/editors/include/ED_object.h
M	source/blender/editors/interface/interface.c
M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/mesh/editmesh_select.c
M	source/blender/editors/mesh/editmesh_tools.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_modifier.c
M	source/blender/editors/object/object_relations.c
M	source/blender/editors/object/object_vgroup.c
M	source/blender/editors/physics/rigidbody_object.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/space_node/node_add.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/RNA_enum_types.h
M	source/blender/makesrna/RNA_types.h
M	source/blender/makesrna/intern/rna_access.c
M	source/blender/makesrna/intern/rna_actuator.c
M	source/blender/makesrna/intern/rna_brush.c
M	source/blender/makesrna/intern/rna_color.c
M	source/blender/makesrna/intern/rna_constraint.c
M	source/blender/makesrna/intern/rna_curve.c
M	source/blender/makesrna/intern/rna_dynamicpaint.c
M	source/blender/makesrna/intern/rna_image.c
M	source/blender/makesrna/intern/rna_internal.h
M	source/blender/makesrna/intern/rna_internal_types.h
M	source/blender/makesrna/intern/rna_main_api.c
M	source/blender/makesrna/intern/rna_material.c
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/makesrna/intern/rna_object_force.c
M	source/blender/makesrna/intern/rna_particle.c
M	source/blender/makesrna/intern/rna_rna.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/makesrna/intern/rna_screen.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c
M	source/blender/makesrna/intern/rna_sensor.c
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/makesrna/intern/rna_texture.c
M	source/blender/makesrna/intern/rna_ui_api.c
M	source/blender/makesrna/intern/rna_userdef.c
M	source/blender/makesrna/intern/rna_wm.c
M	source/blender/python/intern/bpy_props.c
M	source/blender/python/intern/bpy_rna.c
M	source/blender/windowmanager/intern/wm_operators.c

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

diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index ebe8dcc..8d8290f 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -712,7 +712,7 @@ KeyingSet *ANIM_get_keyingset_for_autokeying(Scene *scene, const char *tranformK
 /* Menu of All Keying Sets ----------------------------- */
 
 /* Dynamically populate an enum of Keying Sets */
-EnumPropertyItem *ANIM_keying_sets_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
+EnumPropertyItem *ANIM_keying_sets_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 {
 	Scene *scene = CTX_data_scene(C);
 	KeyingSet *ks;
@@ -772,7 +772,7 @@ EnumPropertyItem *ANIM_keying_sets_enum_itemf(bContext *C, PointerRNA *UNUSED(pt
 	}
 
 	RNA_enum_item_end(&item, &totitem);
-	*free = 1;
+	*r_free = true;
 
 	return item;
 }
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c
index ce10214..3a9dd3c 100644
--- a/source/blender/editors/armature/pose_lib.c
+++ b/source/blender/editors/armature/pose_lib.c
@@ -499,7 +499,7 @@ void POSELIB_OT_pose_add(wmOperatorType *ot)
 /* ----- */
 
 /* can be called with C == NULL */
-static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 {
 	Object *ob = get_poselib_object(C);
 	bAction *act = (ob) ? ob->poselib : NULL;
@@ -524,7 +524,7 @@ static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUS
 	}
 
 	RNA_enum_item_end(&item, &totitem);
-	*free = 1;
+	*r_free = true;
 
 	return item;
 }
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 6664433..b82142a 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -6469,7 +6469,7 @@ static EnumPropertyItem curve_delete_type_items[] = {
 };
 
 static EnumPropertyItem *rna_curve_delete_type_itemf(bContext *C, PointerRNA *UNUSED(ptr),
-                                                            PropertyRNA *UNUSED(prop), int *free)
+                                                            PropertyRNA *UNUSED(prop), bool *r_free)
 {
 	EnumPropertyItem *item = NULL;
 	int totitem = 0;
@@ -6480,7 +6480,7 @@ static EnumPropertyItem *rna_curve_delete_type_itemf(bContext *C, PointerRNA *UN
 	RNA_enum_items_add_value(&item, &totitem, curve_delete_type_items, CURVE_VERTEX);
 	RNA_enum_items_add_value(&item, &totitem, curve_delete_type_items, CURVE_SEGMENT);
 	RNA_enum_item_end(&item, &totitem);
-	*free = true;
+	*r_free = true;
 
 	return item;
 }
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 0298699..715b771 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -429,9 +429,8 @@ static EnumPropertyItem prop_gpencil_convert_timingmodes[] = {
 };
 
 static EnumPropertyItem *rna_GPConvert_mode_items(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop),
-                                                  int *free)
+                                                  bool *UNUSED(r_free))
 {
-	*free = FALSE;
 	if (RNA_boolean_get(ptr, "use_timing_data")) {
 		return prop_gpencil_convert_timingmodes;
 	}
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index 82cf216..b9ad597 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -221,7 +221,7 @@ int ANIM_scene_get_keyingset_index(struct Scene *scene, struct KeyingSet *ks);
 struct KeyingSet *ANIM_get_keyingset_for_autokeying(struct Scene *scene, const char *tranformKSName);
 
 /* Dynamically populate an enum of Keying Sets */
-struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free);
+struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free);
 
 /* Check if KeyingSet can be used in the current context */
 short ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks);
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index 4155dbb..a8711e8 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -216,7 +216,7 @@ struct EnumPropertyItem *ED_object_vgroup_selection_itemf_helper(
         const struct bContext *C,
         struct PointerRNA *ptr,
         struct PropertyRNA *prop,
-        int *free,
+        bool *r_free,
         const unsigned int selection_mask);
 
 void ED_object_check_force_modifiers(struct Main *bmain, struct Scene *scene, struct Object *object);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index af303e8..e6e1752 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2956,7 +2956,8 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
 		if (type == MENU && proptype == PROP_ENUM) {
 			EnumPropertyItem *item;
 			DynStr *dynstr;
-			int i, totitem, value, free;
+			int i, totitem, value;
+			bool free;
 
 			RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free);
 			value = RNA_property_enum_get(ptr, prop);
@@ -2989,7 +2990,7 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
 		}
 		else if (ELEM(type, ROW, LISTROW) && proptype == PROP_ENUM) {
 			EnumPropertyItem *item, *item_array = NULL;
-			int free;
+			bool free;
 
 			/* get untranslated, then translate the single string we need */
 			RNA_property_enum_items(block->evil_C, ptr, prop, &item_array, NULL, &free);
@@ -3904,7 +3905,7 @@ static void operator_enum_search_cb(const struct bContext *C, void *but, const c
 	else {
 		PointerRNA *ptr = uiButGetOperatorPtrRNA(but);  /* Will create it if needed! */
 		EnumPropertyItem *item, *item_array;
-		int do_free;
+		bool do_free;
 
 		RNA_property_enum_items((bContext *)C, ptr, prop, &item_array, NULL, &do_free);
 
@@ -3986,7 +3987,8 @@ void uiButGetStrInfo(bContext *C, uiBut *but, ...)
 	uiStringInfo *si;
 
 	EnumPropertyItem *items = NULL, *item = NULL;
-	int totitems, free_items = FALSE;
+	int totitems;
+	bool free_items = false;
 
 	va_start(args, but);
 	while ((si = (uiStringInfo *) va_arg(args, void *))) {
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 9944f72..c884235 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -547,7 +547,8 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt
 	uiBut *but;
 	EnumPropertyItem *item, *item_array;
 	const char *name;
-	int itemw, icon, value, free;
+	int itemw, icon, value;
+	bool free;
 
 	RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item_array, NULL, &free);
 
@@ -798,7 +799,7 @@ PointerRNA uiItemFullO(uiLayout *layout, const char *opname, const char *name, i
 static const char *ui_menu_enumpropname(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int retval)
 {
 	EnumPropertyItem *item;
-	int free;
+	bool free;
 	const char *name;
 
 	RNA_property_enum_items(layout->root->block->evil_C, ptr, prop, &item, NULL, &free);
@@ -877,7 +878,7 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname
 
 	if (prop && RNA_property_type(prop) == PROP_ENUM) {
 		EnumPropertyItem *item, *item_array = NULL;
-		int free;
+		bool free;
 		uiLayout *split = uiLayoutSplit(layout, 0.0f, false);
 		uiLayout *column = uiLayoutColumn(split, false);
 
@@ -979,7 +980,8 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char
 	PropertyRNA *prop;
 
 	EnumPropertyItem *item;
-	int value, free;
+	int value;
+	bool free;
 
 	UI_OPERATOR_ERROR_RET(ot, opname, return );
 
@@ -1096,7 +1098,7 @@ static void ui_item_rna_size(uiLayout *layout, const char *name, int icon, Point
 		else if (type == PROP_ENUM) {
 			/* Find the longest enum item name, instead of using a dummy text! */
 			EnumPropertyItem *item, *item_array;
-			int free;
+			bool free;
 
 			RNA_property_enum_items_gettexted(layout->root->block->evil_C, ptr, prop, &item_array, NULL, &free);
 			for (item = item_array; item->identifier; item++) {
@@ -1272,7 +1274,8 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *pr
 {
 	PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
 	EnumPropertyItem *item;
-	int ivalue, a, free;
+	int ivalue, a;
+	bool free;
 
 	if (!prop || RNA_property_type(prop) != PROP_ENUM) {
 		ui_item_disabled(layout, propname);
@@ -1325,7 +1328,8 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname
 	}
 	else {
 		EnumPropertyItem *item;
-		int totitem, i, free;
+		int totitem, i;
+		bool free;
 		uiLayout *split = uiLayoutSplit(layout, 0.0f, false);
 		uiLayout *column = uiLayoutColumn(split, false);
 
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 4ab57e3..92a6213 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1584,7 +1584,8 @@ static uiBlock *icon_view_menu(bContext *C, ARegion *ar, void *arg_litem)
 	uiBut *but;
 	int icon;
 	EnumPropertyItem *item;
-	int a, free;
+	int a;
+	bool free;
 
 	/* arg_litem is malloced, can be freed by parent button */
 	cb = *((RNAUpdateCb *)arg_litem);
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index e429e43..f13ca36 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/ed

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list