[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45643] trunk/blender/source: style cleanup: for loop macros, also add a config file for uncrustify source formatter ( able to get very close to our own style guide).

Campbell Barton ideasman42 at gmail.com
Sun Apr 15 09:24:14 CEST 2012


Revision: 45643
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45643
Author:   campbellbarton
Date:     2012-04-15 07:24:14 +0000 (Sun, 15 Apr 2012)
Log Message:
-----------
style cleanup: for loop macros, also add a config file for uncrustify source formatter (able to get very close to our own style guide).

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_context.h
    trunk/blender/source/blender/blenkernel/BKE_sequencer.h
    trunk/blender/source/blender/makesrna/RNA_access.h
    trunk/blender/source/blender/makesrna/RNA_types.h

Added Paths:
-----------
    trunk/blender/source/tools/uncrustify.cfg

Modified: trunk/blender/source/blender/blenkernel/BKE_context.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_context.h	2012-04-14 22:33:48 UTC (rev 45642)
+++ trunk/blender/source/blender/blenkernel/BKE_context.h	2012-04-15 07:24:14 UTC (rev 45643)
@@ -212,8 +212,11 @@
 		ListBase ctx_data_list;                                               \
 		CollectionPointerLink *ctx_link;                                      \
 		CTX_data_##member(C, &ctx_data_list);                                 \
-		for(ctx_link=ctx_data_list.first; ctx_link; ctx_link=ctx_link->next) {\
-			Type instance= ctx_link->ptr.data;
+		for (ctx_link = ctx_data_list.first;                                  \
+		     ctx_link;                                                        \
+		     ctx_link = ctx_link->next)                                       \
+		{                                                                     \
+			Type instance = ctx_link->ptr.data;
 
 #define CTX_DATA_END                                                          \
 		}                                                                     \

Modified: trunk/blender/source/blender/blenkernel/BKE_sequencer.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_sequencer.h	2012-04-14 22:33:48 UTC (rev 45642)
+++ trunk/blender/source/blender/blenkernel/BKE_sequencer.h	2012-04-15 07:24:14 UTC (rev 45643)
@@ -69,14 +69,14 @@
 #define SEQP_BEGIN(ed, _seq)                                                  \
 {                                                                             \
 	SeqIterator iter;                                                         \
-		for(seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) {           \
-			_seq= iter.seq;
+		for (seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) {          \
+			_seq = iter.seq;
 			
 #define SEQ_BEGIN(ed, _seq)                                                   \
 	{                                                                         \
 		SeqIterator iter;                                                     \
-		for(seq_begin(ed, &iter, 0); iter.valid; seq_next(&iter)) {           \
-			_seq= iter.seq;
+		for (seq_begin(ed, &iter, 0); iter.valid; seq_next(&iter)) {          \
+			_seq = iter.seq;
 
 #define SEQ_END                                                               \
 		}                                                                     \
@@ -138,12 +138,10 @@
 	int (*early_out)(struct Sequence *seq, float facf0, float facf1); 
 	
 	/* stores the y-range of the effect IPO */
-	void (*store_icu_yrange)(struct Sequence * seq,
-                                 short adrcode, float *ymin, float *ymax);
+	void (*store_icu_yrange)(struct Sequence * seq, short adrcode, float *ymin, float *ymax);
 	
 	/* stores the default facf0 and facf1 if no IPO is present */
-	void (*get_default_fac)(struct Sequence *seq, float cfra,
-                                float * facf0, float * facf1);
+	void (*get_default_fac)(struct Sequence *seq, float cfra, float * facf0, float * facf1);
 	
 	/* execute the effect
 	 * sequence effects are only required to either support

Modified: trunk/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- trunk/blender/source/blender/makesrna/RNA_access.h	2012-04-14 22:33:48 UTC (rev 45642)
+++ trunk/blender/source/blender/makesrna/RNA_access.h	2012-04-15 07:24:14 UTC (rev 45643)
@@ -902,11 +902,11 @@
 #define RNA_BEGIN(sptr, itemptr, propname)                                    \
 	{                                                                         \
 		CollectionPropertyIterator rna_macro_iter;                            \
-		for(RNA_collection_begin(sptr, propname, &rna_macro_iter);            \
-		    rna_macro_iter.valid;                                             \
-		    RNA_property_collection_next(&rna_macro_iter))                    \
+		for (RNA_collection_begin(sptr, propname, &rna_macro_iter);           \
+		     rna_macro_iter.valid;                                            \
+		     RNA_property_collection_next(&rna_macro_iter))                   \
 		{                                                                     \
-			PointerRNA itemptr= rna_macro_iter.ptr;
+			PointerRNA itemptr = rna_macro_iter.ptr;
 
 #define RNA_END                                                               \
 		}                                                                     \
@@ -916,11 +916,11 @@
 #define RNA_PROP_BEGIN(sptr, itemptr, prop)                                   \
 	{                                                                         \
 		CollectionPropertyIterator rna_macro_iter;                            \
-		for(RNA_property_collection_begin(sptr, prop, &rna_macro_iter);       \
-			rna_macro_iter.valid;                                             \
-			RNA_property_collection_next(&rna_macro_iter))                    \
+		for (RNA_property_collection_begin(sptr, prop, &rna_macro_iter);      \
+		     rna_macro_iter.valid;                                            \
+		     RNA_property_collection_next(&rna_macro_iter))                   \
 		{                                                                     \
-			PointerRNA itemptr= rna_macro_iter.ptr;
+			PointerRNA itemptr = rna_macro_iter.ptr;
 
 #define RNA_PROP_END                                                          \
 		}                                                                     \
@@ -930,14 +930,14 @@
 #define RNA_STRUCT_BEGIN(sptr, prop)                                          \
 	{                                                                         \
 		CollectionPropertyIterator rna_macro_iter;                            \
-		for(RNA_property_collection_begin(                                    \
-					sptr,                                                     \
-					RNA_struct_iterator_property(sptr->type),                 \
-					&rna_macro_iter);                                         \
-			rna_macro_iter.valid;                                             \
-			RNA_property_collection_next(&rna_macro_iter))                    \
+		for (RNA_property_collection_begin(                                   \
+		             sptr,                                                    \
+		             RNA_struct_iterator_property(sptr->type),                \
+		             &rna_macro_iter);                                        \
+		     rna_macro_iter.valid;                                            \
+		     RNA_property_collection_next(&rna_macro_iter))                   \
 		{                                                                     \
-			PropertyRNA *prop= rna_macro_iter.ptr.data;
+			PropertyRNA *prop = rna_macro_iter.ptr.data;
 
 #define RNA_STRUCT_END                                                        \
 		}                                                                     \

Modified: trunk/blender/source/blender/makesrna/RNA_types.h
===================================================================
--- trunk/blender/source/blender/makesrna/RNA_types.h	2012-04-14 22:33:48 UTC (rev 45642)
+++ trunk/blender/source/blender/makesrna/RNA_types.h	2012-04-15 07:24:14 UTC (rev 45643)
@@ -346,8 +346,10 @@
 typedef int (*StructValidateFunc)(struct PointerRNA *ptr, void *data, int *have_function);
 typedef int (*StructCallbackFunc)(struct bContext *C, struct PointerRNA *ptr, struct FunctionRNA *func, ParameterList *list);
 typedef void (*StructFreeFunc)(void *data);
-typedef struct StructRNA *(*StructRegisterFunc)(struct Main *bmain, struct ReportList *reports, void *data,
-	const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free);
+typedef struct StructRNA *(*StructRegisterFunc)(
+        struct Main *bmain, struct ReportList *reports, void *data, const char *identifier,
+        StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free);
+
 typedef void (*StructUnregisterFunc)(struct Main *bmain, struct StructRNA *type);
 typedef void **(*StructInstanceFunc)(PointerRNA *ptr);
 

Added: trunk/blender/source/tools/uncrustify.cfg
===================================================================
--- trunk/blender/source/tools/uncrustify.cfg	                        (rev 0)
+++ trunk/blender/source/tools/uncrustify.cfg	2012-04-15 07:24:14 UTC (rev 45643)
@@ -0,0 +1,1457 @@
+# Uncrustify 0.59
+
+#
+# General options
+#
+
+# The type of line endings
+newlines                                 = auto     # auto/lf/crlf/cr
+
+# The original size of tabs in the input
+input_tab_size                           = 4        # number
+
+# The size of tabs in the output (only used if align_with_tabs=true)
+output_tab_size                          = 4        # number
+
+# The ASCII value of the string escape char, usually 92 (\) or 94 (^). (Pawn)
+string_escape_char                       = 92       # number
+
+# Alternate string escape char for Pawn. Only works right before the quote char.
+string_escape_char2                      = 0        # number
+
+# Allow interpreting '>=' and '>>=' as part of a template in 'void f(list<list<B>>=val);'.
+# If true (default), 'assert(x<0 && y>=3)' will be broken.
+# Improvements to template detection may make this option obsolete.
+tok_split_gte                            = false    # false/true
+
+# Control what to do with the UTF-8 BOM (recommed 'remove')
+utf8_bom                                 = ignore   # ignore/add/remove/force
+
+# If the file only contains chars between 128 and 255 and is not UTF-8, then output as UTF-8
+utf8_byte                                = false    # false/true
+
+# Force the output encoding to UTF-8
+utf8_force                               = false    # false/true
+
+#
+# Indenting
+#
+
+# The number of columns to indent per level.
+# Usually 2, 3, 4, or 8.
+indent_columns                           = 4        # number
+
+# The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents.
+# For FreeBSD, this is set to 4.
+indent_continue                          = 0        # number
+
+# How to use tabs when indenting code
+# 0=spaces only
+# 1=indent with tabs to brace level, align with spaces

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list