From 3e7e97f1277d83582f314587f28f513291e2caca Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 8 Dec 2014 10:54:56 +0100 Subject: 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. --- source/blender/bmesh/bmesh_class.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/bmesh/bmesh_class.h') 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), -- cgit v1.2.3