diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-10 18:34:43 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-10 18:34:43 (GMT) |
commit | 473e0e4dbae1e84d0c7a6732e839200532e168cc (patch) | |
tree | 75f0c4aab1d0f97819c6988a70d7e6b537dbf06b /Objects | |
parent | b0d497c0726c118d40dfadea807b32077f067100 (diff) | |
download | cpython-473e0e4dbae1e84d0c7a6732e839200532e168cc.zip cpython-473e0e4dbae1e84d0c7a6732e839200532e168cc.tar.gz cpython-473e0e4dbae1e84d0c7a6732e839200532e168cc.tar.bz2 |
Fixed compiler warnings in compact dict implementation on 32-bit platforms.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/dictobject.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 91a4e7d..4bcc3db 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -326,16 +326,16 @@ dk_get_index(PyDictKeysObject *keys, Py_ssize_t i) int16_t *indices = keys->dk_indices.as_2; ix = indices[i]; } - else if (s <= 0xffffffff) { - int32_t *indices = keys->dk_indices.as_4; - ix = indices[i]; - } #if SIZEOF_VOID_P > 4 - else { + else if (s > 0xffffffff) { int64_t *indices = keys->dk_indices.as_8; ix = indices[i]; } #endif + else { + int32_t *indices = keys->dk_indices.as_4; + ix = indices[i]; + } assert(ix >= DKIX_DUMMY); return ix; } @@ -358,17 +358,17 @@ dk_set_index(PyDictKeysObject *keys, Py_ssize_t i, Py_ssize_t ix) assert(ix <= 0x7fff); 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 - else { + else if (s > 0xffffffff) { int64_t *indices = keys->dk_indices.as_8; indices[i] = ix; } #endif + else { + int32_t *indices = keys->dk_indices.as_4; + assert(ix <= 0x7fffffff); + indices[i] = (int32_t)ix; + } } |