Skip to content

Loading…

Initialize variables to make gcc happy. #838

Closed
wants to merge 1 commit into from

2 participants

@ldm5180

If -Werror is turned on (as it is in our build system) TOT will not build. This fixes the warnings.

@mattsta

Resolved through refactoring code over time.

@mattsta mattsta closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 19, 2012
  1. @ldm5180
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/ziplist.c
View
4 src/ziplist.c
@@ -307,7 +307,7 @@ static int zipPrevLenByteDiff(unsigned char *p, unsigned int len) {
/* Return the total number of bytes used by the entry pointed to by 'p'. */
static unsigned int zipRawEntryLength(unsigned char *p) {
- unsigned int prevlensize, encoding, lensize, len;
+ unsigned int prevlensize, encoding, lensize = 0, len = 0;
ZIP_DECODE_PREVLENSIZE(p, prevlensize);
ZIP_DECODE_LENGTH(p + prevlensize, encoding, lensize, len);
return prevlensize + lensize + len;
@@ -822,7 +822,7 @@ unsigned char *ziplistFind(unsigned char *p, unsigned char *vstr, unsigned int v
long long vll = 0;
while (p[0] != ZIP_END) {
- unsigned int prevlensize, encoding, lensize, len;
+ unsigned int prevlensize, encoding, lensize = 0, len = 0;
unsigned char *q;
ZIP_DECODE_PREVLENSIZE(p, prevlensize);
Something went wrong with that request. Please try again.