From f013f40003e5709203e31dcba4485f8342e2cccc Mon Sep 17 00:00:00 2001 From: antirez Date: Sun, 23 Oct 2011 10:57:01 +0200 Subject: [PATCH] Fixed a few warnings compiling on Linux. --- src/cluster.c | 2 +- src/rio.c | 2 ++ src/t_zset.c | 2 +- src/ziplist.c | 4 +++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index 42b01113..fadce42e 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -439,7 +439,7 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) { * time PONG figure if it is newer than our figure. * Note that it's not a problem if we have a PING already * in progress against this node. */ - if (node->pong_received < ntohl(g->pong_received)) { + if (node->pong_received < (signed) ntohl(g->pong_received)) { redisLog(REDIS_DEBUG,"Node pong_received updated by gossip"); node->pong_received = ntohl(g->pong_received); } diff --git a/src/rio.c b/src/rio.c index f695a482..95b1ee7e 100644 --- a/src/rio.c +++ b/src/rio.c @@ -1,4 +1,6 @@ +#include "fmacros.h" #include +#include #include "rio.h" #include "util.h" diff --git a/src/t_zset.c b/src/t_zset.c index a7ee1839..5dab64dc 100644 --- a/src/t_zset.c +++ b/src/t_zset.c @@ -929,7 +929,7 @@ void zaddGenericCommand(redisClient *c, int incr) { } else { znode = zslInsert(zs->zsl,score,ele); incrRefCount(ele); /* Inserted in skiplist. */ - redisAssertWithInfo(c,curobj,dictAdd(zs->dict,ele,&znode->score) == DICT_OK); + redisAssertWithInfo(c,NULL,dictAdd(zs->dict,ele,&znode->score) == DICT_OK); incrRefCount(ele); /* Added to dictionary. */ signalModifiedKey(c->db,key); diff --git a/src/ziplist.c b/src/ziplist.c index f5f9e9a6..639e4b61 100644 --- a/src/ziplist.c +++ b/src/ziplist.c @@ -489,7 +489,9 @@ static unsigned char *__ziplistInsert(unsigned char *zl, unsigned char *p, unsig size_t offset; int nextdiff = 0; unsigned char encoding = 0; - long long value; + long long value = 123456789; /* initialized to avoid warning. Using a value + that is easy to see if for some reason + we use it uninitialized. */ zlentry entry, tail; /* Find out prevlen for the entry that is inserted. */ -- 2.45.2