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

@ -18,19 +18,23 @@
*/
#include <ctype.h>
#include <string.h>
#include "curses.h"
#include "rogue.h"
#ifdef PC7300
#include "menu.h"
#endif
bool pick_spell(struct spells spells[], int ability, int num_spells, int power,
char *prompt, char *type);
/*
* affect:
* cleric affecting undead
*/
affect()
void
affect(void)
{
register struct linked_list *item;
register struct thing *tp;
@ -147,7 +151,8 @@ annoy:
/*
* the magic user is going to try and cast a spell
*/
cast()
void
cast(void)
{
int spell_ability,
which_spell,
@ -202,7 +207,7 @@ cast()
if (magic_spells[which_spell].s_type == TYP_POTION)
quaff( magic_spells[which_spell].s_which,
NULL,
0,
magic_spells[which_spell].s_flag,
FALSE);
else if (magic_spells[which_spell].s_type == TYP_SCROLL)
@ -222,7 +227,8 @@ cast()
/*
* the druid asks his deity for a spell
*/
chant()
void
chant(void)
{
register int num_chants,
chant_ability,
@ -290,7 +296,7 @@ chant()
if (druid_spells[which_chant].s_type == TYP_POTION)
quaff( druid_spells[which_chant].s_which,
NULL,
0,
druid_spells[which_chant].s_flag,
FALSE);
else if (druid_spells[which_chant].s_type == TYP_SCROLL)
@ -309,7 +315,8 @@ chant()
/* Constitution bonus */
const_bonus() /* Hit point adjustment for changing levels */
int
const_bonus(void) /* Hit point adjustment for changing levels */
{
register int bonus;
if (pstats.s_const > 6 && pstats.s_const <= 14)
@ -343,7 +350,8 @@ const_bonus() /* Hit point adjustment for changing levels */
* Sense gold
*/
gsense()
void
gsense(void)
{
/* Only thieves can do this */
if (player.t_ctype != C_THIEF && player.t_ctype != C_ASSASIN) {
@ -351,13 +359,14 @@ gsense()
return;
}
read_scroll(S_GFIND, NULL, FALSE);
read_scroll(S_GFIND, 0, FALSE);
}
/*
* the cleric asks his deity for a spell
*/
pray()
void
pray(void)
{
register int num_prayers,
prayer_ability,
@ -430,7 +439,7 @@ pray()
if (cleric_spells[which_prayer].s_type == TYP_POTION)
quaff( cleric_spells[which_prayer].s_which,
NULL,
0,
cleric_spells[which_prayer].s_flag,
FALSE);
else if (cleric_spells[which_prayer].s_type == TYP_SCROLL)
@ -454,7 +463,8 @@ pray()
* Steal in direction given in delta
*/
steal()
void
steal(void)
{
register struct linked_list *item;
register struct thing *tp;
@ -586,14 +596,16 @@ static char Displines[MAXSPELLS+1][LINELEN+1]; /* The lines themselves */
/*
* this routine lets the player pick the spell that they
* want to cast regardless of character class
* spells: spell list
* ability: spell ability
* num_spells: number of spells that can be cast
* power: spell power
* prompt: prompt for spell list
* type: type of thing--> spell, prayer, chant
*/
pick_spell(spells, ability, num_spells, power, prompt, type)
struct spells spells[]; /* spell list */
int ability; /* spell ability */
int num_spells; /* number of spells that can be cast */
int power; /* spell power */
char *prompt; /* prompt for spell list */
char *type; /* type of thing--> spell, prayer, chant */
bool
pick_spell(struct spells spells[], int ability, int num_spells, int power,
char *prompt, char *type)
{
bool nohw = FALSE;
register int i;
@ -754,7 +766,7 @@ char *type; /* type of thing--> spell, prayer, chant */
#endif
/* Should we overlay? */
if (menu_overlay && num_spells + 3 < lines / 2) {
over_win(cw, hw, num_spells + 5, maxlen + 3, 0, curlen, NULL);
over_win(cw, hw, num_spells + 5, maxlen + 3, 0, curlen, '\0');
}
else draw(hw);
}
@ -780,7 +792,7 @@ char *type; /* type of thing--> spell, prayer, chant */
/* Should we overlay? */
if (menu_overlay && num_spells + 3 < lines / 2) {
over_win(cw, hw, num_spells + 5, maxlen + 3,
0, curlen, NULL);
0, curlen, '\0');
}
else draw(hw);