mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
removed a number of stupid compilation warnings on Linux
This commit is contained in:
parent
92e282288f
commit
10c12171cc
@ -538,7 +538,8 @@ void printErrorStack(entry *e) {
|
||||
|
||||
/* display error stack */
|
||||
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;
|
||||
|
||||
for (j = 0; j < server.dbnum; j++) {
|
||||
long bestval;
|
||||
long bestval = 0; /* just to prevent warning */
|
||||
sds bestkey = NULL;
|
||||
struct dictEntry *de;
|
||||
redisDb *db = server.db+j;
|
||||
|
@ -754,9 +754,9 @@ void ziplistRepr(unsigned char *zl) {
|
||||
"pls: %2u, "
|
||||
"payload %5u"
|
||||
"} ",
|
||||
(long unsigned int)p,
|
||||
(long unsigned)p,
|
||||
index,
|
||||
p-zl,
|
||||
(unsigned long) (p-zl),
|
||||
entry.headersize+entry.len,
|
||||
entry.headersize,
|
||||
entry.prevrawlen,
|
||||
@ -765,10 +765,11 @@ void ziplistRepr(unsigned char *zl) {
|
||||
p += entry.headersize;
|
||||
if (ZIP_IS_STR(entry.encoding)) {
|
||||
if (entry.len > 40) {
|
||||
fwrite(p,40,1,stdout);
|
||||
if (fwrite(p,40,1,stdout) == 0) perror("fwrite");
|
||||
printf("...");
|
||||
} else {
|
||||
fwrite(p,entry.len,1,stdout);
|
||||
if (entry.len &&
|
||||
fwrite(p,entry.len,1,stdout) == 0) perror("fwrite");
|
||||
}
|
||||
} else {
|
||||
printf("%lld", (long long) zipLoadInteger(p,entry.encoding));
|
||||
@ -857,7 +858,7 @@ void pop(unsigned char *zl, int where) {
|
||||
printf("Pop tail: ");
|
||||
|
||||
if (vstr)
|
||||
fwrite(vstr,vlen,1,stdout);
|
||||
if (vlen && fwrite(vstr,vlen,1,stdout) == 0) perror("fwrite");
|
||||
else
|
||||
printf("%lld", vlong);
|
||||
|
||||
@ -932,7 +933,7 @@ int main(int argc, char **argv) {
|
||||
return 1;
|
||||
}
|
||||
if (entry) {
|
||||
fwrite(entry,elen,1,stdout);
|
||||
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||
printf("\n");
|
||||
} else {
|
||||
printf("%lld\n", value);
|
||||
@ -962,7 +963,7 @@ int main(int argc, char **argv) {
|
||||
return 1;
|
||||
}
|
||||
if (entry) {
|
||||
fwrite(entry,elen,1,stdout);
|
||||
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||
printf("\n");
|
||||
} else {
|
||||
printf("%lld\n", value);
|
||||
@ -979,7 +980,7 @@ int main(int argc, char **argv) {
|
||||
return 1;
|
||||
}
|
||||
if (entry) {
|
||||
fwrite(entry,elen,1,stdout);
|
||||
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||
printf("\n");
|
||||
} else {
|
||||
printf("%lld\n", value);
|
||||
@ -1007,7 +1008,7 @@ int main(int argc, char **argv) {
|
||||
while (ziplistGet(p, &entry, &elen, &value)) {
|
||||
printf("Entry: ");
|
||||
if (entry) {
|
||||
fwrite(entry,elen,1,stdout);
|
||||
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||
} else {
|
||||
printf("%lld", value);
|
||||
}
|
||||
@ -1024,7 +1025,7 @@ int main(int argc, char **argv) {
|
||||
while (ziplistGet(p, &entry, &elen, &value)) {
|
||||
printf("Entry: ");
|
||||
if (entry) {
|
||||
fwrite(entry,elen,1,stdout);
|
||||
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||
} else {
|
||||
printf("%lld", value);
|
||||
}
|
||||
@ -1041,7 +1042,7 @@ int main(int argc, char **argv) {
|
||||
while (ziplistGet(p, &entry, &elen, &value)) {
|
||||
printf("Entry: ");
|
||||
if (entry) {
|
||||
fwrite(entry,elen,1,stdout);
|
||||
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||
} else {
|
||||
printf("%lld", value);
|
||||
}
|
||||
@ -1070,7 +1071,7 @@ int main(int argc, char **argv) {
|
||||
while (ziplistGet(p, &entry, &elen, &value)) {
|
||||
printf("Entry: ");
|
||||
if (entry) {
|
||||
fwrite(entry,elen,1,stdout);
|
||||
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||
} else {
|
||||
printf("%lld", value);
|
||||
}
|
||||
@ -1087,7 +1088,7 @@ int main(int argc, char **argv) {
|
||||
while (ziplistGet(p, &entry, &elen, &value)) {
|
||||
printf("Entry: ");
|
||||
if (entry) {
|
||||
fwrite(entry,elen,1,stdout);
|
||||
if (elen && fwrite(entry,elen,1,stdout) == 0) perror("fwrite");
|
||||
} else {
|
||||
printf("%lld", value);
|
||||
}
|
||||
@ -1144,7 +1145,8 @@ int main(int argc, char **argv) {
|
||||
} else {
|
||||
printf("Entry: ");
|
||||
if (entry) {
|
||||
fwrite(entry,elen,1,stdout);
|
||||
if (elen && fwrite(entry,elen,1,stdout) == 0)
|
||||
perror("fwrite");
|
||||
} else {
|
||||
printf("%lld",value);
|
||||
}
|
||||
|
@ -374,14 +374,14 @@ void zipmapRepr(unsigned char *p) {
|
||||
l = zipmapDecodeLength(p);
|
||||
printf("{key %u}",l);
|
||||
p += zipmapEncodeLength(NULL,l);
|
||||
fwrite(p,l,1,stdout);
|
||||
if (l != 0 && fwrite(p,l,1,stdout) == 0) perror("fwrite");
|
||||
p += l;
|
||||
|
||||
l = zipmapDecodeLength(p);
|
||||
printf("{value %u}",l);
|
||||
p += zipmapEncodeLength(NULL,l);
|
||||
e = *p++;
|
||||
fwrite(p,l,1,stdout);
|
||||
if (l != 0 && fwrite(p,l,1,stdout) == 0) perror("fwrite");
|
||||
p += l+e;
|
||||
if (e) {
|
||||
printf("[");
|
||||
|
Loading…
Reference in New Issue
Block a user