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

@ -19,6 +19,7 @@
#include "curses.h"
#include <ctype.h>
#include <string.h>
#include "rogue.h"
#ifdef PC7300
#include "menu.h"
@ -41,9 +42,8 @@ static 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, *mname = "";
@ -426,8 +426,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 */
@ -486,8 +485,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 */
@ -564,7 +563,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;
@ -758,8 +758,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;
@ -1103,8 +1103,8 @@ int dy, dx;
* Start the hero running
*/
do_run(ch)
char ch;
void
do_run(char ch)
{
firstmove = TRUE;
running = TRUE;
@ -1119,11 +1119,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++)
@ -1140,8 +1138,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:
@ -1161,8 +1159,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;
@ -1338,8 +1336,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;
@ -1376,8 +1373,7 @@ register struct room *rp;
*/
short
movement(tp)
register struct thing *tp;
movement(struct thing *tp)
{
register int result;
register int carry; /* Percentage carried */
@ -1441,8 +1437,7 @@ register struct thing *tp;
*/
coord *
rndmove(who)
struct thing *who;
rndmove(struct thing *who)
{
register int x, y;
register int ex, ey, nopen = 0;
@ -1506,9 +1501,8 @@ static char Displines[TRAPTYPES+1][TRAPWIDTH+TRAPPREFIX+1];
* 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 int selection = rnd(TRAPTYPES-WIZARDTRAPS) + '1';
@ -1613,7 +1607,7 @@ register int y, x;
* Put out the selection. The longest line is
* the prompt line (39 characters long).
*/
over_win(cw, hw, num_traps + 3, 41, 0, 39, NULL);
over_win(cw, hw, num_traps + 3, 41, 0, 39, '\0');
else
draw(hw);
state = 1; /* Now in prompt window */
@ -1673,7 +1667,7 @@ register int y, x;
* Put out the selection. The longest line is
* the prompt line (43 characters long).
*/
over_win(cw, hw, num_traps+3, 45, 0, 43, NULL);
over_win(cw, hw, num_traps+3, 45, 0, 43, '\0');
else
draw(hw);
}
@ -1743,8 +1737,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;
@ -1784,8 +1778,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;
@ -1803,11 +1796,12 @@ register int y, x;
* Calculate how many segments it will take to swing the given
* weapon (note that the weapon may actually be a stick or
* even something else).
* wielder: Who's wielding the weapon
* weap: The weapon
*/
weap_move(wielder, weap)
register struct thing *wielder; /* Who's wielding the weapon */
register struct object *weap; /* The weapon */
int
weap_move(struct thing *wielder, struct object *weap)
{
register int weap_rate;
int dexterity;