diff options
author | A. Jesse Jiryu Davis <jesse@emptysquare.net> | 2018-06-04 10:57:08 (GMT) |
---|---|---|
committer | INADA Naoki <methane@users.noreply.github.com> | 2018-06-04 10:57:08 (GMT) |
commit | a8eb58546b37a7cd5f332f019bb07388f5212c2d (patch) | |
tree | b79203d6ee079f774bfa794b5e969059bd730bee | |
parent | f7745e1dcb8e8473cc86112a0213b3f244a07230 (diff) | |
download | cpython-a8eb58546b37a7cd5f332f019bb07388f5212c2d.zip cpython-a8eb58546b37a7cd5f332f019bb07388f5212c2d.tar.gz cpython-a8eb58546b37a7cd5f332f019bb07388f5212c2d.tar.bz2 |
bpo-31849: Fix warning in pyhash.c (GH-6799)
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2018-05-14-11-00-00.bpo-31849.EmHaH4.rst | 1 | ||||
-rw-r--r-- | Python/pyhash.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-05-14-11-00-00.bpo-31849.EmHaH4.rst b/Misc/NEWS.d/next/Core and Builtins/2018-05-14-11-00-00.bpo-31849.EmHaH4.rst new file mode 100644 index 0000000..876a3cf --- /dev/null +++ b/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. diff --git a/Python/pyhash.c b/Python/pyhash.c index 6fc12fd..4c0b929 100644 --- a/Python/pyhash.c +++ b/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; } |