style cleanup
authorCampbell Barton <ideasman42@gmail.com>
Sun, 26 Feb 2012 22:38:49 +0000 (22:38 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 26 Feb 2012 22:38:49 +0000 (22:38 +0000)
19 files changed:
source/blender/bmesh/bmesh.h
source/blender/bmesh/bmesh_iterators.h
source/blender/bmesh/bmesh_walkers.h
source/blender/bmesh/intern/bmesh_interp.c
source/blender/bmesh/intern/bmesh_mods.c
source/blender/bmesh/intern/bmesh_operator_api_inline.c
source/blender/bmesh/intern/bmesh_operators.c
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/bmesh/intern/bmesh_queries.c
source/blender/bmesh/operators/bmo_create.c
source/blender/bmesh/operators/bmo_edgesplit.c
source/blender/bmesh/operators/bmo_mesh_conv.c
source/blender/bmesh/operators/bmo_primitive.c
source/blender/bmesh/operators/bmo_subdivide.c
source/blender/bmesh/tools/BME_bevel.c
source/blender/editors/mesh/bmesh_select.c
source/blender/editors/mesh/bmesh_tools.c
source/blender/editors/mesh/knifetool.c
source/blender/python/bmesh/bmesh_py_types.h

index 168a8d913a06bb375785b4ab8c77fcfa325bbf6c..bf939d3f1cb578f17862f2196f052a2ef7bd5fc5 100644 (file)
@@ -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];
index ccbed3ecd01fadf7ef7668557537eade3c67913d..fc914a8c87d78cc0e2637792f036c0614029104a 100644 (file)
@@ -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 {
index d926ab6d0667f5c1f4fccf808160003a9796258e..9dff8cd98fb2bb2373b6aacda757e8b4e69f7a56 100644 (file)
@@ -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
 }
index 7d94fac241476682515a24393fe0e0e999328c4a..406da71ce4d2fb73d0b5a303cf11d4f45163b6a6 100644 (file)
@@ -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]);
                        }
                }
        }
index 4543eaf4109ae473571f26c21a6af5d1f1550588..c8423afc4d9e3075337554d91f587961418fa6e5 100644 (file)
@@ -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);
 }
index 733dcc364589470d35cacbccb5be04813ea06595..88789fc24b0998b2d0d9840c7d7a2854c1e675a2 100644 (file)
  * 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,
index af291eca072a7c97574092271a6a877240e0c451..5e9f9c1a332094a0352e535bfb2aefe6a85aa7ed 100644 (file)
@@ -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++) {
index c511193209eb4289baa65ee1998df6972c2c10bb..8188413bb8cdb93cb88109208ec38bb07da10875 100644 (file)
@@ -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);
                        }
index f7543b151fc42708267d88574435b4e38922fbea..6ea6aba821a7e3f1d9d1a5d88843c282dea0be98 100644 (file)
@@ -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;
index 3da95230c7612f9460f24473795f27d458f5ba7c..2b9f530e77d7f0032c4d86a379f5c369e1fc651d 100644 (file)
@@ -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;
                                }
index 7d719e1ddc9c02df059d7d8a97b24dede84ecf37..f8c41d715580576c3af15b272f853ac11879480d 100644 (file)
@@ -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);
 
index b5807f9ba8df15138300de1e599a290b27398ad2..b41a6f823b0bddb3e4be5022b52dca2b384b2510 100644 (file)
@@ -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;
index 9cf17490d583368d9bc17d5436437b729ff723b9..a050f04078ea6bd3ab0838179fbc06183eed5dd6 100644 (file)
@@ -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);
index a983851891c0dcceb390dcc18f512fe0b47d2f7a..9967764200ed3a92e8e900b05e5a6db45ec970e6 100644 (file)
@@ -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 */
index 758e2479dd3903049c971e8686bcd9718d6431b8..da360d602e484f8d7067f07b1a3eb31141f86cb6 100644 (file)
@@ -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;
                        }
index 1bc1ebcd9a7930125916688003fc2a29c83c2e28..d5c7fa45bd245e8cb680cfa39a5ba140aa6b3fa6 100644 (file)
@@ -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))));
index 74ef159b40e3458eb21d0650db78541214d08248..4b89c2829451e8010708732b90481c5b4e702010 100644 (file)
@@ -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);
index 924be6052810e304f9e6cac78fab6015d17475eb..62e82aaee4737ea51728bec4e03415b898b90986 100755 (executable)
@@ -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;
index c928e8866c34ce8d6b669483fb45f96dcb1c529a..6d4444b46625f841dbc1e2969bf230835187b004 100644 (file)
@@ -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__ */