From ef33252c434ff25991ff75e2c7e4646bc9ad5ff7 Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Tue, 29 Sep 2020 17:03:47 +0300 Subject: [PATCH] warning: comparison between signed and unsigned integer in 32bit build (#7838) --- src/listpack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/listpack.c b/src/listpack.c index 075552ccb..7e2da9b74 100644 --- a/src/listpack.c +++ b/src/listpack.c @@ -768,10 +768,10 @@ unsigned char *lpSeek(unsigned char *lp, long index) { if (numele != LP_HDR_NUMELE_UNKNOWN) { if (index < 0) index = (long)numele+index; if (index < 0) return NULL; /* Index still < 0 means out of range. */ - if (index >= numele) return NULL; /* Out of range the other side. */ + if ((long)index >= numele) return NULL; /* Out of range the other side. */ /* We want to scan right-to-left if the element we are looking for * is past the half of the listpack. */ - if (index > numele/2) { + if ((long)index > numele/2) { forward = 0; /* Right to left scanning always expects a negative index. Convert * our index to negative form. */