diff options
author | Julian Eisel <julian@blender.org> | 2022-03-09 17:28:16 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-03-09 17:28:16 +0300 |
commit | 39c50d8f31bf63b4ccf22eae2d33b69e4cc0dc05 (patch) | |
tree | 835d6571013112ee3ff064106d636a1022e71b5e /source | |
parent | 8e3a58578a312c95f49b8d27ba4b35072772c4ef (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_intern.hh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/space_outliner/outliner_intern.hh b/source/blender/editors/space_outliner/outliner_intern.hh index b9ffea7c735..a9bdcc56787 100644 --- a/source/blender/editors/space_outliner/outliner_intern.hh +++ b/source/blender/editors/space_outliner/outliner_intern.hh @@ -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. |