diff srogue/rings.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 e7862a021609
line wrap: on
line diff
--- a/srogue/rings.c	Thu Jan 28 18:55:47 2016 -0500
+++ b/srogue/rings.c	Sun Jan 31 13:45:07 2016 -0500
@@ -19,11 +19,15 @@
 #include "rogue.h"
 #include "rogue.ext"
 
+int gethand(bool isrmv);
+int ring_eat(void);
+
 /*
  * ring_on:
  *	Put on a ring
  */
-ring_on()
+void
+ring_on(void)
 {
 	reg struct object *obj;
 	reg struct linked_list *item;
@@ -144,7 +148,8 @@
  * ring_off:
  *	Take off some ring
  */
-ring_off()
+void
+ring_off(void)
 {
 	reg int ring;
 	reg struct object *obj;
@@ -178,8 +183,8 @@
  * toss_ring:
  *	Remove a ring and stop its effects
  */
-toss_ring(what)
-struct object *what;
+void
+toss_ring(struct object *what)
 {
 	bool okring;
 
@@ -228,8 +233,8 @@
  * gethand:
  *	Get a hand to wear a ring
  */
-gethand(isrmv)
-bool isrmv;
+int
+gethand(bool isrmv)
 {
 	reg int c;
 	char *ptr;
@@ -280,7 +285,8 @@
  * ring_eat:
  *	How much food do the hero's rings use up?
  */
-ring_eat()
+int
+ring_eat(void)
 {
 	reg struct object *lb;
 	reg int hand, i, howmuch;
@@ -335,8 +341,7 @@
  *	Print ring bonuses
  */
 char *
-ring_num(what)
-struct object *what;
+ring_num(struct object *what)
 {
 	static char number[5];
 
@@ -355,8 +360,8 @@
  * magring:
  *	Returns TRUE if a ring has a number, i.e. +2
  */
-magring(what)
-struct object *what;
+bool
+magring(struct object *what)
 {
 	switch(what->o_which) {
 		case R_SPEED:
@@ -379,7 +384,8 @@
  * ringabil:
  *	Compute effective abilities due to rings
  */
-ringabil()
+void
+ringabil(void)
 {
 	reg struct object *rptr;
 	reg int i;
@@ -406,10 +412,10 @@
  * init_ring:
  *	Initialize a ring
  */
-init_ring(what,fromwiz)
-struct object *what;
-bool fromwiz;			/* TRUE when from wizards */
+void
+init_ring(struct object *what, bool fromwiz)
 {
+	/* fromwiz: TRUE when from wizards */
 	reg int much;
 
 	switch (what->o_which) {
@@ -459,8 +465,8 @@
  * ringex:
  *	Get extra gains from rings
  */
-ringex(rtype)
-int rtype;
+int
+ringex(int rtype)
 {
 	reg int howmuch = 0;
 
@@ -475,8 +481,8 @@
  * iswearing:
  *	Returns TRUE when the hero is wearing a certain type of ring
  */
-iswearing(ring)
-int ring;
+bool
+iswearing(int ring)
 {
 	return (isring(LEFT,ring) || isring(RIGHT,ring));
 }
@@ -485,8 +491,8 @@
  * isring:
  *	Returns TRUE if a ring is on a hand
  */
-isring(hand,ring)
-int hand, ring;
+bool
+isring(int hand, int ring)
 {
 	if (cur_ring[hand] != NULL && cur_ring[hand]->o_which == ring)
 		return TRUE;