diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-12-08 12:54:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-12-08 12:54:56 +0300 |
commit | 3e7e97f1277d83582f314587f28f513291e2caca (patch) | |
tree | 8408974fd135fad7344decfd496badb80e04faa8 /source/blender/bmesh/bmesh_class.h | |
parent | 690345a826544aec7a30b1d39966d867d093a8d1 (diff) |
BMesh: ensure iterator macros assign to valid types
note, this is for C++ code which expects a cast, (will be added later)
also add a macro for nop-expressions (EXPR_NOP),
when we never want an expression to be evaluated, but it should still be valid.
Diffstat (limited to 'source/blender/bmesh/bmesh_class.h')
-rw-r--r-- | source/blender/bmesh/bmesh_class.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index 39359b97a4e..120ff4997dc 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -256,6 +256,12 @@ enum { #define BM_ALL (BM_VERT | BM_EDGE | BM_LOOP | BM_FACE) #define BM_ALL_NOLOOP (BM_VERT | BM_EDGE | BM_FACE) +#define BM_CHECK_TYPE_ELEM(ele) \ + CHECK_TYPE_ANY(ele, void *, BMFace *, BMEdge *, BMVert *, BMLoop *, BMElem *, BMElemF *, BMHeader *) + +#define BM_CHECK_TYPE_ELEM_ASSIGN(ele) \ + (BM_CHECK_TYPE_ELEM(ele), CHECK_TYPE_NONCONST(ele)), ele + /* BMHeader->hflag (char) */ enum { BM_ELEM_SELECT = (1 << 0), |