XRogue: convert to ANSI-style function declarations.

This commit is contained in:
John "Elwin" Edwards 2016-03-02 21:13:26 -05:00
parent e8e6e604c3
commit 2853120387
41 changed files with 1281 additions and 908 deletions

View file

@ -24,8 +24,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;
@ -111,7 +111,8 @@ register struct thing *tp;
* Called when it is time to start rolling for wandering monsters
*/
swander()
void
swander(void)
{
start_daemon(rollwand, (VOID *)NULL, BEFORE);
}
@ -123,7 +124,8 @@ swander()
int between = 0;
rollwand()
void
rollwand(void)
{
if (++between >= 4)
@ -145,7 +147,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);
@ -156,7 +159,8 @@ trap_look()
* Release the poor player from his confusion
*/
unconfuse()
void
unconfuse(void)
{
turn_off(player, ISHUH);
msg("You feel less confused now");
@ -167,7 +171,8 @@ unconfuse()
* He lost his see invisible power
*/
unsee()
void
unsee(void)
{
if (!ISWEARING(R_SEEINVIS)) {
turn_off(player, CANSEE);
@ -180,7 +185,8 @@ unsee()
* Remove to-hit handicap from player
*/
unstink()
void
unstink(void)
{
turn_off(player, HASSTINK);
}
@ -190,7 +196,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.");
@ -201,7 +208,8 @@ unclrhead()
* Player can no longer walk through walls
*/
unphase()
void
unphase(void)
{
turn_off(player, CANINWALL);
msg("Your dizzy feeling leaves you.");
@ -215,7 +223,7 @@ unphase()
*/
int
land()
land(void)
{
turn_off(player, ISFLY);
msg("You regain your normal weight");
@ -228,7 +236,8 @@ land()
* He gets his sight back
*/
sight()
void
sight(void)
{
if (on(player, ISBLIND))
{
@ -245,8 +254,7 @@ sight()
*/
int
res_strength(howmuch)
long howmuch;
res_strength(long howmuch)
{
/* If lost_str is non-zero, restore that amount of strength,
@ -271,7 +279,8 @@ long howmuch;
* End the hasting
*/
nohaste()
void
nohaste(void)
{
turn_off(player, ISHASTE);
msg("You feel yourself slowing down.");
@ -282,7 +291,8 @@ nohaste()
* End the slowing
*/
noslow()
void
noslow(void)
{
turn_off(player, ISSLOW);
msg("You feel yourself speeding up.");
@ -293,7 +303,8 @@ noslow()
* If this gets called, the player has suffocated
*/
suffocate()
void
suffocate(void)
{
pstats.s_hpt = -1;
death(D_SUFFOCATION);
@ -303,7 +314,8 @@ suffocate()
* digest the hero's food
*/
stomach()
void
stomach(void)
{
register int oldfood, old_hunger, food_use, i;
@ -387,7 +399,8 @@ stomach()
* daemon for curing the diseased
*/
cure_disease()
void
cure_disease(void)
{
turn_off(player, HASDISEASE);
if (off (player, HASINFEST))
@ -400,7 +413,8 @@ cure_disease()
* Become visible again
*/
appear()
void
appear(void)
{
turn_off(player, ISINVIS);
PLAYER = VPLAYER;
@ -413,7 +427,8 @@ appear()
* dust of disappearance wears off
*/
dust_appear()
void
dust_appear(void)
{
turn_off(player, ISINVIS);
PLAYER = VPLAYER;
@ -426,7 +441,8 @@ dust_appear()
* the effects of "dust of choking and sneezing" wear off
*/
unchoke()
void
unchoke(void)
{
if (!find_slot(unconfuse))
turn_off(player, ISHUH);
@ -440,8 +456,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;
@ -492,7 +508,7 @@ register struct object *obj;
*/
int
undance()
undance(void)
{
turn_off(player, ISDANCE);
msg ("Your feet take a break.....whew!");
@ -503,7 +519,8 @@ undance()
* if he has our favorite necklace of strangulation then take damage every turn
*/
strangle()
void
strangle(void)
{
if ((pstats.s_hpt -= 6) <= 0) {
pstats.s_hpt = -1;
@ -515,7 +532,8 @@ 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;
@ -557,7 +575,8 @@ fumble()
* it's a lot like trap_look()
*/
ring_search()
void
ring_search(void)
{
if (rnd(75) < (2*dex_compute() + 5*pstats.s_lvl)) search(TRUE, FALSE);
else search(FALSE, FALSE);
@ -567,7 +586,8 @@ ring_search()
* this is called each turn the hero has the ring of teleportation on
*/
ring_teleport()
void
ring_teleport(void)
{
if (rnd(100) < 3) teleport();
}
@ -576,7 +596,8 @@ ring_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;
@ -601,7 +622,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;
@ -616,8 +638,7 @@ unskill()
*/
int
cloak_charge(obj)
register struct object *obj;
cloak_charge(struct object *obj)
{
if (obj->o_charges < 1)
obj->o_charges = 1;
@ -629,7 +650,8 @@ register struct object *obj;
* He lost his fire resistance
*/
nofire()
void
nofire(void)
{
if (!ISWEARING(R_FIRE)) {
turn_off(player, NOFIRE);
@ -642,7 +664,8 @@ nofire()
* He lost his cold resistance
*/
nocold()
void
nocold(void)
{
if (!ISWEARING(R_WARMTH)) {
turn_off(player, NOCOLD);
@ -655,7 +678,8 @@ nocold()
* He lost his protection from lightning
*/
nobolt()
void
nobolt(void)
{
turn_off(player, NOBOLT);
msg("Your skin loses its bluish tint");
@ -666,8 +690,8 @@ nobolt()
* an artifact eats gold
*/
eat_gold(obj)
register struct object *obj;
void
eat_gold(struct object *obj)
{
if (purse == 250)
msg("%s.. Bids you to find some more gold. ", inv_name(obj, FALSE));
@ -691,7 +715,8 @@ register struct object *obj;
* give the hero back some spell points
*/
spell_recovery()
void
spell_recovery(void)
{
int time;
@ -705,7 +730,8 @@ spell_recovery()
* give the hero back some prayer points
*/
prayer_recovery()
void
prayer_recovery(void)
{
int time;
@ -719,7 +745,8 @@ prayer_recovery()
* give the hero back some chant points
*/
chant_recovery()
void
chant_recovery(void)
{
int time;