[Bf-blender-cvs] [39c50d8f31b] master: Outliner: Ensure compiler error when passing wrong tree-element to macro
Julian Eisel
noreply at git.blender.org
Wed Mar 9 15:30:24 CET 2022
Commit: 39c50d8f31bf63b4ccf22eae2d33b69e4cc0dc05
Author: Julian Eisel
Date: Wed Mar 9 15:28:16 2022 +0100
Branches: master
https://developer.blender.org/rB39c50d8f31bf63b4ccf22eae2d33b69e4cc0dc05
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.
===================================================================
M source/blender/editors/space_outliner/outliner_intern.hh
===================================================================
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.
More information about the Bf-blender-cvs
mailing list