[Bf-blender-cvs] [c561e0d] master: Code cleanup: Use enum instead of int in function signatures for bAnimChannelType settings callbacks

Joshua Leung noreply at git.blender.org
Sun May 4 14:24:06 CEST 2014


Commit: c561e0d929dc0b3a164dbebd74c1ff06be585679
Author: Joshua Leung
Date:   Sun May 4 23:19:40 2014 +1200
https://developer.blender.org/rBc561e0d929dc0b3a164dbebd74c1ff06be585679

Code cleanup: Use enum instead of int in function signatures for bAnimChannelType settings callbacks

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

M	source/blender/editors/animation/anim_channels_defines.c
M	source/blender/editors/include/ED_anim_api.h
M	source/blender/editors/space_nla/nla_draw.c

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

diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 8b4b78f..55253c8 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -365,14 +365,14 @@ static bool acf_generic_idfill_name_prop(bAnimListElem *ale, PointerRNA *ptr, Pr
 
 #if 0
 /* channel type has no settings */
-static bool acf_generic_none_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+static bool acf_generic_none_setting_valid(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
 {
 	return false;
 }
 #endif
 
 /* check if some setting exists for this object-based data-expander (datablock only) */
-static bool acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting)
+static bool acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
 {
 	switch (setting) {
 		/* expand is always supported */
@@ -438,14 +438,14 @@ static int acf_summary_icon(bAnimListElem *UNUSED(ale))
 }
 
 /* check if some setting exists for this channel */
-static bool acf_summary_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
+static bool acf_summary_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
 {
 	/* only expanded is supported, as it is used for hiding all stuff which the summary covers */
 	return (setting == ACHANNEL_SETTING_EXPAND);
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_summary_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
+static int acf_summary_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
 {
 	if (setting == ACHANNEL_SETTING_EXPAND) {
 		/* expanded */
@@ -460,7 +460,7 @@ static int acf_summary_setting_flag(bAnimContext *UNUSED(ac), int setting, bool
 }
 
 /* get pointer to the setting */
-static void *acf_summary_setting_ptr(bAnimListElem *ale, int setting, short *type)
+static void *acf_summary_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
 {
 	bAnimContext *ac = (bAnimContext *)ale->data;
 	
@@ -509,7 +509,7 @@ static int acf_scene_icon(bAnimListElem *UNUSED(ale))
 }
 
 /* check if some setting exists for this channel */
-static bool acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting)
+static bool acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
 {
 	switch (setting) {
 		/* muted only in NLA */
@@ -531,7 +531,7 @@ static bool acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale)
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_scene_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
+static int acf_scene_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
 {
 	/* clear extra return data first */
 	*neg = false;
@@ -557,7 +557,7 @@ static int acf_scene_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *n
 }
 
 /* get pointer to the setting */
-static void *acf_scene_setting_ptr(bAnimListElem *ale, int setting, short *type)
+static void *acf_scene_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
 {
 	Scene *scene = (Scene *)ale->data;
 	
@@ -649,7 +649,7 @@ static void acf_object_name(bAnimListElem *ale, char *name)
 }
 
 /* check if some setting exists for this channel */
-static bool acf_object_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+static bool acf_object_setting_valid(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
 {
 	Base *base = (Base *)ale->data;
 	Object *ob = base->object;
@@ -674,7 +674,7 @@ static bool acf_object_setting_valid(bAnimContext *ac, bAnimListElem *ale, int s
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_object_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
+static int acf_object_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
 {
 	/* clear extra return data first */
 	*neg = false;
@@ -700,7 +700,7 @@ static int acf_object_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *
 }
 
 /* get pointer to the setting */
-static void *acf_object_setting_ptr(bAnimListElem *ale, int setting, short *type)
+static void *acf_object_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
 {
 	Base *base = (Base *)ale->data;
 	Object *ob = base->object;
@@ -812,7 +812,7 @@ static bool acf_group_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA
 }
 
 /* check if some setting exists for this channel */
-static bool acf_group_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting)
+static bool acf_group_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
 {
 	/* for now, all settings are supported, though some are only conditionally */
 	switch (setting) {
@@ -830,7 +830,7 @@ static bool acf_group_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale)
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_group_setting_flag(bAnimContext *ac, int setting, bool *neg)
+static int acf_group_setting_flag(bAnimContext *ac, eAnimChannel_Settings setting, bool *neg)
 {
 	/* clear extra return data first */
 	*neg = false;
@@ -866,7 +866,7 @@ static int acf_group_setting_flag(bAnimContext *ac, int setting, bool *neg)
 }
 
 /* get pointer to the setting */
-static void *acf_group_setting_ptr(bAnimListElem *ale, int UNUSED(setting), short *type)
+static void *acf_group_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings UNUSED(setting), short *type)
 {
 	bActionGroup *agrp = (bActionGroup *)ale->data;
 	
@@ -923,7 +923,7 @@ static bool acf_fcurve_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRN
 }
 
 /* check if some setting exists for this channel */
-static bool acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+static bool acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
 {
 	FCurve *fcu = (FCurve *)ale->data;
 	
@@ -950,7 +950,7 @@ static bool acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int s
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_fcurve_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
+static int acf_fcurve_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
 {
 	/* clear extra return data first */
 	*neg = false;
@@ -974,7 +974,7 @@ static int acf_fcurve_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *
 }
 
 /* get pointer to the setting */
-static void *acf_fcurve_setting_ptr(bAnimListElem *ale, int UNUSED(setting), short *type)
+static void *acf_fcurve_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings UNUSED(setting), short *type)
 {
 	FCurve *fcu = (FCurve *)ale->data;
 	
@@ -1010,7 +1010,7 @@ static int acf_fillactd_icon(bAnimListElem *UNUSED(ale))
 }
 
 /* check if some setting exists for this channel */
-static bool acf_fillactd_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
+static bool acf_fillactd_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
 {
 	switch (setting) {
 		/* only select and expand supported */
@@ -1024,7 +1024,7 @@ static bool acf_fillactd_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_fillactd_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
+static int acf_fillactd_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
 {
 	/* clear extra return data first */
 	*neg = false;
@@ -1043,7 +1043,7 @@ static int acf_fillactd_setting_flag(bAnimContext *UNUSED(ac), int setting, bool
 }
 
 /* get pointer to the setting */
-static void *acf_fillactd_setting_ptr(bAnimListElem *ale, int setting, short *type)
+static void *acf_fillactd_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
 {
 	bAction *act = (bAction *)ale->data;
 	AnimData *adt = ale->adt;
@@ -1100,7 +1100,7 @@ static void acf_filldrivers_name(bAnimListElem *UNUSED(ale), char *name)
 
 /* check if some setting exists for this channel */
 // TODO: this could be made more generic
-static bool acf_filldrivers_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
+static bool acf_filldrivers_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting)
 {
 	switch (setting) {
 		/* only expand supported */
@@ -1113,7 +1113,7 @@ static bool acf_filldrivers_setting_valid(bAnimContext *UNUSED(ac), bAnimListEle
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_filldrivers_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
+static int acf_filldrivers_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
 {
 	/* clear extra return data first */
 	*neg = false;
@@ -1129,7 +1129,7 @@ static int acf_filldrivers_setting_flag(bAnimContext *UNUSED(ac), int setting, b
 }
 
 /* get pointer to the setting */
-static void *acf_filldrivers_setting_ptr(bAnimListElem *ale, int setting, short *type)
+static void *acf_filldrivers_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
 {
 	AnimData *adt = (AnimData *)ale->data;
 	
@@ -1174,7 +1174,7 @@ static int acf_dsmat_icon(bAnimListElem *UNUSED(ale))
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dsmat_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
+static int acf_dsmat_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg)
 {
 	/* clear extra return data first */
 	*neg = false;
@@ -1199,7 +1199,7 @@ static int acf_dsmat_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *n
 }
 
 /* get pointer to the setting */

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list