@@ -2864,21 +2864,21 @@ void_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *NPY_UNUSED(kwds))
28642864 * #lname = bool, ubyte, ushort#
28652865 * #name = Bool,UByte, UShort#
28662866 */
2867- static long
2867+ static npy_hash_t
28682868@lname @_arrtype_hash (PyObject * obj )
28692869{
2870- return (long )(((Py @name @ScalarObject * )obj )-> obval );
2870+ return (npy_hash_t )(((Py @name @ScalarObject * )obj )-> obval );
28712871}
28722872/**end repeat**/
28732873
28742874/**begin repeat
28752875 * #lname = byte, short, uint, ulong#
28762876 * #name = Byte, Short, UInt, ULong#
28772877 */
2878- static long
2878+ static npy_hash_t
28792879@lname @_arrtype_hash (PyObject * obj )
28802880{
2881- long x = (long )(((Py @name @ScalarObject * )obj )-> obval );
2881+ npy_hash_t x = (npy_hash_t )(((Py @name @ScalarObject * )obj )-> obval );
28822882 if (x == -1 ) {
28832883 x = -2 ;
28842884 }
@@ -2887,10 +2887,10 @@ static long
28872887/**end repeat**/
28882888
28892889#if (NPY_SIZEOF_INT != NPY_SIZEOF_LONG ) || defined(NPY_PY3K )
2890- static long
2890+ static npy_hash_t
28912891int_arrtype_hash (PyObject * obj )
28922892{
2893- long x = (long )(((PyIntScalarObject * )obj )-> obval );
2893+ npy_hash_t x = (npy_hash_t )(((PyIntScalarObject * )obj )-> obval );
28942894 if (x == -1 ) {
28952895 x = -2 ;
28962896 }
@@ -2903,16 +2903,16 @@ int_arrtype_hash(PyObject *obj)
29032903 * #Char = ,U#
29042904 * #ext = && (x >= LONG_MIN),#
29052905 */
2906- #if NPY_SIZEOF_LONG != NPY_SIZEOF_LONGLONG
2906+ #if NPY_SIZEOF_HASH_T != NPY_SIZEOF_LONGLONG
29072907/* we assume NPY_SIZEOF_LONGLONG=2*NPY_SIZEOF_LONG */
2908- static long
2908+ static npy_hash_t
29092909@char @longlong_arrtype_hash (PyObject * obj )
29102910{
2911- long y ;
2911+ npy_hash_t y ;
29122912 npy_ @char @longlong x = (((Py @Char @LongLongScalarObject * )obj )-> obval );
29132913
29142914 if ((x <= LONG_MAX )@ext @) {
2915- y = (long ) x ;
2915+ y = (npy_hash_t ) x ;
29162916 }
29172917 else {
29182918 union Mask {
@@ -2930,10 +2930,10 @@ static long
29302930}
29312931#else
29322932
2933- static long
2933+ static npy_hash_t
29342934@char @longlong_arrtype_hash (PyObject * obj )
29352935{
2936- long x = (long )(((Py @Char @LongLongScalarObject * )obj )-> obval );
2936+ npy_hash_t x = (npy_hash_t )(((Py @Char @LongLongScalarObject * )obj )-> obval );
29372937 if (x == -1 ) {
29382938 x = -2 ;
29392939 }
@@ -2948,25 +2948,25 @@ static long
29482948 * #lname = datetime, timedelta#
29492949 * #name = Datetime, Timedelta#
29502950 */
2951- #if NPY_SIZEOF_LONG == NPY_SIZEOF_DATETIME
2952- static long
2951+ #if NPY_SIZEOF_HASH_T == NPY_SIZEOF_DATETIME
2952+ static npy_hash_t
29532953@lname @_arrtype_hash (PyObject * obj )
29542954{
2955- long x = (long )(((Py @name @ScalarObject * )obj )-> obval );
2955+ npy_hash_t x = (npy_hash_t )(((Py @name @ScalarObject * )obj )-> obval );
29562956 if (x == -1 ) {
29572957 x = -2 ;
29582958 }
29592959 return x ;
29602960}
29612961#elif NPY_SIZEOF_LONGLONG == NPY_SIZEOF_DATETIME
2962- static long
2962+ static npy_hash_t
29632963@lname @_arrtype_hash (PyObject * obj )
29642964{
2965- long y ;
2965+ npy_hash_t y ;
29662966 npy_longlong x = (((Py @name @ScalarObject * )obj )-> obval );
29672967
29682968 if ((x <= LONG_MAX )) {
2969- y = (long ) x ;
2969+ y = (npy_hash_t ) x ;
29702970 }
29712971 else {
29722972 union Mask {
@@ -2993,17 +2993,17 @@ static long
29932993 * #lname = float, longdouble#
29942994 * #name = Float, LongDouble#
29952995 */
2996- static long
2996+ static npy_hash_t
29972997@lname @_arrtype_hash (PyObject * obj )
29982998{
29992999 return _Py_HashDouble ((double ) ((Py @name @ScalarObject * )obj )-> obval );
30003000}
30013001
30023002/* borrowed from complex_hash */
3003- static long
3003+ static npy_hash_t
30043004c @lname @_arrtype_hash (PyObject * obj )
30053005{
3006- long hashreal , hashimag , combined ;
3006+ npy_hash_t hashreal , hashimag , combined ;
30073007 hashreal = _Py_HashDouble ((double )
30083008 (((PyC @name @ScalarObject * )obj )-> obval ).real );
30093009
@@ -3023,13 +3023,13 @@ c@lname@_arrtype_hash(PyObject *obj)
30233023}
30243024/**end repeat**/
30253025
3026- static long
3026+ static npy_hash_t
30273027half_arrtype_hash (PyObject * obj )
30283028{
30293029 return _Py_HashDouble (npy_half_to_double (((PyHalfScalarObject * )obj )-> obval ));
30303030}
30313031
3032- static long
3032+ static npy_hash_t
30333033object_arrtype_hash (PyObject * obj )
30343034{
30353035 return PyObject_Hash (((PyObjectScalarObject * )obj )-> obval );
@@ -3038,14 +3038,14 @@ object_arrtype_hash(PyObject *obj)
30383038/* we used to just hash the pointer */
30393039/* now use tuplehash algorithm using voidtype_item to get the object
30403040*/
3041- static long
3041+ static npy_hash_t
30423042void_arrtype_hash (PyObject * obj )
30433043{
3044- register long x , y ;
3045- register Py_ssize_t len , n ;
3046- register PyVoidScalarObject * p ;
3047- register PyObject * element ;
3048- long mult = 1000003L ;
3044+ npy_hash_t x , y ;
3045+ Py_ssize_t len , n ;
3046+ PyVoidScalarObject * p ;
3047+ PyObject * element ;
3048+ npy_hash_t mult = 1000003L ;
30493049 x = 0x345678L ;
30503050 p = (PyVoidScalarObject * )obj ;
30513051 /* Cannot hash mutable void scalars */
@@ -3061,7 +3061,7 @@ void_arrtype_hash(PyObject *obj)
30613061 if (y == -1 )
30623062 return -1 ;
30633063 x = (x ^ y ) * mult ;
3064- mult += (long )(82520L + len + len );
3064+ mult += (npy_hash_t )(82520L + len + len );
30653065 }
30663066 x += 97531L ;
30673067 if (x == -1 )
0 commit comments