Lint part 1, unused variables, routines, and return codes.

This commit is contained in:
jwalz
2002-03-10 00:30:53 +00:00
parent 570a6e8bbd
commit bab78d03c8
18 changed files with 43 additions and 90 deletions

View File

@@ -1860,6 +1860,7 @@ struct obj *otmp;
case WAX:
color = "waxy";
goto see_streaks; /* okay even if not touchstone */
/*NOTREACHED*/
break;
case CLOTH:
pline_The("stone looks a little more polished now.");
@@ -1867,6 +1868,7 @@ struct obj *otmp;
case WOOD:
color = "wooden";
goto see_streaks; /* okay even if not touchstone */
/*NOTREACHED*/
break;
}
return;

View File

@@ -20,7 +20,9 @@ char *catmore = 0; /* default pager */
NEARDATA int bases[MAXOCLASSES] = DUMMY;
NEARDATA int multi = 0;
#if 0
NEARDATA int warnlevel = 0; /* used by movemon and dochugw */
#endif
NEARDATA int nroom = 0;
NEARDATA int nsubroom = 0;
NEARDATA int occtime = 0;

View File

@@ -469,7 +469,7 @@ register struct obj *obj;
char buf[BUFSZ];
/* doname can call s_suffix, reusing its buffer */
strcpy(buf, s_suffix(mon_nam(u.ustuck)));
Strcpy(buf, s_suffix(mon_nam(u.ustuck)));
You("drop %s into %s %s.", doname(obj), buf,
mbodypart(u.ustuck, STOMACH));
}

View File

@@ -336,7 +336,7 @@ register int x,y;
char *et;
unsigned maxelen = BUFSZ - sizeof("You feel the words: \"\". ");
if (strlen(ep->engr_txt) > maxelen) {
strncpy(buf, ep->engr_txt, maxelen);
(void) strncpy(buf, ep->engr_txt, maxelen);
buf[maxelen] = '\0';
et = buf;
} else

View File

@@ -550,7 +550,7 @@ boolean test_only;
uwep && is_pick(uwep)) {
/* MRKR: Automatic digging when wielding the appropriate tool */
if (!test_only)
use_pick_axe2(uwep);
(void) use_pick_axe2(uwep);
return FALSE;
} else {
if ( !test_only ) {
@@ -668,9 +668,9 @@ static void findtravelpath()
xchar travelstepy[2][COLNO*ROWNO];
int n=1;
int set=0;
int d=1;
int dia=1;
memset(travel,0,sizeof(travel));
(void) memset(travel,0,sizeof(travel));
travelstepx[0][0] = u.tx;
travelstepy[0][0] = u.ty;
@@ -699,7 +699,7 @@ static void findtravelpath()
if ( !travel[nx][ny] ) {
travelstepx[1-set][nn]=nx;
travelstepy[1-set][nn]=ny;
travel[nx][ny]=d;
travel[nx][ny]=dia;
nn++;
}
}
@@ -708,7 +708,7 @@ static void findtravelpath()
}
n = nn;
set = 1-set;
d++;
dia++;
}
/* give up */

View File

@@ -507,7 +507,7 @@ int spellnum;
destroy_item(SCROLL_CLASS, AD_FIRE);
destroy_item(POTION_CLASS, AD_FIRE);
destroy_item(SPBOOK_CLASS, AD_FIRE);
burn_floor_paper(u.ux, u.uy, TRUE, FALSE);
(void) burn_floor_paper(u.ux, u.uy, TRUE, FALSE);
break;
case CLC_LIGHTNING:
{

View File

@@ -383,7 +383,8 @@ register struct monst *mtmp;
pline("%s burns slightly.", Monnam(mtmp));
}
if (mtmp->mhp > 0) {
fire_damage(mtmp->minvent, FALSE, FALSE, mtmp->mx, mtmp->my);
(void) fire_damage(mtmp->minvent, FALSE, FALSE,
mtmp->mx, mtmp->my);
rloc(mtmp);
return 0;
}
@@ -1395,16 +1396,16 @@ register struct monst *mtmp;
/* TRUE if corpse might be dropped, magr may die if mon was swallowed */
boolean
corpse_chance(mon, magr, swallowed)
corpse_chance(mon, magr, was_swallowed)
struct monst *mon;
struct monst *magr; /* killer, if swallowed */
boolean swallowed; /* digestion */
boolean was_swallowed; /* digestion */
{
struct permonst *mdat = mon->data;
int i, tmp;
if (mdat == &mons[PM_VLAD_THE_IMPALER] || mdat->mlet == S_LICH) {
if (cansee(mon->mx, mon->my) && !swallowed)
if (cansee(mon->mx, mon->my) && !was_swallowed)
pline("%s body crumbles into dust.", s_suffix(Monnam(mon)));
return FALSE;
}
@@ -1419,7 +1420,7 @@ boolean swallowed; /* digestion */
tmp = d((int)mdat->mlevel+1, (int)mdat->mattk[i].damd);
else tmp = 0;
if (Half_physical_damage) tmp = (tmp+1) / 2;
if (swallowed && magr) {
if (was_swallowed && magr) {
if (magr == &youmonst) {
There("is an explosion in your %s!",
body_part(STOMACH));

View File

@@ -2373,7 +2373,6 @@ boolean setinitial,setfromfile;
retval = TRUE;
} else if (!strcmp("disclose", optname)) {
int pick_cnt, pick_idx, opt_idx;
winid tmpwin;
menu_item *disclosure_category_pick = (menu_item *)0;
/*
* The order of disclose_names[]

View File

@@ -2133,9 +2133,7 @@ boolean put_in;
menu_item *pick_list;
int mflags, res;
long count;
boolean all_blessed, all_cursed, all_uncursed, all_buc_unknown;
all_blessed = all_cursed = all_uncursed = all_buc_unknown = FALSE;
if (retry) {
all_categories = (retry == -2);
} else if (flags.menu_style == MENU_FULL) {

View File

@@ -960,11 +960,11 @@ dogaze()
dmg = 0;
}
if((int) u.ulevel > rn2(20))
destroy_mitem(mtmp, SCROLL_CLASS, AD_FIRE);
(void) destroy_mitem(mtmp, SCROLL_CLASS, AD_FIRE);
if((int) u.ulevel > rn2(20))
destroy_mitem(mtmp, POTION_CLASS, AD_FIRE);
(void) destroy_mitem(mtmp, POTION_CLASS, AD_FIRE);
if((int) u.ulevel > rn2(25))
destroy_mitem(mtmp, SPBOOK_CLASS, AD_FIRE);
(void) destroy_mitem(mtmp, SPBOOK_CLASS, AD_FIRE);
if (dmg && !DEADMONSTER(mtmp)) mtmp->mhp -= dmg;
if (mtmp->mhp <= 0) killed(mtmp);
}

View File

@@ -91,7 +91,7 @@ doread()
u.uconduct.literate++;
if(flags.verbose)
pline("It reads:");
strcpy(buf, shirt_msgs[scroll->o_id % SIZE(shirt_msgs)]);
Strcpy(buf, shirt_msgs[scroll->o_id % SIZE(shirt_msgs)]);
erosion = greatest_erosion(scroll);
if (erosion)
wipeout_text(buf,

View File

@@ -248,7 +248,8 @@ register int nux,nuy;
/* this should only drag the chain (and never give a near-
capacity message) since we already checked ball distance */
drag_ball(u.ux, u.uy, &bc_control, &ballx, &bally, &chainx, &chainy, &cause_delay);
(void) drag_ball(u.ux, u.uy, &bc_control, &ballx, &bally,
&chainx, &chainy, &cause_delay);
move_bc(0, bc_control, ballx, bally, chainx, chainy);
} else
placebc();

View File

@@ -2316,6 +2316,7 @@ xchar x, y;
switch (obj->otyp) {
case ICE_BOX:
continue; /* Immune */
/*NOTREACHED*/
break;
case CHEST:
chance = 40;