Skip to content

Commit 2a13a2d

Browse files
committed
Fix compiler warning.
1 parent 51c1ec8 commit 2a13a2d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Objects/dictobject.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ static PyDictValues empty_values_struct = { 0, { NULL }};
461461
#endif
462462

463463
static inline int
464-
get_index_from_order(PyDictObject *mp, int i)
464+
get_index_from_order(PyDictObject *mp, Py_ssize_t i)
465465
{
466466
assert(mp->ma_used <= 16);
467467
int shift = (int)(mp->ma_used-1-i)*4;
@@ -497,14 +497,13 @@ _PyDict_CheckConsistency(PyObject *op, int check_content)
497497

498498
if (check_content) {
499499
PyDictKeyEntry *entries = DK_ENTRIES(keys);
500-
Py_ssize_t i;
501500

502-
for (i=0; i < DK_SIZE(keys); i++) {
501+
for (Py_ssize_t i=0; i < DK_SIZE(keys); i++) {
503502
Py_ssize_t ix = dictkeys_get_index(keys, i);
504503
CHECK(DKIX_DUMMY <= ix && ix <= usable);
505504
}
506505

507-
for (i=0; i < usable; i++) {
506+
for (Py_ssize_t i=0; i < usable; i++) {
508507
PyDictKeyEntry *entry = &entries[i];
509508
PyObject *key = entry->me_key;
510509

@@ -532,7 +531,7 @@ _PyDict_CheckConsistency(PyObject *op, int check_content)
532531
CHECK(mp->ma_used <= SHARED_KEYS_MAX_SIZE);
533532
/* splitted table */
534533
int duplicate_check = 0;
535-
for (i=0; i < mp->ma_used; i++) {
534+
for (Py_ssize_t i=0; i < mp->ma_used; i++) {
536535
int index = get_index_from_order(mp, i);
537536
CHECK((duplicate_check & (1<<index)) == 0);
538537
duplicate_check |= (1<<index);

0 commit comments

Comments
 (0)