diff rogue4/pack.c @ 215:1b73a8641b37

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.
author John "Elwin" Edwards
date Wed, 27 Jan 2016 19:41:05 -0500
parents 9535a08ddc39
children e52a8a7ad4c5
line wrap: on
line diff
--- a/rogue4/pack.c	Sat Jan 23 09:35:14 2016 -0500
+++ b/rogue4/pack.c	Wed Jan 27 19:41:05 2016 -0500
@@ -14,14 +14,16 @@
 #include <ctype.h>
 #include "rogue.h"
 
+void money(int value);
+
 /*
  * update_mdest:
  *	Called after picking up an object, before discarding it.
  *	If this was the object of something's desire, that monster will
  *	get mad and run at the hero
  */
-update_mdest(obj)
-register THING *obj;
+void
+update_mdest(THING *obj)
 {
     register THING *mp;
 
@@ -36,9 +38,8 @@
  *	non-null use it as the linked_list pointer instead of gettting
  *	it off the ground.
  */
-add_pack(obj, silent)
-register THING *obj;
-bool silent;
+void
+add_pack(THING *obj, bool silent)
 {
     register THING *op, *lp = NULL;
     register bool exact, from_floor;
@@ -216,9 +217,8 @@
  * inventory:
  *	List what is in the pack
  */
-inventory(list, type)
-THING *list;
-int type;
+bool
+inventory(THING *list, int type)
 {
     register char ch;
     register int n_objs;
@@ -253,8 +253,8 @@
  * pick_up:
  *	Add something to characters pack.
  */
-pick_up(ch)
-char ch;
+void
+pick_up(char ch)
 {
     register THING *obj, *mp;
 
@@ -290,7 +290,8 @@
  * picky_inven:
  *	Allow player to inventory a single item
  */
-picky_inven()
+void
+picky_inven(void)
 {
     register THING *obj;
     register char ch, mch;
@@ -325,9 +326,7 @@
  *	Pick something out of a pack for a purpose
  */
 THING *
-get_item(purpose, type)
-char *purpose;
-int type;
+get_item(char *purpose, int type)
 {
     register THING *obj;
     register char ch, och;
@@ -384,8 +383,8 @@
  * pack_char:
  *	Return which character would address a pack object
  */
-pack_char(obj)
-register THING *obj;
+char
+pack_char(THING *obj)
 {
     register THING *item;
     register char c;
@@ -403,8 +402,8 @@
  * money:
  *	Add or subtract gold from the pack
  */
-money(value)
-register int value;
+void
+money(int value)
 {
     register char floor;