[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40677] trunk/blender/source/blender/ editors/animation/anim_filter.c: Reverting part of r.40659

Joshua Leung aligorith at gmail.com
Thu Sep 29 01:43:49 CEST 2011


Revision: 40677
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40677
Author:   aligorith
Date:     2011-09-28 23:43:48 +0000 (Wed, 28 Sep 2011)
Log Message:
-----------
Reverting part of r.40659

The output of an automated tool is not a valid excuse for clobbering
code to increase maintenance headaches later on.

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	2011-09-28 19:46:13 UTC (rev 40676)
+++ trunk/blender/source/blender/editors/animation/anim_filter.c	2011-09-28 23:43:48 UTC (rev 40677)
@@ -343,20 +343,23 @@
  *	   channel can be kept around). No need to clear channels-flag in order to 
  *	   keep expander channels with no sub-data out, as those cases should get
  *	   dealt with by the recursive detection idiom in place.
+ *
+ * Implementation Note:
+ * 	YES the _doSubChannels variable is NOT read anywhere. BUT, this is NOT an excuse
+ * 	to go steamrolling the logic into a single-line expression as from experience,
+ * 	those are notoriously difficult to read + debug when extending later on. The code
+ * 	below is purposefully laid out so that each case noted above corresponds clearly to
+ * 	one case below.
  */
-/* XXX Commented most of that macro, since it seems that _doSubChannels var is never used...
- *     mont29.
- */
 #define BEGIN_ANIMFILTER_SUBCHANNELS(expanded_check) \
 	{ \
 		int _filter = filter_mode; \
-/*		short _doSubChannels = 0; \*/ \
-/*		if (!(filter_mode & ANIMFILTER_LIST_VISIBLE) || (expanded_check)) \*/ \
-/*			_doSubChannels=1; \*/ \
-/*		else if (!(filter_mode & ANIMFILTER_LIST_CHANNELS)) \*/ \
-/*			_doSubChannels=2; \*/ \
-/*		else {\*/ \
-		if (!(!(filter_mode & ANIMFILTER_LIST_VISIBLE) || (expanded_check) || !(filter_mode & ANIMFILTER_LIST_CHANNELS))) { \
+		short _doSubChannels = 0; \
+		if (!(filter_mode & ANIMFILTER_LIST_VISIBLE) || (expanded_check)) \
+			_doSubChannels=1; \
+		else if (!(filter_mode & ANIMFILTER_LIST_CHANNELS)) \
+			_doSubChannels=2; \
+		else {\
 			filter_mode |= ANIMFILTER_TMP_PEEK; \
 		}
 		/* ... standard sub-channel filtering can go on here now ... */




More information about the Bf-blender-cvs mailing list