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

@ -21,8 +21,7 @@
* Print the name of a trap
*/
char *
tr_name(type)
char type;
tr_name(char type)
{
switch (type)
{
@ -47,8 +46,8 @@ char type;
* look:
* A quick glance all around the player
*/
look(wakeup)
bool wakeup;
void
look(bool wakeup)
{
register int x, y;
register unsigned char ch;
@ -204,8 +203,7 @@ bool wakeup;
* Find the unclaimed object at y, x
*/
THING *
find_obj(y, x)
register int y, x;
find_obj(int y, int x)
{
register THING *op;
@ -225,7 +223,8 @@ register int y, x;
* eat:
* She wants to eat something, so let her try
*/
eat()
void
eat(void)
{
register THING *obj;
@ -272,8 +271,8 @@ eat()
* Used to modify the playes strength. It keeps track of the
* highest it has been, just in case
*/
chg_str(amt)
register int amt;
void
chg_str(int amt)
{
str_t comp;
@ -293,9 +292,8 @@ register int amt;
* add_str:
* Perform the actual add, checking upper and lower bound limits
*/
add_str(sp, amt)
register str_t *sp;
int amt;
void
add_str(str_t *sp, int amt)
{
if ((*sp += amt) < 3)
*sp = 3;
@ -307,8 +305,8 @@ int amt;
* add_haste:
* Add a haste to the player
*/
add_haste(potion)
bool potion;
bool
add_haste(bool potion)
{
if (on(player, ISHASTE))
{
@ -332,7 +330,8 @@ bool potion;
* aggravate:
* Aggravate all the monsters on this level
*/
aggravate()
void
aggravate(void)
{
register THING *mi;
@ -346,8 +345,7 @@ aggravate()
* "an".
*/
char *
vowelstr(str)
register char *str;
vowelstr(char *str)
{
switch (*str)
{
@ -366,8 +364,8 @@ register char *str;
* is_current:
* See if the object is one of the currently used items
*/
is_current(obj)
register THING *obj;
bool
is_current(THING *obj)
{
if (obj == NULL)
return FALSE;
@ -387,7 +385,8 @@ register THING *obj;
* Set up the direction co_ordinate for use in varios "prefix"
* commands
*/
get_dir()
bool
get_dir(void)
{
register char *prompt;
register bool gotit;
@ -430,8 +429,8 @@ get_dir()
* sign:
* Return the sign of the number
*/
sign(nm)
register int nm;
int
sign(int nm)
{
if (nm < 0)
return -1;
@ -443,8 +442,8 @@ register int nm;
* spread:
* Give a spread around a given number (+/- 10%)
*/
spread(nm)
register int nm;
int
spread(int nm)
{
return nm - nm / 10 + rnd(nm / 5);
}
@ -453,9 +452,8 @@ register int nm;
* call_it:
* Call an object something after use.
*/
call_it(know, guess)
register bool know;
register char **guess;
void
call_it(bool know, char **guess)
{
if (know && *guess)
{