From ab4a2aaf4a4b2b4e416aa1f113b30362cbe0dec3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 24 Mar 2012 06:38:07 +0000 Subject: style cleanup: follow style guide for formatting of if/for/while loops, and else if's --- source/blender/editors/object/object_lattice.c | 52 +++++++++++++------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'source/blender/editors/object/object_lattice.c') diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c index 8d83bd6f9be..4ba62541c60 100644 --- a/source/blender/editors/object/object_lattice.c +++ b/source/blender/editors/object/object_lattice.c @@ -70,12 +70,12 @@ void free_editLatt(Object *ob) { Lattice *lt= ob->data; - if(lt->editlatt) { + if (lt->editlatt) { Lattice *editlt= lt->editlatt->latt; - if(editlt->def) + if (editlt->def) MEM_freeN(editlt->def); - if(editlt->dvert) + if (editlt->dvert) free_dverts(editlt->dvert, editlt->pntsu*editlt->pntsv*editlt->pntsw); MEM_freeN(editlt); @@ -93,20 +93,20 @@ void make_editLatt(Object *obedit) free_editLatt(obedit); actkey= ob_get_keyblock(obedit); - if(actkey) + if (actkey) key_to_latt(actkey, lt); lt->editlatt= MEM_callocN(sizeof(EditLatt), "editlatt"); lt->editlatt->latt= MEM_dupallocN(lt); lt->editlatt->latt->def= MEM_dupallocN(lt->def); - if(lt->dvert) { + if (lt->dvert) { int tot= lt->pntsu*lt->pntsv*lt->pntsw; lt->editlatt->latt->dvert = MEM_mallocN (sizeof (MDeformVert)*tot, "Lattice MDeformVert"); copy_dverts(lt->editlatt->latt->dvert, lt->dvert, tot); } - if(lt->key) lt->editlatt->shapenr= obedit->shapenr; + if (lt->key) lt->editlatt->shapenr= obedit->shapenr; } void load_editLatt(Object *obedit) @@ -120,19 +120,19 @@ void load_editLatt(Object *obedit) lt= obedit->data; editlt= lt->editlatt->latt; - if(lt->editlatt->shapenr) { + if (lt->editlatt->shapenr) { actkey= BLI_findlink(<->key->block, lt->editlatt->shapenr-1); /* active key: vertices */ tot= editlt->pntsu*editlt->pntsv*editlt->pntsw; - if(actkey->data) MEM_freeN(actkey->data); + if (actkey->data) MEM_freeN(actkey->data); fp=actkey->data= MEM_callocN(lt->key->elemsize*tot, "actkey->data"); actkey->totelem= tot; bp= editlt->def; - while(tot--) { + while (tot--) { copy_v3_v3(fp, bp->vec); fp+= 3; bp++; @@ -154,12 +154,12 @@ void load_editLatt(Object *obedit) lt->typew= editlt->typew; } - if(lt->dvert) { + if (lt->dvert) { free_dverts(lt->dvert, lt->pntsu*lt->pntsv*lt->pntsw); lt->dvert= NULL; } - if(editlt->dvert) { + if (editlt->dvert) { tot= lt->pntsu*lt->pntsv*lt->pntsw; lt->dvert = MEM_mallocN (sizeof (MDeformVert)*tot, "Lattice MDeformVert"); @@ -179,8 +179,8 @@ void ED_setflagsLatt(Object *obedit, int flag) a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw; - while(a--) { - if(bp->hide==0) { + while (a--) { + if (bp->hide==0) { bp->f1= flag; } bp++; @@ -201,9 +201,9 @@ static int lattice_select_all_exec(bContext *C, wmOperator *op) bp= lt->editlatt->latt->def; a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw; - while(a--) { - if(bp->hide==0) { - if(bp->f1) { + while (a--) { + if (bp->hide==0) { + if (bp->f1) { action = SEL_DESELECT; break; } @@ -223,8 +223,8 @@ static int lattice_select_all_exec(bContext *C, wmOperator *op) bp= lt->editlatt->latt->def; a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw; - while(a--) { - if(bp->hide==0) { + while (a--) { + if (bp->hide==0) { bp->f1 ^= 1; } bp++; @@ -258,7 +258,7 @@ static int make_regular_poll(bContext *C) { Object *ob; - if(ED_operator_editlattice(C)) return 1; + if (ED_operator_editlattice(C)) return 1; ob= CTX_data_active_object(C); return (ob && ob->type==OB_LATTICE); @@ -269,7 +269,7 @@ static int make_regular_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob= CTX_data_edit_object(C); Lattice *lt; - if(ob) { + if (ob) { lt= ob->data; resizelattice(lt->editlatt->latt, lt->pntsu, lt->pntsv, lt->pntsw, NULL); } @@ -307,10 +307,10 @@ static void findnearestLattvert__doClosest(void *userData, BPoint *bp, int x, in struct { BPoint *bp; short dist, select; int mval[2]; } *data = userData; float temp = abs(data->mval[0]-x) + abs(data->mval[1]-y); - if((bp->f1 & SELECT)==data->select) + if ((bp->f1 & SELECT)==data->select) temp += 5; - if(tempdist) { + if (tempdist) { data->dist = temp; data->bp = bp; @@ -343,8 +343,8 @@ int mouse_lattice(bContext *C, const int mval[2], int extend) view3d_set_viewcontext(C, &vc); bp= findnearestLattvert(&vc, mval, 1); - if(bp) { - if(extend==0) { + if (bp) { + if (extend==0) { ED_setflagsLatt(vc.obedit, 0); bp->f1 |= SELECT; } @@ -392,7 +392,7 @@ static void free_undoLatt(void *data) { UndoLattice *ult= (UndoLattice*)data; - if(ult->def) MEM_freeN(ult->def); + if (ult->def) MEM_freeN(ult->def); MEM_freeN(ult); } @@ -410,7 +410,7 @@ static void *get_editlatt(bContext *C) { Object *obedit= CTX_data_edit_object(C); - if(obedit && obedit->type==OB_LATTICE) { + if (obedit && obedit->type==OB_LATTICE) { Lattice *lt= obedit->data; return lt->editlatt; } -- cgit v1.2.3