aboutsummaryrefslogtreecommitdiffhomepage
path: root/rbtree.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-19 22:12:16 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-20 06:07:33 +0100
commit90f203bff189706c2dec34482475b89d0a232597 (patch)
treea13c16ca7f73b779f941e0543bcff81d97e84b4d /rbtree.h
parentb804417f36ef398f1223e439fd5ac9f2ade046eb (diff)
downloadsciteco-90f203bff189706c2dec34482475b89d0a232597.tar.gz
make goto tables local to macro invocation: they are declared on the C++ callstack since macro invocations result in nested macro_execute() calls
otherwise a macro could set labels with program counters which are invalid in other macros/the command line
Diffstat (limited to 'rbtree.h')
-rw-r--r--rbtree.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/rbtree.h b/rbtree.h
index f1e920a..d5f2a6e 100644
--- a/rbtree.h
+++ b/rbtree.h
@@ -49,16 +49,10 @@ public:
{
RB_INIT(&head);
}
-
virtual
~RBTree()
{
- RBEntry *cur;
-
- while ((cur = min())) {
- remove(cur);
- delete cur;
- }
+ clear();
}
inline RBEntry *
@@ -92,6 +86,17 @@ public:
{
return RB_MAX(Tree, &head);
}
+
+ inline void
+ clear(void)
+ {
+ RBEntry *cur;
+
+ while ((cur = min())) {
+ remove(cur);
+ delete cur;
+ }
+ }
};
template <typename KeyType, typename ValueType>