diff arogue5/things.c @ 218:56e748983fa8

Advanced Rogue 5: convert to ANSI function declarations. This still leaves over a thousand lines of warning messages, mostly related to the return types of daemons and fuses.
author John "Elwin" Edwards
date Sun, 07 Feb 2016 14:39:21 -0500
parents c4f2e1bda8b0
children
line wrap: on
line diff
--- a/arogue5/things.c	Sun Jan 31 13:45:07 2016 -0500
+++ b/arogue5/things.c	Sun Feb 07 14:39:21 2016 -0500
@@ -18,12 +18,13 @@
 #include <string.h>
 #include "rogue.h"
 
+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];
 
@@ -41,9 +42,7 @@
  *	inventory.
  */
 char *
-inv_name(obj, drop)
-register struct object *obj;
-bool drop;
+inv_name(struct object *obj, bool drop)
 {
     register char *pb;
 
@@ -296,8 +295,7 @@
  *	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:
@@ -325,8 +323,8 @@
  * drop:
  *	put something down
  */
-drop(item)
-struct linked_list *item;
+bool
+drop(struct linked_list *item)
 {
     register char ch = 0;
     register struct linked_list *obj, *nobj;
@@ -413,8 +411,8 @@
 /*
  * do special checks for dropping or unweilding|unwearing|unringing
  */
-dropcheck(op)
-register struct object *op;
+bool
+dropcheck(struct object *op)
 {
     int save_max;
 
@@ -514,8 +512,7 @@
  * return a new thing
  */
 struct linked_list *
-new_thing(thing_type)
-int thing_type;
+new_thing(int thing_type)
 {
     register struct linked_list *item;
     register struct object *cur;
@@ -710,8 +707,7 @@
  * 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;
@@ -787,9 +783,8 @@
 /*
  * 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;
@@ -821,8 +816,7 @@
  */
 
 char *
-blesscurse(flags)
-int flags;
+blesscurse(int flags)
 {
     if (flags & ISKNOW)  {
 	if (flags & ISCURSED) return("cursed ");
@@ -836,7 +830,8 @@
  * extras:
  *	Return the number of extra items to be created
  */
-extras()
+int
+extras(void)
 {
 	reg int i;