mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Fixed compiler warnings in compact dict implementation on 32-bit platforms.
This commit is contained in:
parent
b0d497c072
commit
473e0e4dba
1 changed files with 11 additions and 11 deletions
|
@ -326,16 +326,16 @@ dk_get_index(PyDictKeysObject *keys, Py_ssize_t i)
|
||||||
int16_t *indices = keys->dk_indices.as_2;
|
int16_t *indices = keys->dk_indices.as_2;
|
||||||
ix = indices[i];
|
ix = indices[i];
|
||||||
}
|
}
|
||||||
else if (s <= 0xffffffff) {
|
|
||||||
int32_t *indices = keys->dk_indices.as_4;
|
|
||||||
ix = indices[i];
|
|
||||||
}
|
|
||||||
#if SIZEOF_VOID_P > 4
|
#if SIZEOF_VOID_P > 4
|
||||||
else {
|
else if (s > 0xffffffff) {
|
||||||
int64_t *indices = keys->dk_indices.as_8;
|
int64_t *indices = keys->dk_indices.as_8;
|
||||||
ix = indices[i];
|
ix = indices[i];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
else {
|
||||||
|
int32_t *indices = keys->dk_indices.as_4;
|
||||||
|
ix = indices[i];
|
||||||
|
}
|
||||||
assert(ix >= DKIX_DUMMY);
|
assert(ix >= DKIX_DUMMY);
|
||||||
return ix;
|
return ix;
|
||||||
}
|
}
|
||||||
|
@ -358,17 +358,17 @@ dk_set_index(PyDictKeysObject *keys, Py_ssize_t i, Py_ssize_t ix)
|
||||||
assert(ix <= 0x7fff);
|
assert(ix <= 0x7fff);
|
||||||
indices[i] = (int16_t)ix;
|
indices[i] = (int16_t)ix;
|
||||||
}
|
}
|
||||||
else if (s <= 0xffffffff) {
|
|
||||||
int32_t *indices = keys->dk_indices.as_4;
|
|
||||||
assert(ix <= 0x7fffffff);
|
|
||||||
indices[i] = (int32_t)ix;
|
|
||||||
}
|
|
||||||
#if SIZEOF_VOID_P > 4
|
#if SIZEOF_VOID_P > 4
|
||||||
else {
|
else if (s > 0xffffffff) {
|
||||||
int64_t *indices = keys->dk_indices.as_8;
|
int64_t *indices = keys->dk_indices.as_8;
|
||||||
indices[i] = ix;
|
indices[i] = ix;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
else {
|
||||||
|
int32_t *indices = keys->dk_indices.as_4;
|
||||||
|
assert(ix <= 0x7fffffff);
|
||||||
|
indices[i] = (int32_t)ix;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue