Browse Source

bpo-31849: Fix warning in pyhash.c (GH-6799)

pull/7401/head
A. Jesse Jiryu Davis 8 years ago
committed by INADA Naoki
parent
commit
a8eb58546b
  1. 1
      Misc/NEWS.d/next/Core and Builtins/2018-05-14-11-00-00.bpo-31849.EmHaH4.rst
  2. 4
      Python/pyhash.c

1
Misc/NEWS.d/next/Core and Builtins/2018-05-14-11-00-00.bpo-31849.EmHaH4.rst

@ -0,0 +1 @@
Fix signed/unsigned comparison warning in pyhash.c.

4
Python/pyhash.c

@ -272,8 +272,8 @@ fnv(const void *src, Py_ssize_t len)
x = (_PyHASH_MULTIPLIER * x) ^ (Py_uhash_t) *p++;
x ^= (Py_uhash_t) len;
x ^= (Py_uhash_t) _Py_HashSecret.fnv.suffix;
if (x == -1) {
x = -2;
if (x == (Py_uhash_t) -1) {
x = (Py_uhash_t) -2;
}
return x;
}

Loading…
Cancel
Save