diff options
author | tom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2007-12-30 12:28:26 +0000 |
---|---|---|
committer | tom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2007-12-30 12:28:26 +0000 |
commit | 5a835d5980202c293b27f55f257e8e4ef3d170a0 (patch) | |
tree | 1c68fb78be956ff1eb0f8fb1e4ee889aa78e1245 /coregrind/m_oset.c | |
parent | dc2f79e06e588d7f1a5838977f7814215e22fbf1 (diff) |
Add const qualifiers to appropriate arguments of OSet routines.
Patch from Bart Van Assche <bart.vanassche@gmail.com>.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7308 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'coregrind/m_oset.c')
-rw-r--r-- | coregrind/m_oset.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/coregrind/m_oset.c b/coregrind/m_oset.c index ad3b66dd..5b6843dc 100644 --- a/coregrind/m_oset.c +++ b/coregrind/m_oset.c @@ -189,7 +189,7 @@ static inline Word fast_cmp(void* k, AvlNode* n) } // Compare a key and an element. Inlining is *crucial*. -static inline Word slow_cmp(AvlTree* t, void* k, AvlNode* n) +static inline Word slow_cmp(const AvlTree* t, const void* k, const AvlNode* n) { return t->cmp(k, elem_of_node(n)); } @@ -490,7 +490,7 @@ void VG_(OSetWord_Insert)(AvlTree* t, Word val) /*--------------------------------------------------------------------*/ // Find the *node* in t matching k, or NULL if not found. -static AvlNode* avl_lookup(AvlTree* t, void* k) +static AvlNode* avl_lookup(const AvlTree* t, const void* k) { Word cmpres; AvlNode* curr = t->root; @@ -522,7 +522,7 @@ static AvlNode* avl_lookup(AvlTree* t, void* k) } // Find the *element* in t matching k, or NULL if not found. -void* VG_(OSetGen_Lookup)(AvlTree* t, void* k) +void* VG_(OSetGen_Lookup)(const AvlTree* t, const void* k) { AvlNode* n; vg_assert(t); @@ -532,7 +532,7 @@ void* VG_(OSetGen_Lookup)(AvlTree* t, void* k) // Find the *element* in t matching k, or NULL if not found; use the given // comparison function rather than the standard one. -void* VG_(OSetGen_LookupWithCmp)(AvlTree* t, void* k, OSetCmp_t cmp) +void* VG_(OSetGen_LookupWithCmp)(AvlTree* t, const void* k, OSetCmp_t cmp) { // Save the normal one to the side, then restore once we're done. void* e; @@ -546,7 +546,7 @@ void* VG_(OSetGen_LookupWithCmp)(AvlTree* t, void* k, OSetCmp_t cmp) } // Is there an element matching k? -Bool VG_(OSetGen_Contains)(AvlTree* t, void* k) +Bool VG_(OSetGen_Contains)(const AvlTree* t, const void* k) { return (NULL != VG_(OSetGen_Lookup)(t, k)); } @@ -775,7 +775,7 @@ Bool VG_(OSetWord_Next)(AvlTree* t, Word* val) /*--- Miscellaneous operations ---*/ /*--------------------------------------------------------------------*/ -Int VG_(OSetGen_Size)(AvlTree* t) +Int VG_(OSetGen_Size)(const AvlTree* t) { vg_assert(t); return t->nElems; |