Advanced Rogue 7: convert to ANSI-style function declarations.

Almost 1500 lines of compiler warnings remain, and the GCC developers
are already working on a new version with even more warnings turned on
by default.
This commit is contained in:
John "Elwin" Edwards 2016-02-19 21:02:28 -05:00
parent f38b2223c8
commit e8e6e604c3
39 changed files with 1181 additions and 889 deletions

View file

@ -25,8 +25,8 @@
* A healing daemon that restors hit points after rest
*/
doctor(tp)
register struct thing *tp;
void
doctor(struct thing *tp)
{
register int ohp;
register int limit, new_points;
@ -108,7 +108,8 @@ register struct thing *tp;
* Called when it is time to start rolling for wandering monsters
*/
swander()
void
swander(void)
{
start_daemon(rollwand, 0, BEFORE);
}
@ -120,7 +121,8 @@ swander()
int between = 0;
rollwand()
void
rollwand(void)
{
if (++between >= 4)
@ -140,7 +142,8 @@ rollwand()
/*
* this function is a daemon called each turn when the character is a thief
*/
trap_look()
void
trap_look(void)
{
if (rnd(100) < (2*dex_compute() + 5*pstats.s_lvl))
search(TRUE, FALSE);
@ -151,7 +154,8 @@ trap_look()
* Release the poor player from his confusion
*/
unconfuse()
void
unconfuse(void)
{
turn_off(player, ISHUH);
msg("You feel less confused now");
@ -162,7 +166,8 @@ unconfuse()
* unsee:
* He lost his see invisible power
*/
unsee()
void
unsee(void)
{
if (!ISWEARING(R_SEEINVIS)) {
turn_off(player, CANSEE);
@ -175,7 +180,8 @@ unsee()
* Remove to-hit handicap from player
*/
unstink()
void
unstink(void)
{
turn_off(player, HASSTINK);
}
@ -185,7 +191,8 @@ unstink()
* Player is no longer immune to confusion
*/
unclrhead()
void
unclrhead(void)
{
turn_off(player, ISCLEAR);
msg("The blue aura about your head fades away.");
@ -196,7 +203,8 @@ unclrhead()
* Player can no longer walk through walls
*/
unphase()
void
unphase(void)
{
turn_off(player, CANINWALL);
msg("Your dizzy feeling leaves you.");
@ -208,7 +216,8 @@ unphase()
* Player can no longer fly
*/
land()
void
land(void)
{
turn_off(player, ISFLY);
msg("You regain your normal weight");
@ -220,7 +229,8 @@ land()
* He gets his sight back
*/
sight()
void
sight(void)
{
if (on(player, ISBLIND))
{
@ -237,8 +247,7 @@ sight()
*/
void
res_strength(howmuch)
int howmuch;
res_strength(int howmuch)
{
/* If lost_str is non-zero, restore that amount of strength,
@ -262,7 +271,8 @@ int howmuch;
* End the hasting
*/
nohaste()
void
nohaste(void)
{
turn_off(player, ISHASTE);
msg("You feel yourself slowing down.");
@ -273,7 +283,8 @@ nohaste()
* End the slowing
*/
noslow()
void
noslow(void)
{
turn_off(player, ISSLOW);
msg("You feel yourself speeding up.");
@ -284,7 +295,8 @@ noslow()
* If this gets called, the player has suffocated
*/
suffocate()
void
suffocate(void)
{
death(D_SUFFOCATION);
}
@ -292,7 +304,8 @@ suffocate()
/*
* digest the hero's food
*/
stomach()
void
stomach(void)
{
register int oldfood, old_hunger, food_use, i;
@ -368,7 +381,8 @@ stomach()
/*
* daemon for curing the diseased
*/
cure_disease()
void
cure_disease(void)
{
turn_off(player, HASDISEASE);
if (off (player, HASINFEST))
@ -380,7 +394,8 @@ cure_disease()
* appear:
* Become visible again
*/
appear()
void
appear(void)
{
turn_off(player, ISINVIS);
PLAYER = VPLAYER;
@ -391,7 +406,8 @@ appear()
* dust_appear:
* dust of disappearance wears off
*/
dust_appear()
void
dust_appear(void)
{
turn_off(player, ISINVIS);
PLAYER = VPLAYER;
@ -402,7 +418,8 @@ dust_appear()
* unchoke:
* the effects of "dust of choking and sneezing" wear off
*/
unchoke()
void
unchoke(void)
{
if (!find_slot(unconfuse))
turn_off(player, ISHUH);
@ -414,8 +431,8 @@ unchoke()
/*
* make some potion for the guy in the Alchemy jug
*/
alchemy(obj)
register struct object *obj;
void
alchemy(struct object *obj)
{
register struct object *tobj = NULL;
register struct linked_list *item;
@ -464,7 +481,8 @@ register struct object *obj;
* otto's irresistable dance wears off
*/
undance()
void
undance(void)
{
turn_off(player, ISDANCE);
msg ("Your feet take a break.....whew!");
@ -473,14 +491,16 @@ undance()
/*
* if he has our favorite necklace of strangulation then take damage every turn
*/
strangle()
void
strangle(void)
{
if ((pstats.s_hpt -= 6) <= 0) death(D_STRANGLE);
}
/*
* if he has on the gauntlets of fumbling he might drop his weapon each turn
*/
fumble()
void
fumble(void)
{
register struct linked_list *item;
@ -519,21 +539,24 @@ fumble()
/*
* this is called each turn the hero has the ring of searching on
*/
ring_search()
void
ring_search(void)
{
search(FALSE, FALSE);
}
/*
* this is called each turn the hero has the ring of teleportation on
*/
ring_teleport()
void
ring_teleport(void)
{
if (rnd(100) < 2) teleport();
}
/*
* this is called to charge up the quill of Nagrom
*/
quill_charge()
void
quill_charge(void)
{
register struct object *tobj = NULL;
register struct linked_list *item;
@ -556,7 +579,8 @@ quill_charge()
/*
* take the skills away gained (or lost) by the potion of skills
*/
unskill()
void
unskill(void)
{
if (pstats.s_lvladj != 0) {
pstats.s_lvl -= pstats.s_lvladj;
@ -569,8 +593,8 @@ unskill()
* charge up the cloak of Emori
*/
cloak_charge(obj)
register struct object *obj;
void
cloak_charge(struct object *obj)
{
if (obj->o_charges < 1)
obj->o_charges = 1;
@ -580,7 +604,8 @@ register struct object *obj;
* nofire:
* He lost his fire resistance
*/
nofire()
void
nofire(void)
{
if (!ISWEARING(R_FIRE)) {
turn_off(player, NOFIRE);
@ -592,7 +617,8 @@ nofire()
* nocold:
* He lost his cold resistance
*/
nocold()
void
nocold(void)
{
if (!ISWEARING(R_WARMTH)) {
turn_off(player, NOCOLD);
@ -604,7 +630,8 @@ nocold()
* nobolt:
* He lost his protection from lightning
*/
nobolt()
void
nobolt(void)
{
turn_off(player, NOBOLT);
msg("Your skin looses its bluish tint");
@ -613,8 +640,8 @@ nobolt()
* eat_gold:
* an artifact eats gold
*/
eat_gold(obj)
register struct object *obj;
void
eat_gold(struct object *obj)
{
if (purse == 1)
msg("%s demand you find more gold", inv_name(obj, FALSE));
@ -628,36 +655,39 @@ register struct object *obj;
/*
* give the hero back some spell points
*/
spell_recovery()
void
spell_recovery(void)
{
int time;
time = SPELLTIME - max(17-pstats.s_intel, 0);
time = max(time, 5);
if (spell_power > 0) spell_power--;
fuse(spell_recovery, NULL, time, AFTER);
fuse(spell_recovery, 0, time, AFTER);
}
/*
* give the hero back some prayer points
*/
prayer_recovery()
void
prayer_recovery(void)
{
int time;
time = SPELLTIME - max(17-pstats.s_wisdom, 0);
time = max(time, 5);
if (pray_time > 0) pray_time--;
fuse(prayer_recovery, NULL, time, AFTER);
fuse(prayer_recovery, 0, time, AFTER);
}
/*
* give the hero back some chant points
*/
chant_recovery()
void
chant_recovery(void)
{
int time;
time = SPELLTIME - max(17-pstats.s_wisdom, 0);
time = max(time, 5);
if (chant_time > 0) chant_time--;
fuse(chant_recovery, NULL, time, AFTER);
fuse(chant_recovery, 0, time, AFTER);
}