Index: Objects/complexobject.c =================================================================== --- Objects/complexobject.c (revision 85677) +++ Objects/complexobject.c (working copy) @@ -397,12 +397,12 @@ static Py_hash_t complex_hash(PyComplexObject *v) { - unsigned long hashreal, hashimag, combined; - hashreal = (unsigned long)_Py_HashDouble(v->cval.real); - if (hashreal == (unsigned long)-1) + size_t hashreal, hashimag, combined; + hashreal = (ssize_t)_Py_HashDouble(v->cval.real); + if (hashreal == -1) return -1; - hashimag = (unsigned long)_Py_HashDouble(v->cval.imag); - if (hashimag == (unsigned long)-1) + hashimag = (ssize_t)_Py_HashDouble(v->cval.imag); + if (hashimag == -1) return -1; /* Note: if the imaginary part is 0, hashimag is 0 now, * so the following returns hashreal unchanged. This is @@ -411,8 +411,8 @@ * hash(x + 0*j) must equal hash(x). */ combined = hashreal + _PyHASH_IMAG * hashimag; - if (combined == (unsigned long)-1) - combined = (unsigned long)-2; + if (combined == -1) + combined = -2; return (Py_hash_t)combined; } Index: Objects/object.c =================================================================== --- Objects/object.c (revision 85677) +++ Objects/object.c (working copy) @@ -692,7 +692,7 @@ { int e, sign; double m; - unsigned long x, y; + size_t x, y; if (!Py_IS_FINITE(v)) { if (Py_IS_INFINITY(v)) @@ -716,7 +716,7 @@ 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 = (size_t)m; /* pull out integer part */ m -= y; x += y; if (x >= _PyHASH_MODULUS) @@ -728,8 +728,8 @@ x = ((x << e) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - e); x = x * sign; - if (x == (unsigned long)-1) - x = (unsigned long)-2; + if (x == -1) + x = -2; return (Py_hash_t)x; } Index: Objects/tupleobject.c =================================================================== --- Objects/tupleobject.c (revision 85677) +++ Objects/tupleobject.c (working copy) @@ -318,7 +318,7 @@ register Py_hash_t x, y; register Py_ssize_t len = Py_SIZE(v); register PyObject **p; - long mult = 1000003L; + Py_hash_t mult = 1000003L; x = 0x345678L; p = v->ob_item; while (--len >= 0) { @@ -327,7 +327,7 @@ return -1; x = (x ^ y) * mult; /* the cast might truncate len; that doesn't change hash stability */ - mult += (long)(82520L + len + len); + mult += 82520L + len + len; } x += 97531L; if (x == -1) Index: Objects/longobject.c =================================================================== --- Objects/longobject.c (revision 85677) +++ Objects/longobject.c (working copy) @@ -2555,7 +2555,7 @@ static Py_hash_t long_hash(PyLongObject *v) { - unsigned long x; + size_t x; Py_ssize_t i; int sign;