[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53231] trunk/blender/source/blender/ editors/animation/anim_filter.c: Code cleanup - Replacing 0/ 1 with boolean constants

Joshua Leung aligorith at gmail.com
Fri Dec 21 06:57:38 CET 2012


Revision: 53231
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53231
Author:   aligorith
Date:     2012-12-21 05:57:37 +0000 (Fri, 21 Dec 2012)
Log Message:
-----------
Code cleanup - Replacing 0/1 with boolean constants

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/anim_filter.c

Modified: trunk/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_filter.c	2012-12-21 05:55:17 UTC (rev 53230)
+++ trunk/blender/source/blender/editors/animation/anim_filter.c	2012-12-21 05:57:37 UTC (rev 53231)
@@ -290,7 +290,7 @@
 short ANIM_animdata_context_getdata(bAnimContext *ac)
 {
 	SpaceLink *sl = ac->sl;
-	short ok = 0;
+	short ok = FALSE;
 	
 	/* context depends on editor we are currently in */
 	if (sl) {
@@ -319,10 +319,7 @@
 	}
 	
 	/* check if there's any valid data */
-	if (ok && ac->data)
-		return 1;
-	else
-		return 0;
+	return (ok && ac->data);
 }
 
 /* Obtain current anim-data context from Blender Context info 
@@ -354,6 +351,7 @@
 	ac->regiontype = (ar) ? ar->regiontype : 0;
 	
 	/* get data context info */
+	// XXX: if the below fails, try to grab this info from context instead... (to allow for scripting)
 	return ANIM_animdata_context_getdata(ac);
 }
 
@@ -913,14 +911,14 @@
 			Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
 			Sequence *seq = NULL;
 			char *seq_name;
-
+			
 			if (ed) {
 				/* get strip name, and check if this strip is selected */
 				seq_name = BLI_str_quoted_substrN(fcu->rna_path, "sequences_all[");
 				seq = BKE_sequence_get_by_name(ed->seqbasep, seq_name, FALSE);
 				if (seq_name) MEM_freeN(seq_name);
 			}
-
+			
 			/* can only add this F-Curve if it is selected */
 			if (ads->filterflag & ADS_FILTER_ONLYSEL) {
 				if ((seq == NULL) || (seq->flag & SELECT) == 0)
@@ -2146,7 +2144,7 @@
 		if ((ntree) && !(ads->filterflag & ADS_FILTER_NONTREE)) {
 			tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, ads, (ID *)sce, ntree, filter_mode);
 		}
-
+		
 		/* TODO: one day, when sequencer becomes its own datatype, perhaps it should be included here */
 	}
 	END_ANIMFILTER_SUBCHANNELS;




More information about the Bf-blender-cvs mailing list