From 7f32cf46054ceb924afcfef4ebf7c26822aa524d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 1 Aug 2014 21:59:42 +1000 Subject: Prevent macros hiding casts from `const` pointers --- source/blender/bmesh/bmesh_class.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (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 01745396cd1..39359b97a4e 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -285,8 +285,8 @@ extern void bpy_bm_generic_invalidate(struct BPy_BMGeneric *self); typedef bool (*BMElemFilterFunc)(BMElem *, void *user_data); /* defines */ -#define BM_ELEM_CD_SET_INT(ele, offset, f) \ - { assert(offset != -1); *((int *)((char *)(ele)->head.data + (offset))) = (f); } (void)0 +#define BM_ELEM_CD_SET_INT(ele, offset, f) { CHECK_TYPE_NONCONST(ele); \ + assert(offset != -1); *((int *)((char *)(ele)->head.data + (offset))) = (f); } (void)0 #define BM_ELEM_CD_GET_INT(ele, offset) \ (assert(offset != -1), *((int *)((char *)(ele)->head.data + (offset)))) @@ -294,8 +294,8 @@ typedef bool (*BMElemFilterFunc)(BMElem *, void *user_data); #define BM_ELEM_CD_GET_VOID_P(ele, offset) \ (assert(offset != -1), (void *)((char *)(ele)->head.data + (offset))) -#define BM_ELEM_CD_SET_FLOAT(ele, offset, f) \ - { assert(offset != -1); *((float *)((char *)(ele)->head.data + (offset))) = (f); } (void)0 +#define BM_ELEM_CD_SET_FLOAT(ele, offset, f) { CHECK_TYPE_NONCONST(ele); \ + assert(offset != -1); *((float *)((char *)(ele)->head.data + (offset))) = (f); } (void)0 #define BM_ELEM_CD_GET_FLOAT(ele, offset) \ (assert(offset != -1), *((float *)((char *)(ele)->head.data + (offset)))) -- cgit v1.2.3