diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-08 11:34:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-08 11:34:09 +0400 |
commit | c1e475e527c49ed1a355472f560ae43a27af8f15 (patch) | |
tree | 7b50414e99f3e718e0f4a2be16672ca17c8d8130 /source/blender/bmesh | |
parent | 68daca1cbf85076d576f9f36340c41f0cca490aa (diff) |
code cleanup:
- remove unused vars
- no need to hard code version number for collada.
- cleanup some typos in comments.
- movieclip_calc_length was passing arg which should be unsigned to BLI_stringdec()
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_polygon.c | 28 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_private.h | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_structure.c | 4 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_slide.c | 1 |
4 files changed, 16 insertions, 19 deletions
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index df4c3fd5d33..33549660cb3 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -235,7 +235,7 @@ void BM_face_center_mean_calc(BMesh *UNUSED(bm), BMFace *f, float r_cent[3]) * a plane defined by the average * of its edges cross products */ -void compute_poly_plane(float (*verts)[3], int nverts) +void compute_poly_plane(float (*verts)[3], const int nverts) { float avgc[3], norm[3], mag, avgn[3]; @@ -257,15 +257,9 @@ void compute_poly_plane(float (*verts)[3], int nverts) add_v3_v3(avgn, norm); } - /* what was this bit for */ - if (is_zero_v3(avgn)) { - avgn[0] = 0.0f; - avgn[1] = 0.0f; + if (UNLIKELY(normalize_v3(avgn) == 0.0f)) { avgn[2] = 1.0f; } - else { - normalize_v3(avgn); - } for (i = 0; i < nverts; i++) { v1 = verts[i]; @@ -511,7 +505,7 @@ static int linecrossesf(const float v1[2], const float v2[2], const float v3[2], int w1, w2, w3, w4, w5 /*, re */; float mv1[2], mv2[2], mv3[2], mv4[2]; - /* now test windin */ + /* now test winding */ w1 = testedgesidef(v1, v3, v2); w2 = testedgesidef(v2, v4, v1); w3 = !testedgesidef(v1, v2, v3); @@ -607,8 +601,9 @@ int BM_face_point_inside_test(BMesh *bm, BMFace *f, const float co[3]) return crosses % 2 != 0; } -static int goodline(float const (*projectverts)[3], BMFace *f, int v1i, - int v2i, int v3i, int UNUSED(nvert)) +static int goodline(float const (*projectverts)[3], BMFace *f, + int v1i, int v2i, int v3i, + int UNUSED(nvert)) { BMLoop *l_iter; BMLoop *l_first; @@ -684,17 +679,20 @@ static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3], const i l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { - isear = 1; + isear = TRUE; v1 = l_iter->prev->v; v2 = l_iter->v; v3 = l_iter->next->v; if (BM_edge_exists(v1, v3)) { - isear = 0; + isear = FALSE; } - else if (!goodline((float const (*)[3])verts, f, BM_elem_index_get(v1), BM_elem_index_get(v2), BM_elem_index_get(v3), nvert)) { - isear = 0; + else if (!goodline((float const (*)[3])verts, f, + BM_elem_index_get(v1), BM_elem_index_get(v2), BM_elem_index_get(v3), + nvert)) + { + isear = FALSE; } if (isear) { diff --git a/source/blender/bmesh/intern/bmesh_private.h b/source/blender/bmesh/intern/bmesh_private.h index 3f67deb7997..791c8d68880 100644 --- a/source/blender/bmesh/intern/bmesh_private.h +++ b/source/blender/bmesh/intern/bmesh_private.h @@ -65,7 +65,7 @@ int bmesh_disk_count(BMVert *v); #define BM_ELEM_API_FLAG_DISABLE(element, f) ((element)->oflags[0].pflag &= ~(f)) #define BM_ELEM_API_FLAG_TEST(element, f) ((element)->oflags[0].pflag & (f)) -void compute_poly_plane(float (*verts)[3], int nverts); +void compute_poly_plane(float (*verts)[3], const int nverts); void poly_rotate_plane(const float normal[3], float (*verts)[3], const int nverts); /* include the rest of our private declarations */ diff --git a/source/blender/bmesh/intern/bmesh_structure.c b/source/blender/bmesh/intern/bmesh_structure.c index 27815551a87..aa5c8b81c2a 100644 --- a/source/blender/bmesh/intern/bmesh_structure.c +++ b/source/blender/bmesh/intern/bmesh_structure.c @@ -83,7 +83,7 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv) * (this is somewhat outdate, though bits of its API are still used) - joeedh * * Cycles are circular doubly linked lists that form the basis of adjacency - * information in the BME modeller. Full adjacency relations can be derived + * information in the BME modeler. Full adjacency relations can be derived * from examining these cycles very quickly. Although each cycle is a double * circular linked list, each one is considered to have a 'base' or 'head', * and care must be taken by Euler code when modifying the contents of a cycle. @@ -100,7 +100,7 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv) * Base: vertex->edge pointer. * * This cycle is the most complicated in terms of its structure. Each bmesh_Edge contains - * two bmesh_CycleNode structures to keep track of that edge's membership in the disk cycle + * two bmesh_CycleNode structures to keep track of that edges membership in the disk cycle * of each of its vertices. However for any given vertex it may be the first in some edges * in its disk cycle and the second for others. The bmesh_disk_XXX family of functions contain * some nice utilities for navigating disk cycles in a way that hides this detail from the diff --git a/source/blender/bmesh/operators/bmo_slide.c b/source/blender/bmesh/operators/bmo_slide.c index 0e6a1161334..9414c7308b6 100644 --- a/source/blender/bmesh/operators/bmo_slide.c +++ b/source/blender/bmesh/operators/bmo_slide.c @@ -48,7 +48,6 @@ void bmo_vert_slide_exec(BMesh *bm, BMOperator *op) BMVert *vertex; BMEdge *edge; BMEdge *slide_edge; - int is_start_v1 = 0; /* Selection counts */ int selected_edges = 0; |