diff xrogue/things.c @ 220:f54901b9c39b

XRogue: convert to ANSI-style function declarations.
author John "Elwin" Edwards
date Wed, 02 Mar 2016 21:13:26 -0500
parents ce0cf824c192
children e52a8a7ad4c5
line wrap: on
line diff
--- a/xrogue/things.c	Fri Feb 19 21:02:28 2016 -0500
+++ b/xrogue/things.c	Wed Mar 02 21:13:26 2016 -0500
@@ -21,13 +21,17 @@
 #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];
 
@@ -47,9 +51,7 @@
  */
 
 char *
-inv_name(obj, drop)
-register struct object *obj;
-bool drop;
+inv_name(struct object *obj, bool drop)
 {
     register char *pb;
 
@@ -331,8 +333,7 @@
  */
 
 char *
-weap_name(obj)
-register struct object *obj;
+weap_name(struct object *obj)
 {
     switch (obj->o_type) {
         case WEAPON:
@@ -365,8 +366,8 @@
  *      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;
@@ -473,8 +474,8 @@
  * do special checks for dropping or unweilding|unwearing|unringing
  */
 
-dropcheck(op)
-register struct object *op;
+bool
+dropcheck(struct object *op)
 {
     int save_max;
 
@@ -583,9 +584,7 @@
  */
 
 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;
@@ -801,8 +800,7 @@
  */
 
 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;
@@ -877,9 +875,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;
@@ -908,8 +905,7 @@
  */
 
 char *
-blesscurse(flags)
-int flags;
+blesscurse(int flags)
 {
     if (flags & ISKNOW)  {
         if (flags & ISCURSED) return("cursed ");
@@ -922,11 +918,11 @@
 /*
  * 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].w_string);
     else return(p_colors[obj->o_which]);
@@ -937,7 +933,8 @@
  *      Return the number of extra items to be created
  */
 
-extras()
+int
+extras(void)
 {
         reg int i;