[Bf-blender-cvs] [aff30aaf2dd] master: Cleanup: style

Campbell Barton noreply at git.blender.org
Mon Apr 24 13:58:07 CEST 2017


Commit: aff30aaf2dddeb30ae43ec45ff12073a73ffcdc0
Author: Campbell Barton
Date:   Mon Apr 24 21:58:28 2017 +1000
Branches: master
https://developer.blender.org/rBaff30aaf2dddeb30ae43ec45ff12073a73ffcdc0

Cleanup: style

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

M	source/blender/blenkernel/intern/depsgraph.c
M	source/blender/blenkernel/intern/idprop.c
M	source/blender/blenkernel/intern/library_query.c
M	source/blender/blenkernel/intern/mesh_evaluate.c
M	source/blender/blenkernel/intern/object_dupli.c
M	source/blender/blenlib/BLI_hash.h
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/editors/gpencil/gpencil_interpolate.c
M	source/blender/editors/gpencil/gpencil_select.c
M	source/blender/editors/object/object_relations.c
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/modifiers/intern/MOD_surfacedeform.c
M	source/blender/nodes/shader/nodes/node_shader_object_info.c
M	source/blender/python/intern/bpy_rna.c

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

diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 302e55a1f5a..019e0df1623 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -3053,7 +3053,7 @@ void DAG_id_type_tag(Main *bmain, short idtype)
 		DAG_id_type_tag(bmain, ID_SCE);
 	}
 
-	atomic_fetch_and_or_uint8((uint8_t*)&bmain->id_tag_update[BKE_idcode_to_index(idtype)], 1);
+	atomic_fetch_and_or_uint8((uint8_t *)&bmain->id_tag_update[BKE_idcode_to_index(idtype)], 1);
 }
 
 int DAG_id_type_tagged(Main *bmain, short idtype)
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 074a9a12fe0..e98181be444 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -953,7 +953,7 @@ IDProperty *IDP_New(const char type, const IDPropertyTemplate *val, const char *
 				prop->len = prop->totallen = val->array.len;
 				break;
 			}
-			printf("%s: bad array type.\n",__func__);
+			printf("%s: bad array type.\n", __func__);
 			return NULL;
 		}
 		case IDP_STRING:
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index 7d56b4a5553..3d65fa9b6e1 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -978,6 +978,7 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
 				for (bGPDlayer *gp_layer = gpencil->layers.first; gp_layer; gp_layer = gp_layer->next) {
 					CALLBACK_INVOKE(gp_layer->parent, IDWALK_CB_NOP);
 				}
+				break;
 			}
 
 			/* Nothing needed for those... */
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index 0d0055113b7..c725e884b58 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -1026,7 +1026,7 @@ static bool loop_split_generator_check_cyclic_smooth_fan(
 	BLI_assert(!BLI_BITMAP_TEST(skip_loops, mlfan_vert_index));
 	BLI_BITMAP_ENABLE(skip_loops, mlfan_vert_index);
 
-	while(true) {
+	while (true) {
 		/* Find next loop of the smooth fan. */
 		loop_manifold_fan_around_vert_next(
 		            mloops, mpolys, loop_to_poly, e2lfan_curr, mv_pivot_index,
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index eb7abc2f004..e9ebd397df0 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -186,8 +186,9 @@ static DupliObject *make_dupli(const DupliContext *ctx,
 	dob->random_id = BLI_hash_string(dob->ob->id.name + 2);
 
 	if (dob->persistent_id[0] != INT_MAX) {
-		for(i = 0; i < MAX_DUPLI_RECUR*2; i++)
+		for (i = 0; i < MAX_DUPLI_RECUR * 2; i++) {
 			dob->random_id = BLI_hash_int_2d(dob->random_id, (unsigned int)dob->persistent_id[i]);
+		}
 	}
 	else {
 		dob->random_id = BLI_hash_int_2d(dob->random_id, 0);
diff --git a/source/blender/blenlib/BLI_hash.h b/source/blender/blenlib/BLI_hash.h
index 50c7a7f9f0f..e849e5f8f61 100644
--- a/source/blender/blenlib/BLI_hash.h
+++ b/source/blender/blenlib/BLI_hash.h
@@ -27,7 +27,7 @@
 
 BLI_INLINE unsigned int BLI_hash_int_2d(unsigned int kx, unsigned int ky)
 {
-#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
+#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
 
 	unsigned int a, b, c;
 
@@ -35,13 +35,13 @@ BLI_INLINE unsigned int BLI_hash_int_2d(unsigned int kx, unsigned int ky)
 	a += kx;
 	b += ky;
 
-	c ^= b; c -= rot(b,14);
-	a ^= c; a -= rot(c,11);
-	b ^= a; b -= rot(a,25);
-	c ^= b; c -= rot(b,16);
-	a ^= c; a -= rot(c,4);
-	b ^= a; b -= rot(a,14);
-	c ^= b; c -= rot(b,24);
+	c ^= b; c -= rot(b, 14);
+	a ^= c; a -= rot(c, 11);
+	b ^= a; b -= rot(a, 25);
+	c ^= b; c -= rot(b, 16);
+	a ^= c; a -= rot(c, 4);
+	b ^= a; b -= rot(a, 14);
+	c ^= b; c -= rot(b, 24);
 
 	return c;
 
@@ -52,9 +52,9 @@ BLI_INLINE unsigned int BLI_hash_string(const char *str)
 {
 	unsigned int i = 0, c;
 
-	while((c = *str++))
+	while ((c = *str++)) {
 		i = i * 37 + c;
-
+	}
 	return i;
 }
 
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index d3f33cf725f..bc88bbb8997 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1259,7 +1259,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 
 		for (Camera *camera = main->camera.first; camera != NULL; camera = camera->id.next) {
 			if (camera->stereo.pole_merge_angle_from == 0.0f &&
-				camera->stereo.pole_merge_angle_to == 0.0f)
+			    camera->stereo.pole_merge_angle_to == 0.0f)
 			{
 				camera->stereo.pole_merge_angle_from = DEG2RADF(60.0f);
 				camera->stereo.pole_merge_angle_to = DEG2RADF(75.0f);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 57be237be6f..723b7929667 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1317,8 +1317,8 @@ static void write_particlesettings(WriteData *wd, ParticleSettings *part)
 				dw->index = 0;
 				if (part->dup_group) { /* can be NULL if lining fails or set to None */
 					for (GroupObject *go = part->dup_group->gobject.first;
-						 go && go->ob != dw->ob;
-						 go = go->next, dw->index++);
+					     go && go->ob != dw->ob;
+					     go = go->next, dw->index++);
 				}
 			}
 			writestruct(wd, DATA, ParticleDupliWeight, 1, dw);
@@ -2654,8 +2654,8 @@ static void write_scene(WriteData *wd, Scene *sce)
 				}
 				if (seq->type == SEQ_TYPE_IMAGE) {
 					writestruct(wd, DATA, StripElem,
-								MEM_allocN_len(strip->stripdata) / sizeof(struct StripElem),
-								strip->stripdata);
+					            MEM_allocN_len(strip->stripdata) / sizeof(struct StripElem),
+					            strip->stripdata);
 				}
 				else if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD)) {
 					writestruct(wd, DATA, StripElem, 1, strip->stripdata);
@@ -3362,13 +3362,13 @@ static void write_mask(WriteData *wd, Mask *mask)
 			}
 
 			for (masklay_shape = masklay->splines_shapes.first;
-				 masklay_shape;
-				 masklay_shape = masklay_shape->next)
+			     masklay_shape;
+			     masklay_shape = masklay_shape->next)
 			{
 				writestruct(wd, DATA, MaskLayerShape, 1, masklay_shape);
 				writedata(wd, DATA,
-						  masklay_shape->tot_vert * sizeof(float) * MASK_OBJECT_SHAPE_ELEM_SIZE,
-						  masklay_shape->data);
+				          masklay_shape->tot_vert * sizeof(float) * MASK_OBJECT_SHAPE_ELEM_SIZE,
+				          masklay_shape->data);
 			}
 		}
 	}
@@ -3854,7 +3854,7 @@ static bool write_file_handle(
 					write_scene(wd, (Scene *)id);
 					break;
 				case ID_CU:
-					write_curve(wd,(Curve *)id);
+					write_curve(wd, (Curve *)id);
 					break;
 				case ID_MB:
 					write_mball(wd, (MetaBall *)id);
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index d2360fea672..6947ca6b376 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -77,7 +77,6 @@
 #include "ED_object.h"
 #include "ED_screen.h"
 #include "ED_view3d.h"
-#include "ED_screen.h"
 #include "ED_space_api.h"
 
 #include "gpencil_intern.h"
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index 45dbde80284..2912a1ac4eb 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -1012,7 +1012,7 @@ static int gpencil_lasso_select_exec(bContext *C, wmOperator *op)
 			}
 			/* test if in lasso boundbox + within the lasso noose */
 			if ((!ELEM(V2D_IS_CLIPPED, x0, y0)) && BLI_rcti_isect_pt(&rect, x0, y0) &&
-				BLI_lasso_is_point_inside(mcords, mcords_tot, x0, y0, INT_MAX))
+			    BLI_lasso_is_point_inside(mcords, mcords_tot, x0, y0, INT_MAX))
 			{
 				if (select) {
 					pt->flag |= GP_SPOINT_SELECT;
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 861e249b0ee..5a0921f7119 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -2109,7 +2109,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, const bool full, const bo
 		for (Base *base = scene->base.first; base; base = base->next) {
 			Object *ob = base->object;
 			if (!ID_IS_LINKED_DATABLOCK(ob)) {
-					IDP_RelinkProperty(ob->id.properties);
+				IDP_RelinkProperty(ob->id.properties);
 			}
 		}
 
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 79934190cbc..1583d16ca27 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -1912,7 +1912,7 @@ static void GPU_get_object_info(float oi[3], Material *mat)
 	else {
 		random = BLI_hash_int_2d(BLI_hash_string(GMS.gob->id.name + 2), 0);
 	}
-	oi[2] = random * (1.0f/(float)0xFFFFFFFF);
+	oi[2] = random * (1.0f / (float)0xFFFFFFFF);
 }
 
 int GPU_object_material_bind(int nr, void *attribs)
diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c b/source/blender/modifiers/intern/MOD_surfacedeform.c
index e9ec90198c4..79e3eb5f3df 100644
--- a/source/blender/modifiers/intern/MOD_surfacedeform.c
+++ b/source/blender/modifiers/intern/MOD_surfacedeform.c
@@ -1152,9 +1152,11 @@ static void surfacedeformModifier_do(ModifierData *md, float (*vertexCos)[3], un
 	}
 
 	/* Actual vertex location update starts here */
-	SDefDeformData data = {.bind_verts = smd->verts,
-		                   .targetCos = MEM_mallocN(sizeof(float[3]) * tnumverts, "SDefTargetVertArray"),
-		                   .vertexCos = vertexCos};
+	SDefDeformData data = {
+		.bind_verts = smd->verts,
+		.targetCos = MEM_mallocN(sizeof(float[3]) * tnumverts, "SDefTargetVertArray"),
+		.vertexCos = vertexCos,
+	};
 
 	if (data.targetCos != NULL) {
 		bool tdm_vert_alloc;
diff --git a/source/blender/nodes/shader/nodes/node_shader_object_info.c b/source/

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list