switch source tree from k&r to c99

This commit is contained in:
nhmall
2021-01-26 21:06:16 -05:00
parent a2a9cb7b4f
commit f963c5aca7
232 changed files with 12099 additions and 17782 deletions

View File

@@ -9,12 +9,11 @@
#define ALGN_SINNED (-4) /* worse than strayed (-1..-3) */
#define ALGN_PIOUS 14 /* better than fervent (9..13) */
static boolean FDECL(histemple_at, (struct monst *, XCHAR_P, XCHAR_P));
static boolean FDECL(has_shrine, (struct monst *));
static boolean histemple_at(struct monst *, xchar, xchar);
static boolean has_shrine(struct monst *);
void
newepri(mtmp)
struct monst *mtmp;
newepri(struct monst *mtmp)
{
if (!mtmp->mextra)
mtmp->mextra = newmextra();
@@ -25,8 +24,7 @@ struct monst *mtmp;
}
void
free_epri(mtmp)
struct monst *mtmp;
free_epri(struct monst *mtmp)
{
if (mtmp->mextra && EPRI(mtmp)) {
free((genericptr_t) EPRI(mtmp));
@@ -40,12 +38,9 @@ struct monst *mtmp;
* Valid returns are 1: moved 0: didn't -1: let m_move do it -2: died.
*/
int
move_special(mtmp, in_his_shop, appr, uondoor, avoid, omx, omy, gx, gy)
register struct monst *mtmp;
boolean in_his_shop;
schar appr;
boolean uondoor, avoid;
register xchar omx, omy, gx, gy;
move_special(struct monst *mtmp, boolean in_his_shop, schar appr,
boolean uondoor, boolean avoid,
xchar omx, xchar omy, xchar gx, xchar gy)
{
register xchar nx, ny, nix, niy;
register schar i;
@@ -140,8 +135,7 @@ pick_move:
}
char
temple_occupied(array)
register char *array;
temple_occupied(char *array)
{
register char *ptr;
@@ -152,9 +146,7 @@ register char *array;
}
static boolean
histemple_at(priest, x, y)
register struct monst *priest;
register xchar x, y;
histemple_at(struct monst *priest, xchar x, xchar y)
{
return (boolean) (priest && priest->ispriest
&& (EPRI(priest)->shroom == *in_rooms(x, y, TEMPLE))
@@ -162,8 +154,7 @@ register xchar x, y;
}
boolean
inhistemple(priest)
struct monst *priest;
inhistemple(struct monst *priest)
{
/* make sure we have a priest */
if (!priest || !priest->ispriest)
@@ -179,8 +170,7 @@ struct monst *priest;
* pri_move: return 1: moved 0: didn't -1: let m_move do it -2: died
*/
int
pri_move(priest)
register struct monst *priest;
pri_move(struct monst *priest)
{
register xchar gx, gy, omx, omy;
schar temple;
@@ -223,11 +213,8 @@ register struct monst *priest;
/* exclusively for mktemple() */
void
priestini(lvl, sroom, sx, sy, sanctum)
d_level *lvl;
struct mkroom *sroom;
int sx, sy;
boolean sanctum; /* is it the seat of the high priest? */
priestini(d_level *lvl, struct mkroom *sroom, int sx, int sy,
boolean sanctum) /* is it the seat of the high priest? */
{
struct monst *priest;
struct obj *otmp;
@@ -282,8 +269,7 @@ boolean sanctum; /* is it the seat of the high priest? */
/* get a monster's alignment type without caller needing EPRI & EMIN */
aligntyp
mon_aligntyp(mon)
struct monst *mon;
mon_aligntyp(struct monst *mon)
{
aligntyp algn = mon->ispriest ? EPRI(mon)->shralign
: mon->isminion ? EMIN(mon)->min_align
@@ -305,9 +291,8 @@ struct monst *mon;
* the true name even when under that influence
*/
char *
priestname(mon, pname)
register struct monst *mon;
char *pname; /* caller-supplied output buffer */
priestname(struct monst *mon,
char *pname) /* caller-supplied output buffer */
{
boolean do_hallu = Hallucination,
aligned_priest = mon->data == &mons[PM_ALIGNED_CLERIC],
@@ -356,15 +341,13 @@ char *pname; /* caller-supplied output buffer */
}
boolean
p_coaligned(priest)
struct monst *priest;
p_coaligned(struct monst *priest)
{
return (boolean) (u.ualign.type == mon_aligntyp(priest));
}
static boolean
has_shrine(pri)
struct monst *pri;
has_shrine(struct monst *pri)
{
struct rm *lev;
struct epri *epri_p;
@@ -380,8 +363,7 @@ struct monst *pri;
}
struct monst *
findpriest(roomno)
char roomno;
findpriest(char roomno)
{
register struct monst *mtmp;
@@ -397,8 +379,7 @@ char roomno;
/* called from check_special_room() when the player enters the temple room */
void
intemple(roomno)
int roomno;
intemple(int roomno)
{
struct monst *priest, *mtmp;
struct epri *epri_p;
@@ -530,8 +511,7 @@ int roomno;
/* reset the move counters used to limit temple entry feedback;
leaving the level and then returning yields a fresh start */
void
forget_temple_entry(priest)
struct monst *priest;
forget_temple_entry(struct monst *priest)
{
struct epri *epri_p = priest->ispriest ? EPRI(priest) : 0;
@@ -544,8 +524,7 @@ struct monst *priest;
}
void
priest_talk(priest)
register struct monst *priest;
priest_talk(struct monst *priest)
{
boolean coaligned = p_coaligned(priest);
boolean strayed = (u.ualign.record < 0);
@@ -659,11 +638,8 @@ register struct monst *priest;
}
struct monst *
mk_roamer(ptr, alignment, x, y, peaceful)
register struct permonst *ptr;
aligntyp alignment;
xchar x, y;
boolean peaceful;
mk_roamer(struct permonst *ptr, aligntyp alignment, xchar x, xchar y,
boolean peaceful)
{
register struct monst *roamer;
register boolean coaligned = (u.ualign.type == alignment);
@@ -693,8 +669,7 @@ boolean peaceful;
}
void
reset_hostility(roamer)
register struct monst *roamer;
reset_hostility(struct monst *roamer)
{
if (!roamer->isminion)
return;
@@ -710,9 +685,8 @@ register struct monst *roamer;
}
boolean
in_your_sanctuary(mon, x, y)
struct monst *mon; /* if non-null, <mx,my> overrides <x,y> */
xchar x, y;
in_your_sanctuary(struct monst *mon, /* if non-null, <mx,my> overrides <x,y> */
xchar x, xchar y)
{
register char roomno;
register struct monst *priest;
@@ -735,8 +709,7 @@ xchar x, y;
/* when attacking "priest" in his temple */
void
ghod_hitsu(priest)
struct monst *priest;
ghod_hitsu(struct monst *priest)
{
int x, y, ax, ay, roomno = (int) temple_occupied(u.urooms);
struct mkroom *troom;
@@ -808,7 +781,7 @@ struct monst *priest;
}
void
angry_priest()
angry_priest(void)
{
register struct monst *priest;
struct rm *lev;
@@ -849,7 +822,7 @@ angry_priest()
* [Perhaps we should convert them into roamers instead?]
*/
void
clearpriests()
clearpriests(void)
{
struct monst *mtmp;
@@ -863,9 +836,7 @@ clearpriests()
/* munge priest-specific structure when restoring -dlc */
void
restpriest(mtmp, ghostly)
register struct monst *mtmp;
boolean ghostly;
restpriest(struct monst *mtmp, boolean ghostly)
{
if (u.uz.dlevel) {
if (ghostly)