switch source tree from k&r to c99
This commit is contained in:
60
src/dog.c
60
src/dog.c
@@ -5,11 +5,10 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static int NDECL(pet_type);
|
||||
static int pet_type(void);
|
||||
|
||||
void
|
||||
newedog(mtmp)
|
||||
struct monst *mtmp;
|
||||
newedog(struct monst *mtmp)
|
||||
{
|
||||
if (!mtmp->mextra)
|
||||
mtmp->mextra = newmextra();
|
||||
@@ -20,8 +19,7 @@ struct monst *mtmp;
|
||||
}
|
||||
|
||||
void
|
||||
free_edog(mtmp)
|
||||
struct monst *mtmp;
|
||||
free_edog(struct monst *mtmp)
|
||||
{
|
||||
if (mtmp->mextra && EDOG(mtmp)) {
|
||||
free((genericptr_t) EDOG(mtmp));
|
||||
@@ -31,8 +29,7 @@ struct monst *mtmp;
|
||||
}
|
||||
|
||||
void
|
||||
initedog(mtmp)
|
||||
register struct monst *mtmp;
|
||||
initedog(struct monst *mtmp)
|
||||
{
|
||||
mtmp->mtame = is_domestic(mtmp->data) ? 10 : 5;
|
||||
mtmp->mpeaceful = 1;
|
||||
@@ -54,7 +51,7 @@ register struct monst *mtmp;
|
||||
}
|
||||
|
||||
static int
|
||||
pet_type()
|
||||
pet_type(void)
|
||||
{
|
||||
if (g.urole.petnum != NON_PM)
|
||||
return g.urole.petnum;
|
||||
@@ -67,10 +64,7 @@ pet_type()
|
||||
}
|
||||
|
||||
struct monst *
|
||||
make_familiar(otmp, x, y, quietly)
|
||||
register struct obj *otmp;
|
||||
xchar x, y;
|
||||
boolean quietly;
|
||||
make_familiar(struct obj *otmp, xchar x, xchar y, boolean quietly)
|
||||
{
|
||||
struct permonst *pm;
|
||||
struct monst *mtmp = 0;
|
||||
@@ -149,7 +143,7 @@ boolean quietly;
|
||||
}
|
||||
|
||||
struct monst *
|
||||
makedog()
|
||||
makedog(void)
|
||||
{
|
||||
register struct monst *mtmp;
|
||||
register struct obj *otmp;
|
||||
@@ -202,7 +196,7 @@ makedog()
|
||||
/* record `last move time' for all monsters prior to level save so that
|
||||
mon_arrive() can catch up for lost time when they're restored later */
|
||||
void
|
||||
update_mlstmv()
|
||||
update_mlstmv(void)
|
||||
{
|
||||
struct monst *mon;
|
||||
|
||||
@@ -216,7 +210,7 @@ update_mlstmv()
|
||||
}
|
||||
|
||||
void
|
||||
losedogs()
|
||||
losedogs(void)
|
||||
{
|
||||
register struct monst *mtmp, *mtmp0, *mtmp2;
|
||||
int dismissKops = 0;
|
||||
@@ -298,9 +292,7 @@ losedogs()
|
||||
|
||||
/* called from resurrect() in addition to losedogs() */
|
||||
void
|
||||
mon_arrive(mtmp, with_you)
|
||||
struct monst *mtmp;
|
||||
boolean with_you;
|
||||
mon_arrive(struct monst *mtmp, boolean with_you)
|
||||
{
|
||||
struct trap *t;
|
||||
xchar xlocale, ylocale, xyloc, xyflags, wander;
|
||||
@@ -481,9 +473,8 @@ boolean with_you;
|
||||
|
||||
/* heal monster for time spent elsewhere */
|
||||
void
|
||||
mon_catchup_elapsed_time(mtmp, nmv)
|
||||
struct monst *mtmp;
|
||||
long nmv; /* number of moves */
|
||||
mon_catchup_elapsed_time(struct monst *mtmp,
|
||||
long nmv) /* number of moves */
|
||||
{
|
||||
int imv = 0; /* avoid zillions of casts and lint warnings */
|
||||
|
||||
@@ -581,8 +572,7 @@ long nmv; /* number of moves */
|
||||
|
||||
/* called when you move to another level */
|
||||
void
|
||||
keepdogs(pets_only)
|
||||
boolean pets_only; /* true for ascension or final escape */
|
||||
keepdogs(boolean pets_only) /* true for ascension or final escape */
|
||||
{
|
||||
register struct monst *mtmp, *mtmp2;
|
||||
register struct obj *obj;
|
||||
@@ -692,11 +682,10 @@ boolean pets_only; /* true for ascension or final escape */
|
||||
}
|
||||
|
||||
void
|
||||
migrate_to_level(mtmp, tolev, xyloc, cc)
|
||||
register struct monst *mtmp;
|
||||
xchar tolev; /* destination level */
|
||||
xchar xyloc; /* MIGR_xxx destination xy location: */
|
||||
coord *cc; /* optional destination coordinates */
|
||||
migrate_to_level(struct monst *mtmp,
|
||||
xchar tolev, /* destination level */
|
||||
xchar xyloc, /* MIGR_xxx destination xy location: */
|
||||
coord *cc) /* optional destination coordinates */
|
||||
{
|
||||
struct obj *obj;
|
||||
d_level new_lev;
|
||||
@@ -752,9 +741,7 @@ coord *cc; /* optional destination coordinates */
|
||||
/* return quality of food; the lower the better */
|
||||
/* fungi will eat even tainted food */
|
||||
int
|
||||
dogfood(mon, obj)
|
||||
struct monst *mon;
|
||||
register struct obj *obj;
|
||||
dogfood(struct monst *mon, struct obj *obj)
|
||||
{
|
||||
struct permonst *mptr = mon->data, *fptr = 0;
|
||||
boolean carni = carnivorous(mptr), herbi = herbivorous(mptr),
|
||||
@@ -900,9 +887,7 @@ register struct obj *obj;
|
||||
* succeeded.
|
||||
*/
|
||||
boolean
|
||||
tamedog(mtmp, obj)
|
||||
register struct monst *mtmp;
|
||||
register struct obj *obj;
|
||||
tamedog(struct monst *mtmp, struct obj *obj)
|
||||
{
|
||||
/* The Wiz, Medusa and the quest nemeses aren't even made peaceful. */
|
||||
if (mtmp->iswiz || mtmp->data == &mons[PM_MEDUSA]
|
||||
@@ -996,9 +981,7 @@ register struct obj *obj;
|
||||
* If the pet wasn't abused and was very tame, it might revive tame.
|
||||
*/
|
||||
void
|
||||
wary_dog(mtmp, was_dead)
|
||||
struct monst *mtmp;
|
||||
boolean was_dead;
|
||||
wary_dog(struct monst *mtmp, boolean was_dead)
|
||||
{
|
||||
struct edog *edog;
|
||||
boolean quietly = was_dead;
|
||||
@@ -1067,8 +1050,7 @@ boolean was_dead;
|
||||
}
|
||||
|
||||
void
|
||||
abuse_dog(mtmp)
|
||||
struct monst *mtmp;
|
||||
abuse_dog(struct monst *mtmp)
|
||||
{
|
||||
if (!mtmp->mtame)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user