diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-07-12 10:48:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-07-12 10:48:52 +0400 |
commit | c04f301fc3bf5a21413bb0962c199f8eb49fbdaf (patch) | |
tree | 6ee5d8dca3c6ecd3fb0ad8d2e23c55468bbf8888 /source/blender/blenlib/BLI_linklist_stack.h | |
parent | 5e3e095e2e474bbcba0060cb13f2869548091cd8 (diff) |
Replace BLI_SMALLSTACK_FREE with fake user (quiet warnings in msvc)
Diffstat (limited to 'source/blender/blenlib/BLI_linklist_stack.h')
-rw-r--r-- | source/blender/blenlib/BLI_linklist_stack.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_linklist_stack.h b/source/blender/blenlib/BLI_linklist_stack.h index 84e7130a962..17d40e068b3 100644 --- a/source/blender/blenlib/BLI_linklist_stack.h +++ b/source/blender/blenlib/BLI_linklist_stack.h @@ -116,6 +116,9 @@ # define _BLI_SMALLSTACK_CAST(var) #endif +#define _BLI_SMALLSTACK_FAKEUSER(var) \ + (void)(&(_##var##_type)) + #define BLI_SMALLSTACK_DECLARE(var, type) \ LinkNode *_##var##_stack = NULL, *_##var##_free = NULL, *_##var##_temp = NULL; \ type _##var##_type @@ -133,11 +136,14 @@ _##var##_temp->next = _##var##_stack; \ _##var##_temp->link = data; \ _##var##_stack = _##var##_temp; \ + _BLI_SMALLSTACK_FAKEUSER(var); \ } (void)0 /* internal use, no null check */ #define _BLI_SMALLSTACK_DEL_EX(var_src, var_dst) \ - (void)((_##var_src##_temp = _##var_src##_stack->next), \ + (void)(_BLI_SMALLSTACK_FAKEUSER(var_src), \ + _BLI_SMALLSTACK_FAKEUSER(var_dst), \ + (_##var_src##_temp = _##var_src##_stack->next), \ (_##var_src##_stack->next = _##var_dst##_free), \ (_##var_dst##_free = _##var_src##_stack), \ (_##var_src##_stack = _##var_src##_temp)) \ @@ -180,10 +186,6 @@ SWAP(LinkNode *, _##var_a##_free, _##var_b##_free); \ } (void)0 -#define BLI_SMALLSTACK_FREE(var) { \ - (void)&(_##var##_type); \ -} (void)0 - /** \} */ #endif /* __BLI_LINKLIST_STACK_H__ */ |