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

@ -16,6 +16,11 @@
#include <string.h>
#include "rogue.h"
int pick_one(struct magic_item *magic, int nitems);
void print_disc(char type);
void set_order(short *order, int numthings);
char *nothing(char type);
bool got_genocide = FALSE;
/*
@ -24,9 +29,7 @@ bool got_genocide = FALSE;
* inventory.
*/
char *
inv_name(obj, drop)
register THING *obj;
register bool drop;
inv_name(THING *obj, bool drop)
{
register char *pb;
@ -163,7 +166,8 @@ register bool drop;
* drop:
* Put something down
*/
drop()
void
drop(void)
{
register char ch;
register THING *nobj, *op;
@ -211,8 +215,8 @@ drop()
* dropcheck:
* Do special checks for dropping or unweilding|unwearing|unringing
*/
dropcheck(op)
register THING *op;
bool
dropcheck(THING *op)
{
if (op == NULL)
return TRUE;
@ -253,7 +257,7 @@ register THING *op;
* Return a new thing
*/
THING *
new_thing()
new_thing(void)
{
register THING *cur;
register int j, k;
@ -361,9 +365,8 @@ new_thing()
* pick_one:
* Pick an item out of a list of nitems possible magic items
*/
pick_one(magic, nitems)
register struct magic_item *magic;
int nitems;
int
pick_one(struct magic_item *magic, int nitems)
{
register struct magic_item *end;
register int i;
@ -398,7 +401,8 @@ static bool newpage = FALSE;
static char *lastfmt, *lastarg;
discovered()
void
discovered(void)
{
register char ch;
register bool disc_list;
@ -456,8 +460,8 @@ discovered()
#define MAX(a,b,c,d) (a > b ? (a > c ? (a > d ? a : d) : (c > d ? c : d)) : (b > c ? (b > d ? b : d) : (c > d ? c : d)))
print_disc(type)
char type;
void
print_disc(char type)
{
register bool *know = NULL;
register char **guess = NULL;
@ -508,9 +512,8 @@ char type;
* set_order:
* Set up order for list
*/
set_order(order, numthings)
short *order;
int numthings;
void
set_order(short *order, int numthings)
{
register int i, r, t;
@ -591,8 +594,7 @@ end_line()
* Set up prbuf so that message for "nothing found" is there
*/
char *
nothing(type)
register char type;
nothing(char type)
{
register char *sp, *tystr = NULL;