summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-05-29 00:40:12 (GMT)
committerGitHub <noreply@github.com>2021-05-29 00:40:12 (GMT)
commit21dd43c01d6b9cd50512c9ab6d83c97cde3bf115 (patch)
tree0dc6290bda52eda3f37dd4468ee1ade15c67ad2f /Objects/dictobject.c
parent8b4312b909abff3100c1f18fb3efa5c25617fee3 (diff)
downloadcpython-21dd43c01d6b9cd50512c9ab6d83c97cde3bf115.zip
cpython-21dd43c01d6b9cd50512c9ab6d83c97cde3bf115.tar.gz
cpython-21dd43c01d6b9cd50512c9ab6d83c97cde3bf115.tar.bz2
Fix MSVC compiler warnings in dictobject.c (GH-26432)
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 65718c2..d97f9e21 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -416,7 +416,7 @@ calculate_log2_keysize(Py_ssize_t minsize)
minsize = (minsize | PyDict_MINSIZE) - 1;
unsigned long msb;
_BitScanReverse64(&msb, (uint64_t)minsize);
- return msb + 1;
+ return (uint8_t)(msb + 1);
#else
uint8_t log2_size;
for (log2_size = PyDict_LOG_MINSIZE;
@@ -600,7 +600,7 @@ new_keys_object(uint8_t log2_size)
dk->dk_kind = DICT_KEYS_UNICODE;
dk->dk_nentries = 0;
dk->dk_version = 0;
- memset(&dk->dk_indices[0], 0xff, es * (1<<log2_size));
+ memset(&dk->dk_indices[0], 0xff, es<<log2_size);
memset(DK_ENTRIES(dk), 0, sizeof(PyDictKeyEntry) * usable);
return dk;
}