]> granicus.if.org Git - nethack/commitdiff
Lint part 2, mostly parameters.
authorjwalz <jwalz>
Sun, 10 Mar 2002 04:05:59 +0000 (04:05 +0000)
committerjwalz <jwalz>
Sun, 10 Mar 2002 04:05:59 +0000 (04:05 +0000)
include/extern.h
src/detect.c
src/dothrow.c
src/engrave.c
src/hack.c
src/mapglyph.c
src/mcastu.c
src/monmove.c
src/rumors.c
src/steed.c
src/uhitm.c

index faea64d9309627e224579da0e84b803183da7ca1..2c32a0ed5e666efd3a0cd07fdd09789712b7df66 100644 (file)
@@ -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));
index f5980c97161a379389aa913f4ffbbc361ecc0bc9..d7180bf189549310f4768c8e3bb602d182be8c8a 100644 (file)
@@ -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) {
index 291d558fe934c589fe9e15a2ca4de10490b017c4..675182faacc54addf437facdfe0936c400150262 100644 (file)
@@ -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) &&
index 108abe89b9872bc619de7005369ceff3b151f381..9fdabf88964774f7a3b9b5f4d71b49e8c5ba05b2 100644 (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) {
-                       (void) strncpy(buf,  ep->engr_txt, maxelen);
+                       (void) strncpy(buf,  ep->engr_txt, (int)maxelen);
                        buf[maxelen] = '\0';
                        et = buf;
                } else
index 79ff8ec4cf68089b60ccee94a664f2e3fcff4698..f1d5d8914c287a74546367e87c87dd847f21c7aa 100644 (file)
@@ -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;
index bd3c908574bcff451a957eb0a950dbaf47f03e41..6ea4d964b9635abf0fad3a63fec589a39d014047 100644 (file)
@@ -56,6 +56,7 @@ int explcolors[] = {
 # endif
 #endif
 
+/*ARGSUSED*/
 void
 mapglyph(glyph, ochar, ocolor, ospecial, x, y)
 int glyph, *ocolor, x, y;
index 794bdd24e796ea51eb282c9d18746c066a936de3..13827d482fb369332ca76883c11b13988112b87b 100644 (file)
@@ -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
index 437425e13c18795a56e925cac86749f78549cd77..04b48065a1321990dc505f2c39b41d8d80ec6755 100644 (file)
@@ -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)
index 085fa2b17a7c5db95fc2923bc88e2a575c00d210..3272d1cc34db91d64b8ba9260738c2b1cf60651a 100644 (file)
@@ -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
index 698779077cc77b6de74ebf8d15a67ac824b832f9..a25738a96e15380ede14e397d3040bfeca109102 100644 (file)
@@ -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:
index 7700ea27e993bc73584705e7dedcf1b8a0db5802..2ebb86be0e43e7cc15c0f54817ab2ecd4b868e8b 100644 (file)
@@ -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