]> git.saurik.com Git - redis.git/commitdiff
Fixed a few warnings compiling on Linux.
authorantirez <antirez@gmail.com>
Sun, 23 Oct 2011 08:57:01 +0000 (10:57 +0200)
committerantirez <antirez@gmail.com>
Sun, 23 Oct 2011 08:57:01 +0000 (10:57 +0200)
src/cluster.c
src/rio.c
src/t_zset.c
src/ziplist.c

index 42b0111366f4b456f5d8d790534946972914064c..fadce42eacdb9a8adf082b2ecf8029801e63e762 100644 (file)
@@ -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);
             }
index f695a482466341f482835830237ac6dc17be2c45..95b1ee7e6042f9f97e28691ffc9d95cee2fb3df3 100644 (file)
--- a/src/rio.c
+++ b/src/rio.c
@@ -1,4 +1,6 @@
+#include "fmacros.h"
 #include <string.h>
+#include <stdio.h>
 #include "rio.h"
 #include "util.h"
 
index a7ee1839075b2aa64b98ce5efb30976e672e8be2..5dab64dc01c2990e736b32984ded1b2861a67215 100644 (file)
@@ -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);
index f5f9e9a64aa3cad58c2c8c977893bd4cf5b79837..639e4b61ec3cc9c0e5f742448ff19c3420e5d2be 100644 (file)
@@ -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. */