diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-20 02:40:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-20 02:40:09 +0400 |
commit | 028dbb132d7a0f27adb9fab539fc9409043ea742 (patch) | |
tree | 9cfa24cd1e1e4c3173b358b2c46c183333c7c31c /source | |
parent | 741a177a74057b9baaae17640205017ca393ed89 (diff) |
add asserts for invalid iteratpr values so we can catch them in debug mode.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_iterators_inline.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_iterators_inline.h b/source/blender/bmesh/intern/bmesh_iterators_inline.h index 5b5da53f842..96816521493 100644 --- a/source/blender/bmesh/intern/bmesh_iterators_inline.h +++ b/source/blender/bmesh/intern/bmesh_iterators_inline.h @@ -59,14 +59,20 @@ BLI_INLINE int BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *dat /* inlining optimizes out this switch when called with the defined type */ switch ((BMIterType)itype) { case BM_VERTS_OF_MESH: + BLI_assert(bm != NULL); + BLI_assert(data == NULL); iter->begin = bmiter__vert_of_mesh_begin; iter->step = bmiter__vert_of_mesh_step; break; case BM_EDGES_OF_MESH: + BLI_assert(bm != NULL); + BLI_assert(data == NULL); iter->begin = bmiter__edge_of_mesh_begin; iter->step = bmiter__edge_of_mesh_step; break; case BM_FACES_OF_MESH: + BLI_assert(bm != NULL); + BLI_assert(data == NULL); iter->begin = bmiter__face_of_mesh_begin; iter->step = bmiter__face_of_mesh_step; break; @@ -161,6 +167,8 @@ BLI_INLINE int BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *dat iter->edata = data; break; default: + /* should never happen */ + BLI_assert(0); return FALSE; break; } |