diff options
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_construct.c | 3 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh_conv.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_bevel.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_connect.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_create.c | 3 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_extrude.c | 3 |
7 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index 72d9c9ab342..bc121303046 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -902,8 +902,9 @@ BMesh *BM_mesh_copy(BMesh *bm_old) } f2 = BM_face_create_ngon(bm_new, v, v2, edges, f->len, FALSE); - if (!f2) + if (UNLIKELY(f2 == NULL)) { continue; + } /* use totface in case adding some faces fails */ BM_elem_index_set(f2, (bm_new->totface - 1)); /* set_inline */ diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index ccbbb6f170b..d50c94d5e6a 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -1021,7 +1021,7 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const short do_del /* create region face */ newf = BM_face_create_ngon(bm, v1, v2, edges, tote, FALSE); - if (!newf || BMO_error_occurred(bm)) { + if (UNLIKELY(!newf || BMO_error_occurred(bm))) { if (!BMO_error_occurred(bm)) err = "Invalid boundary region to join faces"; goto error; diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.c b/source/blender/bmesh/intern/bmesh_mesh_conv.c index e6827b1f2cd..b0a9168ffda 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_conv.c +++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c @@ -314,7 +314,7 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr) f = BM_face_create(bm, verts, fedges, mpoly->totloop, FALSE); - if (!f) { + if (UNLIKELY(f == NULL)) { printf("%s: Warning! Bad face in mesh" " \"%s\" at index %d!, skipping\n", __func__, me->id.name + 2, i); diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index 8210ea973e6..10a9d511c77 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -475,7 +475,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BLI_array_append(edges, e); f = BM_face_create_ngon(bm, verts[0], verts[1], edges, BLI_array_count(edges), FALSE); - if (!f) { + if (UNLIKELY(f == NULL)) { printf("%s: could not make face!\n", __func__); continue; } @@ -592,7 +592,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) *d3 = (d1 + d2) * 0.5f; } - if (!f) { + if (UNLIKELY(f == NULL)) { fprintf(stderr, "%s: face index out of range! (bmesh internal error)\n", __func__); continue; } @@ -771,7 +771,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) continue; f = BM_face_create_ngon(bm, lastv, vstart, edges, BLI_array_count(edges), FALSE); - if (!f) { + if (UNLIKELY(f == NULL)) { fprintf(stderr, "%s: in bevel vert fill! (bmesh internal error)\n", __func__); } else { diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c index bb2e49d043c..fde475c2d6a 100644 --- a/source/blender/bmesh/operators/bmo_connect.c +++ b/source/blender/bmesh/operators/bmo_connect.c @@ -506,7 +506,7 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op) vv2[i2next], vv1[i1next], f_example, TRUE); - if (!f || f->len != 4) { + if (UNLIKELY((f == NULL) || (f->len != 4))) { fprintf(stderr, "%s: in bridge! (bmesh internal error)\n", __func__); } else { diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c index 519778cb638..731170f963c 100644 --- a/source/blender/bmesh/operators/bmo_create.c +++ b/source/blender/bmesh/operators/bmo_create.c @@ -275,8 +275,9 @@ static int UNUSED_FUNCTION(rotsys_fill_faces)(BMesh *bm, EdgeData *edata, VertDa continue; f = BM_face_create_ngon(bm, verts[0], verts[1], edges, BLI_array_count(edges), TRUE); - if (!f) + if (UNLIKELY(f == NULL)) { continue; + } } } diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c index c8be7c9ce34..81cad277bee 100644 --- a/source/blender/bmesh/operators/bmo_extrude.c +++ b/source/blender/bmesh/operators/bmo_extrude.c @@ -87,7 +87,7 @@ void bmo_extrude_discrete_faces_exec(BMesh *bm, BMOperator *op) BMO_elem_flag_enable(bm, f, EXT_DEL); f2 = BM_face_create_ngon(bm, firstv, BM_edge_other_vert(edges[0], firstv), edges, f->len, FALSE); - if (!f2) { + if (UNLIKELY(f2 == NULL)) { BMO_error_raise(bm, op, BMERR_MESH_ERROR, "Extrude failed; could not create face"); BLI_array_free(edges); return; @@ -104,6 +104,7 @@ void bmo_extrude_discrete_faces_exec(BMesh *bm, BMOperator *op) l4 = l2->next; f3 = BM_face_create_quad_tri(bm, l3->v, l4->v, l2->v, l->v, f, FALSE); + /* XXX, no error check here, why? - Campbell */ l_tmp = BM_FACE_FIRST_LOOP(f3); |