From: jwalz Date: Sun, 10 Mar 2002 04:05:59 +0000 (+0000) Subject: Lint part 2, mostly parameters. X-Git-Tag: MOVE2GIT~3014 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3e6e2ff7c64ac19392ffbff6e114bc22f8a13856;p=nethack Lint part 2, mostly parameters. --- diff --git a/include/extern.h b/include/extern.h index faea64d93..2c32a0ed5 100644 --- a/include/extern.h +++ b/include/extern.h @@ -427,7 +427,7 @@ E int NDECL(dothrow); E int NDECL(dofire); E void FDECL(hitfloor, (struct obj *)); E void FDECL(hurtle, (int,int,int,BOOLEAN_P)); -E void FDECL(mhurtle, (struct monst *,int,int,int,BOOLEAN_P)); +E void FDECL(mhurtle, (struct monst *,int,int,int)); E void FDECL(throwit, (struct obj *,long,BOOLEAN_P)); E int FDECL(omon_adj, (struct monst *,struct obj *,BOOLEAN_P)); E int FDECL(thitmonst, (struct monst *,struct obj *)); @@ -1153,7 +1153,7 @@ E boolean FDECL(mb_trapped, (struct monst *)); E void FDECL(mon_regen, (struct monst *,BOOLEAN_P)); E int FDECL(dochugw, (struct monst *)); E boolean FDECL(onscary, (int,int,struct monst *)); -E void FDECL(monflee, (struct monst *, unsigned int, BOOLEAN_P, BOOLEAN_P)); +E void FDECL(monflee, (struct monst *, int, BOOLEAN_P, BOOLEAN_P)); E int FDECL(dochug, (struct monst *)); E int FDECL(m_move, (struct monst *,int)); E boolean FDECL(closed_door, (int,int)); diff --git a/src/detect.c b/src/detect.c index f5980c971..d7180bf18 100644 --- a/src/detect.c +++ b/src/detect.c @@ -169,7 +169,8 @@ register struct obj *sobj; struct obj *temp; boolean stale; - known = stale = clear_stale_map(GOLD_CLASS, sobj->blessed ? GOLD : 0); + known = stale = clear_stale_map(GOLD_CLASS, + (unsigned)(sobj->blessed ? GOLD : 0)); /* look for gold carried by monsters (might be in a container) */ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { diff --git a/src/dothrow.c b/src/dothrow.c index 291d558fe..675182faa 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -611,10 +611,9 @@ hurtle(dx, dy, range, verbose) /* Move a monster through the air for a few squares. */ void -mhurtle(mon, dx, dy, range, verbose) +mhurtle(mon, dx, dy, range) struct monst *mon; int dx, dy, range; - boolean verbose; { coord mc, cc; @@ -852,7 +851,7 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */ } if ((u.dx || u.dy || (u.dz < 1)) && - calc_capacity(obj->owt) > SLT_ENCUMBER && + calc_capacity((int)obj->owt) > SLT_ENCUMBER && (Upolyd ? (u.mh < 5 && u.mh != u.mhmax) : (u.uhp < 10 && u.uhp != u.uhpmax)) && obj->owt > (unsigned)((Upolyd ? u.mh : u.uhp) * 2) && diff --git a/src/engrave.c b/src/engrave.c index 108abe89b..9fdabf889 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -336,7 +336,7 @@ register int x,y; char *et; unsigned maxelen = BUFSZ - sizeof("You feel the words: \"\". "); if (strlen(ep->engr_txt) > maxelen) { - (void) strncpy(buf, ep->engr_txt, maxelen); + (void) strncpy(buf, ep->engr_txt, (int)maxelen); buf[maxelen] = '\0'; et = buf; } else diff --git a/src/hack.c b/src/hack.c index 79ff8ec4c..f1d5d8914 100644 --- a/src/hack.c +++ b/src/hack.c @@ -670,7 +670,7 @@ static void findtravelpath() int set=0; int dia=1; - (void) memset(travel,0,sizeof(travel)); + (void) memset((genericptr_t)travel,0,sizeof(travel)); travelstepx[0][0] = u.tx; travelstepy[0][0] = u.ty; diff --git a/src/mapglyph.c b/src/mapglyph.c index bd3c90857..6ea4d964b 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -56,6 +56,7 @@ int explcolors[] = { # endif #endif +/*ARGSUSED*/ void mapglyph(glyph, ochar, ocolor, ospecial, x, y) int glyph, *ocolor, x, y; diff --git a/src/mcastu.c b/src/mcastu.c index 794bdd24e..13827d482 100644 --- a/src/mcastu.c +++ b/src/mcastu.c @@ -35,8 +35,8 @@ STATIC_DCL int FDECL(choose_magic_spell, (int)); STATIC_DCL int FDECL(choose_clerical_spell, (int)); STATIC_DCL void FDECL(cast_wizard_spell,(struct monst *, int,int)); STATIC_DCL void FDECL(cast_cleric_spell,(struct monst *, int,int)); -STATIC_DCL boolean FDECL(is_undirected_spell,(int,int)); -STATIC_DCL boolean FDECL(spell_would_be_useless,(struct monst *,int,int)); +STATIC_DCL boolean FDECL(is_undirected_spell,(unsigned int,int)); +STATIC_DCL boolean FDECL(spell_would_be_useless,(struct monst *,unsigned int,int)); #ifdef OVL0 @@ -660,7 +660,7 @@ int spellnum; STATIC_DCL boolean is_undirected_spell(adtyp, spellnum) -int adtyp; +unsigned int adtyp; int spellnum; { if (adtyp == AD_SPEL) { @@ -692,8 +692,8 @@ STATIC_DCL boolean spell_would_be_useless(mtmp, adtyp, spellnum) struct monst *mtmp; +unsigned int adtyp; int spellnum; -int adtyp; { /* Some spells don't require the player to really be there and can be cast * by the monster when you're invisible, yet still shouldn't be cast when diff --git a/src/monmove.c b/src/monmove.c index 437425e13..04b48065a 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -206,10 +206,10 @@ disturb(mtmp) * if fleemsg, prints a message about new flight, otherwise, caller should */ void monflee(mtmp, fleetime, first, fleemsg) - struct monst *mtmp; - unsigned int fleetime; - boolean first; - boolean fleemsg; +struct monst *mtmp; +int fleetime; +boolean first; +boolean fleemsg; { if (u.ustuck == mtmp) { if (u.uswallow) diff --git a/src/rumors.c b/src/rumors.c index 085fa2b17..3272d1cc3 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -313,7 +313,7 @@ register struct monst *oracl; Sprintf(qbuf, "\"Wilt thou settle for a minor consultation?\" (%d %s)", - minor_cost, currency(minor_cost)); + minor_cost, currency((long)minor_cost)); switch (ynq(qbuf)) { default: case 'q': @@ -338,7 +338,7 @@ register struct monst *oracl; (oracle_cnt == 1 || oracle_flg < 0)) return 0; Sprintf(qbuf, "\"Then dost thou desire a major one?\" (%d %s)", - major_cost, currency(major_cost)); + major_cost, currency((long)major_cost)); if (yn(qbuf) != 'y') return 0; #ifndef GOLDOBJ u_pay = (u.ugold < (long)major_cost ? (int)u.ugold diff --git a/src/steed.c b/src/steed.c index 698779077..a25738a96 100644 --- a/src/steed.c +++ b/src/steed.c @@ -463,7 +463,7 @@ dismount_steed(reason) You("%s off of %s!", verb, mon_nam(mtmp)); if (!have_spot) have_spot = landing_spot(&cc,1); losehp(rn1(10,10), "riding accident", KILLED_BY_AN); - set_wounded_legs(BOTH_SIDES, HWounded_legs + rn1(5,5)); + set_wounded_legs(BOTH_SIDES, (int)HWounded_legs + rn1(5,5)); repair_leg_damage = FALSE; break; case DISMOUNT_POLY: diff --git a/src/uhitm.c b/src/uhitm.c index 7700ea27e..2ebb86be0 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -896,7 +896,7 @@ int thrown; if (jousting) { You("joust %s%s", mon_nam(mon), canseemon(mon) ? exclam(tmp) : "."); - mhurtle(mon, u.dx, u.dy, 1, TRUE); + mhurtle(mon, u.dx, u.dy, 1); hittxt = TRUE; } else #endif @@ -908,7 +908,7 @@ int thrown; if (canspotmon(mon)) pline("%s %s from your powerful strike!", Monnam(mon), makeplural(stagger(mon->data, "stagger"))); - mhurtle(mon, u.dx, u.dy, 1, TRUE); + mhurtle(mon, u.dx, u.dy, 1); hittxt = TRUE; } } @@ -918,7 +918,7 @@ int thrown; destroyed = TRUE; if (mon->mtame && (!mon->mflee || mon->mfleetim) && tmp > 0) { abuse_dog(mon); - monflee(mon, (unsigned)(10 * rnd(tmp)), FALSE, FALSE); + monflee(mon, 10 * rnd(tmp), FALSE, FALSE); } if((mdat == &mons[PM_BLACK_PUDDING] || mdat == &mons[PM_BROWN_PUDDING]) && obj && obj == uwep