]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Constify.
authorFlorian Krohm <florian@eich-krohm.de>
Sat, 18 Oct 2014 20:56:13 +0000 (20:56 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sat, 18 Oct 2014 20:56:13 +0000 (20:56 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14641

coregrind/m_xarray.c
include/pub_tool_xarray.h

index 74ee63102cc16193b2115d8c589236907808b205..18e3f6cb99198495307146b21091f4fc71ac3bc8 100644 (file)
@@ -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;
index 73b9eab8692210ad552ee105004fad8c061638de..2f429e4c618cc1644fe281467fdcb23071d711af 100644 (file)
@@ -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