|
From: <sv...@va...> - 2014-10-18 20:56:20
|
Author: florian
Date: Sat Oct 18 21:56:13 2014
New Revision: 14641
Log:
Constify.
Modified:
trunk/coregrind/m_xarray.c
trunk/include/pub_tool_xarray.h
Modified: trunk/coregrind/m_xarray.c
==============================================================================
--- trunk/coregrind/m_xarray.c (original)
+++ trunk/coregrind/m_xarray.c Sat Oct 18 21:56:13 2014
@@ -78,7 +78,7 @@
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 @@
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 @@
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) ( 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 @@
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;
Modified: trunk/include/pub_tool_xarray.h
==============================================================================
--- trunk/include/pub_tool_xarray.h (original)
+++ trunk/include/pub_tool_xarray.h Sat Oct 18 21:56:13 2014
@@ -86,7 +86,7 @@
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 @@
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 @@
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 @@
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
|