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

(cherry picked from commit a8eb58546b)

Co-authored-by: A. Jesse Jiryu Davis <jesse@emptysquare.net>
This commit is contained in:
Miss Islington (bot) 2018-06-04 10:31:07 -07:00 committed by GitHub
parent 7548a93274
commit 150033d159
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

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

View file

@ -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;
}