From e54fe9a79f71e97a5beb76dee346c8c0606b02be Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 24 Apr 2012 11:11:55 +0200 Subject: [PATCH] A few compiler warnings suppressed. --- src/cluster.c | 1 + src/redis-cli.c | 4 ++-- src/t_zset.c | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index 93f095c3..07552c18 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -4,6 +4,7 @@ #include #include #include +#include void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask); void clusterReadHandler(aeEventLoop *el, int fd, void *privdata, int mask); diff --git a/src/redis-cli.c b/src/redis-cli.c index 3e0c5895..f7fe54fa 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -890,7 +890,7 @@ static int evalMode(int argc, char **argv) { static void latencyMode(void) { redisReply *reply; - long long start, latency, min, max, tot, count = 0; + long long start, latency, min = 0, max = 0, tot = 0, count = 0; double avg; if (!context) exit(1); @@ -977,7 +977,7 @@ static void slaveMode(void) { static void findBigKeys(void) { unsigned long long biggest[5] = {0,0,0,0,0}; unsigned long long samples = 0; - redisReply *reply1, *reply2, *reply3; + redisReply *reply1, *reply2, *reply3 = NULL; char *sizecmd, *typename[] = {"string","list","set","hash","zset"}; int type; diff --git a/src/t_zset.c b/src/t_zset.c index d482d4c2..50ad8d43 100644 --- a/src/t_zset.c +++ b/src/t_zset.c @@ -1259,7 +1259,9 @@ int zuiNext(zsetopsrc *op, zsetopval *val) { if (op->type == REDIS_SET) { iterset *it = &op->iter.set; if (op->encoding == REDIS_ENCODING_INTSET) { - if (!intsetGet(it->is.is,it->is.ii,(int64_t*)&val->ell)) + int64_t ell = val->ell; + + if (!intsetGet(it->is.is,it->is.ii,&ell)) return 0; val->score = 1.0; -- GitLab