diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-01 20:26:15 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-01 20:26:15 +0000 |
commit | 850b4c6957b9273f61aeaa7bcdbb24a83ef2d382 (patch) | |
tree | 851494d9242cd575beb25868a673e325e041a477 /include | |
parent | 98e91af9e1ec97e1bc3eaee08b3068ca76672d93 (diff) | |
download | klee-850b4c6957b9273f61aeaa7bcdbb24a83ef2d382.tar.gz |
Use size_t where appropriate for ImmutableTree and friends.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@77799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/klee/Internal/ADT/ImmutableMap.h | 6 | ||||
-rw-r--r-- | include/klee/Internal/ADT/ImmutableSet.h | 6 | ||||
-rw-r--r-- | include/klee/Internal/ADT/ImmutableTree.h | 21 |
3 files changed, 17 insertions, 16 deletions
diff --git a/include/klee/Internal/ADT/ImmutableMap.h b/include/klee/Internal/ADT/ImmutableMap.h index c7af3786..3c408246 100644 --- a/include/klee/Internal/ADT/ImmutableMap.h +++ b/include/klee/Internal/ADT/ImmutableMap.h @@ -45,7 +45,7 @@ namespace klee { bool empty() const { return elts.empty(); } - unsigned count(const key_type &key) const { + size_t count(const key_type &key) const { return elts.count(key); } const value_type *lookup(const key_type &key) const { @@ -60,7 +60,7 @@ namespace klee { const value_type &max() const { return elts.max(); } - unsigned size() const { + size_t size() const { return elts.size(); } @@ -96,7 +96,7 @@ namespace klee { return elts.upper_bound(key); } - static unsigned getAllocated() { return Tree::allocated; } + static size_t getAllocated() { return Tree::allocated; } }; } diff --git a/include/klee/Internal/ADT/ImmutableSet.h b/include/klee/Internal/ADT/ImmutableSet.h index 0c79eb9c..e60a1d2a 100644 --- a/include/klee/Internal/ADT/ImmutableSet.h +++ b/include/klee/Internal/ADT/ImmutableSet.h @@ -45,7 +45,7 @@ namespace klee { bool empty() const { return elts.empty(); } - unsigned count(const key_type &key) const { + size_t count(const key_type &key) const { return elts.count(key); } const value_type *lookup(const key_type &key) const { @@ -57,7 +57,7 @@ namespace klee { const value_type &max() const { return elts.max(); } - unsigned size() { + size_t size() { return elts.size(); } @@ -93,7 +93,7 @@ namespace klee { return elts.upper_bound(key); } - static unsigned getAllocated() { return Tree::allocated; } + static size_t getAllocated() { return Tree::allocated; } }; } diff --git a/include/klee/Internal/ADT/ImmutableTree.h b/include/klee/Internal/ADT/ImmutableTree.h index 2f294077..4e6d530f 100644 --- a/include/klee/Internal/ADT/ImmutableTree.h +++ b/include/klee/Internal/ADT/ImmutableTree.h @@ -17,7 +17,7 @@ namespace klee { template<class K, class V, class KOV, class CMP> class ImmutableTree { public: - static unsigned allocated; + static size_t allocated; class iterator; typedef K key_type; @@ -34,7 +34,7 @@ namespace klee { bool empty() const; - unsigned count(const key_type &key) const; // always 0 or 1 + size_t count(const key_type &key) const; // always 0 or 1 const value_type *lookup(const key_type &key) const; // find the last value less than or equal to key, or null if @@ -43,7 +43,7 @@ namespace klee { const value_type &min() const; const value_type &max() const; - unsigned size() const; + size_t size() const; ImmutableTree insert(const value_type &value) const; ImmutableTree replace(const value_type &value) const; @@ -57,7 +57,7 @@ namespace klee { iterator lower_bound(const key_type &key) const; iterator upper_bound(const key_type &key) const; - static unsigned getAllocated() { return allocated; } + static size_t getAllocated() { return allocated; } private: class Node; @@ -90,7 +90,7 @@ namespace klee { bool isTerminator(); - unsigned size(); + size_t size(); Node *popMin(value_type &valueOut); Node *popMax(value_type &valueOut); Node *insert(const value_type &v); @@ -98,7 +98,8 @@ namespace klee { Node *remove(const key_type &k); }; - // Should live somewhere else, this is a simple stack with maximum size. + // Should live somewhere else, this is a simple stack with maximum (dynamic) + // size. template<typename T> class FixedStack { unsigned pos, max; @@ -240,7 +241,7 @@ namespace klee { ImmutableTree<K,V,KOV,CMP>::Node::terminator; template<class K, class V, class KOV, class CMP> - unsigned ImmutableTree<K,V,KOV,CMP>::allocated = 0; + size_t ImmutableTree<K,V,KOV,CMP>::allocated = 0; template<class K, class V, class KOV, class CMP> ImmutableTree<K,V,KOV,CMP>::Node::Node() @@ -331,7 +332,7 @@ namespace klee { } template<class K, class V, class KOV, class CMP> - unsigned ImmutableTree<K,V,KOV,CMP>::Node::size() { + size_t ImmutableTree<K,V,KOV,CMP>::Node::size() { if (isTerminator()) { return 0; } else { @@ -453,7 +454,7 @@ namespace klee { } template<class K, class V, class KOV, class CMP> - unsigned ImmutableTree<K,V,KOV,CMP>::count(const key_type &k) const { + size_t ImmutableTree<K,V,KOV,CMP>::count(const key_type &k) const { Node *n = node; while (!n->isTerminator()) { key_type key = key_of_value()(n->value); @@ -523,7 +524,7 @@ namespace klee { } template<class K, class V, class KOV, class CMP> - unsigned ImmutableTree<K,V,KOV,CMP>::size() const { + size_t ImmutableTree<K,V,KOV,CMP>::size() const { return node->size(); } |