removed a number of stupid compilation warnings on Linux
This commit is contained in:
parent
4e0d189300
commit
82105585b2
@ -538,7 +538,8 @@ void printErrorStack(entry *e) {
|
|||||||
|
|
||||||
/* display error stack */
|
/* display error stack */
|
||||||
for (i = 0; i < errors.level; i++) {
|
for (i = 0; i < errors.level; i++) {
|
||||||
printf("0x%08lx - %s\n", errors.offset[i], errors.error[i]);
|
printf("0x%08lx - %s\n",
|
||||||
|
(unsigned long) errors.offset[i], errors.error[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1250,7 +1250,7 @@ void freeMemoryIfNeeded(void) {
|
|||||||
if (tryFreeOneObjectFromFreelist() == REDIS_OK) continue;
|
if (tryFreeOneObjectFromFreelist() == REDIS_OK) continue;
|
||||||
|
|
||||||
for (j = 0; j < server.dbnum; j++) {
|
for (j = 0; j < server.dbnum; j++) {
|
||||||
long bestval;
|
long bestval = 0; /* just to prevent warning */
|
||||||
sds bestkey = NULL;
|
sds bestkey = NULL;
|
||||||
struct dictEntry *de;
|
struct dictEntry *de;
|
||||||
redisDb *db = server.db+j;
|
redisDb *db = server.db+j;
|
||||||
|
@ -754,9 +754,9 @@ void ziplistRepr(unsigned char *zl) {
|
|||||||
"pls: %2u, "
|
"pls: %2u, "
|
||||||
"payload %5u"
|
"payload %5u"
|
||||||
"} ",
|
"} ",
|
||||||
(long unsigned int)p,
|
(long unsigned)p,
|
||||||
index,
|
index,
|
||||||
p-zl,
|
(unsigned long) (p-zl),
|
||||||
entry.headersize+entry.len,
|
entry.headersize+entry.len,
|
||||||
entry.headersize,
|
entry.headersize,
|
||||||
entry.prevrawlen,
|
entry.prevrawlen,
|
||||||
@ -765,10 +765,11 @@ void ziplistRepr(unsigned char *zl) {
|
|||||||
p += entry.headersize;
|
p += entry.headersize;
|
||||||
if (ZIP_IS_STR(entry.encoding)) {
|
if (ZIP_IS_STR(entry.encoding)) {
|
||||||
if (entry.len > 40) {
|
if (entry.len > 40) {
|
||||||
fwrite(p,40,1,stdout);
|
if (fwrite(p,40,1,stdout) == 0) perror("fwrite");
|
||||||
printf("...");
|
printf("...");
|
||||||
} else {
|
} else {
|
||||||
fwrite(p,entry.len,1,stdout);
|
if (entry.len &&
|
||||||
|
fwrite(p,entry.len,1,stdout) == 0) perror("fwrite");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("%lld", (long long) zipLoadInteger(p,entry.encoding));
|
printf("%lld", (long long) zipLoadInteger(p,entry.encoding));
|
||||||
@ -857,7 +858,7 @@ void pop(unsigned char *zl, int where) {
|
|||||||
printf("Pop tail: ");
|
printf("Pop tail: ");
|
||||||
|
|
||||||
if (vstr)
|
if (vstr)
|
||||||
fwrite(vstr,vlen,1,stdout);
|
if (vlen && fwrite(vstr,vlen,1,stdout) == 0) perror("fwrite");
|
||||||
else
|
else
|
||||||
printf("%lld", vlong);
|
printf("%lld", vlong);
|
||||||
|
|
||||||
@ -932,7 +933,7 @@ int main(int argc, char **argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (entry) {
|
if (entry) {
|
||||||
fwrite(entry,elen,1,stdout);
|
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
} else {
|
} else {
|
||||||
printf("%lld\n", value);
|
printf("%lld\n", value);
|
||||||
@ -962,7 +963,7 @@ int main(int argc, char **argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (entry) {
|
if (entry) {
|
||||||
fwrite(entry,elen,1,stdout);
|
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
} else {
|
} else {
|
||||||
printf("%lld\n", value);
|
printf("%lld\n", value);
|
||||||
@ -979,7 +980,7 @@ int main(int argc, char **argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (entry) {
|
if (entry) {
|
||||||
fwrite(entry,elen,1,stdout);
|
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
} else {
|
} else {
|
||||||
printf("%lld\n", value);
|
printf("%lld\n", value);
|
||||||
@ -1007,7 +1008,7 @@ int main(int argc, char **argv) {
|
|||||||
while (ziplistGet(p, &entry, &elen, &value)) {
|
while (ziplistGet(p, &entry, &elen, &value)) {
|
||||||
printf("Entry: ");
|
printf("Entry: ");
|
||||||
if (entry) {
|
if (entry) {
|
||||||
fwrite(entry,elen,1,stdout);
|
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||||
} else {
|
} else {
|
||||||
printf("%lld", value);
|
printf("%lld", value);
|
||||||
}
|
}
|
||||||
@ -1024,7 +1025,7 @@ int main(int argc, char **argv) {
|
|||||||
while (ziplistGet(p, &entry, &elen, &value)) {
|
while (ziplistGet(p, &entry, &elen, &value)) {
|
||||||
printf("Entry: ");
|
printf("Entry: ");
|
||||||
if (entry) {
|
if (entry) {
|
||||||
fwrite(entry,elen,1,stdout);
|
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||||
} else {
|
} else {
|
||||||
printf("%lld", value);
|
printf("%lld", value);
|
||||||
}
|
}
|
||||||
@ -1041,7 +1042,7 @@ int main(int argc, char **argv) {
|
|||||||
while (ziplistGet(p, &entry, &elen, &value)) {
|
while (ziplistGet(p, &entry, &elen, &value)) {
|
||||||
printf("Entry: ");
|
printf("Entry: ");
|
||||||
if (entry) {
|
if (entry) {
|
||||||
fwrite(entry,elen,1,stdout);
|
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||||
} else {
|
} else {
|
||||||
printf("%lld", value);
|
printf("%lld", value);
|
||||||
}
|
}
|
||||||
@ -1070,7 +1071,7 @@ int main(int argc, char **argv) {
|
|||||||
while (ziplistGet(p, &entry, &elen, &value)) {
|
while (ziplistGet(p, &entry, &elen, &value)) {
|
||||||
printf("Entry: ");
|
printf("Entry: ");
|
||||||
if (entry) {
|
if (entry) {
|
||||||
fwrite(entry,elen,1,stdout);
|
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||||
} else {
|
} else {
|
||||||
printf("%lld", value);
|
printf("%lld", value);
|
||||||
}
|
}
|
||||||
@ -1087,7 +1088,7 @@ int main(int argc, char **argv) {
|
|||||||
while (ziplistGet(p, &entry, &elen, &value)) {
|
while (ziplistGet(p, &entry, &elen, &value)) {
|
||||||
printf("Entry: ");
|
printf("Entry: ");
|
||||||
if (entry) {
|
if (entry) {
|
||||||
fwrite(entry,elen,1,stdout);
|
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||||
} else {
|
} else {
|
||||||
printf("%lld", value);
|
printf("%lld", value);
|
||||||
}
|
}
|
||||||
@ -1144,7 +1145,8 @@ int main(int argc, char **argv) {
|
|||||||
} else {
|
} else {
|
||||||
printf("Entry: ");
|
printf("Entry: ");
|
||||||
if (entry) {
|
if (entry) {
|
||||||
fwrite(entry,elen,1,stdout);
|
if (elen && fwrite(entry,elen,1,stdout) == 0)
|
||||||
|
perror("fwrite");
|
||||||
} else {
|
} else {
|
||||||
printf("%lld",value);
|
printf("%lld",value);
|
||||||
}
|
}
|
||||||
|
@ -374,14 +374,14 @@ void zipmapRepr(unsigned char *p) {
|
|||||||
l = zipmapDecodeLength(p);
|
l = zipmapDecodeLength(p);
|
||||||
printf("{key %u}",l);
|
printf("{key %u}",l);
|
||||||
p += zipmapEncodeLength(NULL,l);
|
p += zipmapEncodeLength(NULL,l);
|
||||||
fwrite(p,l,1,stdout);
|
if (l != 0 && fwrite(p,l,1,stdout) == 0) perror("fwrite");
|
||||||
p += l;
|
p += l;
|
||||||
|
|
||||||
l = zipmapDecodeLength(p);
|
l = zipmapDecodeLength(p);
|
||||||
printf("{value %u}",l);
|
printf("{value %u}",l);
|
||||||
p += zipmapEncodeLength(NULL,l);
|
p += zipmapEncodeLength(NULL,l);
|
||||||
e = *p++;
|
e = *p++;
|
||||||
fwrite(p,l,1,stdout);
|
if (l != 0 && fwrite(p,l,1,stdout) == 0) perror("fwrite");
|
||||||
p += l+e;
|
p += l+e;
|
||||||
if (e) {
|
if (e) {
|
||||||
printf("[");
|
printf("[");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user