Outliner: Ensure compiler error when passing wrong tree-element to macro
Passing a `TreeElement *` instead of its `TreeStoreElement *` to `TSELEM_OPEN()` would seem to work but cause a bug. Add a type check that will cause a compiler error if it fails.
This commit is contained in:
parent
8e3a58578a
commit
39c50d8f31
|
@ -219,8 +219,9 @@ typedef enum {
|
|||
|
||||
/* is the current element open? if so we also show children */
|
||||
#define TSELEM_OPEN(telm, sv) \
|
||||
(((telm)->flag & TSE_CLOSED) == 0 || \
|
||||
(SEARCHING_OUTLINER(sv) && ((telm)->flag & TSE_CHILDSEARCH)))
|
||||
(CHECK_TYPE_INLINE(telm, TreeStoreElem *), \
|
||||
(((telm)->flag & TSE_CLOSED) == 0 || \
|
||||
(SEARCHING_OUTLINER(sv) && ((telm)->flag & TSE_CHILDSEARCH))))
|
||||
|
||||
/**
|
||||
* Container to avoid passing around these variables to many functions.
|
||||
|
|
Loading…
Reference in New Issue