style cleanup > 120 line length.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 13 Feb 2012 05:36:31 +0000 (05:36 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 13 Feb 2012 05:36:31 +0000 (05:36 +0000)
source/blender/bmesh/intern/bmesh_interp.c
source/blender/bmesh/intern/bmesh_marking.c
source/blender/bmesh/intern/bmesh_mesh.c
source/blender/bmesh/intern/bmesh_operators.c
source/blender/bmesh/operators/bmo_bevel.c
source/blender/bmesh/operators/bmo_create.c
source/blender/bmesh/operators/bmo_dupe.c
source/blender/bmesh/operators/bmo_mesh_conv.c
source/blender/bmesh/operators/bmo_primitive.c
source/blender/bmesh/operators/bmo_triangulate.c

index 18db9d2cb18cf7c32629f01fd278a05fccafb147..0e3a78ebcb7c97e3911c2b7095ab988175f02e1b 100644 (file)
@@ -560,7 +560,8 @@ static void bmesh_loop_interp_mdisps(BMesh *bm, BMLoop *target, BMFace *source)
                
                mdisps->totdisp = md2->totdisp;
                if (mdisps->totdisp) {
-                       mdisps->disps = MEM_callocN(sizeof(float) * 3 * mdisps->totdisp, "mdisp->disps in bmesh_loop_intern_mdisps");
+                       mdisps->disps = MEM_callocN(sizeof(float) * 3 * mdisps->totdisp,
+                                                   "mdisp->disps in bmesh_loop_intern_mdisps");
                }
                else {
                        return;
index ce997584a4d8559fd477a36726faed3673f53f55..6cccc5e64438bc1f928962d67a2f788bb0f52c56 100644 (file)
@@ -90,7 +90,10 @@ void BM_mesh_select_mode_flush(BMesh *bm)
 
        if (bm->selectmode & SCE_SELECT_VERTEX) {
                for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
-                       if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && BM_elem_flag_test(e->v2, BM_ELEM_SELECT) && !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
+                       if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) &&
+                           BM_elem_flag_test(e->v2, BM_ELEM_SELECT) &&
+                           !BM_elem_flag_test(e, BM_ELEM_HIDDEN))
+                       {
                                BM_elem_flag_enable(e, BM_ELEM_SELECT);
                        }
                        else {
@@ -165,7 +168,10 @@ void BM_mesh_deselect_flush(BMesh *bm)
        int ok;
 
        for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
-               if (!(BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && BM_elem_flag_test(e->v2, BM_ELEM_SELECT) && !BM_elem_flag_test(e, BM_ELEM_HIDDEN))) {
+               if (!(BM_elem_flag_test(e->v1, BM_ELEM_SELECT) &&
+                     BM_elem_flag_test(e->v2, BM_ELEM_SELECT) &&
+                     !BM_elem_flag_test(e, BM_ELEM_HIDDEN)))
+               {
                        BM_elem_flag_disable(e, BM_ELEM_SELECT);
                }
        }
@@ -211,7 +217,10 @@ void BM_mesh_select_flush(BMesh *bm)
        int ok;
 
        for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
-               if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && BM_elem_flag_test(e->v2, BM_ELEM_SELECT) && !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
+               if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) &&
+                   BM_elem_flag_test(e->v2, BM_ELEM_SELECT) &&
+                   !BM_elem_flag_test(e, BM_ELEM_HIDDEN))
+               {
                        BM_elem_flag_enable(e, BM_ELEM_SELECT);
                }
        }
index 1a2fd45aa0d5f6367633af31167166d1d19cf945..d285be460e1f420f22714a98e686d91c3130070b 100644 (file)
@@ -537,7 +537,8 @@ void BM_mesh_elem_index_ensure(BMesh *bm, const char hflag)
  *
  */
 
-void BM_mesh_elem_index_validate(BMesh *bm, const char *location, const char *func, const char *msg_a, const char *msg_b)
+void BM_mesh_elem_index_validate(BMesh *bm, const char *location, const char *func,
+                                 const char *msg_a, const char *msg_b)
 {
        const char iter_types[3] = {BM_VERTS_OF_MESH,
                                    BM_EDGES_OF_MESH,
index 75f598b90996637b43bad6c4f5f7581caa0d9b47..09f587c39d31556db542219951970d02eed008bc 100644 (file)
@@ -506,6 +506,7 @@ void *BMO_Grow_Array(BMesh *bm, BMOperator *op, int slotcode, int totadd)
 {
        BMOpSlot *slot = &op->slots[slotcode];
        void *tmp;
+       ssize_t allocsize;
        
        /* check if its actually a buffer */
        if (!(slot->slottype > BMO_OP_SLOT_VEC))
@@ -515,9 +516,11 @@ void *BMO_Grow_Array(BMesh *bm, BMOperator *op, int slotcode, int totadd)
                if (slot->len >= slot->size) {
                        slot->size = (slot->size + 1 + totadd) * 2;
 
+                       allocsize = BMO_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->size;
+
                        tmp = slot->data.buf;
-                       slot->data.buf = MEM_callocN(BMO_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->size, "opslot dynamic array");
-                       memcpy(slot->data.buf, tmp, BMO_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->size);
+                       slot->data.buf = MEM_callocN(allocsize, "opslot dynamic array");
+                       memcpy(slot->data.buf, tmp, allocsize);
                        MEM_freeN(tmp);
                }
 
@@ -527,9 +530,12 @@ void *BMO_Grow_Array(BMesh *bm, BMOperator *op, int slotcode, int totadd)
                slot->flag |= BMOS_DYNAMIC_ARRAY;
                slot->len += totadd;
                slot->size = slot->len + 2;
+
+               allocsize = BMO_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->len;
+
                tmp = slot->data.buf;
-               slot->data.buf = MEM_callocN(BMO_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->len, "opslot dynamic array");
-               memcpy(slot->data.buf, tmp, BMO_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->len);
+               slot->data.buf = MEM_callocN(allocsize, "opslot dynamic array");
+               memcpy(slot->data.buf, tmp, allocsize);
        }
 
        return slot->data.buf;
index 2b988e646a9ec77104c7c05010eaf822e236e12a..da5ccb398d4380e7409d644d27088f64ed06f84c 100644 (file)
@@ -360,7 +360,8 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                                        if (!tag->newv) {
                                                sub_v3_v3v3(co, l->prev->v->co, l->v->co);
                                                if (has_elens) {
-                                                       float elen = *(float *)CustomData_bmesh_get_n(&bm->edata, l->prev->e->head.data, CD_PROP_FLT, li);
+                                                       float elen = *(float *)CustomData_bmesh_get_n(&bm->edata, l->prev->e->head.data,
+                                                                                                     CD_PROP_FLT, li);
 
                                                        normalize_v3(co);
                                                        mul_v3_fl(co, elen);
@@ -799,7 +800,10 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
        
        /* handle vertices along boundary edge */
        BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-               if (BMO_elem_flag_test(bm, v, VERT_OLD) && BMO_elem_flag_test(bm, v, BEVEL_FLAG) && !BMO_elem_flag_test(bm, v, BEVEL_DEL)) {
+               if (BMO_elem_flag_test(bm, v, VERT_OLD) &&
+                   BMO_elem_flag_test(bm, v, BEVEL_FLAG) &&
+                   !BMO_elem_flag_test(bm, v, BEVEL_DEL))
+               {
                        BMLoop *l;
                        BMLoop *lorig = NULL;
                        BMIter liter;
index ddae628c8da2fd5b487f6e953b1954f0c024e171..5deaa516d3d420e0851d2b5ff566f43c50a81497 100644 (file)
@@ -1144,8 +1144,12 @@ void bmesh_edgenet_prepare(BMesh *bm, BMOperator *op)
                count++;
        }
 
-       if (edges1 && BLI_array_count(edges1) > 2 && BM_edge_share_vert(edges1[0], edges1[BLI_array_count(edges1) - 1])) {
-               if (edges2 && BLI_array_count(edges2) > 2 && BM_edge_share_vert(edges2[0], edges2[BLI_array_count(edges2) - 1])) {
+       if (edges1 && BLI_array_count(edges1) > 2 &&
+           BM_edge_share_vert(edges1[0], edges1[BLI_array_count(edges1) - 1]))
+       {
+               if (edges2 && BLI_array_count(edges2) > 2 &&
+                   BM_edge_share_vert(edges2[0], edges2[BLI_array_count(edges2) - 1]))
+               {
                        BLI_array_free(edges1);
                        BLI_array_free(edges2);
                        return;
@@ -1156,7 +1160,9 @@ void bmesh_edgenet_prepare(BMesh *bm, BMOperator *op)
                }
        }
 
-       if (edges2 && BLI_array_count(edges2) > 2 && BM_edge_share_vert(edges2[0], edges2[BLI_array_count(edges2) - 1])) {
+       if (edges2 && BLI_array_count(edges2) > 2 &&
+           BM_edge_share_vert(edges2[0], edges2[BLI_array_count(edges2) - 1]))
+       {
                edges2 = NULL;
        }
 
index 150048cf9092e712cf838329d5379635901ae10e..f9617d0affd7ad3ac83247eaf0cc09267f255f65 100644 (file)
@@ -203,7 +203,9 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target)
        ehash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh dupeops e");
        
        for (v = BM_iter_new(&verts, source, BM_VERTS_OF_MESH, source); v; v = BM_iter_step(&verts)) {
-               if (BMO_elem_flag_test(source, (BMHeader *)v, DUPE_INPUT) && (!BMO_elem_flag_test(source, (BMHeader *)v, DUPE_DONE))) {
+               if ( BMO_elem_flag_test(source, (BMHeader *)v, DUPE_INPUT) &&
+                   !BMO_elem_flag_test(source, (BMHeader *)v, DUPE_DONE))
+               {
                        BMIter iter;
                        int iso = 1;
 
@@ -235,7 +237,9 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target)
 
        /* now we dupe all the edge */
        for (e = BM_iter_new(&edges, source, BM_EDGES_OF_MESH, source); e; e = BM_iter_step(&edges)) {
-               if (BMO_elem_flag_test(source, (BMHeader *)e, DUPE_INPUT) && (!BMO_elem_flag_test(source, (BMHeader *)e, DUPE_DONE))) {
+               if ( BMO_elem_flag_test(source, (BMHeader *)e, DUPE_INPUT) &&
+                   !BMO_elem_flag_test(source, (BMHeader *)e, DUPE_DONE))
+               {
                        /* make sure that verts are copie */
                        if (!BMO_elem_flag_test(source, (BMHeader *)e->v1, DUPE_DONE)) {
                                copy_vertex(source, e->v1, target, vhash);
index 782cbf66aa8d49eddeabd628bef36565a39dd33a..4f6db9056e59b994b2566efcf08c111424a7266d 100644 (file)
@@ -760,7 +760,9 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
                                        currkey->totelem = bm->totvert;
 
                                        BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-                                               co = currkey == actkey ? eve->co : CustomData_bmesh_get_n(&bm->vdata, eve->head.data, CD_SHAPEKEY, j);
+                                               co = (currkey == actkey) ?
+                                                           eve->co :
+                                                           CustomData_bmesh_get_n(&bm->vdata, eve->head.data, CD_SHAPEKEY, j);
                                                
                                                copy_v3_v3(fp, co);
 
index 5e7ebd87e43cb19f91f6c8f579370de2b07c4315..27bcccd14e31bbf36bdfa02da1d4b1bb64d438dc 100644 (file)
@@ -451,7 +451,10 @@ void bmesh_create_monkey_exec(BMesh *bm, BMOperator *op)
                tv[i] = BM_vert_create(bm, v, NULL);
                BMO_elem_flag_enable(bm, tv[i], VERT_MARK);
 
-               tv[monkeynv + i] = (fabsf(v[0] = -v[0]) < 0.001f) ? tv[i]: (eve = BM_vert_create(bm, v, NULL), mul_m4_v3(mat, eve->co), eve);
+               tv[monkeynv + i] = (fabsf(v[0] = -v[0]) < 0.001f) ?
+                           tv[i] :
+                           (eve = BM_vert_create(bm, v, NULL), mul_m4_v3(mat, eve->co), eve);
+
                BMO_elem_flag_enable(bm, tv[monkeynv + i], VERT_MARK);
 
                mul_m4_v3(mat, tv[i]->co);
index 1254ad60dbf292f86edf8fd0a24ee8a22b750b48..90efe0b6e444ec8036c2a84c5120f066b85f87e0 100644 (file)
@@ -100,10 +100,15 @@ void bmesh_beautify_fill_exec(BMesh *bm, BMOperator *op)
                BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
                        BMVert *v1, *v2, *v3, *v4;
                        
-                       if (BM_edge_face_count(e) != 2 || BMO_elem_flag_test(bm, e, EDGE_MARK))
+                       if (BM_edge_face_count(e) != 2 || BMO_elem_flag_test(bm, e, EDGE_MARK)) {
                                continue;
-                       if (!BMO_elem_flag_test(bm, e->l->f, FACE_MARK) || !BMO_elem_flag_test(bm, e->l->radial_next->f, FACE_MARK))
+                       }
+
+                       if (!BMO_elem_flag_test(bm, e->l->f, FACE_MARK) ||
+                           !BMO_elem_flag_test(bm, e->l->radial_next->f, FACE_MARK))
+                       {
                                continue;
+                       }
                        
                        v1 = e->l->prev->v;
                        v2 = e->l->v;