diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-23 06:23:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-23 06:23:42 +0400 |
commit | c8b53d2aaf7ee4d07736cf842ca385e0311f3c53 (patch) | |
tree | 2feabb1078d838a001be6a32dcf7e9f00bebf70f /source/blender/editors | |
parent | 53fece44cf08e730bba8b8581f8bd02361f37930 (diff) |
code style cleanup, no functional changes.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/reeb.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 2 | ||||
-rw-r--r-- | source/blender/editors/metaball/mball_edit.c | 12 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_bake.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 18 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_uv.c | 150 | ||||
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 24 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 8 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 6 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 4 |
14 files changed, 122 insertions, 122 deletions
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index cb0857d41e6..bf7cde54ccb 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -3383,7 +3383,7 @@ ReebGraph *BIF_ReebGraphMultiFromEditMesh(bContext *C) #if 0 Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); - EditMesh *em =BKE_mesh_get_editmesh(((Mesh*)obedit->data)); + EditMesh *em = BKE_mesh_get_editmesh(((Mesh*)obedit->data)); EdgeIndex indexed_edges; VertexData *data; ReebGraph *rg = NULL; diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 7c2d411e076..3e6d4f31479 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -186,7 +186,7 @@ static void def_internal_vicon( int icon_id, VectorDrawFunc drawFunc) di = MEM_callocN(sizeof(DrawInfo), "drawinfo"); di->type= ICON_TYPE_VECTOR; - di->data.vector.func =drawFunc; + di->data.vector.func = drawFunc; new_icon->drawinfo_free = NULL; new_icon->drawinfo = di; @@ -662,7 +662,7 @@ static void init_iconfile_list(struct ListBase *list) /* free temporary direntry structure that's been created by BLI_dir_contents() */ i= totfile-1; - for(; i>=0; i--){ + for (; i>=0; i--) { MEM_freeN(dir[i].relname); MEM_freeN(dir[i].path); if (dir[i].string) { diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index c12d28e4166..12cc21f4807 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -56,7 +56,7 @@ static float new_primitive_matrix(bContext *C, float *loc, float *rot, float primmat[][4]) { Object *obedit= CTX_data_edit_object(C); - View3D *v3d =CTX_wm_view3d(C); + View3D *v3d = CTX_wm_view3d(C); float mat[3][3], rmat[3][3], cmat[3][3], imat[3][3]; unit_m4(primmat); diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index da8009ecc22..e9c1bd4047e 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -345,7 +345,7 @@ static int hide_metaelems_exec(bContext *C, wmOperator *op) ml= mb->editelems->first; if(ml) { - while(ml){ + while(ml) { if((ml->flag & SELECT) != invert) ml->flag |= MB_HIDE; ml= ml->next; @@ -449,11 +449,11 @@ int mouse_mball(bContext *C, const int mval[2], int extend) while(ml) { for(a=0; a<hits; a++) { /* index converted for gl stuff */ - if(ml->selcol1==buffer[ 4 * a + 3 ]){ + if(ml->selcol1==buffer[ 4 * a + 3 ]) { ml->flag |= MB_SCALE_RAD; act= ml; } - if(ml->selcol2==buffer[ 4 * a + 3 ]){ + if(ml->selcol2==buffer[ 4 * a + 3 ]) { ml->flag &= ~MB_SCALE_RAD; act= ml; } @@ -505,7 +505,7 @@ static void freeMetaElemlist(ListBase *lb) if(lb==NULL) return; ml= lb->first; - while(ml){ + while(ml) { next= ml->next; BLI_remlink(lb, ml); MEM_freeN(ml); @@ -526,7 +526,7 @@ static void undoMball_to_editMball(void *lbu, void *lbe, void *UNUSED(obe)) /* copy 'undo' MetaElems to 'edit' MetaElems */ ml= lb->first; - while(ml){ + while(ml) { newml= MEM_dupallocN(ml); BLI_addtail(editelems, newml); ml= ml->next; @@ -546,7 +546,7 @@ static void *editMball_to_undoMball(void *lbe, void *UNUSED(obe)) /* copy contents of current ListBase to the undo ListBase */ ml= editelems->first; - while(ml){ + while(ml) { newml= MEM_dupallocN(ml); BLI_addtail(lb, newml); ml= ml->next; diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 1b289732302..86fa01b44d3 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -154,7 +154,7 @@ void ED_object_base_init_transform(bContext *C, Base *base, float *loc, float *r /* returns standard diameter */ float ED_object_new_primitive_matrix(bContext *C, Object *obedit, float *loc, float *rot, float primmat[][4]) { - View3D *v3d =CTX_wm_view3d(C); + View3D *v3d = CTX_wm_view3d(C); float mat[3][3], rmat[3][3], cmat[3][3], imat[3][3]; unit_m4(primmat); diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 6df8ed1155a..5473552eedd 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -424,9 +424,9 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image* ima, MPassKnownData nr_tris= mface[f].v4!=0 ? 2 : 1; for(t= 0; t<nr_tris; t++) { - data.i0= verts[0][t]; - data.i1= verts[1][t]; - data.i2 =verts[2][t]; + data.i0 = verts[0][t]; + data.i1 = verts[1][t]; + data.i2 = verts[2][t]; bake_rasterize(&bake_rast, mtfate->uv[data.i0], mtfate->uv[data.i1], mtfate->uv[data.i2]); } diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index b0d99ddd788..6825edb0822 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -140,7 +140,7 @@ static int object_hide_view_clear_exec(bContext *C, wmOperator *UNUSED(op)) int changed = 0; /* XXX need a context loop to handle such cases */ - for(base = FIRSTBASE; base; base=base->next){ + for(base = FIRSTBASE; base; base=base->next) { if((base->lay & v3d->lay) && base->object->restrictflag & OB_RESTRICT_VIEW) { base->flag |= SELECT; base->object->flag = base->flag; @@ -182,7 +182,7 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN(C, Base*, base, visible_bases) { if(!unselected) { - if (base->flag & SELECT){ + if (base->flag & SELECT) { base->flag &= ~SELECT; base->object->flag = base->flag; base->object->restrictflag |= OB_RESTRICT_VIEW; @@ -193,7 +193,7 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op) } } else { - if (!(base->flag & SELECT)){ + if (!(base->flag & SELECT)) { base->object->restrictflag |= OB_RESTRICT_VIEW; changed = 1; } @@ -272,12 +272,12 @@ static int object_hide_render_set_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN(C, Base*, base, visible_bases) { if(!unselected) { - if (base->flag & SELECT){ + if (base->flag & SELECT) { base->object->restrictflag |= OB_RESTRICT_RENDER; } } else { - if (!(base->flag & SELECT)){ + if (!(base->flag & SELECT)) { base->object->restrictflag |= OB_RESTRICT_RENDER; } } @@ -447,7 +447,7 @@ void ED_object_enter_editmode(bContext *C, int flag) WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_MESH, scene); } - else if (ob->type==OB_ARMATURE){ + else if (ob->type==OB_ARMATURE) { bArmature *arm= base->object->data; if (!arm) return; /* @@ -906,7 +906,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) base->object->recalc |= OB_RECALC_DATA; } } - else if(event==21){ + else if(event==21) { if (base->object->type==OB_MESH) { ModifierData *md = modifiers_findByType(ob, eModifierType_Subsurf); @@ -1024,7 +1024,7 @@ static void UNUSED_FUNCTION(copy_attr_menu)(Main *bmain, Scene *scene, View3D *v strcat(str, "|Curve Resolution%x25"); } - if(ob->type==OB_MESH){ + if(ob->type==OB_MESH) { strcat(str, "|Subsurf Settings%x21|AutoSmooth%x27"); } @@ -1032,7 +1032,7 @@ static void UNUSED_FUNCTION(copy_attr_menu)(Main *bmain, Scene *scene, View3D *v strcat(str, "|Pass Index%x30"); - if(ob->type==OB_MESH || ob->type==OB_CURVE || ob->type==OB_LATTICE || ob->type==OB_SURF){ + if(ob->type==OB_MESH || ob->type==OB_CURVE || ob->type==OB_LATTICE || ob->type==OB_SURF) { strcat(str, "|Modifiers ...%x24"); } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 547c5b24778..55dbbb50958 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -261,7 +261,7 @@ int ED_object_modifier_remove(ReportList *reports, Main *bmain, Scene *scene, Ob void ED_object_modifier_clear(Main *bmain, Scene *scene, Object *ob) { - ModifierData *md =ob->modifiers.first; + ModifierData *md = ob->modifiers.first; int sort_depsgraph = 0; if(!md) diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index de1238dabd7..f902c88d5f0 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -156,7 +156,7 @@ typedef struct Temp_UvData{ -void HC_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, float mouse_coord[2], float alpha, float radius, float aspectRatio){ +void HC_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, float mouse_coord[2], float alpha, float radius, float aspectRatio) { Temp_UVData *tmp_uvdata; float diff[2]; int i; @@ -166,7 +166,7 @@ void HC_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, float tmp_uvdata = (Temp_UVData *)MEM_callocN(sculptdata->totalUniqueUvs * sizeof(Temp_UVData), "Temporal data"); /* counting neighbors */ - for (i = 0; i < sculptdata->totalUvEdges; i++){ + for (i = 0; i < sculptdata->totalUvEdges; i++) { UvEdge *tmpedge = sculptdata->uvedges+i; tmp_uvdata[tmpedge->uv1].ncounter++; tmp_uvdata[tmpedge->uv2].ncounter++; @@ -175,7 +175,7 @@ void HC_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, float add_v2_v2(tmp_uvdata[tmpedge->uv1].sum_co, sculptdata->uv[tmpedge->uv2].uv); } - for (i = 0; i < sculptdata->totalUniqueUvs; i++){ + for (i = 0; i < sculptdata->totalUniqueUvs; i++) { copy_v2_v2(diff,tmp_uvdata[i].sum_co); mul_v2_fl(diff,1.f/tmp_uvdata[i].ncounter); copy_v2_v2(tmp_uvdata[i].p,diff); @@ -184,23 +184,23 @@ void HC_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, float tmp_uvdata[i].b[1] = diff[1] - sculptdata->uv[i].uv[1]; } - for (i = 0; i < sculptdata->totalUvEdges; i++){ + for (i = 0; i < sculptdata->totalUvEdges; i++) { UvEdge *tmpedge = sculptdata->uvedges+i; add_v2_v2(tmp_uvdata[tmpedge->uv1].sum_b, tmp_uvdata[tmpedge->uv2].b); add_v2_v2(tmp_uvdata[tmpedge->uv2].sum_b, tmp_uvdata[tmpedge->uv1].b); } - for (i = 0; i < sculptdata->totalUniqueUvs; i++){ + for (i = 0; i < sculptdata->totalUniqueUvs; i++) { float dist; /* This is supposed to happen only if "Pin Edges" is on, since we have initialization on stroke start * If ever uv brushes get their own mode we should check for toolsettings option too */ - if((sculptdata->uv[i].flag & MARK_BOUNDARY)){ + if ((sculptdata->uv[i].flag & MARK_BOUNDARY)) { continue; } sub_v2_v2v2(diff, sculptdata->uv[i].uv, mouse_coord); diff[1] /= aspectRatio; - if((dist = dot_v2v2(diff, diff)) <= radius){ + if ((dist = dot_v2v2(diff, diff)) <= radius) { UvElement *element; float strength; strength = alpha*brush_curve_strength(brush, sqrt(dist), radius_root); @@ -208,11 +208,11 @@ void HC_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, float sculptdata->uv[i].uv[0] = (1.0-strength)*sculptdata->uv[i].uv[0] + strength*(tmp_uvdata[i].p[0] - 0.5f*(tmp_uvdata[i].b[0] + tmp_uvdata[i].sum_b[0]/tmp_uvdata[i].ncounter)); sculptdata->uv[i].uv[1] = (1.0-strength)*sculptdata->uv[i].uv[1] + strength*(tmp_uvdata[i].p[1] - 0.5f*(tmp_uvdata[i].b[1] + tmp_uvdata[i].sum_b[1]/tmp_uvdata[i].ncounter)); - for(element = sculptdata->uv[i].element; element; element = element->next){ + for (element = sculptdata->uv[i].element; element; element = element->next) { MLoopUV *luv; BMLoop *l; - if(element->separate && element != sculptdata->uv[i].element) + if (element->separate && element != sculptdata->uv[i].element) break; l = element->l; @@ -238,7 +238,7 @@ static void laplacian_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *scul tmp_uvdata = (Temp_UVData *)MEM_callocN(sculptdata->totalUniqueUvs * sizeof(Temp_UVData), "Temporal data"); /* counting neighbors */ - for (i = 0; i < sculptdata->totalUvEdges; i++){ + for (i = 0; i < sculptdata->totalUvEdges; i++) { UvEdge *tmpedge = sculptdata->uvedges+i; tmp_uvdata[tmpedge->uv1].ncounter++; tmp_uvdata[tmpedge->uv2].ncounter++; @@ -249,22 +249,22 @@ static void laplacian_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *scul /* Original Lacplacian algorithm included removal of normal component of translation. here it is not * needed since we translate along the UV plane always.*/ - for (i = 0; i < sculptdata->totalUniqueUvs; i++){ + for (i = 0; i < sculptdata->totalUniqueUvs; i++) { copy_v2_v2(tmp_uvdata[i].p, tmp_uvdata[i].sum_co); mul_v2_fl(tmp_uvdata[i].p, 1.f/tmp_uvdata[i].ncounter); } - for (i = 0; i < sculptdata->totalUniqueUvs; i++){ + for (i = 0; i < sculptdata->totalUniqueUvs; i++) { float dist; /* This is supposed to happen only if "Pin Edges" is on, since we have initialization on stroke start * If ever uv brushes get their own mode we should check for toolsettings option too */ - if((sculptdata->uv[i].flag & MARK_BOUNDARY)){ + if ((sculptdata->uv[i].flag & MARK_BOUNDARY)) { continue; } sub_v2_v2v2(diff, sculptdata->uv[i].uv, mouse_coord); diff[1] /= aspectRatio; - if((dist = dot_v2v2(diff, diff)) <= radius){ + if ((dist = dot_v2v2(diff, diff)) <= radius) { UvElement *element; float strength; strength = alpha*brush_curve_strength(brush, sqrt(dist), radius_root); @@ -272,11 +272,11 @@ static void laplacian_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *scul sculptdata->uv[i].uv[0] = (1.0-strength)*sculptdata->uv[i].uv[0] + strength*tmp_uvdata[i].p[0]; sculptdata->uv[i].uv[1] = (1.0-strength)*sculptdata->uv[i].uv[1] + strength*tmp_uvdata[i].p[1]; - for(element = sculptdata->uv[i].element; element; element = element->next){ + for (element = sculptdata->uv[i].element; element; element = element->next) { MLoopUV *luv; BMLoop *l; - if(element->separate && element != sculptdata->uv[i].element) + if (element->separate && element != sculptdata->uv[i].element) break; l = element->l; @@ -326,20 +326,20 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event, /* * Pinch Tool */ - if(tool == UV_SCULPT_TOOL_PINCH){ + if (tool == UV_SCULPT_TOOL_PINCH) { int i; alpha *= invert; - for (i = 0; i < sculptdata->totalUniqueUvs; i++){ + for (i = 0; i < sculptdata->totalUniqueUvs; i++) { float dist, diff[2]; /* This is supposed to happen only if "Lock Borders" is on, since we have initialization on stroke start * If ever uv brushes get their own mode we should check for toolsettings option too */ - if(sculptdata->uv[i].flag & MARK_BOUNDARY){ + if (sculptdata->uv[i].flag & MARK_BOUNDARY) { continue; } sub_v2_v2v2(diff, sculptdata->uv[i].uv, co); diff[1] /= aspectRatio; - if((dist = dot_v2v2(diff, diff)) <= radius){ + if ((dist = dot_v2v2(diff, diff)) <= radius) { UvElement *element; float strength; strength = alpha*brush_curve_strength(brush, sqrt(dist), radius_root); @@ -348,11 +348,11 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event, sculptdata->uv[i].uv[0] -= strength*diff[0]*0.001; sculptdata->uv[i].uv[1] -= strength*diff[1]*0.001; - for(element = sculptdata->uv[i].element; element; element = element->next){ + for (element = sculptdata->uv[i].element; element; element = element->next) { MLoopUV *luv; BMLoop *l; - if(element->separate && element != sculptdata->uv[i].element) + if (element->separate && element != sculptdata->uv[i].element) break; l = element->l; @@ -366,9 +366,9 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event, /* * Smooth Tool */ - else if(tool == UV_SCULPT_TOOL_RELAX){ + else if (tool == UV_SCULPT_TOOL_RELAX) { unsigned int method = toolsettings->uv_relax_method; - if(method == UV_SCULPT_TOOL_RELAX_HC){ + if (method == UV_SCULPT_TOOL_RELAX_HC) { HC_relaxation_iteration_uv(em, sculptdata, co, alpha, radius, aspectRatio); }else{ laplacian_relaxation_iteration_uv(em, sculptdata, co, alpha, radius, aspectRatio); @@ -378,23 +378,23 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event, /* * Grab Tool */ - else if(tool == UV_SCULPT_TOOL_GRAB){ + else if (tool == UV_SCULPT_TOOL_GRAB) { int i; float diff[2]; sub_v2_v2v2(diff, co, sculptdata->initial_stroke->init_coord); - for(i = 0; i < sculptdata->initial_stroke->totalInitialSelected; i++ ){ + for (i = 0; i < sculptdata->initial_stroke->totalInitialSelected; i++ ) { UvElement *element; int uvindex = sculptdata->initial_stroke->initialSelection[i].uv; float strength = sculptdata->initial_stroke->initialSelection[i].strength; sculptdata->uv[uvindex].uv[0] = sculptdata->initial_stroke->initialSelection[i].initial_uv[0] + strength*diff[0]; sculptdata->uv[uvindex].uv[1] = sculptdata->initial_stroke->initialSelection[i].initial_uv[1] + strength*diff[1]; - for(element = sculptdata->uv[uvindex].element; element; element = element->next){ + for (element = sculptdata->uv[uvindex].element; element; element = element->next) { MLoopUV *luv; BMLoop *l; - if(element->separate && element != sculptdata->uv[uvindex].element) + if (element->separate && element != sculptdata->uv[uvindex].element) break; l = element->l; @@ -409,21 +409,21 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event, static void uv_sculpt_stroke_exit(bContext *C, wmOperator *op) { UvSculptData *data = op->customdata; - if(data->timer){ + if (data->timer) { WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), data->timer); } - if(data->elementMap) + if (data->elementMap) { EDBM_free_uv_element_map(data->elementMap); } - if(data->uv){ + if (data->uv) { MEM_freeN(data->uv); } - if(data->uvedges){ + if (data->uvedges) { MEM_freeN(data->uvedges); } - if(data->initial_stroke){ - if(data->initial_stroke->initialSelection){ + if (data->initial_stroke) { + if (data->initial_stroke->initialSelection) { MEM_freeN(data->initial_stroke->initialSelection); } MEM_freeN(data->initial_stroke); @@ -433,27 +433,27 @@ static void uv_sculpt_stroke_exit(bContext *C, wmOperator *op) op->customdata = NULL; } -static int get_uv_element_offset_from_face(UvElementMap *map, BMFace *efa, BMLoop *l, int island_index, int doIslands){ +static int get_uv_element_offset_from_face(UvElementMap *map, BMFace *efa, BMLoop *l, int island_index, int doIslands) { UvElement *element = ED_get_uv_element(map, efa, l); - if(!element || (doIslands && element->island != island_index)){ + if (!element || (doIslands && element->island != island_index)) { return -1; } return element - map->buf; } -static unsigned int uv_edge_hash(const void *key){ +static unsigned int uv_edge_hash(const void *key) { UvEdge *edge = (UvEdge *)key; return BLI_ghashutil_inthash(SET_INT_IN_POINTER(edge->uv2)) + BLI_ghashutil_inthash(SET_INT_IN_POINTER(edge->uv1)); } -static int uv_edge_compare(const void *a, const void *b){ +static int uv_edge_compare(const void *a, const void *b) { UvEdge *edge1 = (UvEdge *)a; UvEdge *edge2 = (UvEdge *)b; - if((edge1->uv1 == edge2->uv1) && (edge1->uv2 == edge2->uv2)){ + if ((edge1->uv1 == edge2->uv1) && (edge1->uv2 == edge2->uv2)) { return 0; } return 1; @@ -471,7 +471,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent op->customdata = data; - if(data){ + if (data) { int counter = 0, i; ARegion *ar= CTX_wm_region(C); float co[2]; @@ -493,22 +493,22 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent data->uvsculpt = &ts->uvsculpt->paint; - if(do_island_optimization){ + if (do_island_optimization) { /* We will need island information */ - if(ts->uv_flag & UV_SYNC_SELECTION){ + if (ts->uv_flag & UV_SYNC_SELECTION) { data->elementMap = EDBM_make_uv_element_map(em, 0, 1); }else{ data->elementMap = EDBM_make_uv_element_map(em, 1, 1); } }else { - if(ts->uv_flag & UV_SYNC_SELECTION){ + if (ts->uv_flag & UV_SYNC_SELECTION) { data->elementMap = EDBM_make_uv_element_map(em, 0, 0); }else{ data->elementMap = EDBM_make_uv_element_map(em, 1, 0); } } - if(!data->elementMap){ + if (!data->elementMap) { uv_sculpt_stroke_exit(C, op); return NULL; } @@ -517,7 +517,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]); /* we need to find the active island here */ - if(do_island_optimization){ + if (do_island_optimization) { UvElement *element; NearestHit hit; Image *ima= CTX_data_edit_image(C); @@ -529,9 +529,9 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent /* Count 'unique' uvs */ - for(i = 0; i < data->elementMap->totalUVs; i++){ - if(data->elementMap->buf[i].separate - && (!do_island_optimization || data->elementMap->buf[i].island == island_index)){ + for (i = 0; i < data->elementMap->totalUVs; i++) { + if (data->elementMap->buf[i].separate + && (!do_island_optimization || data->elementMap->buf[i].island == island_index)) { counter++; } } @@ -542,14 +542,14 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent edgeHash = BLI_ghash_new(uv_edge_hash, uv_edge_compare, "uv_brush_edge_hash"); /* we have at most totalUVs edges */ edges = MEM_mallocN(sizeof(*edges)*data->elementMap->totalUVs, "uv_brush_all_edges"); - if(!data->uv || !uniqueUv || !edgeHash || !edges){ - if(edges){ + if (!data->uv || !uniqueUv || !edgeHash || !edges) { + if (edges) { MEM_freeN(edges); } - if(uniqueUv){ + if (uniqueUv) { MEM_freeN(uniqueUv); } - if(edgeHash){ + if (edgeHash) { MEM_freeN(edgeHash); } uv_sculpt_stroke_exit(C, op); @@ -560,13 +560,13 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent /* So that we can use this as index for the UvElements */ counter = -1; /* initialize the unique UVs */ - for(i = 0; i < bm->totvert; i++){ + for (i = 0; i < bm->totvert; i++) { UvElement *element = data->elementMap->vert[i]; - for(; element; element = element->next){ - if(element->separate){ - if(do_island_optimization && (element->island != island_index)){ + for (; element; element = element->next) { + if (element->separate) { + if (do_island_optimization && (element->island != island_index)) { /* skip this uv if not on the active island */ - for(; element->next && !(element->next->separate); element = element->next) + for (; element->next && !(element->next->separate); element = element->next) ; continue; } @@ -593,7 +593,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent int offset2, itmp2 = get_uv_element_offset_from_face(data->elementMap, efa, l->next, island_index, do_island_optimization); /* Skip edge if not found(unlikely) or not on valid island */ - if(itmp1 == -1 || itmp2 == -1) + if (itmp1 == -1 || itmp2 == -1) continue; offset1 = uniqueUv[itmp1]; @@ -602,7 +602,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent edges[counter].flag = 0; /* using an order policy, sort uvs according to address space. This avoids * Having two different UvEdges with the same uvs on different positions */ - if(offset1 < offset2){ + if (offset1 < offset2) { edges[counter].uv1 = offset1; edges[counter].uv2 = offset2; } @@ -611,7 +611,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent edges[counter].uv2 = offset1; } /* Hack! Set the value of the key to its flag. Now we can set the flag when an edge exists twice :) */ - if(BLI_ghash_haskey(edgeHash, &edges[counter])){ + if (BLI_ghash_haskey(edgeHash, &edges[counter])) { char *flag = BLI_ghash_lookup(edgeHash, &edges[counter]); *flag = 1; } @@ -627,21 +627,21 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent /* Allocate connectivity data, we allocate edges once */ data->uvedges = MEM_mallocN(sizeof(*data->uvedges)*BLI_ghash_size(edgeHash), "uv_brush_edge_connectivity_data"); - if(!data->uvedges){ + if (!data->uvedges) { BLI_ghash_free(edgeHash, NULL, NULL); MEM_freeN(edges); uv_sculpt_stroke_exit(C, op); return NULL; } ghi = BLI_ghashIterator_new(edgeHash); - if(!ghi){ + if (!ghi) { BLI_ghash_free(edgeHash, NULL, NULL); MEM_freeN(edges); uv_sculpt_stroke_exit(C, op); return NULL; } /* fill the edges with data */ - for(i = 0; !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)){ + for (i = 0; !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)) { data->uvedges[i++] = *((UvEdge *)BLI_ghashIterator_getKey(ghi)); } data->totalUvEdges = BLI_ghash_size(edgeHash); @@ -652,9 +652,9 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent MEM_freeN(edges); /* transfer boundary edge property to uvs */ - if(ts->uv_sculpt_settings & UV_SCULPT_LOCK_BORDERS){ - for(i = 0; i < data->totalUvEdges; i++){ - if(!data->uvedges[i].flag){ + if (ts->uv_sculpt_settings & UV_SCULPT_LOCK_BORDERS) { + for (i = 0; i < data->totalUvEdges; i++) { + if (!data->uvedges[i].flag) { data->uv[data->uvedges[i].uv1].flag |= MARK_BOUNDARY; data->uv[data->uvedges[i].uv2].flag |= MARK_BOUNDARY; } @@ -662,7 +662,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent } /* Allocate initial selection for grab tool */ - if(data->tool == UV_SCULPT_TOOL_GRAB){ + if (data->tool == UV_SCULPT_TOOL_GRAB) { float radius, radius_root; UvSculptData *sculptdata = (UvSculptData *)op->customdata; SpaceImage *sima; @@ -685,11 +685,11 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent /* Allocate selection stack */ data->initial_stroke = MEM_mallocN(sizeof(*data->initial_stroke), "uv_sculpt_initial_stroke"); - if(!data->initial_stroke){ + if (!data->initial_stroke) { uv_sculpt_stroke_exit(C, op); } data->initial_stroke->initialSelection = MEM_mallocN(sizeof(*data->initial_stroke->initialSelection)*data->totalUniqueUvs, "uv_sculpt_initial_selection"); - if(!data->initial_stroke->initialSelection){ + if (!data->initial_stroke->initialSelection) { uv_sculpt_stroke_exit(C, op); } @@ -697,15 +697,15 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent counter = 0; - for(i = 0; i < data->totalUniqueUvs; i++){ + for (i = 0; i < data->totalUniqueUvs; i++) { float dist, diff[2]; - if(data->uv[i].flag & MARK_BOUNDARY){ + if (data->uv[i].flag & MARK_BOUNDARY) { continue; } sub_v2_v2v2(diff, data->uv[i].uv, co); diff[1] /= aspectRatio; - if((dist = dot_v2v2(diff, diff)) <= radius){ + if ((dist = dot_v2v2(diff, diff)) <= radius) { float strength; strength = alpha*brush_curve_strength(brush, sqrt(dist), radius_root); @@ -728,7 +728,7 @@ static int uv_sculpt_stroke_invoke(bContext *C, wmOperator *op, wmEvent *event) UvSculptData *data; Object *obedit = CTX_data_edit_object(C); - if(!(data = uv_sculpt_stroke_init(C, op, event))) { + if (!(data = uv_sculpt_stroke_init(C, op, event))) { return OPERATOR_CANCELLED; } @@ -736,7 +736,7 @@ static int uv_sculpt_stroke_invoke(bContext *C, wmOperator *op, wmEvent *event) data->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.001f); - if(!data->timer){ + if (!data->timer) { uv_sculpt_stroke_exit(C, op); return OPERATOR_CANCELLED; } @@ -763,7 +763,7 @@ static int uv_sculpt_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) uv_sculpt_stroke_apply(C, op, event, obedit); break; case TIMER: - if(event->customdata == data->timer) + if (event->customdata == data->timer) uv_sculpt_stroke_apply(C, op, event, obedit); break; default: diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index b161d16ecf9..a58e03be237 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1533,19 +1533,19 @@ static void node_composit_buts_map_value(uiLayout *layout, bContext *UNUSED(C), { uiLayout *sub, *col; - col =uiLayoutColumn(layout, 1); + col = uiLayoutColumn(layout, 1); uiItemR(col, ptr, "offset", 0, NULL, ICON_NONE); uiItemR(col, ptr, "size", 0, NULL, ICON_NONE); - col =uiLayoutColumn(layout, 1); + col = uiLayoutColumn(layout, 1); uiItemR(col, ptr, "use_min", 0, NULL, ICON_NONE); - sub =uiLayoutColumn(col, 0); + sub = uiLayoutColumn(col, 0); uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_min")); uiItemR(sub, ptr, "min", 0, "", ICON_NONE); - col =uiLayoutColumn(layout, 1); + col = uiLayoutColumn(layout, 1); uiItemR(col, ptr, "use_max", 0, NULL, ICON_NONE); - sub =uiLayoutColumn(col, 0); + sub = uiLayoutColumn(col, 0); uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max")); uiItemR(sub, ptr, "max", 0, "", ICON_NONE); } @@ -1554,7 +1554,7 @@ static void node_composit_buts_alphaover(uiLayout *layout, bContext *UNUSED(C), { uiLayout *col; - col =uiLayoutColumn(layout, 1); + col = uiLayoutColumn(layout, 1); uiItemR(col, ptr, "use_premultiply", 0, NULL, ICON_NONE); uiItemR(col, ptr, "premul", 0, NULL, ICON_NONE); } @@ -1563,7 +1563,7 @@ static void node_composit_buts_zcombine(uiLayout *layout, bContext *UNUSED(C), P { uiLayout *col; - col =uiLayoutColumn(layout, 1); + col = uiLayoutColumn(layout, 1); uiItemR(col, ptr, "use_alpha", 0, NULL, ICON_NONE); } @@ -1572,7 +1572,7 @@ static void node_composit_buts_hue_sat(uiLayout *layout, bContext *UNUSED(C), Po { uiLayout *col; - col =uiLayoutColumn(layout, 0); + col = uiLayoutColumn(layout, 0); uiItemR(col, ptr, "color_hue", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "color_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "color_value", UI_ITEM_R_SLIDER, NULL, ICON_NONE); @@ -1587,7 +1587,7 @@ static void node_composit_buts_diff_matte(uiLayout *layout, bContext *UNUSED(C), { uiLayout *col; - col =uiLayoutColumn(layout, 1); + col = uiLayoutColumn(layout, 1); uiItemR(col, ptr, "tolerance", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "falloff", UI_ITEM_R_SLIDER, NULL, ICON_NONE); } @@ -1596,7 +1596,7 @@ static void node_composit_buts_distance_matte(uiLayout *layout, bContext *UNUSED { uiLayout *col; - col =uiLayoutColumn(layout, 1); + col = uiLayoutColumn(layout, 1); uiItemR(col, ptr, "tolerance", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "falloff", UI_ITEM_R_SLIDER, NULL, ICON_NONE); } @@ -1606,7 +1606,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C) uiLayout *row, *col; uiItemL(layout, "Despill Channel:", ICON_NONE); - row =uiLayoutRow(layout,0); + row = uiLayoutRow(layout,0); uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE); col= uiLayoutColumn(layout, 0); @@ -1664,7 +1664,7 @@ static void node_composit_buts_channel_matte(uiLayout *layout, bContext *UNUSED( row= uiLayoutRow(col, 0); uiItemR(row, ptr, "matte_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE); - col =uiLayoutColumn(layout, 0); + col = uiLayoutColumn(layout, 0); uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE); if(RNA_enum_get(ptr, "limit_method")==0) { diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index dfdbf852305..8e7537b14e4 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -790,7 +790,7 @@ int transformEvent(TransInfo *t, wmEvent *event) } /* else do non-mapped events */ else if (event->val==KM_PRESS) { - switch (event->type){ + switch (event->type) { case RIGHTMOUSE: t->state = TRANS_CANCEL; break; @@ -1039,7 +1039,7 @@ int transformEvent(TransInfo *t, wmEvent *event) } else if (event->val==KM_RELEASE) { - switch (event->type){ + switch (event->type) { case LEFTSHIFTKEY: case RIGHTSHIFTKEY: t->modifiers &= ~MOD_CONSTRAINT_PLANE; @@ -2671,7 +2671,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) protectedSizeBits(td->protectflag, fsize); if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't resize objects itself - if((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)){ + if((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)) { /* scale val and reset size */ *td->val = td->ival * (1 + (fsize[0] - 1) * td->factor); @@ -2955,7 +2955,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL); mat3_to_quat( quat,fmat); // Actual transform - if(td->ext->quat){ + if(td->ext->quat) { mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat); /* is there a reason not to have this here? -jahka */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index abbe2db9f19..7737978c4ea 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -409,7 +409,7 @@ static short apply_targetless_ik(Object *ob) parchan= pchan; /* Find the chain's root & count the segments needed */ - for (; parchan; parchan=parchan->parent){ + for (; parchan; parchan=parchan->parent) { chanlist[segcount]= parchan; segcount++; @@ -1343,7 +1343,7 @@ static void createTransMBallVerts(TransInfo *t) td->ext = tx; /* Radius of MetaElem (mass of MetaElem influence) */ - if(ml->flag & MB_SCALE_RAD){ + if(ml->flag & MB_SCALE_RAD) { td->val = &ml->rad; td->ival = ml->rad; } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 8013520639e..13f45ff58b9 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -741,11 +741,11 @@ static void recalcData_view3d(TransInfo *t) } /* Ensure all bones are correctly adjusted */ - for (ebo = edbo->first; ebo; ebo = ebo->next){ + for (ebo = edbo->first; ebo; ebo = ebo->next) { - if ((ebo->flag & BONE_CONNECTED) && ebo->parent){ + if ((ebo->flag & BONE_CONNECTED) && ebo->parent) { /* If this bone has a parent tip that has been moved */ - if (ebo->parent->flag & BONE_TIPSEL){ + if (ebo->parent->flag & BONE_TIPSEL) { copy_v3_v3 (ebo->head, ebo->parent->tail); if(t->mode==TFM_BONE_ENVELOPE) ebo->rad_head= ebo->parent->rad_tail; } diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 67a0d5dbe04..bd687ddfe40 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -362,10 +362,10 @@ int calc_manipulator_stats(const bContext *C) } } } /* end editmesh */ - else if (obedit->type==OB_ARMATURE){ + else if (obedit->type==OB_ARMATURE) { bArmature *arm= obedit->data; EditBone *ebo; - for (ebo= arm->edbo->first; ebo; ebo=ebo->next){ + for (ebo= arm->edbo->first; ebo; ebo=ebo->next) { if(EBONE_VISIBLE(arm, ebo)) { if (ebo->flag & BONE_TIPSEL) { calc_tw_center(scene, ebo->tail); |