]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
The number of elements in a hash table cannot be negative.
authorFlorian Krohm <florian@eich-krohm.de>
Wed, 5 Aug 2015 11:26:10 +0000 (11:26 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Wed, 5 Aug 2015 11:26:10 +0000 (11:26 +0000)
Let the return type of VG_(HT_count_nodes) reflect that.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15490

coregrind/m_deduppoolalloc.c
coregrind/m_gdbserver/m_gdbserver.c
coregrind/m_hashtable.c
helgrind/hg_main.c
include/pub_tool_hashtable.h

index 51a58cb063d676262ed20b583e44549f228ce8a1..d562cc728bbebb9a30aa8868f28039cf0d7f0310 100644 (file)
@@ -201,7 +201,7 @@ static Word cmp_pool_elt (const void* node1, const void* node2 )
 static void print_stats (DedupPoolAlloc *ddpa)
 {
    VG_(message)(Vg_DebugMsg,
-                "dedupPA:%s %ld allocs (%d uniq)"
+                "dedupPA:%s %ld allocs (%u uniq)"
                 " %ld pools (%ld bytes free in last pool)\n",
                 ddpa->cc,
                 (long int) ddpa->nr_alloc_calls,
index fba0a2b18a0d052728396e952cde2925e0228b49..87b5b45156d5c10542857bdcdeb2f25cc9d487a5 100644 (file)
@@ -542,7 +542,7 @@ static void clear_gdbserved_addresses(Bool clear_only_jumps)
    int i;
 
    dlog(1,
-        "clear_gdbserved_addresses: scanning hash table nodes %d\n", 
+        "clear_gdbserved_addresses: scanning hash table nodes %u\n", 
         VG_(HT_count_nodes) (gs_addresses));
    ag = (GS_Address**) VG_(HT_to_array) (gs_addresses, &n_elems);
    for (i = 0; i < n_elems; i++)
index bebcaab6163588b050d002a2544c8f223c94bda8..32219c95608988ee2af22f85957d3e980e2c5972 100644 (file)
@@ -82,7 +82,7 @@ VgHashTable *VG_(HT_construct) ( const HChar* name )
    return table;
 }
 
-Int VG_(HT_count_nodes) ( const VgHashTable *table )
+UInt VG_(HT_count_nodes) ( const VgHashTable *table )
 {
    return table->n_elements;
 }
index 76650c05e99356c73d6fc1a7d36e48cf289b4cd4..10a0e4b5d9ba264589d92364a1947228505aa5d1 100644 (file)
@@ -5653,7 +5653,7 @@ static void hg_print_stats (void)
                HG_(stats__LockN_to_P_queries),
                HG_(stats__LockN_to_P_get_map_size)() );
 
-   VG_(printf)("client malloc-ed blocks: %'8d\n",
+   VG_(printf)("client malloc-ed blocks: %'8u\n",
                VG_(HT_count_nodes)(hg_mallocmeta_table));
                
    VG_(printf)("string table map: %'8llu queries (%llu map size)\n",
index 6fc6822b4687bfb6dc329d2886eba7f04beaa31d..17060ecfd7834e5c21135dbfab4fb7fa7dfec661 100644 (file)
@@ -58,7 +58,7 @@ typedef struct _VgHashTable VgHashTable;
 extern VgHashTable *VG_(HT_construct) ( const HChar* name );
 
 /* Count the number of nodes in a table. */
-extern Int VG_(HT_count_nodes) ( const VgHashTable *table );
+extern UInt VG_(HT_count_nodes) ( const VgHashTable *table );
 
 /* Add a node to the table.  Duplicate keys are permitted. */
 extern void VG_(HT_add_node) ( VgHashTable *t, void* node );