[Python-checkins] cpython: Fixed compiler warnings in compact dict implementation on 32-bit platforms.

serhiy.storchaka python-checkins at python.org
Sat Sep 10 14:35:00 EDT 2016


https://hg.python.org/cpython/rev/b28b37de9470
changeset:   103575:b28b37de9470
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat Sep 10 21:34:43 2016 +0300
summary:
  Fixed compiler warnings in compact dict implementation on 32-bit platforms.

files:
  Objects/dictobject.c |  24 ++++++++++++------------
  1 files changed, 12 insertions(+), 12 deletions(-)


diff --git a/Objects/dictobject.c b/Objects/dictobject.c
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -326,16 +326,16 @@
         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 @@
         assert(ix <= 0x7fff);
         indices[i] = (int16_t)ix;
     }
-    else if (s <= 0xffffffff) {
+#if SIZEOF_VOID_P > 4
+    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;
     }
-#if SIZEOF_VOID_P > 4
-    else {
-        int64_t *indices = keys->dk_indices.as_8;
-        indices[i] = ix;
-    }
-#endif
 }
 
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list