summaryrefslogtreecommitdiffstats
path: root/Modules/hashtable.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-01 06:57:10 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-01 06:57:10 (GMT)
commit293f3f526d9c0a9b8e9e5a478bc57975f9cfe3c5 (patch)
tree7d047c1622e5fa442ad7ce0a885bd408742ec63f /Modules/hashtable.c
parent529ea5d184c4b7a8ee118557c8a8f46016476e69 (diff)
downloadcpython-293f3f526d9c0a9b8e9e5a478bc57975f9cfe3c5.zip
cpython-293f3f526d9c0a9b8e9e5a478bc57975f9cfe3c5.tar.gz
cpython-293f3f526d9c0a9b8e9e5a478bc57975f9cfe3c5.tar.bz2
Closes #21892, #21893: Use PY_FORMAT_SIZE_T instead of %zi or %zu to format C
size_t, because %zi/%u is not supported on all platforms.
Diffstat (limited to 'Modules/hashtable.c')
-rw-r--r--Modules/hashtable.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/hashtable.c b/Modules/hashtable.c
index aaded46..133f313 100644
--- a/Modules/hashtable.c
+++ b/Modules/hashtable.c
@@ -233,11 +233,12 @@ _Py_hashtable_print_stats(_Py_hashtable_t *ht)
nchains++;
}
}
- printf("hash table %p: entries=%zu/%zu (%.0f%%), ",
+ printf("hash table %p: entries=%"
+ PY_FORMAT_SIZE_T "u/%" PY_FORMAT_SIZE_T "u (%.0f%%), ",
ht, ht->entries, ht->num_buckets, load * 100.0);
if (nchains)
printf("avg_chain_len=%.1f, ", (double)total_chain_len / nchains);
- printf("max_chain_len=%zu, %zu kB\n",
+ printf("max_chain_len=%" PY_FORMAT_SIZE_T "u, %" PY_FORMAT_SIZE_T "u kB\n",
max_chain_len, size / 1024);
}
#endif