diff srogue/things.c @ 217:94a0d9dd5ce1

Super-Rogue: convert to ANSI-style function declarations. This fixes most of the build warnings.
author John "Elwin" Edwards
date Sun, 31 Jan 2016 13:45:07 -0500
parents 3aa87373c908
children 0250220d8cdd
line wrap: on
line diff
--- a/srogue/things.c	Thu Jan 28 18:55:47 2016 -0500
+++ b/srogue/things.c	Sun Jan 31 13:45:07 2016 -0500
@@ -20,15 +20,14 @@
 #include "rogue.h"
 #include "rogue.ext"
 
+void basic_init(struct object *cur);
 
 /*
  * inv_name:
  *	Return the name of something as it would appear in an inventory.
  */
 char *
-inv_name(obj, drop)
-struct object *obj;
-bool drop;
+inv_name(struct object *obj, bool drop)
 {
 	reg char *pb, *tn, *pl;
 	reg int wh, knowit;
@@ -183,7 +182,8 @@
  * money:
  *	Add to characters purse
  */
-money()
+void
+money(void)
 {
 	reg struct room *rp;
 	reg struct linked_list *item;
@@ -215,8 +215,8 @@
  * drop:
  *	put something down
  */
-drop(item)
-struct linked_list *item;
+int
+drop(struct linked_list *item)
 {
 	reg char ch;
 	reg struct linked_list *ll, *nll;
@@ -281,8 +281,8 @@
  * dropcheck:
  *	Do special checks for dropping or unweilding|unwearing|unringing
  */
-dropcheck(op)
-struct object *op;
+bool
+dropcheck(struct object *op)
 {
 	if (op == NULL)
 		return TRUE;
@@ -320,9 +320,7 @@
  *	Return a new thing
  */
 struct linked_list *
-new_thing(treas, type, which)
-int type, which;
-bool treas;
+new_thing(bool treas, int type, int which)
 {
 	struct linked_list *item;
 	struct magic_item *mi;
@@ -404,8 +402,8 @@
  * basic_init:
  *	Set all params of an object to the basic values.
  */
-basic_init(cur)
-struct object *cur;
+void
+basic_init(struct object *cur)
 {
 	cur->o_ac = 11;
 	cur->o_count = 1;
@@ -423,7 +421,8 @@
  * extras:
  *	Return the number of extra items to be created
  */
-extras()
+int
+extras(void)
 {
 	reg int i;
 
@@ -441,8 +440,8 @@
  * pick_one:
  * 	Pick an item out of a list of nitems possible magic items
  */
-pick_one(mag)
-struct magic_item *mag;
+int
+pick_one(struct magic_item *mag)
 {
 	reg struct magic_item *start;
 	reg int i;