[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44963] trunk/blender/source/blender/ makesrna/intern: Code style edits (mostly spliting long lines, and removing trailing spaces).

Bastien Montagne montagne29 at wanadoo.fr
Sun Mar 18 10:27:42 CET 2012


Revision: 44963
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44963
Author:   mont29
Date:     2012-03-18 09:27:36 +0000 (Sun, 18 Mar 2012)
Log Message:
-----------
Code style edits (mostly spliting long lines, and removing trailing spaces).

Note about long lines: I did not touch to two pieces of code (because I don?\226?\128?\153t see any way to keep a nicely formated, compact code, with shorter lines):
* The node types definitions into rna_nodetree_types.h
* The vgroup name functions into rna_particle.c

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/makesrna.c
    trunk/blender/source/blender/makesrna/intern/rna_ID.c
    trunk/blender/source/blender/makesrna/intern/rna_access.c
    trunk/blender/source/blender/makesrna/intern/rna_action.c
    trunk/blender/source/blender/makesrna/intern/rna_action_api.c
    trunk/blender/source/blender/makesrna/intern/rna_actuator.c
    trunk/blender/source/blender/makesrna/intern/rna_actuator_api.c
    trunk/blender/source/blender/makesrna/intern/rna_animation.c
    trunk/blender/source/blender/makesrna/intern/rna_animation_api.c
    trunk/blender/source/blender/makesrna/intern/rna_animviz.c
    trunk/blender/source/blender/makesrna/intern/rna_armature.c
    trunk/blender/source/blender/makesrna/intern/rna_armature_api.c
    trunk/blender/source/blender/makesrna/intern/rna_boid.c
    trunk/blender/source/blender/makesrna/intern/rna_brush.c
    trunk/blender/source/blender/makesrna/intern/rna_camera.c
    trunk/blender/source/blender/makesrna/intern/rna_camera_api.c
    trunk/blender/source/blender/makesrna/intern/rna_cloth.c
    trunk/blender/source/blender/makesrna/intern/rna_color.c
    trunk/blender/source/blender/makesrna/intern/rna_constraint.c
    trunk/blender/source/blender/makesrna/intern/rna_controller.c
    trunk/blender/source/blender/makesrna/intern/rna_controller_api.c
    trunk/blender/source/blender/makesrna/intern/rna_curve.c
    trunk/blender/source/blender/makesrna/intern/rna_define.c
    trunk/blender/source/blender/makesrna/intern/rna_dynamicpaint.c
    trunk/blender/source/blender/makesrna/intern/rna_fcurve.c
    trunk/blender/source/blender/makesrna/intern/rna_fcurve_api.c
    trunk/blender/source/blender/makesrna/intern/rna_fluidsim.c
    trunk/blender/source/blender/makesrna/intern/rna_gpencil.c
    trunk/blender/source/blender/makesrna/intern/rna_group.c
    trunk/blender/source/blender/makesrna/intern/rna_image.c
    trunk/blender/source/blender/makesrna/intern/rna_image_api.c
    trunk/blender/source/blender/makesrna/intern/rna_internal.h
    trunk/blender/source/blender/makesrna/intern/rna_internal_types.h
    trunk/blender/source/blender/makesrna/intern/rna_key.c
    trunk/blender/source/blender/makesrna/intern/rna_lamp.c
    trunk/blender/source/blender/makesrna/intern/rna_lattice.c
    trunk/blender/source/blender/makesrna/intern/rna_main.c
    trunk/blender/source/blender/makesrna/intern/rna_main_api.c
    trunk/blender/source/blender/makesrna/intern/rna_material.c
    trunk/blender/source/blender/makesrna/intern/rna_material_api.c
    trunk/blender/source/blender/makesrna/intern/rna_mesh.c
    trunk/blender/source/blender/makesrna/intern/rna_mesh_api.c
    trunk/blender/source/blender/makesrna/intern/rna_mesh_utils.h
    trunk/blender/source/blender/makesrna/intern/rna_meta.c
    trunk/blender/source/blender/makesrna/intern/rna_modifier.c
    trunk/blender/source/blender/makesrna/intern/rna_movieclip.c
    trunk/blender/source/blender/makesrna/intern/rna_nla.c
    trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
    trunk/blender/source/blender/makesrna/intern/rna_object.c
    trunk/blender/source/blender/makesrna/intern/rna_object_api.c
    trunk/blender/source/blender/makesrna/intern/rna_object_force.c
    trunk/blender/source/blender/makesrna/intern/rna_particle.c
    trunk/blender/source/blender/makesrna/intern/rna_pose.c
    trunk/blender/source/blender/makesrna/intern/rna_pose_api.c
    trunk/blender/source/blender/makesrna/intern/rna_render.c
    trunk/blender/source/blender/makesrna/intern/rna_rna.c
    trunk/blender/source/blender/makesrna/intern/rna_scene.c
    trunk/blender/source/blender/makesrna/intern/rna_scene_api.c
    trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c
    trunk/blender/source/blender/makesrna/intern/rna_sensor.c
    trunk/blender/source/blender/makesrna/intern/rna_sensor_api.c
    trunk/blender/source/blender/makesrna/intern/rna_sequencer.c
    trunk/blender/source/blender/makesrna/intern/rna_sequencer_api.c
    trunk/blender/source/blender/makesrna/intern/rna_smoke.c
    trunk/blender/source/blender/makesrna/intern/rna_sound.c
    trunk/blender/source/blender/makesrna/intern/rna_space.c
    trunk/blender/source/blender/makesrna/intern/rna_test.c
    trunk/blender/source/blender/makesrna/intern/rna_text.c
    trunk/blender/source/blender/makesrna/intern/rna_texture.c
    trunk/blender/source/blender/makesrna/intern/rna_texture_api.c
    trunk/blender/source/blender/makesrna/intern/rna_tracking.c
    trunk/blender/source/blender/makesrna/intern/rna_ui.c
    trunk/blender/source/blender/makesrna/intern/rna_ui_api.c
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c
    trunk/blender/source/blender/makesrna/intern/rna_wm.c
    trunk/blender/source/blender/makesrna/intern/rna_wm_api.c
    trunk/blender/source/blender/makesrna/intern/rna_world.c

Modified: trunk/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/makesrna.c	2012-03-18 09:21:24 UTC (rev 44962)
+++ trunk/blender/source/blender/makesrna/intern/makesrna.c	2012-03-18 09:27:36 UTC (rev 44963)
@@ -75,19 +75,19 @@
 
 #define REN_IF_DIFF                                                           \
 	{                                                                         \
-		FILE *file_test = fopen(orgfile, "rb");                                \
-		if (file_test) {                                                       \
+		FILE *file_test = fopen(orgfile, "rb");                               \
+		if (file_test) {                                                      \
 			fclose(file_test);                                                \
-			if (fp_org) fclose(fp_org);                                        \
-			if (fp_new) fclose(fp_new);                                        \
-			if (remove(orgfile) != 0) {                                        \
+			if (fp_org) fclose(fp_org);                                       \
+			if (fp_new) fclose(fp_new);                                       \
+			if (remove(orgfile) != 0) {                                       \
 				fprintf(stderr, "%s:%d, Remove Error (%s): \"%s\"\n",         \
 				        __FILE__, __LINE__, strerror(errno), orgfile);        \
 				return -1;                                                    \
 			}                                                                 \
 		}                                                                     \
 	}                                                                         \
-	if (rename(tmpfile, orgfile) != 0) {                                       \
+	if (rename(tmpfile, orgfile) != 0) {                                      \
 		fprintf(stderr, "%s:%d, Rename Error (%s): \"%s\" -> \"%s\"\n",       \
 		        __FILE__, __LINE__, strerror(errno), tmpfile, orgfile);       \
 		return -1;                                                            \
@@ -304,7 +304,8 @@
 static void rna_print_data_get(FILE *f, PropertyDefRNA *dp)
 {
 	if (dp->dnastructfromname && dp->dnastructfromprop)
-		fprintf(f, "	%s *data= (%s*)(((%s*)ptr->data)->%s);\n", dp->dnastructname, dp->dnastructname, dp->dnastructfromname, dp->dnastructfromprop);
+		fprintf(f, "	%s *data= (%s*)(((%s*)ptr->data)->%s);\n", dp->dnastructname, dp->dnastructname,
+		        dp->dnastructfromname, dp->dnastructfromprop);
 	else
 		fprintf(f, "	%s *data= (%s*)(ptr->data);\n", dp->dnastructname, dp->dnastructname);
 }
@@ -476,7 +477,8 @@
 	else fprintf(f, "%d", num);
 }
 
-static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
+static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp,
+                                       const char *manualfunc)
 {
 	char *func;
 
@@ -498,7 +500,8 @@
 				if (IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) {
 					if (prop->subtype != PROP_COLOR_GAMMA) { /* colors are an exception. these get translated */
 						fprintf(stderr, "%s (1): %s.%s is a '%s' but wrapped as type '%s'.\n",
-						        __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
+						        __func__, srna->identifier, prop->identifier, dp->dnatype,
+						        RNA_property_typename(prop->type));
 						DefRNA.error = 1;
 						return NULL;
 					}
@@ -507,7 +510,8 @@
 			else if (prop->type == PROP_INT || prop->type == PROP_BOOLEAN || prop->type == PROP_ENUM) {
 				if (IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
 					fprintf(stderr, "%s (2): %s.%s is a '%s' but wrapped as type '%s'.\n",
-					        __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
+					        __func__, srna->identifier, prop->identifier, dp->dnatype,
+					        RNA_property_typename(prop->type));
 					DefRNA.error = 1;
 					return NULL;
 				}
@@ -538,7 +542,8 @@
 				if (sprop->maxlength)
 					fprintf(f, "	%s(value, data->%s, %d);\n", string_copy_func, dp->dnaname, sprop->maxlength);
 				else
-					fprintf(f, "	%s(value, data->%s, sizeof(data->%s));\n", string_copy_func, dp->dnaname, dp->dnaname);
+					fprintf(f, "	%s(value, data->%s, sizeof(data->%s));\n", string_copy_func,
+					        dp->dnaname, dp->dnaname);
 			}
 			fprintf(f, "}\n\n");
 			break;
@@ -553,9 +558,11 @@
 				PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
 				rna_print_data_get(f, dp);
 				if (dp->dnapointerlevel == 0)
-					fprintf(f, "	return rna_pointer_inherit_refine(ptr, &RNA_%s, &data->%s);\n", (const char*)pprop->type, dp->dnaname);
+					fprintf(f, "	return rna_pointer_inherit_refine(ptr, &RNA_%s, &data->%s);\n",
+					        (const char*)pprop->type, dp->dnaname);
 				else
-					fprintf(f, "	return rna_pointer_inherit_refine(ptr, &RNA_%s, data->%s);\n", (const char*)pprop->type, dp->dnaname);
+					fprintf(f, "	return rna_pointer_inherit_refine(ptr, &RNA_%s, data->%s);\n",
+					        (const char*)pprop->type, dp->dnaname);
 			}
 			fprintf(f, "}\n\n");
 			break;
@@ -585,7 +592,8 @@
 				if (prop->flag & PROP_DYNAMIC)
 					fprintf(f, "void %s(PointerRNA *ptr, %s values[])\n", func, rna_type_type(prop));
 				else
-					fprintf(f, "void %s(PointerRNA *ptr, %s values[%u])\n", func, rna_type_type(prop), prop->totarraylength);
+					fprintf(f, "void %s(PointerRNA *ptr, %s values[%u])\n", func, rna_type_type(prop),
+					        prop->totarraylength);
 				fprintf(f, "{\n");
 
 				if (manualfunc) {
@@ -595,7 +603,8 @@
 					rna_print_data_get(f, dp);
 
 					if (prop->flag & PROP_DYNAMIC) {
-						char *lenfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get_length");
+						char *lenfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier),
+						                                        "get_length");
 						fprintf(f, "	int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n");
 						fprintf(f, "	int len= %s(ptr, arraylen);\n\n", lenfunc);
 						fprintf(f, "	for(i=0; i<len; i++) {\n");
@@ -618,7 +627,8 @@
 					}
 					else {
 						if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
-							fprintf(f, "		values[i]= %s((data->%s[i] & ", (dp->booleannegative)? "!": "", dp->dnaname);
+							fprintf(f, "		values[i]= %s((data->%s[i] & ", (dp->booleannegative)? "!": "",
+							        dp->dnaname);
 							rna_int_print(f, dp->booleanbit);
 							fprintf(f, ") != 0);\n");
 						}
@@ -659,7 +669,8 @@
 						fprintf(f, ");\n");
 					}
 					else
-						fprintf(f, "	return (%s)%s(data->%s);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname);
+						fprintf(f, "	return (%s)%s(data->%s);\n", rna_type_type(prop),
+						        (dp->booleannegative)? "!": "", dp->dnaname);
 				}
 
 				fprintf(f, "}\n\n");
@@ -730,7 +741,8 @@
 		fprintf(f, "value;\n");
 }
 
-static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
+static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp,
+                                       const char *manualfunc)
 {
 	char *func;
 
@@ -772,7 +784,8 @@
 				if (sprop->maxlength)
 					fprintf(f, "	%s(data->%s, value, %d);\n", string_copy_func, dp->dnaname, sprop->maxlength);
 				else
-					fprintf(f, "	%s(data->%s, value, sizeof(data->%s));\n", string_copy_func, dp->dnaname, dp->dnaname);
+					fprintf(f, "	%s(data->%s, value, sizeof(data->%s));\n", string_copy_func,
+					        dp->dnaname, dp->dnaname);
 			}
 			fprintf(f, "}\n\n");
 			break;
@@ -817,7 +830,8 @@
 				if (prop->flag & PROP_DYNAMIC)
 					fprintf(f, "void %s(PointerRNA *ptr, const %s values[])\n", func, rna_type_type(prop));
 				else
-					fprintf(f, "void %s(PointerRNA *ptr, const %s values[%u])\n", func, rna_type_type(prop), prop->totarraylength);
+					fprintf(f, "void %s(PointerRNA *ptr, const %s values[%u])\n", func,
+					        rna_type_type(prop), prop->totarraylength);
 				fprintf(f, "{\n");
 
 				if (manualfunc) {
@@ -827,7 +841,8 @@
 					rna_print_data_get(f, dp);
 
 					if (prop->flag & PROP_DYNAMIC) {
-						char *lenfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set_length");
+						char *lenfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier),
+						                                        "set_length");
 						fprintf(f, "	int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n");
 						fprintf(f, "	int len= %s(ptr, arraylen);\n\n", lenfunc);
 						rna_clamp_value_range(f, prop);
@@ -842,17 +857,19 @@
 
 					if (dp->dnaarraylength == 1) {
 						if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
-							fprintf(f, "		if(%svalues[i]) data->%s |= (%d<<i);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
+							fprintf(f, "		if(%svalues[i]) data->%s |= (%d<<i);\n",
+							        (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
 							fprintf(f, "		else data->%s &= ~(%d<<i);\n", dp->dnaname, dp->booleanbit);
 						}
 						else {
-							fprintf(f, "		(&data->%s)[i]= %s", dp->dnaname, (dp->booleannegative)? "!": "");
+							fprintf(f, "		(&data->%s)[i]= %s", dp->dnaname, (dp->booleannegative) ? "!" : "");
 							rna_clamp_value(f, prop, 1);
 						}
 					}
 					else {
 						if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
-							fprintf(f, "		if(%svalues[i]) data->%s[i] |= ", (dp->booleannegative)? "!": "", dp->dnaname);
+							fprintf(f, "		if(%svalues[i]) data->%s[i] |= ", (dp->booleannegative) ? "!" : "",
+							        dp->dnaname);
 							rna_int_print(f, dp->booleanbit);
 							fprintf(f, ";\n");
 							fprintf(f, "		else data->%s[i] &= ~", dp->dnaname);
@@ -864,9 +881,10 @@
 						}
 						else {
 							if (dp->dnatype)
-								fprintf(f, "		((%s*)data->%s)[i]= %s", dp->dnatype, dp->dnaname, (dp->booleannegative)? "!": "");
+								fprintf(f, "		((%s*)data->%s)[i]= %s", dp->dnatype, dp->dnaname,
+								        (dp->booleannegative) ? "!" : "");
 							else
-								fprintf(f, "		(data->%s)[i]= %s", dp->dnaname, (dp->booleannegative)? "!": "");
+								fprintf(f, "		(data->%s)[i]= %s", dp->dnaname, (dp->booleannegative) ? "!" : "");
 							rna_clamp_value(f, prop, 1);

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list