Mercurial > hg > early-roguelike
diff arogue7/pack.c @ 200:1cd604c827a3
Advanced Rogue 7: initialize multiple variables.
MSVC complained that they might be used uninitialized. In some cases,
this might have been possible.
XRogue already has initializations for all these variables.
author | John "Elwin" Edwards |
---|---|
date | Wed, 12 Aug 2015 15:42:02 -0400 |
parents | cadff8f047a1 |
children | f9ef86cf22b2 |
line wrap: on
line diff
--- a/arogue7/pack.c Tue Aug 11 16:19:04 2015 -0400 +++ b/arogue7/pack.c Wed Aug 12 15:42:02 2015 -0400 @@ -34,8 +34,8 @@ register struct linked_list *item, **packret; bool silent; { - register struct linked_list *ip, *lp, *ap; - register struct object *obj, *op; + register struct linked_list *ip, *lp = NULL, *ap; + register struct object *obj, *op = NULL; register bool exact, from_floor; if (packret != NULL) @@ -576,7 +576,7 @@ reg struct linked_list *item; reg struct object *obj; reg int cnt, pagecnt, ch, och, maxx, curx, confused; - struct linked_list *saveitem; + struct linked_list *saveitem = NULL; char description[2*LINELEN+1]; char cost[LINELEN/2]; #ifdef PC7300