diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-04 04:54:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-04 04:57:19 +0400 |
commit | a9b97dcf22be451ec5b8229d799a2f74f705be18 (patch) | |
tree | 76fda597d8b0be55e851984f49ec387fdc0f3298 /source/blender/blenlib/BLI_linklist_stack.h | |
parent | 4584caa13310d89c83f67db9530f05336ed89560 (diff) |
User interface: internal change, collect panels to draw before drawing.
avoids calling poll twice, in some cases
Diffstat (limited to 'source/blender/blenlib/BLI_linklist_stack.h')
-rw-r--r-- | source/blender/blenlib/BLI_linklist_stack.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_linklist_stack.h b/source/blender/blenlib/BLI_linklist_stack.h index c9fb00ecdf5..ef78fb9a305 100644 --- a/source/blender/blenlib/BLI_linklist_stack.h +++ b/source/blender/blenlib/BLI_linklist_stack.h @@ -147,6 +147,17 @@ (_BLI_SMALLSTACK_CAST(var) ((_##var##_stack) ? \ (_BLI_SMALLSTACK_DEL(var), (_##var##_free->link)) : NULL)) +/* loop over stack members last-added-first */ +#define BLI_SMALLSTACK_ITER_BEGIN(var, item) \ + { \ + LinkNode *_##var##_iter; \ + for (_##var##_iter = _##var##_stack; _##var##_iter; _##var##_iter = _##var##_iter->next) { \ + item = _BLI_SMALLSTACK_CAST(var) (_##var##_iter->link); \ + +#define BLI_SMALLSTACK_ITER_END \ + } \ + } (void)0 + #define BLI_SMALLSTACK_FREE(var) { \ (void)&(_##var##_type); \ } (void)0 |