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

Campbell Barton noreply at git.blender.org
Fri Nov 30 22:18:38 CET 2018


Commit: a9bd788348484fb4a62654ea3ffa60ed24b94ff3
Author: Campbell Barton
Date:   Sat Dec 1 08:15:25 2018 +1100
Branches: master
https://developer.blender.org/rBa9bd788348484fb4a62654ea3ffa60ed24b94ff3

Cleanup: style

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

M	source/blender/blenkernel/intern/particle_distribute.c
M	source/blender/blenlib/intern/system.c
M	source/blender/depsgraph/DEG_depsgraph.h
M	source/blender/editors/uvedit/uvedit_parametrizer.c
M	source/blender/physics/intern/BPH_mass_spring.cpp
M	source/blender/physics/intern/eigen_utils.h
M	source/blender/physics/intern/hair_volume.cpp
M	source/blender/physics/intern/implicit.h
M	source/blender/physics/intern/implicit_blender.c
M	source/blender/physics/intern/implicit_eigen.cpp

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

diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
index 8a3b1312590..8b4b39710f8 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -479,7 +479,7 @@ static void distribute_from_verts_exec(ParticleTask *thread, ParticleData *pa, i
 		int w, maxw;
 
 		psys_particle_on_dm(ctx->dm,from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co1,0,0,0,orco1,0);
-		BKE_mesh_orco_verts_transform((Mesh*)ob->data, &orco1, 1, 1);
+		BKE_mesh_orco_verts_transform((Mesh *)ob->data, &orco1, 1, 1);
 		maxw = BLI_kdtree_find_nearest_n(ctx->tree,orco1,ptn,3);
 
 		for (w=0; w<maxw; w++) {
@@ -665,7 +665,7 @@ static void distribute_children_exec(ParticleTask *thread, ChildParticle *cpa, i
 		float pweight[10];
 
 		psys_particle_on_dm(dm,cfrom,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co1,nor1,NULL,NULL,orco1,NULL);
-		BKE_mesh_orco_verts_transform((Mesh*)ob->data, &orco1, 1, 1);
+		BKE_mesh_orco_verts_transform((Mesh *)ob->data, &orco1, 1, 1);
 		maxw = BLI_kdtree_find_nearest_n(ctx->tree,orco1,ptn,3);
 
 		maxd=ptn[maxw-1].dist;
@@ -865,7 +865,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
 				dm = finaldm;
 			}
 			else {
-				dm = CDDM_from_mesh((Mesh*)ob->data);
+				dm = CDDM_from_mesh((Mesh *)ob->data);
 			}
 			DM_ensure_tessface(dm);
 
@@ -894,7 +894,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
 
 		for (p=0,pa=psys->particles; p<totpart; p++,pa++) {
 			psys_particle_on_dm(dm,part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,nor,0,0,orco,NULL);
-			BKE_mesh_orco_verts_transform((Mesh*)ob->data, &orco, 1, 1);
+			BKE_mesh_orco_verts_transform((Mesh *)ob->data, &orco, 1, 1);
 			BLI_kdtree_insert(tree, p, orco);
 		}
 
@@ -910,7 +910,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
 		if (psys->part->use_modifier_stack)
 			dm = finaldm;
 		else
-			dm= CDDM_from_mesh((Mesh*)ob->data);
+			dm= CDDM_from_mesh((Mesh *)ob->data);
 
 		DM_ensure_tessface(dm);
 
@@ -928,7 +928,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
 			for (p=0; p<totvert; p++) {
 				if (orcodata) {
 					copy_v3_v3(co,orcodata[p]);
-					BKE_mesh_orco_verts_transform((Mesh*)ob->data, &co, 1, 1);
+					BKE_mesh_orco_verts_transform((Mesh *)ob->data, &co, 1, 1);
 				}
 				else
 					copy_v3_v3(co,mv[p].co);
@@ -974,23 +974,23 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
 				copy_v3_v3(co1, orcodata[mf->v1]);
 				copy_v3_v3(co2, orcodata[mf->v2]);
 				copy_v3_v3(co3, orcodata[mf->v3]);
-				BKE_mesh_orco_verts_transform((Mesh*)ob->data, &co1, 1, 1);
-				BKE_mesh_orco_verts_transform((Mesh*)ob->data, &co2, 1, 1);
-				BKE_mesh_orco_verts_transform((Mesh*)ob->data, &co3, 1, 1);
+				BKE_mesh_orco_verts_transform((Mesh *)ob->data, &co1, 1, 1);
+				BKE_mesh_orco_verts_transform((Mesh *)ob->data, &co2, 1, 1);
+				BKE_mesh_orco_verts_transform((Mesh *)ob->data, &co3, 1, 1);
 				if (mf->v4) {
 					copy_v3_v3(co4, orcodata[mf->v4]);
-					BKE_mesh_orco_verts_transform((Mesh*)ob->data, &co4, 1, 1);
+					BKE_mesh_orco_verts_transform((Mesh *)ob->data, &co4, 1, 1);
 				}
 			}
 			else {
-				v1= (MVert*)dm->getVertData(dm,mf->v1,CD_MVERT);
-				v2= (MVert*)dm->getVertData(dm,mf->v2,CD_MVERT);
-				v3= (MVert*)dm->getVertData(dm,mf->v3,CD_MVERT);
+				v1= (MVert *)dm->getVertData(dm,mf->v1,CD_MVERT);
+				v2= (MVert *)dm->getVertData(dm,mf->v2,CD_MVERT);
+				v3= (MVert *)dm->getVertData(dm,mf->v3,CD_MVERT);
 				copy_v3_v3(co1, v1->co);
 				copy_v3_v3(co2, v2->co);
 				copy_v3_v3(co3, v3->co);
 				if (mf->v4) {
-					v4= (MVert*)dm->getVertData(dm,mf->v4,CD_MVERT);
+					v4= (MVert *)dm->getVertData(dm,mf->v4,CD_MVERT);
 					copy_v3_v3(co4, v4->co);
 				}
 			}
diff --git a/source/blender/blenlib/intern/system.c b/source/blender/blenlib/intern/system.c
index 38fe2c7a9eb..fca168dce69 100644
--- a/source/blender/blenlib/intern/system.c
+++ b/source/blender/blenlib/intern/system.c
@@ -167,9 +167,9 @@ char *BLI_cpu_brand_string(void)
 	int result[4] = { 0 };
 	__cpuid(result, 0x80000000);
 	if (result[0] >= (int)0x80000004) {
-		__cpuid((int*)(buf + 0), 0x80000002);
-		__cpuid((int*)(buf + 16), 0x80000003);
-		__cpuid((int*)(buf + 32), 0x80000004);
+		__cpuid((int *)(buf + 0), 0x80000002);
+		__cpuid((int *)(buf + 16), 0x80000003);
+		__cpuid((int *)(buf + 32), 0x80000004);
 		char *brand = BLI_strdup(buf);
 		/* TODO(sergey): Make it a bit more presentable by removing trademark. */
 		return brand;
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index d9672732ffc..fd272d7363d 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -210,9 +210,9 @@ void DEG_editors_update_pre(struct Main *bmain, struct Scene *scene, bool time);
 
 /* Evaluation Debug ------------------------------ */
 
-void DEG_debug_print_eval(const char* function_name,
-                          const char* object_name,
-                          const void* object_address);
+void DEG_debug_print_eval(const char *function_name,
+                          const char *object_name,
+                          const void *object_address);
 
 void DEG_debug_print_eval_subdata(const char *function_name,
                                   const char *object_name,
@@ -229,9 +229,9 @@ void DEG_debug_print_eval_subdata_index(const char *function_name,
                                         const void *subdata_address,
                                         const int subdata_index);
 
-void DEG_debug_print_eval_time(const char* function_name,
-                               const char* object_name,
-                               const void* object_address,
+void DEG_debug_print_eval_time(const char *function_name,
+                               const char *object_name,
+                               const void *object_address,
                                float time);
 
 #ifdef __cplusplus
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 352bfbf9a9e..412d68a5d4d 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -4189,7 +4189,7 @@ static void p_add_ngon(ParamHandle *handle, ParamKey key, int nverts,
 	float normal[3];
 	zero_v3(normal);
 
-	const float *co_curr, *co_prev = co[nverts-1];
+	const float *co_curr, *co_prev = co[nverts - 1];
 	for (int j = 0; j < nverts; j++) {
 		co_curr = co[j];
 		add_newell_cross_v3_v3v3(normal, co_prev, co_curr);
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp
index 451959766cb..1b8b05ac752 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -149,7 +149,7 @@ static bool collision_response(ClothModifierData *clmd, CollisionModifierData *c
 		return false; /* XXX tested before already? */
 
 	/* only handle static collisions here */
-	if ( collpair->flag & COLLISION_IN_FUTURE )
+	if (collpair->flag & COLLISION_IN_FUTURE)
 		return false;
 
 	/* velocity */
@@ -260,8 +260,8 @@ static void cloth_setup_constraints(ClothModifierData *clmd, ColliderContacts *c
  * collisions*/
 static int UNUSED_FUNCTION(cloth_calc_helper_forces)(Object *UNUSED(ob), ClothModifierData *clmd, float (*initial_cos)[3], float UNUSED(step), float dt)
 {
-	Cloth *cloth= clmd->clothObject;
-	float (*cos)[3] = (float (*)[3])MEM_callocN(sizeof(float[3]) * cloth->mvert_num, "cos cloth_calc_helper_forces");
+	Cloth *cloth = clmd->clothObject;
+	float(*cos)[3] = (float(*)[3])MEM_callocN(sizeof(float[3]) * cloth->mvert_num, "cos cloth_calc_helper_forces");
 	float *masses = (float *)MEM_callocN(sizeof(float) * cloth->mvert_num, "cos cloth_calc_helper_forces");
 	LinkNode *node;
 	ClothSpring *spring;
@@ -281,8 +281,8 @@ static int UNUSED_FUNCTION(cloth_calc_helper_forces)(Object *UNUSED(ob), ClothMo
 	}
 
 	steps = 55;
-	for (i=0; i<steps; i++) {
-		for (node=cloth->springs; node; node=node->next) {
+	for (i = 0; i < steps; i++) {
+		for (node = cloth->springs; node; node = node->next) {
 			/* ClothVertex *cv1, *cv2; */ /* UNUSED */
 			int v1, v2;
 			float len, c, l, vec[3];
@@ -322,7 +322,7 @@ static int UNUSED_FUNCTION(cloth_calc_helper_forces)(Object *UNUSED(ob), ClothMo
 
 		/*compute forces*/
 		sub_v3_v3v3(vec, cos[i], cv->tx);
-		mul_v3_fl(vec, cv->mass*dt*20.0f);
+		mul_v3_fl(vec, cv->mass * dt * 20.0f);
 		add_v3_v3(cv->tv, vec);
 		//copy_v3_v3(cv->tx, cos[i]);
 	}
@@ -438,10 +438,10 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), ListB
 	/* Collect forces and derivatives:  F, dFdX, dFdV */
 	Cloth *cloth = clmd->clothObject;
 	Implicit_Data *data = cloth->implicit;
-	unsigned int i	= 0;
-	float 		drag 	= clmd->sim_parms->Cvi * 0.01f; /* viscosity of air scaled in percent */
-	float 		gravity[3] = {0.0f, 0.0f, 0.0f};
-	const MVertTri *tri 	= cloth->tri;
+	unsigned int i  = 0;
+	float drag    = clmd->sim_parms->Cvi * 0.01f;       /* viscosity of air scaled in percent */
+	float gravity[3] = {0.0f, 0.0f, 0.0f};
+	const MVertTri *tri     = cloth->tri;
 	unsigned int mvert_num = cloth->mvert_num;
 	ClothVertex *vert;
 
@@ -481,7 +481,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), ListB
 	/* handle external forces like wind */
 	if (effectors) {
 		/* cache per-vertex forces to avoid redundant calculation */
-		float (*winvec)[3] = (float (*)[3])MEM_callocN(sizeof(float[3]) * mvert_num, "effector forces");
+		float(*winvec)[3] = (float(*)[3])MEM_callocN(sizeof(float[3]) * mvert_num, "effector forces");
 		for (i = 0; i < cloth->mvert_num; i++) {
 			float x[3], v[3];
 			EffectedPoint epoint;
@@ -526,8 +526,8 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), ListB
 				else
 					BPH_mass_spring_force_vertex_wind(data, i, 1.0f, winvec);
 			}
-		}
 #endif
+		}
 
 		MEM_freeN(winvec);
 	}
@@ -57

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list