diff srogue/misc.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 2128c7dc8a40
children e52a8a7ad4c5
line wrap: on
line diff
--- a/srogue/misc.c	Thu Jan 28 18:55:47 2016 -0500
+++ b/srogue/misc.c	Sun Jan 31 13:45:07 2016 -0500
@@ -22,7 +22,8 @@
  * waste_time:
  *	Do nothing but let other things happen
  */
-waste_time()
+void
+waste_time(void)
 {
 	if (inwhgt)		/* if from wghtchk, then done */
 	     return;
@@ -35,8 +36,8 @@
  * getindex:
  *	Convert a type into an index for the things structures
  */
-getindex(what)
-char what;
+int
+getindex(char what)
 {
 	int index = -1;
 
@@ -58,8 +59,7 @@
  *	print the name of a trap
  */
 char *
-tr_name(ch)
-char ch;
+tr_name(char ch)
 {
 	reg char *s;
 
@@ -92,8 +92,8 @@
  * Look:
  *	A quick glance all around the player
  */
-look(wakeup)
-bool wakeup;
+void
+look(bool wakeup)
 {
 	reg char ch;
 	reg int oldx, oldy, y, x;
@@ -230,8 +230,7 @@
  *	find the unclaimed object at y, x
  */
 struct linked_list *
-find_obj(y, x)
-int y, x;
+find_obj(int y, int x)
 {
 	reg struct linked_list *obj;
 	reg struct object *op;
@@ -248,7 +247,8 @@
  * eat:
  *	Let the hero eat some food.
  */
-eat()
+void
+eat(void)
 {
 	reg struct linked_list *item;
 	reg struct object *obj;
@@ -297,7 +297,8 @@
  * aggravate:
  *	aggravate all the monsters on this level
  */
-aggravate()
+void
+aggravate(void)
 {
 	reg struct linked_list *mi;
 
@@ -310,8 +311,7 @@
  * 	If string starts with a vowel, return "n" for an "an"
  */
 char *
-vowelstr(str)
-char *str;
+vowelstr(char *str)
 {
 	switch (tolower(*str)) {
 		case 'a':
@@ -329,8 +329,8 @@
  * is_current:
  *	See if the object is one of the currently used items
  */
-is_current(obj)
-struct object *obj;
+bool
+is_current(struct object *obj)
 {
 	if (obj == NULL)
 		return FALSE;
@@ -346,7 +346,8 @@
  * get_dir:
  *	Set up the direction coordinates
  */
-get_dir()
+bool
+get_dir(void)
 {
 	reg char *prompt;
 	reg bool gotit;
@@ -384,8 +385,8 @@
  * initfood:
  *	Set up stuff for a food-type object
  */
-initfood(what)
-struct object *what;
+void
+initfood(struct object *what)
 {
 	what->o_type = FOOD;
 	what->o_group = NORMFOOD;