Advanced Rogue 5: convert to ANSI function declarations.

This still leaves over a thousand lines of warning messages, mostly
related to the return types of daemons and fuses.
This commit is contained in:
John "Elwin" Edwards 2016-02-07 14:39:21 -05:00
parent 59f448e92e
commit f38b2223c8
37 changed files with 977 additions and 733 deletions

View file

@ -37,9 +37,8 @@ static const char Moves[3][3] = {
* The guy stepped on a trap.... Make him pay.
*/
be_trapped(th, tc)
register struct thing *th;
register coord *tc;
char
be_trapped(struct thing *th, coord *tc)
{
register struct trap *tp;
register char ch;
@ -353,8 +352,7 @@ register coord *tc;
*/
bool
blue_light(blessed, cursed)
bool blessed, cursed;
blue_light(bool blessed, bool cursed)
{
register struct room *rp;
bool ret_val=FALSE; /* Whether or not affect is known */
@ -413,8 +411,8 @@ bool blessed, cursed;
* If not, if player came from a legal place, then try to turn him.
*/
corr_move(dy, dx)
int dy, dx;
void
corr_move(int dy, int dx)
{
int legal=0; /* Number of legal alternatives */
register int y, x, /* Indexes though possible positions */
@ -491,7 +489,8 @@ int dy, dx;
* dip_it:
* Dip an object into a magic pool
*/
dip_it()
void
dip_it(void)
{
reg struct linked_list *what;
reg struct object *ob;
@ -667,8 +666,8 @@ dip_it()
* consequences (fighting, picking up, etc.)
*/
do_move(dy, dx)
int dy, dx;
void
do_move(int dy, int dx)
{
register struct room *rp, *orp;
register char ch;
@ -878,8 +877,8 @@ int dy, dx;
* Start the hero running
*/
do_run(ch)
char ch;
void
do_run(char ch)
{
firstmove = TRUE;
running = TRUE;
@ -894,11 +893,9 @@ char ch;
* Returns TRUE if it could find it, FALSE otherwise.
*/
bool
getdelta(match, dy, dx)
char match;
int *dy, *dx;
getdelta(char match, int *dy, int *dx)
{
register y, x;
int y, x;
for (y = 0; y < 3; y++)
for (x = 0; x < 3; x++)
@ -915,8 +912,8 @@ int *dy, *dx;
* isatrap:
* Returns TRUE if this character is some kind of trap
*/
isatrap(ch)
reg char ch;
bool
isatrap(char ch)
{
switch(ch) {
case DARTTRAP:
@ -936,8 +933,8 @@ reg char ch;
* If it is dark, remove anything that might move.
*/
light(cp)
coord *cp;
void
light(coord *cp)
{
register struct room *rp;
register int j, k, x, y;
@ -1113,8 +1110,7 @@ coord *cp;
*/
bool
lit_room(rp)
register struct room *rp;
lit_room(struct room *rp)
{
register struct linked_list *fire_item;
register struct thing *fire_creature;
@ -1150,8 +1146,7 @@ register struct room *rp;
*/
coord *
rndmove(who)
struct thing *who;
rndmove(struct thing *who)
{
register int x, y;
register int ex, ey, nopen = 0;
@ -1192,9 +1187,8 @@ struct thing *who;
* set a trap at (y, x) on screen.
*/
set_trap(tp, y, x)
register struct thing *tp;
register int y, x;
void
set_trap(struct thing *tp, int y, int x)
{
register bool is_player = (tp == &player);
register char selection = rnd(7) + '1';
@ -1330,8 +1324,8 @@ register int y, x;
* returns what a certain thing will display as to the un-initiated
*/
show(y, x)
register int y, x;
char
show(int y, int x)
{
register char ch = CCHAR( winat(y, x) );
register struct linked_list *it;
@ -1371,8 +1365,7 @@ register int y, x;
*/
struct trap *
trap_at(y, x)
register int y, x;
trap_at(int y, int x)
{
register struct trap *tp, *ep;