summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-01 08:57:10 +0200
committerVictor Stinner <victor.stinner@gmail.com>2014-07-01 08:57:10 +0200
commit2184c975667c8e5eff7eb35967fb69fd897178fb (patch)
treef964b3689fe4ea1608c6dfdd645b5ee57bddee4d /Modules
parent56bb5116b652c71c7de699510a335f9d93161119 (diff)
downloadcpython-2184c975667c8e5eff7eb35967fb69fd897178fb.tar.gz
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')
-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