]> git.saurik.com Git - redis.git/commitdiff
fix some warnings
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Sat, 29 May 2010 09:35:48 +0000 (11:35 +0200)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Sat, 29 May 2010 19:10:16 +0000 (21:10 +0200)
ziplist.c

index 4b4c568dafb130eb84f295bcf889275cbd00b559..0d739d3d30ee93743a642a2824db14d70b89bfee 100644 (file)
--- a/ziplist.c
+++ b/ziplist.c
@@ -124,7 +124,7 @@ static int zipTryEncoding(unsigned char *entry, long long *v, char *encoding) {
     char *eptr;
 
     if (entry[0] == '-' || (entry[0] >= '0' && entry[0] <= '9')) {
     char *eptr;
 
     if (entry[0] == '-' || (entry[0] >= '0' && entry[0] <= '9')) {
-        value = strtoll(entry,&eptr,10);
+        value = strtoll((char*)entry,&eptr,10);
         if (eptr[0] != '\0') return 0;
         if (value >= SHRT_MIN && value <= SHRT_MAX) {
             *encoding = ZIP_ENC_SHORT;
         if (eptr[0] != '\0') return 0;
         if (value >= SHRT_MIN && value <= SHRT_MAX) {
             *encoding = ZIP_ENC_SHORT;
@@ -327,7 +327,7 @@ unsigned int ziplistGet(unsigned char *p, unsigned char **e, unsigned int *elen,
 /* Delete a range of entries from the ziplist. */
 unsigned char *ziplistDeleteRange(unsigned char *zl, unsigned int index, unsigned int num) {
     unsigned char *p, *first = ziplistIndex(zl, index);
 /* Delete a range of entries from the ziplist. */
 unsigned char *ziplistDeleteRange(unsigned char *zl, unsigned int index, unsigned int num) {
     unsigned char *p, *first = ziplistIndex(zl, index);
-    unsigned int i, deleted = 0, totlen, newlen;
+    unsigned int i, totlen, deleted = 0;
     for (p = first, i = 0; *p != ZIP_END && i < num; i++) {
         p += zipRawEntryLength(p);
         deleted++;
     for (p = first, i = 0; *p != ZIP_END && i < num; i++) {
         p += zipRawEntryLength(p);
         deleted++;
@@ -419,7 +419,6 @@ unsigned int ziplistSize(unsigned char *zl) {
 void ziplistRepr(unsigned char *zl) {
     unsigned char *p, encoding;
     unsigned int l, lsize;
 void ziplistRepr(unsigned char *zl) {
     unsigned char *p, encoding;
     unsigned int l, lsize;
-    long long value;
 
     printf("{total bytes %d} {length %u}\n",ZIPLIST_BYTES(zl), ZIPLIST_LENGTH(zl));
     p = ziplistHead(zl);
 
     printf("{total bytes %d} {length %u}\n",ZIPLIST_BYTES(zl), ZIPLIST_LENGTH(zl));
     p = ziplistHead(zl);