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

@ -4314,14 +4314,14 @@ static PyObject *
wrap_hashfunc(PyObject *self, PyObject *args, void *wrapped)
{
hashfunc func = (hashfunc)wrapped;
long res;
Py_hash_t res;
if (!check_num_args(args, 0))
return NULL;
res = (*func)(self);
if (res == -1 && PyErr_Occurred())
return NULL;
return PyLong_FromLong(res);
return PyLong_FromSsize_t(res);
}
static PyObject *