follow up to #9778: define and use an unsigned hash type

This commit is contained in:
Benjamin Peterson 2010-10-23 16:20:50 +00:00
parent 2b9af63b4f
commit 8035bc5c04
7 changed files with 22 additions and 20 deletions

View file

@ -2555,7 +2555,7 @@ long_richcompare(PyObject *self, PyObject *other, int op)
static Py_hash_t
long_hash(PyLongObject *v)
{
unsigned long x;
Py_uhash_t x;
Py_ssize_t i;
int sign;
@ -2604,8 +2604,8 @@ long_hash(PyLongObject *v)
x -= _PyHASH_MODULUS;
}
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;
}