summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-10-23 16:20:50 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-10-23 16:20:50 (GMT)
commit8035bc5c048ff08f652649754eb8ea769337afa0 (patch)
tree82778e9f0242d5a26e4ceba5d5b85babde6c12cf /Objects/object.c
parent2b9af63b4f4757cccad70b76960cfe8c7b9e6a49 (diff)
downloadcpython-8035bc5c048ff08f652649754eb8ea769337afa0.zip
cpython-8035bc5c048ff08f652649754eb8ea769337afa0.tar.gz
cpython-8035bc5c048ff08f652649754eb8ea769337afa0.tar.bz2
follow up to #9778: define and use an unsigned hash type
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 2f544ba..723e40e 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -692,7 +692,7 @@ _Py_HashDouble(double v)
{
int e, sign;
double m;
- unsigned long x, y;
+ Py_uhash_t x, y;
if (!Py_IS_FINITE(v)) {
if (Py_IS_INFINITY(v))
@@ -716,7 +716,7 @@ _Py_HashDouble(double v)
x = ((x << 28) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - 28);
m *= 268435456.0; /* 2**28 */
e -= 28;
- y = (unsigned long)m; /* pull out integer part */
+ y = (Py_uhash_t)m; /* pull out integer part */
m -= y;
x += y;
if (x >= _PyHASH_MODULUS)
@@ -728,8 +728,8 @@ _Py_HashDouble(double v)
x = ((x << e) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - e);
x = x * sign;
- if (x == (unsigned long)-1)
- x = (unsigned long)-2;
+ if (x == (Py_uhash_t)-1)
+ x = (Py_uhash_t)-2;
return (Py_hash_t)x;
}