Skip to content

Commit 4251d2a

Browse files
bpo-31849: Fix warning in pyhash.c (GH-6799)
(cherry picked from commit a8eb585) Co-authored-by: A. Jesse Jiryu Davis <[email protected]>
1 parent ffe29db commit 4251d2a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix signed/unsigned comparison warning in pyhash.c.

Python/pyhash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ fnv(const void *src, Py_ssize_t len)
272272
x = (_PyHASH_MULTIPLIER * x) ^ (Py_uhash_t) *p++;
273273
x ^= (Py_uhash_t) len;
274274
x ^= (Py_uhash_t) _Py_HashSecret.fnv.suffix;
275-
if (x == -1) {
276-
x = -2;
275+
if (x == (Py_uhash_t) -1) {
276+
x = (Py_uhash_t) -2;
277277
}
278278
return x;
279279
}

0 commit comments

Comments
 (0)