From e701f9b67010279db02ceb51f7d08078cb34170a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 29 Apr 2012 15:47:02 +0000 Subject: style cleanup: whitespace / commas --- source/blender/modifiers/intern/MOD_boolean_util.c | 12 ++-- source/blender/modifiers/intern/MOD_explode.c | 72 +++++++++++----------- .../blender/modifiers/intern/MOD_fluidsim_util.c | 8 +-- .../modifiers/intern/MOD_particleinstance.c | 16 ++--- source/blender/modifiers/intern/MOD_util.c | 2 +- source/blender/modifiers/intern/MOD_uvproject.c | 4 +- 6 files changed, 57 insertions(+), 57 deletions(-) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c index 8341bc67107..711c7e6e4ff 100644 --- a/source/blender/modifiers/intern/MOD_boolean_util.c +++ b/source/blender/modifiers/intern/MOD_boolean_util.c @@ -129,7 +129,7 @@ static void VertexIt_Construct(CSG_VertexIteratorDescriptor *output, DerivedMesh if (output == 0) return; // allocate some memory for blender iterator - it = (VertexIt *)(MEM_mallocN(sizeof(VertexIt),"Boolean_VIt")); + it = (VertexIt *)(MEM_mallocN(sizeof(VertexIt), "Boolean_VIt")); if (it == 0) { return; } @@ -223,7 +223,7 @@ static void FaceIt_Construct( if (output == 0) return; // allocate some memory for blender iterator - it = (FaceIt *)(MEM_mallocN(sizeof(FaceIt),"Boolean_FIt")); + it = (FaceIt *)(MEM_mallocN(sizeof(FaceIt), "Boolean_FIt")); if (it == 0) { return; } @@ -333,7 +333,7 @@ static void InterpCSGFace( else copy_v3_v3(obco, co[j]); - interp_weights_face_v3( w[j],orig_co[0], orig_co[1], orig_co[2], orig_co[3], obco); + interp_weights_face_v3(w[j], orig_co[0], orig_co[1], orig_co[2], orig_co[3], obco); } CustomData_interp(&orig_dm->faceData, &dm->faceData, &orig_index, NULL, (float*)w, 1, index); @@ -496,8 +496,8 @@ static void BuildMeshDescriptors( struct CSG_FaceIteratorDescriptor * face_it, struct CSG_VertexIteratorDescriptor * vertex_it) { - VertexIt_Construct(vertex_it,dm, ob); - FaceIt_Construct(face_it,dm,face_offset,ob); + VertexIt_Construct(vertex_it, dm, ob); + FaceIt_Construct(face_it, dm, face_offset, ob); } static void FreeMeshDescriptors( @@ -551,7 +551,7 @@ static DerivedMesh *NewBooleanDerivedMesh_intern( } BuildMeshDescriptors(dm_select, ob_select, 0, &fd_1, &vd_1); - BuildMeshDescriptors(dm, ob, dm_select->getNumTessFaces(dm_select) , &fd_2, &vd_2); + BuildMeshDescriptors(dm, ob, dm_select->getNumTessFaces(dm_select), &fd_2, &vd_2); bool_op = CSG_NewBooleanFunction(); diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 11542dc4c1a..af1969061fe 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -104,8 +104,8 @@ static void createFacepa(ExplodeModifierData *emd, ParticleData *pa; KDTree *tree; float center[3], co[3]; - int *facepa=NULL,*vertpa=NULL,totvert=0,totface=0,totpart=0; - int i,p,v1,v2,v3,v4=0; + int *facepa=NULL, *vertpa=NULL, totvert=0, totface=0, totpart=0; + int i, p, v1, v2, v3, v4=0; mvert = dm->getVertArray(dm); mface = dm->getTessFaceArray(dm); @@ -145,24 +145,24 @@ static void createFacepa(ExplodeModifierData *emd, /* make tree of emitter locations */ tree=BLI_kdtree_new(totpart); - for (p=0,pa=psys->particles; ppart->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,NULL,NULL,NULL,NULL,NULL); + for (p=0, pa=psys->particles; ppart->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, NULL, NULL, NULL, NULL, NULL); BLI_kdtree_insert(tree, p, co, NULL); } BLI_kdtree_balance(tree); /* set face-particle-indexes to nearest particle to face center */ - for (i=0,fa=mface; iv1].co,mvert[fa->v2].co); + for (i=0, fa=mface; iv1].co, mvert[fa->v2].co); add_v3_v3(center, mvert[fa->v3].co); if (fa->v4) { add_v3_v3(center, mvert[fa->v4].co); - mul_v3_fl(center,0.25); + mul_v3_fl(center, 0.25); } else - mul_v3_fl(center,0.3333f); + mul_v3_fl(center, 0.3333f); - p= BLI_kdtree_find_nearest(tree,center,NULL,NULL); + p= BLI_kdtree_find_nearest(tree, center, NULL, NULL); v1=vertpa[fa->v1]; v2=vertpa[fa->v2]; @@ -545,7 +545,7 @@ static void remap_uvs_23(DerivedMesh *dm, DerivedMesh *split, int numlayer, int static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm) { DerivedMesh *splitdm; - MFace *mf=NULL,*df1=NULL; + MFace *mf=NULL, *df1=NULL; MFace *mface=dm->getTessFaceArray(dm); MVert *dupve, *mv; EdgeHash *edgehash; @@ -553,10 +553,10 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm) int totvert=dm->getNumVerts(dm); int totface=dm->getNumTessFaces(dm); - int *facesplit = MEM_callocN(sizeof(int)*totface,"explode_facesplit"); - int *vertpa = MEM_callocN(sizeof(int)*totvert,"explode_vertpa2"); + int *facesplit = MEM_callocN(sizeof(int)*totface, "explode_facesplit"); + int *vertpa = MEM_callocN(sizeof(int)*totvert, "explode_vertpa2"); int *facepa = emd->facepa; - int *fs, totesplit=0,totfsplit=0,curdupface=0; + int *fs, totesplit=0, totfsplit=0, curdupface=0; int i, v1, v2, v3, v4, esplit, v[4] = {0, 0, 0, 0}, /* To quite gcc barking... */ uv[4] = {0, 0, 0, 0}; /* To quite gcc barking... */ @@ -566,7 +566,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm) edgehash= BLI_edgehash_new(); /* recreate vertpa from facepa calculation */ - for (i=0,mf=mface; iv1]=facepa[i]; vertpa[mf->v2]=facepa[i]; vertpa[mf->v3]=facepa[i]; @@ -575,7 +575,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm) } /* mark edges for splitting and how to split faces */ - for (i=0,mf=mface,fs=facesplit; iv1]; v2=vertpa[mf->v2]; v3=vertpa[mf->v3]; @@ -627,7 +627,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm) BLI_edgehashIterator_free(ehi); /* count new faces due to splitting */ - for (i=0,fs=facesplit; ifacepa,totface*sizeof(int)); + facepa= MEM_callocN(sizeof(int)*(totface+(totfsplit * 2)), "explode_facepa"); + //memcpy(facepa, emd->facepa, totface*sizeof(int)); emd->facepa=facepa; /* create new verts */ @@ -660,9 +660,9 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm) BLI_edgehashIterator_getKey(ehi, &ed_v1, &ed_v2); esplit= GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi)); mv=CDDM_get_vert(splitdm, ed_v2); - dupve=CDDM_get_vert(splitdm,esplit); + dupve=CDDM_get_vert(splitdm, esplit); - DM_copy_vert_data(splitdm,splitdm, ed_v2, esplit,1); + DM_copy_vert_data(splitdm, splitdm, ed_v2, esplit, 1); *dupve=*mv; @@ -676,7 +676,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm) /* create new faces */ curdupface=0;//=totface; //curdupin=totesplit; - for (i=0,fs=facesplit; igetTessFaceData(dm, i, CD_MFACE); switch (*fs) { @@ -797,7 +797,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, float cfra; /* float timestep; */ int *facepa=emd->facepa; - int totdup=0,totvert=0,totface=0,totpart=0,delface=0; + int totdup=0, totvert=0, totface=0, totpart=0, delface=0; int i, v, u; unsigned int ed_v1, ed_v2, mindex=0; MTFace *mtface = NULL, *mtf; @@ -858,12 +858,12 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, BLI_edgehashIterator_free(ehi); /* the final duplicated vertices */ - explode= CDDM_from_template(dm, totdup, 0,totface-delface, 0, 0); + explode= CDDM_from_template(dm, totdup, 0, totface-delface, 0, 0); mtface = CustomData_get_layer_named(&explode->faceData, CD_MTFACE, emd->uvname); /*dupvert= CDDM_get_verts(explode);*/ /* getting back to object space */ - invert_m4_m4(imat,ob->obmat); + invert_m4_m4(imat, ob->obmat); psmd->psys->lattice = psys_get_lattice(&sim); @@ -879,7 +879,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, v= GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi)); dm->getVert(dm, ed_v1, &source); - dest = CDDM_get_vert(explode,v); + dest = CDDM_get_vert(explode, v); DM_copy_vert_data(dm, explode, ed_v1, v, 1); *dest = source; @@ -893,8 +893,8 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, state.time=cfra; psys_get_particle_state(&sim, ed_v2, &state, 1); - vertco=CDDM_get_vert(explode,v)->co; - mul_m4_v3(ob->obmat,vertco); + vertco=CDDM_get_vert(explode, v)->co; + mul_m4_v3(ob->obmat, vertco); sub_v3_v3(vertco, birth.co); @@ -903,7 +903,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, mul_qt_v3(rot, vertco); if (emd->flag & eExplodeFlag_PaSize) - mul_v3_fl(vertco,pa->size); + mul_v3_fl(vertco, pa->size); add_v3_v3(vertco, state.co); @@ -913,7 +913,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, BLI_edgehashIterator_free(ehi); /*map new vertices to faces*/ - for (i=0,u=0; ialive==PARS_DEAD && (emd->flag&eExplodeFlag_Dead)==0) continue; } - dm->getTessFace(dm,i,&source); - mf=CDDM_get_tessface(explode,u); + dm->getTessFace(dm, i, &source); + mf=CDDM_get_tessface(explode, u); orig_v4 = source.v4; @@ -941,7 +941,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, if (source.v4) source.v4 = edgecut_get(vertpahash, source.v4, mindex); - DM_copy_tessface_data(dm,explode,i,u,1); + DM_copy_tessface_data(dm, explode, i, u, 1); *mf = source; @@ -995,7 +995,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob, { DerivedMesh *dm = derivedData; ExplodeModifierData *emd= (ExplodeModifierData*) md; - ParticleSystemModifierData *psmd=findPrecedingParticlesystem(ob,md); + ParticleSystemModifierData *psmd=findPrecedingParticlesystem(ob, md); DM_ensure_tessface(dm); /* BMESH - UNTIL MODIFIER IS UPDATED FOR MPoly */ @@ -1018,13 +1018,13 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob, if (emd->flag & eExplodeFlag_CalcFaces) emd->flag &= ~eExplodeFlag_CalcFaces; - createFacepa(emd,psmd,derivedData); + createFacepa(emd, psmd, derivedData); } /* 2. create new mesh */ if (emd->flag & eExplodeFlag_EdgeCut) { int *facepa = emd->facepa; - DerivedMesh *splitdm=cutEdges(emd,dm); - DerivedMesh *explode=explodeMesh(emd, psmd, md->scene, ob, splitdm); + DerivedMesh *splitdm = cutEdges(emd, dm); + DerivedMesh *explode = explodeMesh(emd, psmd, md->scene, ob, splitdm); MEM_freeN(emd->facepa); emd->facepa=facepa; diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 8d3b1871c51..ac3341f8e8d 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -165,7 +165,7 @@ void fluidsim_free(FluidsimModifierData *fluidmd) /* read .bobj.gz file into a fluidsimDerivedMesh struct */ static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_example) { - int wri = 0,i; + int wri = 0, i; int gotBytes; gzFile gzf; int numverts = 0, numfaces = 0; @@ -361,7 +361,7 @@ void fluid_estimate_memory(Object *ob, FluidsimSettings *fss, char *value) mesh= ob->data; fluid_get_bb(mesh->mvert, mesh->totvert, ob->obmat, fss->bbStart, fss->bbSize); - elbeemEstimateMemreq(fss->resolutionxyz, fss->bbSize[0],fss->bbSize[1],fss->bbSize[2], fss->maxRefine, value); + elbeemEstimateMemreq(fss->resolutionxyz, fss->bbSize[0], fss->bbSize[1], fss->bbSize[2], fss->maxRefine, value); } } @@ -393,7 +393,7 @@ static void fluidsim_read_vel_cache(FluidsimModifierData *fluidmd, DerivedMesh * velarray = fss->meshVelocities; - // .bobj.gz , correct filename + // .bobj.gz, correct filename // 87654321 filename[len-6] = 'v'; filename[len-5] = 'e'; @@ -478,7 +478,7 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim if (getenv(strEnvName2)) { int elevel = atoi(getenv(strEnvName2)); if (elevel>0) { - printf("Env. var %s set, fluid sim mesh '%s' not found, aborting render...\n",strEnvName2, targetFile); + printf("Env. var %s set, fluid sim mesh '%s' not found, aborting render...\n", strEnvName2, targetFile); exit(1); } } diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c index 628104295f7..3af1351cbdb 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.c +++ b/source/blender/modifiers/intern/MOD_particleinstance.c @@ -117,7 +117,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob, ParticleData *pa= NULL, *pars= NULL; MFace *mface, *orig_mface; MVert *mvert, *orig_mvert; - int i,totvert, totpart=0, totface, maxvert, maxface, first_particle=0; + int i, totvert, totpart=0, totface, maxvert, maxface, first_particle=0; short track=ob->trackflag%3, trackneg, axis = pimd->axis; float max_co=0.0, min_co=0.0, temp_co[3], cross[3]; float *size=NULL; @@ -132,7 +132,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob, } if (pimd->ob) { - psys = BLI_findlink(&pimd->ob->particlesystem,pimd->psys-1); + psys = BLI_findlink(&pimd->ob->particlesystem, pimd->psys-1); if (psys==NULL || psys->totpart==0) return derivedData; } @@ -192,7 +192,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob, max_co=max_r[track]; } - result = CDDM_from_template(dm, maxvert,dm->getNumEdges(dm)*totpart,maxface, 0, 0); + result = CDDM_from_template(dm, maxvert, dm->getNumEdges(dm)*totpart, maxface, 0, 0); mvert=result->getVertArray(result); orig_mvert=dm->getVertArray(dm); @@ -231,7 +231,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob, mv->co[axis] = 0.0; } - psys_get_particle_on_path(&sim, first_particle + i/totvert, &state,1); + psys_get_particle_on_path(&sim, first_particle + i/totvert, &state, 1); normalize_v3(state.vel); @@ -241,22 +241,22 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob, state.rot[1] = state.rot[2] = state.rot[3] = 0.0f; } else { - float temp[3] = {0.0f,0.0f,0.0f}; + float temp[3] = {0.0f, 0.0f, 0.0f}; temp[axis] = 1.0f; cross_v3_v3v3(cross, temp, state.vel); /* state.vel[axis] is the only component surviving from a dot product with the axis */ - axis_angle_to_quat(state.rot,cross,saacos(state.vel[axis])); + axis_angle_to_quat(state.rot, cross, saacos(state.vel[axis])); } } else { state.time=-1.0; - psys_get_particle_state(&sim, first_particle + i/totvert, &state,1); + psys_get_particle_state(&sim, first_particle + i/totvert, &state, 1); } - mul_qt_v3(state.rot,mv->co); + mul_qt_v3(state.rot, mv->co); if (pimd->flag & eParticleInstanceFlag_UseSize) mul_v3_fl(mv->co, size[i/totvert]); add_v3_v3(mv->co, state.co); diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index c0a4b319a18..4e143bcb008 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -209,7 +209,7 @@ DerivedMesh *get_dm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float (* if (orco) DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob)); } - else if (ELEM3(ob->type,OB_FONT,OB_CURVE,OB_SURF)) { + else if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) { dm= CDDM_from_curve(ob); } diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index 1b96c586cbf..2b289efa437 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -224,12 +224,12 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, if (cam->type == CAM_PERSP) { float perspmat[4][4]; - perspective_m4( perspmat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend); + perspective_m4( perspmat, xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend); mult_m4_m4m4(tmpmat, perspmat, projectors[i].projmat); } else { /* if (cam->type == CAM_ORTHO) */ float orthomat[4][4]; - orthographic_m4( orthomat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend); + orthographic_m4( orthomat, xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend); mult_m4_m4m4(tmpmat, orthomat, projectors[i].projmat); } } -- cgit v1.2.3