make hashes always the size of pointers; introduce Py_hash_t #9778
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 9a04549..d791cde 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -1843,7 +1843,7 @@
static PyObject *delta_getstate(PyDateTime_Delta *self);
-static long
+static Py_hash_t
delta_hash(PyDateTime_Delta *self)
{
if (self->hashcode == -1) {
@@ -2777,11 +2777,11 @@
/*
Borrowed from stringobject.c, originally it was string_hash()
*/
-static long
+static Py_hash_t
generic_hash(unsigned char *data, int len)
{
register unsigned char *p;
- register long x;
+ register Py_hash_t x;
p = (unsigned char *) data;
x = *p << 7;
@@ -2797,7 +2797,7 @@
static PyObject *date_getstate(PyDateTime_Date *self);
-static long
+static Py_hash_t
date_hash(PyDateTime_Date *self)
{
if (self->hashcode == -1)
@@ -3246,7 +3246,7 @@
return delta_richcompare(self->offset, other->offset, op);
}
-static long
+static Py_hash_t
timezone_hash(PyDateTime_TimeZone *self)
{
return delta_hash((PyDateTime_Delta *)self->offset);
@@ -3751,7 +3751,7 @@
return result;
}
-static long
+static Py_hash_t
time_hash(PyDateTime_Time *self)
{
if (self->hashcode == -1) {
@@ -4640,7 +4640,7 @@
return result;
}
-static long
+static Py_hash_t
datetime_hash(PyDateTime_DateTime *self)
{
if (self->hashcode == -1) {