Mercurial > hg > early-roguelike
diff rogue4/things.c @ 215:1b73a8641b37
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.
author | John "Elwin" Edwards |
---|---|
date | Wed, 27 Jan 2016 19:41:05 -0500 |
parents | 9535a08ddc39 |
children | 2dcf10d45d5b |
line wrap: on
line diff
--- a/rogue4/things.c Sat Jan 23 09:35:14 2016 -0500 +++ b/rogue4/things.c Wed Jan 27 19:41:05 2016 -0500 @@ -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 @@ * 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 @@ * drop: * Put something down */ -drop() +void +drop(void) { register char ch; register THING *nobj, *op; @@ -211,8 +215,8 @@ * 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 @@ * Return a new thing */ THING * -new_thing() +new_thing(void) { register THING *cur; register int j, k; @@ -361,9 +365,8 @@ * 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 char *lastfmt, *lastarg; -discovered() +void +discovered(void) { register char ch; register bool disc_list; @@ -456,8 +460,8 @@ #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 @@ * 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 @@ * 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;