Super-Rogue: convert to ANSI-style function declarations.

This fixes most of the build warnings.
This commit is contained in:
John "Elwin" Edwards 2016-01-31 13:45:07 -05:00
parent 0f87d5b4d8
commit 59f448e92e
33 changed files with 783 additions and 518 deletions

View file

@ -14,6 +14,7 @@
* See the file LICENSE.TXT for full copyright and licensing information.
*/
#include <string.h>
#include <ctype.h>
#include "rogue.h"
#include "rogue.ext"
@ -29,8 +30,8 @@ struct coord nh;
* Start the hero running
*/
do_run(ch)
char ch;
void
do_run(char ch)
{
running = TRUE;
after = FALSE;
@ -43,8 +44,8 @@ char ch;
* consequences (fighting, picking up, etc.)
*/
do_move(dy, dx)
int dy, dx;
void
do_move(int dy, int dx)
{
reg int ch;
reg struct room *rp;
@ -209,8 +210,8 @@ int dy, dx;
* Called to illuminate a room.
* If it is dark, remove anything that might move.
*/
light(cp)
struct coord *cp;
void
light(struct coord *cp)
{
reg struct room *rp;
reg int j, k, x, y;
@ -291,8 +292,8 @@ struct coord *cp;
* show:
* returns what a certain thing will display as to the un-initiated
*/
show(y, x)
int y, x;
char
show(int y, int x)
{
reg char ch = winat(y, x);
reg struct linked_list *it;
@ -330,9 +331,8 @@ int y, x;
* be_trapped:
* Hero or monster stepped on a trap.
*/
be_trapped(tc, th)
struct thing *th;
struct coord *tc;
int
be_trapped(struct coord *tc, struct thing *th)
{
reg struct trap *trp;
reg int ch, ishero;
@ -340,7 +340,7 @@ struct coord *tc;
char stuckee[35], seeit, sayso;
if ((trp = trap_at(tc->y, tc->x)) == NULL)
return;
return 0;
ishero = (th == &player);
if (ishero) {
strcpy(stuckee, "You");
@ -491,7 +491,7 @@ goner:
if ((trp->tr_flags & ISGONE) && rnd(100) < 10) {
nlmove = TRUE;
if (rnd(100) < 15)
teleport(rndspot); /* teleport away */
teleport(rndspot, th); /* teleport away */
else if(rnd(100) < 15 && level > 2) {
level -= rnd(2) + 1;
new_level(NORMLEV);
@ -519,7 +519,8 @@ goner:
* dip_it:
* Dip an object into a magic pool
*/
dip_it()
void
dip_it(void)
{
reg struct linked_list *what;
reg struct object *ob;
@ -654,8 +655,7 @@ dip_it()
* Find the trap at (y,x) on screen.
*/
struct trap *
trap_at(y, x)
int y, x;
trap_at(int y, int x)
{
reg struct trap *tp, *ep;
@ -673,8 +673,7 @@ int y, x;
* move in a random direction if the monster/person is confused
*/
struct coord *
rndmove(who)
struct thing *who;
rndmove(struct thing *who)
{
reg int x, y, ex, ey, ch;
int nopen = 0;
@ -720,8 +719,8 @@ struct thing *who;
* isatrap:
* Returns TRUE if this character is some kind of trap
*/
isatrap(ch)
char ch;
bool
isatrap(char ch)
{
switch(ch) {
case POST: