File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1962,7 +1962,7 @@ long_compare(PyLongObject *a, PyLongObject *b)
19621962static long
19631963long_hash (PyLongObject * v )
19641964{
1965- long x ;
1965+ unsigned long x ;
19661966 Py_ssize_t i ;
19671967 int sign ;
19681968
@@ -1977,17 +1977,18 @@ long_hash(PyLongObject *v)
19771977 i = - (i );
19781978 }
19791979#define LONG_BIT_PyLong_SHIFT (8*sizeof(long) - PyLong_SHIFT)
1980- /* The following loop produces a C long x such that (unsigned long)x
1981- is congruent to the absolute value of v modulo ULONG_MAX. The
1982- resulting x is nonzero if and only if v is. */
1980+ /* The following loop produces a C long x such that x is congruent to
1981+ the absolute value of v modulo ULONG_MAX. The resulting x is
1982+ nonzero if and only if v is. */
19831983 while (-- i >= 0 ) {
19841984 /* Force a native long #-bits (32 or 64) circular shift */
1985- x = ((x << PyLong_SHIFT ) & ~PyLong_MASK ) | ((x >> LONG_BIT_PyLong_SHIFT ) & PyLong_MASK );
1985+ x = ((x << PyLong_SHIFT ) & ~PyLong_MASK ) |
1986+ ((x >> LONG_BIT_PyLong_SHIFT ) & PyLong_MASK );
19861987 x += v -> ob_digit [i ];
1987- /* If the addition above overflowed (thinking of x as
1988- unsigned), we compensate by incrementing. This preserves
1989- the value modulo ULONG_MAX. */
1990- if (( unsigned long ) x < v -> ob_digit [i ])
1988+ /* If the addition above overflowed we compensate by
1989+ incrementing. This preserves the value modulo
1990+ ULONG_MAX. */
1991+ if (x < v -> ob_digit [i ])
19911992 x ++ ;
19921993 }
19931994#undef LONG_BIT_PyLong_SHIFT
You can’t perform that action at this time.
0 commit comments