Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/1225.bugfix.rst
1 change: 1 addition & 0 deletions CHANGES/1226.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed format string compilation errors in debug builds on 32-bit platforms by using portable ``%zd`` format specifiers for ``Py_ssize_t`` values instead of ``%ld`` -- by :user:`bdraco`.
8 changes: 4 additions & 4 deletions multidict/_multilib/hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -1963,15 +1963,15 @@ static inline int
_md_dump(MultiDictObject *md)
{
htkeys_t *keys = md->keys;
printf("Dump %p [%ld from %ld usable %ld nentries %ld]\n",
printf("Dump %p [%zd from %zd usable %zd nentries %zd]\n",
(void *)md,
md->used,
htkeys_nslots(keys),
keys->usable,
keys->nentries);
for (Py_ssize_t i = 0; i < htkeys_nslots(keys); i++) {
Py_ssize_t ix = htkeys_get_index(keys, i);
printf(" %ld -> %ld\n", i, ix);
printf(" %zd -> %zd\n", i, ix);
}
printf(" --------\n");
entry_t *entries = htkeys_entries(keys);
Expand All @@ -1980,9 +1980,9 @@ _md_dump(MultiDictObject *md)
PyObject *identity = entry->identity;

if (identity == NULL) {
printf(" %ld [deleted]\n", i);
printf(" %zd [deleted]\n", i);
} else {
printf(" %ld h=%20ld, i=\'", i, entry->hash);
printf(" %zd h=%20zd, i=\'", i, entry->hash);
PyObject_Print(entry->identity, stdout, Py_PRINT_RAW);
printf("\', k=\'");
PyObject_Print(entry->key, stdout, Py_PRINT_RAW);
Expand Down
Loading