diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-27 02:38:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-27 02:38:49 +0400 |
commit | 3ba37b65a32541ac594183d45c0939ee95bb098d (patch) | |
tree | 7e9015c177d0e0d679c1dca3ad35c2ed230c6d37 | |
parent | 5df6869b379401874fb2cae0c1e33a58aaab8786 (diff) |
style cleanup
19 files changed, 81 insertions, 80 deletions
diff --git a/source/blender/bmesh/bmesh.h b/source/blender/bmesh/bmesh.h index 168a8d913a0..bf939d3f1cb 100644 --- a/source/blender/bmesh/bmesh.h +++ b/source/blender/bmesh/bmesh.h @@ -106,12 +106,12 @@ struct EditMesh; /* we have 3 spare flags which is awesome but since we're limited to 8 * only add new flags with care! - campbell */ -/* #define BM_ELEM_SPARE (1<<5) */ -/* #define BM_ELEM_SPARE (1<<6) */ +/* #define BM_ELEM_SPARE (1 << 5) */ +/* #define BM_ELEM_SPARE (1 << 6) */ -#define BM_ELEM_INTERNAL_TAG (1<<7) /* for low level internal API tagging, - * since tools may want to tag verts and - * not have functions clobber them */ +#define BM_ELEM_INTERNAL_TAG (1 << 7) /* for low level internal API tagging, + * since tools may want to tag verts and + * not have functions clobber them */ /* Mesh Level Ops */ extern int bm_mesh_allocsize_default[4]; diff --git a/source/blender/bmesh/bmesh_iterators.h b/source/blender/bmesh/bmesh_iterators.h index ccbed3ecd01..fc914a8c87d 100644 --- a/source/blender/bmesh/bmesh_iterators.h +++ b/source/blender/bmesh/bmesh_iterators.h @@ -84,11 +84,11 @@ extern const char bm_iter_itype_htype_map[BM_ITYPE_MAX]; #define BM_ITER(ele, iter, bm, itype, data) \ ele = BM_iter_new(iter, bm, itype, data); \ - for ( ; ele; ele=BM_iter_step(iter)) + for ( ; ele; ele = BM_iter_step(iter)) #define BM_ITER_INDEX(ele, iter, bm, itype, data, indexvar) \ ele = BM_iter_new(iter, bm, itype, data); \ - for (indexvar=0; ele; indexvar++, ele=BM_iter_step(iter)) + for (indexvar = 0; ele; indexvar++, ele = BM_iter_step(iter)) /*Iterator Structure*/ typedef struct BMIter { diff --git a/source/blender/bmesh/bmesh_walkers.h b/source/blender/bmesh/bmesh_walkers.h index d926ab6d066..9dff8cd98fb 100644 --- a/source/blender/bmesh/bmesh_walkers.h +++ b/source/blender/bmesh/bmesh_walkers.h @@ -91,7 +91,7 @@ BMFace *f; BMW_init(&walker, bm, BMW_ISLAND, SOME_OP_FLAG); f = BMW_begin(&walker, some_start_face); -for (; f; f=BMW_step(&walker)) +for (; f; f = BMW_step(&walker)) { //do something with f } diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index 7d94fac2414..406da71ce4d 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -288,14 +288,14 @@ static float quad_coord(float aa[3], float bb[3], float cc[3], float dd[3], int y = aa[a1] * dd[a2] + bb[a1] * cc[a2] - cc[a1] * bb[a2] - dd[a1] * aa[a2]; z = bb[a1] * dd[a2] - dd[a1] * bb[a2]; - if (fabs(2 * (x - y + z)) > FLT_EPSILON * 10.0f) { + if (fabsf(2.0f * (x - y + z)) > FLT_EPSILON * 10.0f) { float f2; f1 = (sqrt(y * y - 4.0 * x * z) - y + 2.0 * z) / (2.0 * (x - y + z)); f2 = (-sqrt(y * y - 4.0 * x * z) - y + 2.0 * z) / (2.0 * (x - y + z)); - f1 = fabs(f1); - f2 = fabs(f2); + f1 = fabsf(f1); + f2 = fabsf(f2); f1 = MIN2(f1, f2); CLAMP(f1, 0.0f, 1.0f + FLT_EPSILON); } @@ -308,9 +308,9 @@ static float quad_coord(float aa[3], float bb[3], float cc[3], float dd[3], int for (i = 0; i < 2; i++) { if (fabsf(aa[i]) < FLT_EPSILON * 100.0f) - return aa[(i + 1) % 2] / fabs(bb[(i + 1) % 2] - aa[(i + 1) % 2]); + return aa[(i + 1) % 2] / fabsf(bb[(i + 1) % 2] - aa[(i + 1) % 2]); if (fabsf(cc[i]) < FLT_EPSILON * 100.0f) - return cc[(i + 1) % 2] / fabs(dd[(i + 1) % 2] - cc[(i + 1) % 2]); + return cc[(i + 1) % 2] / fabsf(dd[(i + 1) % 2] - cc[(i + 1) % 2]); } } } diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index 4543eaf4109..c8423afc4d9 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -782,7 +782,7 @@ BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, int ccw) return nl->e; } -BMVert *BM_vert_rip ( BMesh *bm, BMFace *sf, BMVert *sv) +BMVert *BM_vert_rip(BMesh *bm, BMFace *sf, BMVert *sv) { return bmesh_urmv(bm, sf, sv); } diff --git a/source/blender/bmesh/intern/bmesh_operator_api_inline.c b/source/blender/bmesh/intern/bmesh_operator_api_inline.c index 733dcc36458..88789fc24b0 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api_inline.c +++ b/source/blender/bmesh/intern/bmesh_operator_api_inline.c @@ -40,31 +40,31 @@ * if you need to store a value per element, use a * ghash or a mapping slot to do it. */ -/* flags 15 and 16 (1<<14 and 1<<15) are reserved for bmesh api use */ +/* flags 15 and 16 (1 << 14 and 1 << 15) are reserved for bmesh api use */ BM_INLINE short _bmo_elem_flag_test(BMesh *bm, BMFlagLayer *oflags, const short oflag) { - return oflags[bm->stackdepth-1].f & oflag; + return oflags[bm->stackdepth - 1].f & oflag; } BM_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, const short oflag) { - oflags[bm->stackdepth-1].f |= oflag; + oflags[bm->stackdepth - 1].f |= oflag; } BM_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, const short oflag) { - oflags[bm->stackdepth-1].f &= ~oflag; + oflags[bm->stackdepth - 1].f &= ~oflag; } BM_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val) { - if (val) oflags[bm->stackdepth-1].f |= oflag; - else oflags[bm->stackdepth-1].f &= ~oflag; + if (val) oflags[bm->stackdepth - 1].f |= oflag; + else oflags[bm->stackdepth - 1].f &= ~oflag; } BM_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const short oflag) { - oflags[bm->stackdepth-1].f ^= oflag; + oflags[bm->stackdepth - 1].f ^= oflag; } BM_INLINE void BMO_slot_map_int_insert(BMesh *bm, BMOperator *op, const char *slotname, diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index af291eca072..5e9f9c1a332 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -943,7 +943,7 @@ static void bmo_flag_layer_alloc(BMesh *bm) bm->totflags++; /* allocate new flag poo */ - bm->toolflagpool = newpool = BLI_mempool_create(sizeof(BMFlagLayer)*bm->totflags, 512, 512, FALSE, FALSE); + bm->toolflagpool = newpool = BLI_mempool_create(sizeof(BMFlagLayer) * bm->totflags, 512, 512, FALSE, FALSE); /* now go through and memcpy all the flags. Loops don't get a flag layer at this time.. */ for (ele = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) { diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index c511193209e..8188413bb8c 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -740,8 +740,8 @@ static int goodline(float (*projectverts)[3], BMFace *f, int v1i, //if (linecrosses(pv1, pv2, v1, v3)) return FALSE; - if ( point_in_triangle(v1, v2, v3, pv1) || - point_in_triangle(v3, v2, v1, pv1)) + if (point_in_triangle(v1, v2, v3, pv1) || + point_in_triangle(v3, v2, v1, pv1)) { return FALSE; } @@ -784,8 +784,9 @@ static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3], const i if (isear) { #if 0 + /* if this code comes back, it needs to be converted to radians */ angle = angle_v3v3v3(verts[v1->head.eflag2], verts[v2->head.eflag2], verts[v3->head.eflag2]); - if (!bestear || ABS(angle-45.0f) < bestangle) { + if (!bestear || ABS(angle - 45.0f) < bestangle) { bestear = l; bestangle = ABS(45.0f - angle); } diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index f7543b151fc..6ea6aba821a 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -547,10 +547,10 @@ BMVert *BM_edge_share_vert(struct BMEdge *e1, struct BMEdge *e2) void BM_edge_ordered_verts(BMEdge *edge, BMVert **r_v1, BMVert **r_v2) { - if ( (edge->l == NULL) || - ( ((edge->l->prev->v == edge->v1) && (edge->l->v == edge->v2)) || - ((edge->l->v == edge->v1) && (edge->l->next->v == edge->v2)) ) - ) + if ((edge->l == NULL) || + (((edge->l->prev->v == edge->v1) && (edge->l->v == edge->v2)) || + ((edge->l->v == edge->v1) && (edge->l->next->v == edge->v2))) + ) { *r_v1 = edge->v1; *r_v2 = edge->v2; @@ -801,7 +801,7 @@ int BM_face_exists_multi_edge(BMesh *bm, BMEdge **earr, int len) /* first check if verts have edges, if not we can bail out early */ ok = TRUE; - for (i = len - 1, i_next = 0; i_next < len; (i=i_next++)) { + for (i = len - 1, i_next = 0; i_next < len; (i = i_next++)) { if (!(varr[i] = BM_edge_share_vert(earr[i], earr[i_next]))) { ok = FALSE; break; diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c index 3da95230c76..2b9f530e77d 100644 --- a/source/blender/bmesh/operators/bmo_create.c +++ b/source/blender/bmesh/operators/bmo_create.c @@ -880,8 +880,8 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op) if (!bm->totvert || !bm->totedge) return; - edata = MEM_callocN(sizeof(EdgeData)*bm->totedge, "EdgeData"); - vdata = MEM_callocN(sizeof(VertData)*bm->totvert, "VertData"); + edata = MEM_callocN(sizeof(EdgeData) * bm->totedge, "EdgeData"); + vdata = MEM_callocN(sizeof(VertData) * bm->totvert, "VertData"); BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_MARK, BM_EDGE); BMO_slot_buffer_flag_enable(bm, op, "excludefaces", FACE_IGNORE, BM_FACE); @@ -1050,9 +1050,9 @@ static BMEdge *edge_next(BMesh *bm, BMEdge *e) for (i = 0; i < 2; i++) { BM_ITER(e2, &iter, bm, BM_EDGES_OF_VERT, i ? e->v2 : e->v1) { - if ( (BMO_elem_flag_test(bm, e2, EDGE_MARK)) && - (!BMO_elem_flag_test(bm, e2, EDGE_VIS)) && - (e2 != e)) + if ((BMO_elem_flag_test(bm, e2, EDGE_MARK)) && + (!BMO_elem_flag_test(bm, e2, EDGE_VIS)) && + (e2 != e)) { return e2; } @@ -1101,8 +1101,8 @@ void bmesh_edgenet_prepare(BMesh *bm, BMOperator *op) while (1) { BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) { if (!BMO_elem_flag_test(bm, e, EDGE_VIS)) { - if ( BMO_vert_edge_flags_count(bm, e->v1, EDGE_MARK) == 1 || - BMO_vert_edge_flags_count(bm, e->v2, EDGE_MARK) == 1) + if (BMO_vert_edge_flags_count(bm, e->v1, EDGE_MARK) == 1 || + BMO_vert_edge_flags_count(bm, e->v2, EDGE_MARK) == 1) { break; } diff --git a/source/blender/bmesh/operators/bmo_edgesplit.c b/source/blender/bmesh/operators/bmo_edgesplit.c index 7d719e1ddc9..f8c41d71558 100644 --- a/source/blender/bmesh/operators/bmo_edgesplit.c +++ b/source/blender/bmesh/operators/bmo_edgesplit.c @@ -230,7 +230,7 @@ void bmesh_edgesplitop_exec(BMesh *bm, BMOperator *op) } } - etags = MEM_callocN(sizeof(EdgeTag)*bm->totedge, "EdgeTag"); + etags = MEM_callocN(sizeof(EdgeTag) * bm->totedge, "EdgeTag"); BM_mesh_elem_index_ensure(bm, BM_EDGE); diff --git a/source/blender/bmesh/operators/bmo_mesh_conv.c b/source/blender/bmesh/operators/bmo_mesh_conv.c index b5807f9ba8d..b41a6f823b0 100644 --- a/source/blender/bmesh/operators/bmo_mesh_conv.c +++ b/source/blender/bmesh/operators/bmo_mesh_conv.c @@ -134,7 +134,7 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) } } else if (actkey) { - printf("shapekey<->mesh mismatch!\n"); + printf("shapekey <-> mesh mismatch!\n"); } CustomData_bmesh_init_pool(&bm->vdata, bm_mesh_allocsize_default[0]); @@ -897,9 +897,9 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) add_v3_v3(fp, ofs[i]); } - fp+= 3; - ++i; - ++mvert; + fp += 3; + i++; + mvert++; eve = BM_iter_step(&iter); } currkey->totelem = bm->totvert; diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c index 9cf17490d58..a050f04078e 100644 --- a/source/blender/bmesh/operators/bmo_primitive.c +++ b/source/blender/bmesh/operators/bmo_primitive.c @@ -317,7 +317,7 @@ void bmesh_create_uvsphere_exec(BMesh *bm, BMOperator *op) BMO_elem_flag_enable(bm, e, EDGE_ORIG); } - phi+= phid; + phi += phid; preveve = eve; } @@ -351,15 +351,15 @@ void bmesh_create_uvsphere_exec(BMesh *bm, BMOperator *op) { float len, len2, vec2[3]; - len= 2*dia*sinf(phid / 2.0f); + len = 2 * dia * sinf(phid / 2.0f); /* length of one segment in shortest parallen */ - vec[0]= dia*sinf(phid); - vec[1]= 0.0; - vec[2]= dia*cosf(phid); + vec[0] = dia * sinf(phid); + vec[1] = 0.0f; + vec[2] = dia * cosf(phid); mul_v3_m3v3(vec2, cmat, vec); - len2= len_v3v3(vec, vec2); + len2 = len_v3v3(vec, vec2); /* use shortest segment length divided by 3 as merge threshold */ BMO_op_callf(bm, "removedoubles verts=%fv dist=%f", VERT_MARK, MIN2(len, len2) / 3.0f); diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index a983851891c..9967764200e 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -117,7 +117,7 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const subdpar copy_v3_v3(nor2, vend->no); /* cosine angle */ - fac= dot_v3v3(nor, nor1); + fac = dot_v3v3(nor, nor1); mul_v3_v3fl(tvec, nor1, fac); /* cosine angle */ diff --git a/source/blender/bmesh/tools/BME_bevel.c b/source/blender/bmesh/tools/BME_bevel.c index 758e2479dd3..da360d602e4 100644 --- a/source/blender/bmesh/tools/BME_bevel.c +++ b/source/blender/bmesh/tools/BME_bevel.c @@ -172,7 +172,7 @@ static int BME_bevel_is_split_vert(BMesh *bm, BMLoop *l) * beveling other polys; this can be determined by testing the * vert and the edges around it for originality */ - if ( !BMO_elem_flag_test(bm, l->v, BME_BEVEL_ORIG) && + if (!BMO_elem_flag_test(bm, l->v, BME_BEVEL_ORIG) && BMO_elem_flag_test(bm, l->e, BME_BEVEL_ORIG) && BMO_elem_flag_test(bm, l->prev->e, BME_BEVEL_ORIG)) { @@ -496,16 +496,16 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti e = l->e; /* sanity check */ - if ( !BMO_elem_flag_test(bm, l->e, BME_BEVEL_BEVEL) && - (BMO_elem_flag_test(bm, l->v, BME_BEVEL_BEVEL) || BMO_elem_flag_test(bm, l->next->v, BME_BEVEL_BEVEL))) + if (!BMO_elem_flag_test(bm, l->e, BME_BEVEL_BEVEL) && + (BMO_elem_flag_test(bm, l->v, BME_BEVEL_BEVEL) || BMO_elem_flag_test(bm, l->next->v, BME_BEVEL_BEVEL))) { return l; } /* checks and operations for prev edge */ /* first, check to see if this edge was inset previously */ - if ( !BMO_elem_flag_test(bm, l->prev->e, BME_BEVEL_ORIG) && - !BMO_elem_flag_test(bm, l->v, BME_BEVEL_NONMAN)) + if (!BMO_elem_flag_test(bm, l->prev->e, BME_BEVEL_ORIG) && + !BMO_elem_flag_test(bm, l->v, BME_BEVEL_NONMAN)) { kl = l->prev->radial_next; kl = (kl->v == l->v) ? kl->prev : kl->next; @@ -550,8 +550,8 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti /* checks and operations for the next edge */ /* first, check to see if this edge was inset previously */ - if ( !BMO_elem_flag_test(bm, l->next->e, BME_BEVEL_ORIG) && - !BMO_elem_flag_test(bm, l->next->v, BME_BEVEL_NONMAN)) + if (!BMO_elem_flag_test(bm, l->next->e, BME_BEVEL_ORIG) && + !BMO_elem_flag_test(bm, l->next->v, BME_BEVEL_NONMAN)) { kl = l->next->radial_next; kl = (kl->v == l->next->v) ? kl->prev : kl->next; @@ -666,9 +666,9 @@ static BMFace *BME_bevel_poly(BMesh *bm, BMFace *f, float value, int options, BM max = 1.0f; l = BME_bevel_edge(bm, l, value, options, up_vec, td); } - else if ( BMO_elem_flag_test(bm, l->v, BME_BEVEL_BEVEL) && - BMO_elem_flag_test(bm, l->v, BME_BEVEL_ORIG) && - !BMO_elem_flag_test(bm, l->prev->e, BME_BEVEL_BEVEL)) + else if (BMO_elem_flag_test(bm, l->v, BME_BEVEL_BEVEL) && + BMO_elem_flag_test(bm, l->v, BME_BEVEL_ORIG) && + !BMO_elem_flag_test(bm, l->prev->e, BME_BEVEL_BEVEL)) { max = 1.0f; l = BME_bevel_vert(bm, l, value, options, up_vec, td); @@ -1019,7 +1019,7 @@ BMesh *BME_bevel(BMEditMesh *em, float value, int res, int options, int defgrp_i /* otherwise apply transforms */ BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) { - if ( (vtd = BME_get_transdata(td, v)) ) { + if ((vtd = BME_get_transdata(td, v))) { if (vtd->max && (*vtd->max > 0 && value > *vtd->max)) { d = *vtd->max; } diff --git a/source/blender/editors/mesh/bmesh_select.c b/source/blender/editors/mesh/bmesh_select.c index 1bc1ebcd9a7..d5c7fa45bd2 100644 --- a/source/blender/editors/mesh/bmesh_select.c +++ b/source/blender/editors/mesh/bmesh_select.c @@ -445,7 +445,7 @@ float labda_PdistVL2Dfl(const float v1[3], const float v2[3], const float v3[3]) if (len == 0.0f) return 0.0f; - return (rc[0] * (v1[0] - v2[0]) + rc[1] * (v1[1] - v2[1]) ) / len; + return (rc[0] * (v1[0] - v2[0]) + rc[1] * (v1[1] - v2[1])) / len; } /* note; uses v3d, so needs active 3d window */ @@ -1119,7 +1119,7 @@ static float edgetag_cut_cost(BMEditMesh *UNUSED(em), BMEdge *e1, BMEdge *e2, BM cost = len_v3(d1); cost += len_v3(d2); - /*.but is biased to give higher values to sharp turns, so that it will take + /* but is biased to give higher values to sharp turns, so that it will take * paths with fewer "turns" when selecting between equal-weighted paths between * the two edges */ cost = cost + 0.5f * cost * (2.0f - sqrt(fabs(dot_v3v3(d1, d2)))); diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c index 74ef159b40e..4b89c282945 100644 --- a/source/blender/editors/mesh/bmesh_tools.c +++ b/source/blender/editors/mesh/bmesh_tools.c @@ -283,22 +283,22 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag, } if (mmd->flag & MOD_MIR_AXIS_X) { - if ( (fabs(co1[0]) < mmd->tolerance) && - (fabs(co2[0]) < mmd->tolerance) ) + if ((fabsf(co1[0]) < mmd->tolerance) && + (fabsf(co2[0]) < mmd->tolerance)) { BMO_slot_map_ptr_insert(bm, &extop, "exclude", edge, NULL); } } if (mmd->flag & MOD_MIR_AXIS_Y) { - if ( (fabs(co1[1]) < mmd->tolerance) && - (fabs(co2[1]) < mmd->tolerance) ) + if ((fabsf(co1[1]) < mmd->tolerance) && + (fabsf(co2[1]) < mmd->tolerance)) { BMO_slot_map_ptr_insert(bm, &extop, "exclude", edge, NULL); } } if (mmd->flag & MOD_MIR_AXIS_Z) { - if ( (fabs(co1[2]) < mmd->tolerance) && - (fabs(co2[2]) < mmd->tolerance) ) + if ((fabsf(co1[2]) < mmd->tolerance) && + (fabsf(co2[2]) < mmd->tolerance)) { BMO_slot_map_ptr_insert(bm, &extop, "exclude", edge, NULL); } @@ -2136,9 +2136,9 @@ static EnumPropertyItem *merge_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; if (em->selectmode & SCE_SELECT_VERTEX) { - if ( em->bm->selected.first && em->bm->selected.last && - ((BMEditSelection *)em->bm->selected.first)->htype == BM_VERT && - ((BMEditSelection *)em->bm->selected.last)->htype == BM_VERT) + if (em->bm->selected.first && em->bm->selected.last && + ((BMEditSelection *)em->bm->selected.first)->htype == BM_VERT && + ((BMEditSelection *)em->bm->selected.last)->htype == BM_VERT) { RNA_enum_items_add_value(&item, &totitem, merge_type_items, 6); RNA_enum_items_add_value(&item, &totitem, merge_type_items, 1); @@ -2955,13 +2955,13 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode, x12 = c[i].x; y12 = c[i].y; - /* test e->v1*/ + /* test e->v1 */ if ((x11 == x21 && y11 == y21) || (x12 == x21 && y12 == y21)) { perc = 0; *isected = 1; return perc; } - /* test e->v2*/ + /* test e->v2 */ else if ((x11 == x22 && y11 == y22) || (x12 == x22 && y12 == y22)) { perc = 0; *isected = 2; @@ -3105,7 +3105,7 @@ static int knife_cut_exec(bContext *C, wmOperator *op) /* the floating point coordinates of verts in screen space will be stored in a hash table according to the vertices pointer */ gh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "knife cut exec"); for (bv = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); bv; bv = BM_iter_step(&iter)) { - scr = MEM_mallocN(sizeof(float)*2, "Vertex Screen Coordinates"); + scr = MEM_mallocN(sizeof(float) * 2, "Vertex Screen Coordinates"); copy_v3_v3(co, bv->co); co[3] = 1.0f; mul_m4_v4(obedit->obmat, co); @@ -4002,7 +4002,7 @@ static int vergxco(const void *v1, const void *v2) { const xvertsort *x1 = v1, *x2 = v2; - if (x1->x > x2->x ) return 1; + if (x1->x > x2->x) return 1; else if (x1->x < x2->x) return -1; return 0; } @@ -4050,7 +4050,7 @@ static void xsortvert_flag(bContext *UNUSED(C), int UNUSED(flag)) em = vc.em; amount = em->bm->totvert; - sortblock = MEM_callocN(sizeof(xvertsort)*amount,"xsort"); + sortblock = MEM_callocN(sizeof(xvertsort) * amount,"xsort"); BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) sortblock[i].v1 = eve; @@ -4459,7 +4459,7 @@ static int mesh_bevel_exec(bContext *C, wmOperator *op) int li; BM_data_layer_add(em->bm, &em->bm->edata, CD_PROP_FLT); - li = CustomData_number_of_layers(&em->bm->edata, CD_PROP_FLT)-1; + li = CustomData_number_of_layers(&em->bm->edata, CD_PROP_FLT) - 1; BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) { float d = len_v3v3(eed->v1->co, eed->v2->co); diff --git a/source/blender/editors/mesh/knifetool.c b/source/blender/editors/mesh/knifetool.c index 924be605281..62e82aaee47 100755 --- a/source/blender/editors/mesh/knifetool.c +++ b/source/blender/editors/mesh/knifetool.c @@ -1699,7 +1699,7 @@ static void knifenet_fill_faces(knifetool_opdata *kcd) KnifeVert *kfv; KnifeEdge *kfe; facenet_entry *entry; - ListBase *face_nets = MEM_callocN(sizeof(ListBase)*bm->totface, "face_nets"); + ListBase *face_nets = MEM_callocN(sizeof(ListBase) * bm->totface, "face_nets"); BMFace **faces = MEM_callocN(sizeof(BMFace *) * bm->totface, "faces knife"); MemArena *arena = BLI_memarena_new(1 << 16, "knifenet_fill_faces"); SmallHash shash; diff --git a/source/blender/python/bmesh/bmesh_py_types.h b/source/blender/python/bmesh/bmesh_py_types.h index c928e8866c3..6d4444b4662 100644 --- a/source/blender/python/bmesh/bmesh_py_types.h +++ b/source/blender/python/bmesh/bmesh_py_types.h @@ -140,8 +140,8 @@ void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_ #define BPY_BM_CHECK_OBJ(obj) if (bpy_bm_generic_valid_check((BPy_BMGeneric *)obj) == -1) { return NULL; } (void)NULL #define BPY_BM_CHECK_INT(obj) if (bpy_bm_generic_valid_check((BPy_BMGeneric *)obj) == -1) { return -1; } (void)NULL -#define BM_ITER_BPY_BM_SEQ(ele, iter, bpy_bmelemseq) \ - BM_ITER(ele, iter, (bpy_bmelemseq)->bm, (bpy_bmelemseq)->itype,\ +#define BM_ITER_BPY_BM_SEQ(ele, iter, bpy_bmelemseq) \ + BM_ITER(ele, iter, (bpy_bmelemseq)->bm, (bpy_bmelemseq)->itype, \ (bpy_bmelemseq)->py_ele ? ((BPy_BMElem *)(bpy_bmelemseq)->py_ele)->ele : NULL) #endif /* __BMESH_TYPES_H__ */ |