rogue4: fix most GCC5 warnings.

Converting all function definitions to ANSI style accounts for most of
the change.  This has exposed other problems, such as daemons not
actually being their stated type, that will require more careful
solutions.
This commit is contained in:
John "Elwin" Edwards 2016-01-27 19:41:05 -05:00
parent 384386d71c
commit c1d6a6af6a
32 changed files with 625 additions and 394 deletions

View file

@ -10,6 +10,7 @@
* See the file LICENSE.TXT for full copyright and licensing information.
*/
#include <stdlib.h>
#include <curses.h>
#include "rogue.h"
@ -17,11 +18,16 @@
coord ch_ret; /* Where chasing takes you */
bool chase(THING *tp, coord *ee);
int do_chase(THING *th);
coord *find_dest(THING *tp);
/*
* runners:
* Make all the running monsters move.
*/
runners()
void
runners(void)
{
register THING *tp;
register THING *ntp;
@ -46,8 +52,8 @@ runners()
* do_chase:
* Make one thing chase another.
*/
do_chase(th)
register THING *th;
int
do_chase(THING *th)
{
register struct room *rer, *ree; /* room of chaser, room of chasee */
register int mindist = 32767, i, dist;
@ -184,8 +190,8 @@ over:
* see_monst:
* Return TRUE if the hero can see the monster
*/
see_monst(mp)
register THING *mp;
bool
see_monst(THING *mp)
{
if (on(player, ISBLIND))
return FALSE;
@ -203,9 +209,8 @@ register THING *mp;
* Set a mosnter running after something or stop it from running
* (for when it dies)
*/
runto(runner, spot)
register coord *runner;
coord *spot;
void
runto(coord *runner, coord *spot)
{
register THING *tp;
@ -234,9 +239,8 @@ coord *spot;
* chasee(ee). Returns TRUE if we want to keep on chasing later
* FALSE if we reach the goal.
*/
chase(tp, ee)
THING *tp;
coord *ee;
bool
chase(THING *tp, coord *ee)
{
register int x, y;
register int dist, thisdist;
@ -339,8 +343,7 @@ coord *ee;
* in any room.
*/
struct room *
roomin(cp)
register coord *cp;
roomin(coord *cp)
{
register struct room *rp;
register char *fp;
@ -360,8 +363,8 @@ register coord *cp;
* diag_ok:
* Check to see if the move is legal if it is diagonal
*/
diag_ok(sp, ep)
register coord *sp, *ep;
bool
diag_ok(coord *sp, coord *ep)
{
if (ep->x == sp->x || ep->y == sp->y)
return TRUE;
@ -372,8 +375,8 @@ register coord *sp, *ep;
* cansee:
* Returns true if the hero can see a certain coordinate.
*/
cansee(y, x)
register int y, x;
bool
cansee(int y, int x)
{
register struct room *rer;
coord tp;
@ -396,8 +399,7 @@ register int y, x;
* find the proper destination for the monster
*/
coord *
find_dest(tp)
register THING *tp;
find_dest(THING *tp)
{
register THING *obj;
register int prob;