Author: florian
Date: Wed Aug 5 12:26:10 2015
New Revision: 15490
Log:
The number of elements in a hash table cannot be negative.
Let the return type of VG_(HT_count_nodes) reflect that.
Modified:
trunk/coregrind/m_deduppoolalloc.c
trunk/coregrind/m_gdbserver/m_gdbserver.c
trunk/coregrind/m_hashtable.c
trunk/helgrind/hg_main.c
trunk/include/pub_tool_hashtable.h
Modified: trunk/coregrind/m_deduppoolalloc.c
==============================================================================
--- trunk/coregrind/m_deduppoolalloc.c (original)
+++ trunk/coregrind/m_deduppoolalloc.c Wed Aug 5 12:26:10 2015
@@ -201,7 +201,7 @@
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,
Modified: trunk/coregrind/m_gdbserver/m_gdbserver.c
==============================================================================
--- trunk/coregrind/m_gdbserver/m_gdbserver.c (original)
+++ trunk/coregrind/m_gdbserver/m_gdbserver.c Wed Aug 5 12:26:10 2015
@@ -542,7 +542,7 @@
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++)
Modified: trunk/coregrind/m_hashtable.c
==============================================================================
--- trunk/coregrind/m_hashtable.c (original)
+++ trunk/coregrind/m_hashtable.c Wed Aug 5 12:26:10 2015
@@ -82,7 +82,7 @@
return table;
}
-Int VG_(HT_count_nodes) ( const VgHashTable *table )
+UInt VG_(HT_count_nodes) ( const VgHashTable *table )
{
return table->n_elements;
}
Modified: trunk/helgrind/hg_main.c
==============================================================================
--- trunk/helgrind/hg_main.c (original)
+++ trunk/helgrind/hg_main.c Wed Aug 5 12:26:10 2015
@@ -5653,7 +5653,7 @@
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",
Modified: trunk/include/pub_tool_hashtable.h
==============================================================================
--- trunk/include/pub_tool_hashtable.h (original)
+++ trunk/include/pub_tool_hashtable.h Wed Aug 5 12:26:10 2015
@@ -58,7 +58,7 @@
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 );
|