Initialize x and y unconditionally

Fixes a compiler warning.
This commit is contained in:
Steven Dee 2014-02-26 01:24:50 +00:00
parent 89f1ac3953
commit 823a820e87

6
capn.c
View file

@ -186,8 +186,8 @@ end:
} }
static struct capn_segment *lookup_segment(struct capn* c, struct capn_segment *s, uint32_t id) { static struct capn_segment *lookup_segment(struct capn* c, struct capn_segment *s, uint32_t id) {
struct capn_tree **x; struct capn_tree **x = &c->segtree;
struct capn_segment *y; struct capn_segment *y = NULL;
if (s && s->id == id) if (s && s->id == id)
return s; return s;
@ -195,8 +195,6 @@ static struct capn_segment *lookup_segment(struct capn* c, struct capn_segment *
return NULL; return NULL;
if (id < c->segnum) { if (id < c->segnum) {
x = &c->segtree;
y = NULL;
while (*x) { while (*x) {
y = (struct capn_segment*) *x; y = (struct capn_segment*) *x;
if (id == y->id) { if (id == y->id) {