summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2020-10-20 09:12:24 +0300
committerGitHub <noreply@github.com>2020-10-20 09:12:24 +0300
commita425e1d26df02ac5ce0fc9a0c679b99d72550009 (patch)
tree50c57884d5cce36a83f372b2fc5f9852e9110408
parent04a0af9085ed91eace8af94f71a07b651a1af454 (diff)
downloadredis-a425e1d26df02ac5ce0fc9a0c679b99d72550009.tar.gz
fix 32bit build warnings (#7926)
-rw-r--r--src/config.c2
-rw-r--r--src/listpack.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c
index 2a9f49d80..afd4bc81c 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1610,7 +1610,7 @@ int rewriteConfigOverwriteFile(char *configfile, sds content) {
written_bytes = write(fd, content + offset, sdslen(content) - offset);
if (written_bytes <= 0) {
if (errno == EINTR) continue; /* FD is blocking, no other retryable errors */
- serverLog(LL_WARNING, "Failed after writing (%ld) bytes to tmp config file (%s)", offset, strerror(errno));
+ serverLog(LL_WARNING, "Failed after writing (%zd) bytes to tmp config file (%s)", offset, strerror(errno));
goto cleanup;
}
offset+=written_bytes;
diff --git a/src/listpack.c b/src/listpack.c
index 7e2da9b74..f8c34429e 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 ((long)index >= numele) return NULL; /* Out of range the other side. */
+ if (index >= (long)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 ((long)index > numele/2) {
+ if (index > (long)numele/2) {
forward = 0;
/* Right to left scanning always expects a negative index. Convert
* our index to negative form. */