aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflorian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9>2014-10-18 20:56:13 +0000
committerflorian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9>2014-10-18 20:56:13 +0000
commit2fa8a5f811144bcf23a1445c30087dfced107ff4 (patch)
tree2e75f5e461e430fa45db2cba5f1b640ba988a2e1
parentee0d0e9cd0351721260f8b079495ed9d5ecf5faf (diff)
downloadvalgrind-2fa8a5f811144bcf23a1445c30087dfced107ff4.tar.gz
Constify.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14641 a5019735-40e9-0310-863c-91ae7b9d1cf9
-rw-r--r--coregrind/m_xarray.c10
-rw-r--r--include/pub_tool_xarray.h10
2 files changed, 10 insertions, 10 deletions
diff --git a/coregrind/m_xarray.c b/coregrind/m_xarray.c
index 74ee63102..18e3f6cb9 100644
--- a/coregrind/m_xarray.c
+++ b/coregrind/m_xarray.c
@@ -78,7 +78,7 @@ XArray* VG_(newXA) ( void*(*alloc_fn)(const HChar*,SizeT),
return xa;
}
-XArray* VG_(cloneXA)( const HChar* cc, XArray* xa )
+XArray* VG_(cloneXA)( const HChar* cc, const XArray* xa )
{
XArray* nyu;
const HChar* nyu_cc;
@@ -125,7 +125,7 @@ void VG_(setCmpFnXA) ( XArray* xa, XACmpFn_t compar )
xa->sorted = False;
}
-inline void* VG_(indexXA) ( XArray* xa, Word n )
+inline void* VG_(indexXA) ( const XArray* xa, Word n )
{
vg_assert(xa);
vg_assert(n >= 0);
@@ -211,7 +211,7 @@ void VG_(sortXA) ( XArray* xa )
xa->sorted = True;
}
-Bool VG_(lookupXA_UNSAFE) ( XArray* xa, const void* key,
+Bool VG_(lookupXA_UNSAFE) ( const XArray* xa, const void* key,
/*OUT*/Word* first, /*OUT*/Word* last,
Int(*cmpFn)(const void*, const void*) )
{
@@ -249,7 +249,7 @@ Bool VG_(lookupXA_UNSAFE) ( XArray* xa, const void* key,
}
}
-Bool VG_(lookupXA) ( XArray* xa, const void* key,
+Bool VG_(lookupXA) ( const XArray* xa, const void* key,
/*OUT*/Word* first, /*OUT*/Word* last )
{
vg_assert(xa);
@@ -258,7 +258,7 @@ Bool VG_(lookupXA) ( XArray* xa, const void* key,
return VG_(lookupXA_UNSAFE)(xa, key, first, last, xa->cmpFn);
}
-Word VG_(sizeXA) ( XArray* xa )
+Word VG_(sizeXA) ( const XArray* xa )
{
vg_assert(xa);
return xa->usedsizeE;
diff --git a/include/pub_tool_xarray.h b/include/pub_tool_xarray.h
index 73b9eab86..2f429e4c6 100644
--- a/include/pub_tool_xarray.h
+++ b/include/pub_tool_xarray.h
@@ -86,7 +86,7 @@ extern void VG_(sortXA) ( XArray* );
value found. If any values are found, return True, else return
False, and don't change *first or *last. first and/or last may be
NULL. Bomb if the array is not sorted. */
-extern Bool VG_(lookupXA) ( XArray*, const void* key,
+extern Bool VG_(lookupXA) ( const XArray*, const void* key,
/*OUT*/Word* first, /*OUT*/Word* last );
/* A version of VG_(lookupXA) in which you can specify your own
@@ -97,12 +97,12 @@ extern Bool VG_(lookupXA) ( XArray*, const void* key,
VG_(lookupXA), which refuses to do anything (asserts) unless the
array has first been sorted using the same comparison function as
is being used for the lookup. */
-extern Bool VG_(lookupXA_UNSAFE) ( XArray* xao, const void* key,
+extern Bool VG_(lookupXA_UNSAFE) ( const XArray* xao, const void* key,
/*OUT*/Word* first, /*OUT*/Word* last,
XACmpFn_t cmpFn );
/* How elements are there in this XArray now? */
-extern Word VG_(sizeXA) ( XArray* );
+extern Word VG_(sizeXA) ( const XArray* );
/* Index into the XArray. Checks bounds and bombs if the index is
invalid. What this returns is the address of the specified element
@@ -111,7 +111,7 @@ extern Word VG_(sizeXA) ( XArray* );
insertIndexXA, so you should copy it out immediately and not regard
its address as unchanging. Note also that indexXA will of course
not return NULL if it succeeds. */
-extern void* VG_(indexXA) ( XArray*, Word );
+extern void* VG_(indexXA) ( const XArray*, Word );
/* Drop the last n elements of an XArray. Bombs if there are less
than n elements in the array. This is an O(1) operation. */
@@ -140,7 +140,7 @@ extern void VG_(insertIndexXA)( XArray*, Word, const void* elem );
Space for the clone (and all additions to it) is billed to 'cc' unless
that is NULL, in which case the parent's cost-center is used.
Ths function never returns NULL. */
-extern XArray* VG_(cloneXA)( const HChar* cc, XArray* xa );
+extern XArray* VG_(cloneXA)( const HChar* cc, const XArray* xa );
/* Get the raw array and size so callers can index it really fast.
This is dangerous in the sense that there's no range or