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;
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);
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*) )
{
}
}
-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);
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;
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
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
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. */
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