On Dec 30, 2007 1:28 PM, Tom Hughes <[EMAIL PROTECTED]> wrote:
> On 27/12/2007, Bart Van Assche <[EMAIL PROTECTED]> wrote:
>
> > I know that not everyone uses the const keyword wherever possible, but I
> > would appreciate if the Valgrind core would support programmers that
> follow
> > this style. Currently it is not possible to pass pointers to const keys
> to
> > the OSet-manipulating functions without having to cast away constness in
> > order to avoid compiler errors. Can the attached patch please be
> reviewed
> > and committed on the trunk ?
>
> Looks good to me - committed.
>
> Tom
>
Hello Tom,
It seems that I overlooked that osets are also used in regression tests. Can
you please apply the attached patch ?
Thanks,
Bart.
Index: memcheck/tests/oset_test.c
===================================================================
--- memcheck/tests/oset_test.c (revision 7313)
+++ memcheck/tests/oset_test.c (working copy)
@@ -347,10 +347,10 @@
return buf;
}
-static Word blockCmp(void* vkey, void* velem)
+static Word blockCmp(const void* vkey, const void* velem)
{
- Addr key = *(Addr*)vkey;
- Block* elem = (Block*)velem;
+ Addr key = *(const Addr*)vkey;
+ const Block* elem = (const Block*)velem;
assert(elem->first <= elem->last);
if (key < elem->first) return -1;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers