summaryrefslogtreecommitdiff
path: root/Modules/hashtable.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-01 08:57:54 +0200
committerVictor Stinner <victor.stinner@gmail.com>2014-07-01 08:57:54 +0200
commit9f43505f3d2efe21e1a89552aade9c0d0e05b593 (patch)
tree0be2226c392c6577b054a8f9a95b6730b0df90f9 /Modules/hashtable.c
parent744a1193aa3e767cfb19c3fdb1d4f0c822ed21cd (diff)
parent293f3f526d9c0a9b8e9e5a478bc57975f9cfe3c5 (diff)
downloadcpython-git-9f43505f3d2efe21e1a89552aade9c0d0e05b593.tar.gz
(Merge 3.4) 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 aaded46a9e..133f3133ef 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