diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 11:52:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 11:52:14 +0400 |
commit | b8a71efeba70d6c3ebc579f5043daa4162da86e8 (patch) | |
tree | d2d89da2a59f8955583f4968a35e48c578fd4d4c /source/blender/editors | |
parent | 81d8f17843f92c6d6abbacb652ca22917910f4bc (diff) |
style cleanup: follow style guide for/with/if spacing
Diffstat (limited to 'source/blender/editors')
26 files changed, 115 insertions, 114 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index fbcda86eb75..aeab4f27179 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -3673,7 +3673,7 @@ static int is_u_selected(Nurb *nu, int u) /* what about resolu == 2? */ bp= nu->bp+u; for (v=0; v<nu->pntsv-1; v++, bp+=nu->pntsu) { - if (v) if(bp->f1 & SELECT) return 1; + if (v) if (bp->f1 & SELECT) return 1; } return 0; @@ -6376,7 +6376,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) bp->vec[0]+= fac*grid; fac= (float)b -1.5f; bp->vec[1]+= fac*grid; - if (a==1 || a==2) if(b==1 || b==2) { + if (a==1 || a==2) if (b==1 || b==2) { bp->vec[2]+= grid; } mul_m4_v3(mat,bp->vec); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index b9002648709..b6821abf243 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -81,7 +81,7 @@ /* avoid unneeded calls to ui_get_but_val */ #define UI_BUT_VALUE_UNSET DBL_MAX -#define UI_GET_BUT_VALUE_INIT(_but, _value) if(_value == DBL_MAX) { (_value)= ui_get_but_val(_but); } +#define UI_GET_BUT_VALUE_INIT(_but, _value) if (_value == DBL_MAX) { (_value)= ui_get_but_val(_but); } /* * a full doc with API notes can be found in bf-blender/trunk/blender/doc/guides/interface_API.txt diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 25c616cc67e..a2f253cecaf 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -161,12 +161,12 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl glGetFloatv(GL_CURRENT_COLOR, color); /* 'shade' defines strength of shading */ - coltop[0]= color[0]+shadetop; if(coltop[0]>1.0f) coltop[0]= 1.0f; - coltop[1]= color[1]+shadetop; if(coltop[1]>1.0f) coltop[1]= 1.0f; - coltop[2]= color[2]+shadetop; if(coltop[2]>1.0f) coltop[2]= 1.0f; - coldown[0]= color[0]+shadedown; if(coldown[0]<0.0f) coldown[0]= 0.0f; - coldown[1]= color[1]+shadedown; if(coldown[1]<0.0f) coldown[1]= 0.0f; - coldown[2]= color[2]+shadedown; if(coldown[2]<0.0f) coldown[2]= 0.0f; + coltop[0]= color[0]+shadetop; if (coltop[0]>1.0f) coltop[0]= 1.0f; + coltop[1]= color[1]+shadetop; if (coltop[1]>1.0f) coltop[1]= 1.0f; + coltop[2]= color[2]+shadetop; if (coltop[2]>1.0f) coltop[2]= 1.0f; + coldown[0]= color[0]+shadedown; if (coldown[0]<0.0f) coldown[0]= 0.0f; + coldown[1]= color[1]+shadedown; if (coldown[1]<0.0f) coldown[1]= 0.0f; + coldown[2]= color[2]+shadedown; if (coldown[2]<0.0f) coldown[2]= 0.0f; glShadeModel(GL_SMOOTH); glBegin(mode); @@ -269,12 +269,12 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float glGetFloatv(GL_CURRENT_COLOR, color); /* 'shade' defines strength of shading */ - colLeft[0]= color[0]+shadeLeft; if(colLeft[0]>1.0f) colLeft[0]= 1.0f; - colLeft[1]= color[1]+shadeLeft; if(colLeft[1]>1.0f) colLeft[1]= 1.0f; - colLeft[2]= color[2]+shadeLeft; if(colLeft[2]>1.0f) colLeft[2]= 1.0f; - colRight[0]= color[0]+shadeRight; if(colRight[0]<0.0f) colRight[0]= 0.0f; - colRight[1]= color[1]+shadeRight; if(colRight[1]<0.0f) colRight[1]= 0.0f; - colRight[2]= color[2]+shadeRight; if(colRight[2]<0.0f) colRight[2]= 0.0f; + colLeft[0]= color[0]+shadeLeft; if (colLeft[0]>1.0f) colLeft[0]= 1.0f; + colLeft[1]= color[1]+shadeLeft; if (colLeft[1]>1.0f) colLeft[1]= 1.0f; + colLeft[2]= color[2]+shadeLeft; if (colLeft[2]>1.0f) colLeft[2]= 1.0f; + colRight[0]= color[0]+shadeRight; if (colRight[0]<0.0f) colRight[0]= 0.0f; + colRight[1]= color[1]+shadeRight; if (colRight[1]<0.0f) colRight[1]= 0.0f; + colRight[2]= color[2]+shadeRight; if (colRight[2]<0.0f) colRight[2]= 0.0f; glShadeModel(GL_SMOOTH); glBegin(mode); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index ff72c13aa34..13962777da3 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1342,8 +1342,8 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but, dir1 &= (UI_TOP|UI_DOWN); } - if (dir2==0) if(dir1==UI_LEFT || dir1==UI_RIGHT) dir2= UI_DOWN; - if (dir2==0) if(dir1==UI_TOP || dir1==UI_DOWN) dir2= UI_LEFT; + if (dir2==0) if (dir1==UI_LEFT || dir1==UI_RIGHT) dir2= UI_DOWN; + if (dir2==0) if (dir1==UI_TOP || dir1==UI_DOWN) dir2= UI_LEFT; /* no space at all? don't change */ if (left || right) { diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index d47bd44d8f7..91ff4000541 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -953,7 +953,7 @@ static void do_constraint_panels(bContext *C, void *ob_pt, int event) // if there are problems because of this, then rna needs changed update functions. // // object_test_constraints(ob); - // if(ob->pose) update_pose_constraint_flags(ob->pose); + // if (ob->pose) update_pose_constraint_flags(ob->pose); if (ob->type==OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB); else DAG_id_tag_update(&ob->id, OB_RECALC_OB); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 22ecf6198d7..3717591e412 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -908,7 +908,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN(C, Base*, base, selected_bases) { - /* if(base->object->type==OB_LAMP) islamp= 1; */ + /* if (base->object->type==OB_LAMP) islamp= 1; */ /* deselect object -- it could be used in other scenes */ base->object->flag &= ~SELECT; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 906ee65b45d..341ba368729 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1115,7 +1115,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) base->object->lay= lay; base->object->flag &= ~SELECT; base->flag &= ~SELECT; - /* if(base->object->type==OB_LAMP) islamp= 1; */ + /* if (base->object->type==OB_LAMP) islamp= 1; */ } CTX_DATA_END; } @@ -1127,7 +1127,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) local= base->lay & 0xFF000000; base->lay= lay + local; base->object->lay= lay; - /* if(base->object->type==OB_LAMP) islamp= 1; */ + /* if (base->object->type==OB_LAMP) islamp= 1; */ } CTX_DATA_END; } diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 36571fc0ced..959bda22263 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -227,7 +227,7 @@ static int object_shape_key_mirror(bContext *C, Object *ob) /* currently editmode isn't supported by mesh so * ignore here for now too */ - /* if(lt->editlatt) lt= lt->editlatt->latt; */ + /* if (lt->editlatt) lt= lt->editlatt->latt; */ for (w=0; w<lt->pntsw; w++) { for (v=0; v<lt->pntsv; v++) { diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 68d464da261..bf3a9fff4e2 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -90,15 +90,15 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys); #define KEY_K PTCacheEditKey *key; int k #define POINT_P PTCacheEditPoint *point; int p #define LOOP_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) -#define LOOP_VISIBLE_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(!(point->flag & PEP_HIDE)) -#define LOOP_SELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point_is_selected(point)) -#define LOOP_UNSELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(!point_is_selected(point)) -#define LOOP_EDITED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point->flag & PEP_EDIT_RECALC) -#define LOOP_TAGGED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point->flag & PEP_TAG) +#define LOOP_VISIBLE_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (!(point->flag & PEP_HIDE)) +#define LOOP_SELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point_is_selected(point)) +#define LOOP_UNSELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (!point_is_selected(point)) +#define LOOP_EDITED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point->flag & PEP_EDIT_RECALC) +#define LOOP_TAGGED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point->flag & PEP_TAG) #define LOOP_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) -#define LOOP_VISIBLE_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if(!(key->flag & PEK_HIDE)) -#define LOOP_SELECTED_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE)) -#define LOOP_TAGGED_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if(key->flag & PEK_TAG) +#define LOOP_VISIBLE_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if (!(key->flag & PEK_HIDE)) +#define LOOP_SELECTED_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if ((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE)) +#define LOOP_TAGGED_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if (key->flag & PEK_TAG) #define KEY_WCO (key->flag & PEK_USE_WCO ? key->world_co : key->co) @@ -2152,7 +2152,7 @@ static void remove_tagged_keys(Object *ob, ParticleSystem *psys) hkey= pa->hair; LOOP_KEYS { - while(key->flag & PEK_TAG && hkey < pa->hair + pa->totkey) { + while (key->flag & PEK_TAG && hkey < pa->hair + pa->totkey) { key++; hkey++; } @@ -2366,7 +2366,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) /* remove tagged particles - don't do mirror here! */ remove_tagged_particles(ob, psys, 0); totremoved += removed; - } while(removed); + } while (removed); if (totremoved == 0) return OPERATOR_CANCELLED; @@ -2645,7 +2645,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged) newpa->fuv[1]= pa->fuv[1]; newpa->fuv[2]= pa->fuv[0]; newpa->fuv[3]= pa->fuv[3]; - while(rotation-- > 0) + while (rotation-- > 0) if (me->mface[pa->num].v4) { SHIFT4(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2], newpa->fuv[3]); } @@ -3214,7 +3214,7 @@ static int brush_add(PEData *data, short number) for (i=0; i<number; i++) { if (number>1) { dmx=dmy=size; - while(dmx*dmx+dmy*dmy>size2) { + while (dmx*dmx+dmy*dmy>size2) { dmx=(short)((2.0f*BLI_frand()-1.0f)*size); dmy=(short)((2.0f*BLI_frand()-1.0f)*size); } @@ -3891,7 +3891,7 @@ void PE_undo_push(Scene *scene, const char *str) if (!edit) return; /* remove all undos after (also when curundo==NULL) */ - while(edit->undo.last != edit->curundo) { + while (edit->undo.last != edit->curundo) { undo= edit->undo.last; BLI_remlink(&edit->undo, undo); free_PTCacheUndo(undo); @@ -3906,13 +3906,13 @@ void PE_undo_push(Scene *scene, const char *str) /* and limit amount to the maximum */ nr= 0; undo= edit->undo.last; - while(undo) { + while (undo) { nr++; if (nr==U.undosteps) break; undo= undo->prev; } if (undo) { - while(edit->undo.first!=undo) { + while (edit->undo.first!=undo) { PTCacheUndo *first= edit->undo.first; BLI_remlink(&edit->undo, first); free_PTCacheUndo(first); @@ -3973,7 +3973,7 @@ static void PTCacheUndo_clear(PTCacheEdit *edit) if (edit==NULL) return; undo= edit->undo.first; - while(undo) { + while (undo) { free_PTCacheUndo(undo); undo= undo->next; } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 48b1afad891..9deb64ef60a 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -599,11 +599,11 @@ void select_connected_scredge(bScreen *sc, ScrEdge *edge) oneselected= 0; while (se) { if (se->v1->flag + se->v2->flag==1) { - if (dir=='h') if(se->v1->vec.y==se->v2->vec.y) { + if (dir=='h') if (se->v1->vec.y==se->v2->vec.y) { se->v1->flag= se->v2->flag= 1; oneselected= 1; } - if (dir=='v') if(se->v1->vec.x==se->v2->vec.x) { + if (dir=='v') if (se->v1->vec.x==se->v2->vec.x) { se->v1->flag= se->v2->flag= 1; oneselected= 1; } diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 3508f8e7f11..8cdacea9bd7 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -229,7 +229,7 @@ static void imapaint_tri_weights(Object *ob, h[1]= (co[1] - view[1])*2.0f/view[3] - 1; h[2]= 1.0f; - /* solve for(w1,w2,w3)/perspdiv in: + /* solve for (w1,w2,w3)/perspdiv in: * h * perspdiv = Project * Model * (w1 * v1 + w2 * v2 + w3 * v3) */ wmat[0][0]= pv1[0]; wmat[1][0]= pv2[0]; wmat[2][0]= pv3[0]; diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 1ca3ac1ec9a..425cee38af0 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -393,7 +393,7 @@ static int console_insert_exec(bContext *C, wmOperator *op) static int console_insert_invoke(bContext *C, wmOperator *op, wmEvent *event) { - // if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ + // if (!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ if (!RNA_string_length(op->ptr, "text")) { /* if alt/ctrl/super are pressed pass through */ if (event->ctrl || event->oskey) { @@ -512,12 +512,12 @@ static int console_clear_exec(bContext *C, wmOperator *op) /*ConsoleLine *ci= */ console_history_verify(C); if (scrollback) { /* last item in mistory */ - while(sc->scrollback.first) + while (sc->scrollback.first) console_scrollback_free(sc, sc->scrollback.first); } if (history) { - while(sc->history.first) + while (sc->history.first) console_history_free(sc, sc->history.first); } @@ -577,7 +577,7 @@ static int console_history_cycle_exec(bContext *C, wmOperator *op) { /* add a duplicate of the new arg and remove all other instances */ ConsoleLine *cl; - while((cl= console_history_find(sc, ci->line, ci))) + while ((cl= console_history_find(sc, ci->line, ci))) console_history_free(sc, cl); console_history_add(C, (ConsoleLine *)sc->history.last); @@ -626,7 +626,7 @@ static int console_history_append_exec(bContext *C, wmOperator *op) if (rem_dupes) { ConsoleLine *cl; - while((cl= console_history_find(sc, ci->line, ci))) + while ((cl= console_history_find(sc, ci->line, ci))) console_history_free(sc, cl); if (strcmp(str, ci->line)==0) { @@ -815,7 +815,7 @@ static int console_paste_exec(bContext *C, wmOperator *UNUSED(op)) buf_step= buf_str; - while((buf_next=buf_step) && buf_next[0] != '\0') { + while ((buf_next=buf_step) && buf_next[0] != '\0') { buf_step= strchr(buf_next, '\n'); if (buf_step) { *buf_step= '\0'; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 202a82be4b4..71ead483d06 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1179,7 +1179,7 @@ void filelist_from_main(struct FileList *filelist) id= lb->first; filelist->numfiles= 0; - while(id) { + while (id) { if (!filelist->hide_dot || id->name[2] != '.') { filelist->numfiles++; } @@ -1204,7 +1204,7 @@ void filelist_from_main(struct FileList *filelist) id= lb->first; totlib= totbl= 0; - while(id) { + while (id) { ok = 1; if (ok) { if (!filelist->hide_dot || id->name[2] != '.') { diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 5de0dd3fccd..be53b03bec6 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -2260,7 +2260,7 @@ static int image_record_composite_exec(bContext *C, wmOperator *op) if (!image_record_composite_init(C, op)) return OPERATOR_CANCELLED; - while(image_record_composite_apply(C, op)) + while (image_record_composite_apply(C, op)) ; image_record_composite_exit(C, op); diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index 04bb97ee431..c55ba069e11 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -292,7 +292,7 @@ int textview_draw(TextViewContext *tvc, int draw, int mval[2], void **mouse_pick tvc->iter_index++; - } while(tvc->step(tvc)); + } while (tvc->step(tvc)); } tvc->end(tvc); diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 23272a5d93a..37b284a030d 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -152,22 +152,22 @@ void make_unique_prop_names(bContext *C, char *str) for (a=0; a<obcount; a++) { ob= (Object *)idar[a]; prop= ob->prop.first; - while(prop) { + while (prop) { names[nr++]= prop->name; prop= prop->next; } sens= ob->sensors.first; - while(sens) { + while (sens) { names[nr++]= sens->name; sens= sens->next; } cont= ob->controllers.first; - while(cont) { + while (cont) { names[nr++]= cont->name; cont= cont->next; } act= ob->actuators.first; - while(act) { + while (act) { names[nr++]= act->name; act= act->next; } @@ -211,10 +211,10 @@ static void old_sca_move_sensor(bContext *C, void *datav, void *move_up) if (val>0) { /* now find out which object has this ... */ base= FIRSTBASE; - while(base) { + while (base) { sens= base->object->sensors.first; - while(sens) { + while (sens) { if (sens == sens_to_delete) break; sens= sens->next; } @@ -264,10 +264,10 @@ static void old_sca_move_controller(bContext *C, void *datav, void *move_up) if (val>0) { /* now find out which object has this ... */ base= FIRSTBASE; - while(base) { + while (base) { cont= base->object->controllers.first; - while(cont) { + while (cont) { if (cont == controller_to_del) break; cont= cont->next; } @@ -276,7 +276,7 @@ static void old_sca_move_controller(bContext *C, void *datav, void *move_up) if ( val==1 && cont->prev) { /* locate the controller that has the same state mask but is earlier in the list */ tmp = cont->prev; - while(tmp) { + while (tmp) { if (tmp->state_mask & cont->state_mask) break; tmp = tmp->prev; @@ -288,7 +288,7 @@ static void old_sca_move_controller(bContext *C, void *datav, void *move_up) } else if ( val==2 && cont->next) { tmp = cont->next; - while(tmp) { + while (tmp) { if (tmp->state_mask & cont->state_mask) break; tmp = tmp->next; @@ -320,10 +320,10 @@ static void old_sca_move_actuator(bContext *C, void *datav, void *move_up) if (val>0) { /* now find out which object has this ... */ base= FIRSTBASE; - while(base) { + while (base) { act= base->object->actuators.first; - while(act) { + while (act) { if (act == actuator_to_move) break; act= act->next; } @@ -401,7 +401,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event) case B_CHANGE_SENS: for (ob=bmain->object.first; ob; ob=ob->id.next) { sens= ob->sensors.first; - while(sens) { + while (sens) { if (sens->type != sens->otype) { init_sensor(sens); sens->otype= sens->type; @@ -415,7 +415,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event) case B_DEL_SENS: for (ob=bmain->object.first; ob; ob=ob->id.next) { sens= ob->sensors.first; - while(sens) { + while (sens) { if (sens->flag & SENS_DEL) { BLI_remlink(&(ob->sensors), sens); free_sensor(sens); @@ -475,7 +475,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event) case B_CHANGE_CONT: for (ob=bmain->object.first; ob; ob=ob->id.next) { cont= ob->controllers.first; - while(cont) { + while (cont) { if (cont->type != cont->otype) { init_controller(cont); cont->otype= cont->type; @@ -490,7 +490,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event) case B_DEL_CONT: for (ob=bmain->object.first; ob; ob=ob->id.next) { cont= ob->controllers.first; - while(cont) { + while (cont) { if (cont->flag & CONT_DEL) { BLI_remlink(&(ob->controllers), cont); unlink_controller(cont); @@ -519,7 +519,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event) case B_CHANGE_ACT: for (ob=bmain->object.first; ob; ob=ob->id.next) { act= ob->actuators.first; - while(act) { + while (act) { if (act->type != act->otype) { init_actuator(act); act->otype= act->type; @@ -533,7 +533,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event) case B_DEL_ACT: for (ob=bmain->object.first; ob; ob=ob->id.next) { act= ob->actuators.first; - while(act) { + while (act) { if (act->flag & ACT_DEL) { BLI_remlink(&(ob->actuators), act); unlink_actuator(act); @@ -551,7 +551,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event) didit= 0; for (ob=bmain->object.first; ob; ob=ob->id.next) { act= ob->actuators.first; - while(act) + while (act) { if (act->type==ACT_SOUND) { @@ -567,7 +567,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event) break; } - while(sound) + while (sound) { if (nr==sa->sndnr) break; @@ -759,12 +759,12 @@ static void set_sca_ob(Object *ob) bActuator *act; cont= ob->controllers.first; - while(cont) { + while (cont) { cont->mynew= (bController *)ob; cont= cont->next; } act= ob->actuators.first; - while(act) { + while (act) { act->mynew= (bActuator *)ob; act= act->next; } @@ -791,7 +791,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf if (scene==NULL) return NULL; ob= bmain->object.first; - while(ob) { + while (ob) { ob->scavisflag= 0; set_sca_ob(ob); ob= ob->id.next; @@ -801,7 +801,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf lay= scene->lay; base= FIRSTBASE; - while(base) { + while (base) { if (base->lay & lay) { if (base->flag & SELECT) { if (scavisflag & BUTS_SENS_SEL) base->object->scavisflag |= OB_VIS_SENS; @@ -821,16 +821,16 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf /* BUTS_XXX_STATE are similar to BUTS_XXX_LINK for selecting the object */ if (scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK|BUTS_SENS_STATE|BUTS_ACT_STATE)) { doit= 1; - while(doit) { + while (doit) { doit= 0; ob= bmain->object.first; - while(ob) { + while (ob) { /* 1st case: select sensor when controller selected */ if ((scavisflag & (BUTS_SENS_LINK|BUTS_SENS_STATE)) && (ob->scavisflag & OB_VIS_SENS)==0) { sens= ob->sensors.first; - while(sens) { + while (sens) { for (a=0; a<sens->totlinks; a++) { if (sens->links[a]) { obt= (Object *)sens->links[a]->mynew; @@ -849,7 +849,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf /* 2nd case: select cont when act selected */ if ((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_CONT)==0) { cont= ob->controllers.first; - while(cont) { + while (cont) { for (a=0; a<cont->totlinks; a++) { if (cont->links[a]) { obt= (Object *)cont->links[a]->mynew; @@ -868,7 +868,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf /* 3rd case: select controller when sensor selected */ if ((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_SENS)) { sens= ob->sensors.first; - while(sens) { + while (sens) { for (a=0; a<sens->totlinks; a++) { if (sens->links[a]) { obt= (Object *)sens->links[a]->mynew; @@ -885,7 +885,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf /* 4th case: select actuator when controller selected */ if ( (scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE)) && (ob->scavisflag & OB_VIS_CONT)) { cont= ob->controllers.first; - while(cont) { + while (cont) { for (a=0; a<cont->totlinks; a++) { if (cont->links[a]) { obt= (Object *)cont->links[a]->mynew; @@ -906,7 +906,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf /* now we count */ ob= bmain->object.first; - while(ob) { + while (ob) { if ( ob->scavisflag ) (*count)++; ob= ob->id.next; } @@ -925,7 +925,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf nr++; } - while(ob) { + while (ob) { if ( (ob->scavisflag) && (ob != obact)) { idar[nr]= (ID *)ob; nr++; @@ -2973,7 +2973,7 @@ static void do_sensor_menu(bContext *C, void *UNUSED(arg), int event) for (a=0; a<count; a++) { ob= (Object *)idar[a]; sens= ob->sensors.first; - while(sens) { + while (sens) { if (event==2) sens->flag |= SENS_SHOW; else if (event==3) sens->flag &= ~SENS_SHOW; sens= sens->next; @@ -3022,7 +3022,7 @@ static void do_controller_menu(bContext *C, void *UNUSED(arg), int event) for (a=0; a<count; a++) { ob= (Object *)idar[a]; cont= ob->controllers.first; - while(cont) { + while (cont) { if (event==2) cont->flag |= CONT_SHOW; else if (event==3) cont->flag &= ~CONT_SHOW; cont= cont->next; @@ -3071,7 +3071,7 @@ static void do_actuator_menu(bContext *C, void *UNUSED(arg), int event) for (a=0; a<count; a++) { ob= (Object *)idar[a]; act= ob->actuators.first; - while(act) { + while (act) { if (event==2) act->flag |= ACT_SHOW; else if (event==3) act->flag &= ~ACT_SHOW; act= act->next; @@ -4511,20 +4511,20 @@ static void logic_buttons_new(bContext *C, ARegion *ar) /* clean ACT_LINKED and ACT_VISIBLE of all potentially visible actuators so that we can determine which is actually linked/visible */ act = ob->actuators.first; - while(act) { + while (act) { act->flag &= ~(ACT_LINKED|ACT_VISIBLE); act = act->next; } /* same for sensors */ sens= ob->sensors.first; - while(sens) { + while (sens) { sens->flag &= ~(SENS_VISIBLE); sens = sens->next; } /* mark the linked and visible actuators */ cont= ob->controllers.first; - while(cont) { + while (cont) { flag = ACT_LINKED; /* this controller is visible, mark all its actuator */ @@ -4826,13 +4826,13 @@ void logic_buttons(bContext *C, ARegion *ar) for (a=0; a<count; a++) { ob= (Object *)idar[a]; act= ob->actuators.first; - while(act) { + while (act) { act->flag &= ~(ACT_LINKED|ACT_VISIBLE); act = act->next; } /* same for sensors */ sens= ob->sensors.first; - while(sens) { + while (sens) { sens->flag &= ~(SENS_VISIBLE); sens = sens->next; } @@ -4871,7 +4871,7 @@ void logic_buttons(bContext *C, ARegion *ar) /* note that some of these actuators could be from objects that are not in the display list. * It's ok because those actuators will not be displayed here */ cont= ob->controllers.first; - while(cont) { + while (cont) { for (iact=0; iact<cont->totlinks; iact++) { act = cont->links[iact]; if (act) @@ -4918,7 +4918,7 @@ void logic_buttons(bContext *C, ARegion *ar) yco -= 6; } cont= ob->controllers.first; - while(cont) { + while (cont) { if (cont->state_mask & (1<<stbit)) { /* this controller is visible, mark all its actuator */ for (iact=0; iact<cont->totlinks; iact++) { @@ -5008,7 +5008,7 @@ void logic_buttons(bContext *C, ARegion *ar) if (ob->scaflag & OB_SHOWSENS) { sens= ob->sensors.first; - while(sens) { + while (sens) { if (!(slogic->scaflag & BUTS_SENS_STATE) || (sens->totlinks == 0) || /* always display sensor without links so that is can be edited */ (sens->flag & SENS_PIN && slogic->scaflag & BUTS_SENS_STATE) || /* states can hide some sensors, pinned sensors ignore the visible state */ @@ -5088,7 +5088,7 @@ void logic_buttons(bContext *C, ARegion *ar) if (ob->scaflag & OB_SHOWACT) { act= ob->actuators.first; - while(act) { + while (act) { if (!(slogic->scaflag & BUTS_ACT_STATE) || !(act->flag & ACT_LINKED) || /* always display actuators without links so that is can be edited */ (act->flag & ACT_VISIBLE) || /* this actuator has visible connection, display it */ diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 1c58c4152f0..73289dce968 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -95,7 +95,7 @@ static void outliner_height(SpaceOops *soops, ListBase *lb, int *h) { TreeElement *te= lb->first; - while(te) { + while (te) { TreeStoreElem *tselem= TREESTORE(te); if (TSELEM_OPEN(tselem,soops)) outliner_height(soops, &te->subtree, h); @@ -108,7 +108,7 @@ static void outliner_height(SpaceOops *soops, ListBase *lb, int *h) static void outliner_width(SpaceOops *soops, ListBase *lb, int *w) { TreeElement *te= lb->first; - while(te) { + while (te) { // TreeStoreElem *tselem= TREESTORE(te); // XXX fixme... te->xend is not set yet @@ -125,7 +125,7 @@ static void outliner_width(SpaceOops *soops, ListBase *lb, int *w) static void outliner_rna_width(SpaceOops *soops, ListBase *lb, int *w, int startx) { TreeElement *te= lb->first; - while(te) { + while (te) { TreeStoreElem *tselem= TREESTORE(te); // XXX fixme... (currently, we're using a fixed length of 100)! #if 0 @@ -1550,7 +1550,7 @@ static void outliner_back(ARegion *ar) ystart= (int)ar->v2d.tot.ymax; ystart= UI_UNIT_Y*(ystart/(UI_UNIT_Y))-OL_Y_OFFSET; - while(ystart+2*UI_UNIT_Y > ar->v2d.cur.ymin) { + while (ystart+2*UI_UNIT_Y > ar->v2d.cur.ymin) { glRecti(0, ystart, (int)ar->v2d.cur.xmax+V2D_SCROLL_WIDTH, ystart+UI_UNIT_Y); ystart-= 2*UI_UNIT_Y; } @@ -1568,7 +1568,7 @@ static void outliner_draw_restrictcols(ARegion *ar) ystart= (int)ar->v2d.tot.ymax; ystart= UI_UNIT_Y*(ystart/(UI_UNIT_Y))-OL_Y_OFFSET; - while(ystart+2*UI_UNIT_Y > ar->v2d.cur.ymin) { + while (ystart+2*UI_UNIT_Y > ar->v2d.cur.ymin) { glRecti((int)ar->v2d.cur.xmax-OL_TOGW, ystart, (int)ar->v2d.cur.xmax, ystart+UI_UNIT_Y); ystart-= 2*UI_UNIT_Y; } diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index e64804b6090..c7aa4dc4e92 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -631,7 +631,7 @@ static int tree_element_active_sequence_dup(Scene *scene, TreeElement *te, TreeS // XXX select_single_seq(seq, 1); p= ed->seqbasep->first; - while(p) { + while (p) { if ((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) { p= p->next; continue; diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 2486875bc04..bcc2c358529 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -866,7 +866,7 @@ static void UNUSED_FUNCTION(touch_seq_files)(Scene *scene) if (ed==NULL) return; - // XXX25 if(okee("Touch and print selected movies")==0) return; + // XXX25 if (okee("Touch and print selected movies")==0) return; WM_cursor_wait(1); @@ -1739,7 +1739,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) /* remove seq so overlap tests don't conflict, * see seq_free_sequence below for the real free'ing */ BLI_remlink(ed->seqbasep, seq); - /* if(seq->ipo) seq->ipo->id.us--; */ + /* if (seq->ipo) seq->ipo->id.us--; */ /* XXX, remove fcurve and assign to split image strips */ start_ofs = cfra = seq_tx_get_final_left(seq, 0); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index c111870b5bb..00c2caea258 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -509,7 +509,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) xo= mval[0]; yo= mval[1]; - while(get_mbut()) { + while (get_mbut()) { // getmouseco_areawin(mval); if (abs(mval[0]-xo)+abs(mval[1]-yo) > 4) { transform_markers('g', 0); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 8230da838e7..de26fa1f8ca 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2566,10 +2566,10 @@ static void text_cursor_set_to_pos(SpaceText *st, ARegion *ar, int x, int y, int y-= txt_get_span(text->lines.first, *linep) - st->top; if (y>0) { - while (y-- != 0) if((*linep)->next) *linep= (*linep)->next; + while (y-- != 0) if ((*linep)->next) *linep= (*linep)->next; } else if (y<0) { - while (y++ != 0) if((*linep)->prev) *linep= (*linep)->prev; + while (y++ != 0) if ((*linep)->prev) *linep= (*linep)->prev; } @@ -2856,7 +2856,7 @@ static int text_insert_invoke(bContext *C, wmOperator *op, wmEvent *event) { int ret; - // if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ + // if (!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ if (!RNA_string_length(op->ptr, "text")) { /* if alt/ctrl/super are pressed pass through */ if (event->ctrl || event->oskey) { diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c index f8472a132e1..452f74e8826 100644 --- a/source/blender/editors/space_text/text_python.c +++ b/source/blender/editors/space_text/text_python.c @@ -517,8 +517,8 @@ static short UNUSED_FUNCTION(do_textmarkers)(SpaceText *st, char ascii, unsigned break; /* Events that should clear markers */ - case UKEY: if(!(qual & LR_ALTKEY)) break; - case ZKEY: if(evnt==ZKEY && !(qual & LR_CTRLKEY)) break; + case UKEY: if (!(qual & LR_ALTKEY)) break; + case ZKEY: if (evnt==ZKEY && !(qual & LR_CTRLKEY)) break; case RETKEY: case ESCKEY: if (marker->flags & (TMARK_EDITALL | TMARK_TEMP)) diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 082707fbefb..0ec9e9664f6 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -294,7 +294,8 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m if (textured!=c_textured || texface!=c_texface) { if (textured ) { c_badtex= !GPU_set_tpage(texface, !(litob->mode & OB_MODE_TEXTURE_PAINT), alphablend); - }else { + } + else { GPU_set_tpage(NULL, 0, 0); c_badtex= 0; } diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index e30406ea568..eb1d8e1df5c 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1289,7 +1289,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS /* when called while moving in mixed mode, do not draw when... */ if ((drawflags & MAN_TRANS_C)==0) return; - // XXX if(moving) glTranslatef(t->vec[0], t->vec[1], t->vec[2]); + // XXX if (moving) glTranslatef(t->vec[0], t->vec[1], t->vec[2]); glDisable(GL_DEPTH_TEST); qobj= gluNewQuadric(); diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index a1d4c3c990d..092b9c27929 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -724,7 +724,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], if (nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; - while(a--) + while (a--) { /* exception */ if ((bezt->f1 & SELECT) + (bezt->f2 & SELECT) + (bezt->f3 & SELECT) > SELECT) { diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 1c5fc18e99f..3e6be67f233 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -1049,7 +1049,7 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit else looking= 1; /* iterate */ - while(looking) { + while (looking) { looking= 0; /* find correct valence edges which are not tagged yet, but connect to tagged one */ @@ -1177,7 +1177,7 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, float limit[ } } - while(stacksize > 0) { + while (stacksize > 0) { int j; stacksize--; |