]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fixed compiler warnings.
authorBart Van Assche <bvanassche@acm.org>
Sun, 4 May 2008 08:10:24 +0000 (08:10 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 4 May 2008 08:10:24 +0000 (08:10 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8004

memcheck/tests/oset_test.c

index 4bf6686b1a6b0c9f975024910db2d9d576545d1b..3954f7304c193501041458d30ef5ebc4781a9f14 100644 (file)
@@ -45,6 +45,11 @@ static UInt myrandom( void )
   return seed;
 }
 
+static void* allocate_node(SizeT szB)
+{ return malloc(szB); }
+
+static void free_node(void* p)
+{ return free(p); }
 
 
 //---------------------------------------------------------------------------
@@ -78,8 +83,8 @@ void example1(void)
    // Create a static OSet of Ints.  This one uses fast (built-in)
    // comparisons.
    OSet* oset = VG_(OSetGen_Create)(0,
-                                  NULL,
-                                  malloc, free);
+                                    NULL,
+                                    allocate_node, free_node);
 
    // Try some operations on an empty OSet to ensure they don't screw up.
    vg_assert( ! VG_(OSetGen_Contains)(oset, &v) );
@@ -212,7 +217,7 @@ void example1b(void)
 
    // Create a static OSet of Ints.  This one uses fast (built-in)
    // comparisons.
-   OSet* oset = VG_(OSetWord_Create)(malloc, free);
+   OSet* oset = VG_(OSetWord_Create)(allocate_node, free_node);
 
    // Try some operations on an empty OSet to ensure they don't screw up.
    vg_assert( ! VG_(OSetWord_Contains)(oset, v) );
@@ -370,7 +375,7 @@ void example2(void)
    // comparisons.
    OSet* oset = VG_(OSetGen_Create)(offsetof(Block, first),
                                     blockCmp,
-                                    malloc, free);
+                                    allocate_node, free_node);
 
    // Try some operations on an empty OSet to ensure they don't screw up.
    vg_assert( ! VG_(OSetGen_Contains)(oset, &v) );