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

@@ -11,19 +11,19 @@
#define Not_firsttime (on_level(&u.uz0, &u.uz))
#define Qstat(x) (g.quest_status.x)
static void NDECL(on_start);
static void NDECL(on_locate);
static void NDECL(on_goal);
static boolean NDECL(not_capable);
static int FDECL(is_pure, (BOOLEAN_P));
static void FDECL(expulsion, (BOOLEAN_P));
static void NDECL(chat_with_leader);
static void NDECL(chat_with_nemesis);
static void NDECL(chat_with_guardian);
static void FDECL(prisoner_speaks, (struct monst *));
static void on_start(void);
static void on_locate(void);
static void on_goal(void);
static boolean not_capable(void);
static int is_pure(boolean);
static void expulsion(boolean);
static void chat_with_leader(void);
static void chat_with_nemesis(void);
static void chat_with_guardian(void);
static void prisoner_speaks(struct monst *);
static void
on_start()
on_start(void)
{
if (!Qstat(first_start)) {
qt_pager("firsttime");
@@ -37,7 +37,7 @@ on_start()
}
static void
on_locate()
on_locate(void)
{
/* the locate messages are phrased in a manner such that they only
make sense when arriving on the level from above */
@@ -59,7 +59,7 @@ on_locate()
}
static void
on_goal()
on_goal(void)
{
if (Qstat(killed_nemesis)) {
return;
@@ -87,7 +87,7 @@ on_goal()
}
void
onquest()
onquest(void)
{
if (u.uevent.qcompleted || Not_firsttime)
return;
@@ -104,7 +104,7 @@ onquest()
}
void
nemdead()
nemdead(void)
{
if (!Qstat(killed_nemesis)) {
Qstat(killed_nemesis) = TRUE;
@@ -113,8 +113,7 @@ nemdead()
}
void
artitouch(obj)
struct obj *obj;
artitouch(struct obj *obj)
{
if (!Qstat(touched_artifact)) {
/* in case we haven't seen the item yet (ie, currently blinded),
@@ -129,21 +128,20 @@ struct obj *obj;
/* external hook for do.c (level change check) */
boolean
ok_to_quest()
ok_to_quest(void)
{
return (boolean) ((Qstat(got_quest) || Qstat(got_thanks))
&& is_pure(FALSE) > 0);
}
static boolean
not_capable()
not_capable(void)
{
return (boolean) (u.ulevel < MIN_QUEST_LEVEL);
}
static int
is_pure(talk)
boolean talk;
is_pure(boolean talk)
{
int purity;
aligntyp original_alignment = u.ualignbase[A_ORIGINAL];
@@ -176,8 +174,7 @@ boolean talk;
* there is a single branch to and from it.
*/
static void
expulsion(seal)
boolean seal;
expulsion(boolean seal)
{
branch *br;
d_level *dest;
@@ -214,8 +211,8 @@ boolean seal;
give another message about the character keeping the artifact
and using the magic portal to return to the dungeon. */
void
finish_quest(obj)
struct obj *obj; /* quest artifact; possibly null if carrying Amulet */
finish_quest(struct obj *obj) /* quest artifact; possibly null if carrying
Amulet */
{
struct obj *otmp;
@@ -243,7 +240,7 @@ struct obj *obj; /* quest artifact; possibly null if carrying Amulet */
}
static void
chat_with_leader()
chat_with_leader(void)
{
/* Rule 0: Cheater checks. */
if (u.uhave.questart && !Qstat(met_nemesis))
@@ -317,8 +314,7 @@ chat_with_leader()
}
void
leader_speaks(mtmp)
struct monst *mtmp;
leader_speaks(struct monst *mtmp)
{
/* maybe you attacked leader? */
if (!mtmp->mpeaceful) {
@@ -338,7 +334,7 @@ struct monst *mtmp;
}
static void
chat_with_nemesis()
chat_with_nemesis(void)
{
/* The nemesis will do most of the talking, but... */
qt_pager("discourage");
@@ -347,7 +343,7 @@ chat_with_nemesis()
}
void
nemesis_speaks()
nemesis_speaks(void)
{
if (!Qstat(in_battle)) {
if (u.uhave.questart)
@@ -369,7 +365,7 @@ nemesis_speaks()
}
static void
chat_with_guardian()
chat_with_guardian(void)
{
/* These guys/gals really don't have much to say... */
if (u.uhave.questart && Qstat(killed_nemesis))
@@ -379,8 +375,7 @@ chat_with_guardian()
}
static void
prisoner_speaks(mtmp)
struct monst *mtmp;
prisoner_speaks(struct monst *mtmp)
{
if (mtmp->data == &mons[PM_PRISONER]
&& (mtmp->mstrategy & STRAT_WAITMASK)) {
@@ -401,8 +396,7 @@ struct monst *mtmp;
}
void
quest_chat(mtmp)
register struct monst *mtmp;
quest_chat(struct monst *mtmp)
{
if (mtmp->m_id == Qstat(leader_m_id)) {
chat_with_leader();
@@ -421,8 +415,7 @@ register struct monst *mtmp;
}
void
quest_talk(mtmp)
struct monst *mtmp;
quest_talk(struct monst *mtmp)
{
if (mtmp->m_id == Qstat(leader_m_id)) {
leader_speaks(mtmp);
@@ -441,8 +434,7 @@ struct monst *mtmp;
}
void
quest_stat_check(mtmp)
struct monst *mtmp;
quest_stat_check(struct monst *mtmp)
{
if (mtmp->data->msound == MS_NEMESIS)
Qstat(in_battle) = (mtmp->mcanmove && !mtmp->msleeping