[Bf-blender-cvs] [1d33098] master: More short->bool refactoring work for anim channel type define callbacks

Joshua Leung noreply at git.blender.org
Sat Nov 23 07:00:09 CET 2013


Commit: 1d3309831404d0e0a6dca0bafb8260dbe77f2afa
Author: Joshua Leung
Date:   Sat Nov 23 18:58:45 2013 +1300
http://developer.blender.org/rB1d3309831404d0e0a6dca0bafb8260dbe77f2afa

More short->bool refactoring work for anim channel type define callbacks

Changed the "neg" flag for acf.setting_flag() to be a bool

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

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

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

diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 958f721..75363f4 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -445,16 +445,16 @@ static bool acf_summary_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *U
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_summary_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg)
+static int acf_summary_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	if (setting == ACHANNEL_SETTING_EXPAND) {
 		/* expanded */
-		*neg = 1;
+		*neg = true;
 		return ADS_FLAG_SUMMARY_COLLAPSED;
 	}
 	else {
 		/* unsupported */
-		*neg = 0;
+		*neg = false;
 		return 0;
 	}
 }
@@ -531,24 +531,24 @@ 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, short *neg)
+static int acf_scene_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_SELECT: /* selected */
 			return SCE_DS_SELECTED;
 			
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
-			*neg = 1;
+			*neg = true;
 			return SCE_DS_COLLAPSED;
 			
 		case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
 			return ADT_NLA_EVAL_OFF;
 			
 		case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
-			*neg = 1;
+			*neg = true;
 			return ADT_CURVES_NOT_VISIBLE;
 			
 		default: /* unsupported */
@@ -674,10 +674,10 @@ 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, short *neg)
+static int acf_object_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_SELECT: /* selected */
@@ -691,7 +691,7 @@ static int acf_object_setting_flag(bAnimContext *UNUSED(ac), int setting, short
 			return ADT_NLA_EVAL_OFF;
 			
 		case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
-			*neg = 1;
+			*neg = true;
 			return ADT_CURVES_NOT_VISIBLE;
 			
 		default: /* unsupported */
@@ -830,10 +830,10 @@ 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, short *neg)
+static int acf_group_setting_flag(bAnimContext *ac, int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_SELECT: /* selected */
@@ -854,7 +854,6 @@ static int acf_group_setting_flag(bAnimContext *ac, int setting, short *neg)
 			return AGRP_MUTED;
 			
 		case ACHANNEL_SETTING_PROTECT: /* protected */
-			// *neg = 1; - if we change this to edtiability
 			return AGRP_PROTECTED;
 			
 		case ACHANNEL_SETTING_VISIBLE: /* visibility - graph editor */
@@ -951,10 +950,10 @@ 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, short *neg)
+static int acf_fcurve_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_SELECT: /* selected */
@@ -964,7 +963,6 @@ static int acf_fcurve_setting_flag(bAnimContext *UNUSED(ac), int setting, short
 			return FCURVE_MUTED;
 			
 		case ACHANNEL_SETTING_PROTECT: /* protected */
-			// *neg = 1; - if we change this to edtiability
 			return FCURVE_PROTECTED;
 			
 		case ACHANNEL_SETTING_VISIBLE: /* visibility - graph editor */
@@ -1026,17 +1024,17 @@ 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, short *neg)
+static int acf_fillactd_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_SELECT: /* selected */
 			return ADT_UI_SELECTED;
 			
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
-			*neg = 1;
+			*neg = true;
 			return ACT_COLLAPSED;
 		
 		default: /* unsupported */
@@ -1115,14 +1113,14 @@ 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, short *neg)
+static int acf_filldrivers_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
-			*neg = 1;
+			*neg = true;
 			return ADT_DRIVERS_COLLAPSED;
 		
 		default: /* unsupported */
@@ -1176,10 +1174,10 @@ 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, short *neg)
+static int acf_dsmat_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
@@ -1189,7 +1187,7 @@ static int acf_dsmat_setting_flag(bAnimContext *UNUSED(ac), int setting, short *
 			return ADT_NLA_EVAL_OFF;
 			
 		case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
-			*neg = 1;
+			*neg = true;
 			return ADT_CURVES_NOT_VISIBLE;
 			
 		case ACHANNEL_SETTING_SELECT: /* selected */
@@ -1252,10 +1250,10 @@ static int acf_dslam_icon(bAnimListElem *UNUSED(ale))
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dslam_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg)
+static int acf_dslam_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
@@ -1265,7 +1263,7 @@ static int acf_dslam_setting_flag(bAnimContext *UNUSED(ac), int setting, short *
 			return ADT_NLA_EVAL_OFF;
 			
 		case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
-			*neg = 1;
+			*neg = true;
 			return ADT_CURVES_NOT_VISIBLE;
 			
 		case ACHANNEL_SETTING_SELECT: /* selected */
@@ -1335,10 +1333,10 @@ static short acf_dstex_offset(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(al
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dstex_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg)
+static int acf_dstex_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
@@ -1348,7 +1346,7 @@ static int acf_dstex_setting_flag(bAnimContext *UNUSED(ac), int setting, short *
 			return ADT_NLA_EVAL_OFF;
 			
 		case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
-			*neg = 1;
+			*neg = true;
 			return ADT_CURVES_NOT_VISIBLE;
 			
 		case ACHANNEL_SETTING_SELECT: /* selected */
@@ -1411,10 +1409,10 @@ static int acf_dscam_icon(bAnimListElem *UNUSED(ale))
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dscam_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg)
+static int acf_dscam_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
@@ -1424,7 +1422,7 @@ static int acf_dscam_setting_flag(bAnimContext *UNUSED(ac), int setting, short *
 			return ADT_NLA_EVAL_OFF;
 			
 		case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
-			*neg = 1;
+			*neg = true;
 			return ADT_CURVES_NOT_VISIBLE;
 			
 		case ACHANNEL_SETTING_SELECT: /* selected */
@@ -1497,10 +1495,10 @@ static int acf_dscur_icon(bAnimListElem *ale)
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dscur_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg)
+static int acf_dscur_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
@@ -1510,7 +1508,7 @@ static int acf_dscur_setting_flag(bAnimContext *UNUSED(ac), int setting, short *
 			return ADT_NLA_EVAL_OFF;
 			
 		case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
-			*neg = 1;
+			*neg = true;
 			return ADT_CURVES_NOT_VISIBLE;
 			
 		case ACHANNEL_SETTING_SELECT: /* selected */
@@ -1573,10 +1571,10 @@ static int acf_dsskey_icon(bAnimListElem *UNUSED(ale))
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dsskey_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg)
+static int acf_dsskey_setting_flag(bAnimContext *UNUSED(ac), int setting, bool *neg)
 {
 	/* clear extra return data first */
-	*neg = 0;
+	*neg = false;
 	
 	switch (setting) {
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
@@ -1586,7 +1584,7 @@ static int acf_dsskey_setting_flag(bAnimContext *UNUSED(ac), int setting, short
 			return ADT_NLA_EVAL_OFF;
 			
 		case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
-			*neg = 1;
+			*neg = true;
 			return ADT_CURVES_NOT_VISIBLE;
 			
 		case ACHANNEL_SETTING_SELECT: /* selected */
@@ -1649,10 +1647,10 @@ static int

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list