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.
This commit is contained in:
parent
b41fb230b0
commit
295a180ea1
12 changed files with 23 additions and 23 deletions
|
|
@ -239,7 +239,7 @@ m_breathe(tp)
|
||||||
register struct thing *tp;
|
register struct thing *tp;
|
||||||
{
|
{
|
||||||
register int damage;
|
register int damage;
|
||||||
register char *breath;
|
register char *breath = "";
|
||||||
|
|
||||||
damage = tp->t_stats.s_hpt;
|
damage = tp->t_stats.s_hpt;
|
||||||
turn_off(*tp, CANSURPRISE);
|
turn_off(*tp, CANSURPRISE);
|
||||||
|
|
@ -783,7 +783,7 @@ runners(segments)
|
||||||
int segments; /* Number of segments since last called */
|
int segments; /* Number of segments since last called */
|
||||||
{
|
{
|
||||||
register struct linked_list *item;
|
register struct linked_list *item;
|
||||||
register struct thing *tp;
|
register struct thing *tp = NULL;
|
||||||
register min_time = 20; /* Minimum time until a monster can act */
|
register min_time = 20; /* Minimum time until a monster can act */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -1078,7 +1078,7 @@ struct linked_list *item;
|
||||||
bool mark;
|
bool mark;
|
||||||
{
|
{
|
||||||
register struct object *obj;
|
register struct object *obj;
|
||||||
register char **guess, *elsewise;
|
register char **guess = NULL, *elsewise = NULL;
|
||||||
register bool *know;
|
register bool *know;
|
||||||
|
|
||||||
if (item == NULL) {
|
if (item == NULL) {
|
||||||
|
|
|
||||||
|
|
@ -417,7 +417,7 @@ unchoke()
|
||||||
alchemy(obj)
|
alchemy(obj)
|
||||||
register struct object *obj;
|
register struct object *obj;
|
||||||
{
|
{
|
||||||
register struct object *tobj;
|
register struct object *tobj = NULL;
|
||||||
register struct linked_list *item;
|
register struct linked_list *item;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -535,7 +535,7 @@ ring_teleport()
|
||||||
*/
|
*/
|
||||||
quill_charge()
|
quill_charge()
|
||||||
{
|
{
|
||||||
register struct object *tobj;
|
register struct object *tobj = NULL;
|
||||||
register struct linked_list *item;
|
register struct linked_list *item;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,7 @@ struct object *cur_weapon;
|
||||||
bool back_stab;
|
bool back_stab;
|
||||||
{
|
{
|
||||||
register struct stats *att, *def;
|
register struct stats *att, *def;
|
||||||
register char *cp;
|
register char *cp = NULL;
|
||||||
register int ndice, nsides, nplus, def_arm;
|
register int ndice, nsides, nplus, def_arm;
|
||||||
bool did_hit = FALSE;
|
bool did_hit = FALSE;
|
||||||
int prop_hplus, prop_dplus;
|
int prop_hplus, prop_dplus;
|
||||||
|
|
|
||||||
|
|
@ -277,7 +277,7 @@ do_bag(item)
|
||||||
register struct linked_list *item;
|
register struct linked_list *item;
|
||||||
{
|
{
|
||||||
|
|
||||||
register struct linked_list *titem;
|
register struct linked_list *titem = NULL;
|
||||||
register struct object *obj, *tobj;
|
register struct object *obj, *tobj;
|
||||||
bool doit = TRUE;
|
bool doit = TRUE;
|
||||||
|
|
||||||
|
|
@ -838,8 +838,8 @@ got_scroll:
|
||||||
use_mm(which)
|
use_mm(which)
|
||||||
int which;
|
int which;
|
||||||
{
|
{
|
||||||
register struct object *obj;
|
register struct object *obj = NULL;
|
||||||
register struct linked_list *item;
|
register struct linked_list *item = NULL;
|
||||||
bool cursed, blessed, is_mm;
|
bool cursed, blessed, is_mm;
|
||||||
|
|
||||||
cursed = FALSE;
|
cursed = FALSE;
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,10 @@ register struct thing *th;
|
||||||
register coord *tc;
|
register coord *tc;
|
||||||
{
|
{
|
||||||
register struct trap *tp;
|
register struct trap *tp;
|
||||||
register char ch, *mname;
|
register char ch, *mname = "";
|
||||||
register bool is_player = (th == &player),
|
register bool is_player = (th == &player),
|
||||||
can_see;
|
can_see;
|
||||||
register struct linked_list *mitem;
|
register struct linked_list *mitem = NULL;
|
||||||
register struct thing *mp;
|
register struct thing *mp;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -764,7 +764,7 @@ int dy, dx;
|
||||||
register struct room *rp, *orp;
|
register struct room *rp, *orp;
|
||||||
register char ch;
|
register char ch;
|
||||||
struct linked_list *item;
|
struct linked_list *item;
|
||||||
register struct thing *tp;
|
register struct thing *tp = NULL;
|
||||||
coord old_hero;
|
coord old_hero;
|
||||||
register int wasfirstmove, moved, num_hits;
|
register int wasfirstmove, moved, num_hits;
|
||||||
bool changed=FALSE; /* Did we switch places with a friendly monster? */
|
bool changed=FALSE; /* Did we switch places with a friendly monster? */
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@ add_pack(item, silent, packret)
|
||||||
register struct linked_list *item, **packret;
|
register struct linked_list *item, **packret;
|
||||||
bool silent;
|
bool silent;
|
||||||
{
|
{
|
||||||
register struct linked_list *ip, *lp, *ap;
|
register struct linked_list *ip, *lp = NULL, *ap;
|
||||||
register struct object *obj, *op;
|
register struct object *obj, *op = NULL;
|
||||||
register bool exact, from_floor;
|
register bool exact, from_floor;
|
||||||
|
|
||||||
if (packret != NULL)
|
if (packret != NULL)
|
||||||
|
|
@ -576,7 +576,7 @@ bool askfirst, showcost;
|
||||||
reg struct linked_list *item;
|
reg struct linked_list *item;
|
||||||
reg struct object *obj;
|
reg struct object *obj;
|
||||||
reg int cnt, pagecnt, ch, och, maxx, curx, confused;
|
reg int cnt, pagecnt, ch, och, maxx, curx, confused;
|
||||||
struct linked_list *saveitem;
|
struct linked_list *saveitem = NULL;
|
||||||
char description[2*LINELEN+1];
|
char description[2*LINELEN+1];
|
||||||
char cost[LINELEN/2];
|
char cost[LINELEN/2];
|
||||||
#ifdef PC7300
|
#ifdef PC7300
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
do_passages()
|
do_passages()
|
||||||
{
|
{
|
||||||
register struct rdes *r1, *r2;
|
register struct rdes *r1, *r2 = NULL;
|
||||||
register int i, j;
|
register int i, j;
|
||||||
register int roomcount;
|
register int roomcount;
|
||||||
static struct rdes
|
static struct rdes
|
||||||
|
|
@ -137,7 +137,7 @@ do_passages()
|
||||||
conn(r1, r2)
|
conn(r1, r2)
|
||||||
int r1, r2;
|
int r1, r2;
|
||||||
{
|
{
|
||||||
register struct room *rpf, *rpt;
|
register struct room *rpf, *rpt = NULL;
|
||||||
register char rmt;
|
register char rmt;
|
||||||
register int distance, max_diag, offset, i;
|
register int distance, max_diag, offset, i;
|
||||||
register int rm;
|
register int rm;
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ register int which;
|
||||||
int flag;
|
int flag;
|
||||||
bool is_scroll;
|
bool is_scroll;
|
||||||
{
|
{
|
||||||
register struct object *obj, *nobj;
|
register struct object *obj = NULL, *nobj;
|
||||||
register struct linked_list *item, *nitem;
|
register struct linked_list *item, *nitem;
|
||||||
register int i,j;
|
register int i,j;
|
||||||
register char ch, nch;
|
register char ch, nch;
|
||||||
|
|
|
||||||
|
|
@ -33,13 +33,13 @@ coord *direction;
|
||||||
int which;
|
int which;
|
||||||
int flags;
|
int flags;
|
||||||
{
|
{
|
||||||
register struct linked_list *item;
|
register struct linked_list *item = NULL;
|
||||||
register struct thing *tp;
|
register struct thing *tp;
|
||||||
register int y, x, bonus;
|
register int y, x, bonus;
|
||||||
struct linked_list *nitem;
|
struct linked_list *nitem;
|
||||||
struct object *nobj;
|
struct object *nobj;
|
||||||
bool cursed, blessed, is_player;
|
bool cursed, blessed, is_player;
|
||||||
char *mname;
|
char *mname = "";
|
||||||
|
|
||||||
cursed = flags & ISCURSED;
|
cursed = flags & ISCURSED;
|
||||||
blessed = flags & ISBLESSED;
|
blessed = flags & ISBLESSED;
|
||||||
|
|
|
||||||
|
|
@ -1006,7 +1006,7 @@ bool
|
||||||
move_hero(why)
|
move_hero(why)
|
||||||
int why;
|
int why;
|
||||||
{
|
{
|
||||||
char *action;
|
char *action = "";
|
||||||
char which;
|
char which;
|
||||||
coord c;
|
coord c;
|
||||||
|
|
||||||
|
|
@ -1207,7 +1207,7 @@ char *
|
||||||
tr_name(ch)
|
tr_name(ch)
|
||||||
char ch;
|
char ch;
|
||||||
{
|
{
|
||||||
register char *s;
|
register char *s = "";
|
||||||
|
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -537,7 +537,7 @@ passwd()
|
||||||
|
|
||||||
teleport()
|
teleport()
|
||||||
{
|
{
|
||||||
register struct room *new_rp, *old_rp = roomin(&hero);
|
register struct room *new_rp = NULL, *old_rp = roomin(&hero);
|
||||||
register int rm, which;
|
register int rm, which;
|
||||||
coord old;
|
coord old;
|
||||||
bool got_position = FALSE;
|
bool got_position = FALSE;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue