Advanced Rogue 7: convert to ANSI-style function declarations.

Almost 1500 lines of compiler warnings remain, and the GCC developers
are already working on a new version with even more warnings turned on
by default.
This commit is contained in:
John "Elwin" Edwards 2016-02-19 21:02:28 -05:00
parent f38b2223c8
commit e8e6e604c3
39 changed files with 1181 additions and 889 deletions

View file

@ -23,12 +23,16 @@
#include <string.h>
#include "rogue.h"
int pick_one(struct magic_item *magic, int nitems);
char *blesscurse(int flags);
char *p_kind(struct object *obj);
int extras(void);
/*
* print out the number of charges on a stick
*/
char *
charge_str(obj)
register struct object *obj;
charge_str(struct object *obj)
{
static char buf[20];
@ -46,9 +50,7 @@ register struct object *obj;
* inventory.
*/
char *
inv_name(obj, drop)
register struct object *obj;
bool drop;
inv_name(struct object *obj, bool drop)
{
register char *pb;
@ -324,8 +326,7 @@ bool drop;
* Return the name of a weapon.
*/
char *
weap_name(obj)
register struct object *obj;
weap_name(struct object *obj)
{
switch (obj->o_type) {
case WEAPON:
@ -357,8 +358,8 @@ register struct object *obj;
* drop:
* put something down
*/
drop(item)
struct linked_list *item;
bool
drop(struct linked_list *item)
{
register char ch;
register struct linked_list *obj, *nobj;
@ -464,8 +465,8 @@ struct linked_list *item;
/*
* do special checks for dropping or unweilding|unwearing|unringing
*/
dropcheck(op)
register struct object *op;
bool
dropcheck(struct object *op)
{
int save_max;
@ -566,9 +567,7 @@ register struct object *op;
* return a new thing
*/
struct linked_list *
new_thing(thing_type, allow_curse)
int thing_type;
bool allow_curse;
new_thing(int thing_type, bool allow_curse)
{
register struct linked_list *item;
register struct object *cur;
@ -779,8 +778,7 @@ bool allow_curse;
* provide a new item tailored to specification
*/
struct linked_list *
spec_item(type, which, hit, damage)
int type, which, hit, damage;
spec_item(int type, int which, int hit, int damage)
{
register struct linked_list *item;
register struct object *obj;
@ -858,9 +856,8 @@ int type, which, hit, damage;
/*
* 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;
@ -889,8 +886,7 @@ int nitems;
*/
char *
blesscurse(flags)
int flags;
blesscurse(int flags)
{
if (flags & ISKNOW) {
if (flags & ISCURSED) return("cursed ");
@ -903,11 +899,11 @@ int flags;
/*
* p_kind returns the type of potion for some types of identified potions;
* otherwise, it returns the color.
* We assume that obj points to a potion
*/
char *
p_kind(obj)
struct object *obj; /* We assume that obj points to a potion */
p_kind(struct object *obj)
{
if (obj->o_which == P_ABIL) return(abilities[obj->o_kind]);
else return(p_colors[obj->o_which]);
@ -917,7 +913,8 @@ struct object *obj; /* We assume that obj points to a potion */
* extras:
* Return the number of extra items to be created
*/
extras()
int
extras(void)
{
reg int i;