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.
This commit is contained in:
Victor Stinner 2014-07-01 08:57:10 +02:00
parent 529ea5d184
commit 293f3f526d
2 changed files with 26 additions and 13 deletions

View file

@ -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