diff srogue/init.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 e52a8a7ad4c5
line wrap: on
line diff
--- a/srogue/init.c	Thu Jan 28 18:55:47 2016 -0500
+++ b/srogue/init.c	Sun Jan 31 13:45:07 2016 -0500
@@ -19,6 +19,9 @@
 #include "rogue.h"
 #include "rogue.ext"
 
+int pinit(void);
+void badcheck(char *name, struct magic_item *magic);
+
 char *rainbow[NCOLORS] = {
 	"Red",		"Blue",		"Green",	"Yellow",
 	"Black",	"Brown",	"Orange",	"Pink",
@@ -82,24 +85,11 @@
 };
 
 /*
- * init_everything:
- *	Set up all important stuff.
- */
-init_everything()
-{
-	init_player();			/* Roll up the rogue */
-	init_things();			/* Set up probabilities */
-	init_names();			/* Set up names of scrolls */
-	init_colors();			/* Set up colors of potions */
-	init_stones();			/* Set up stones in rings */
-	init_materials();		/* Set up materials of wands */
-}
-
-/*
  * init_things:
  *	Initialize the probabilities for types of things
  */
-init_things()
+void
+init_things(void)
 {
 	struct magic_item *mi;
 	
@@ -128,7 +118,8 @@
  * init_colors:
  *	Initialize the potion color scheme for this time
  */
-init_colors()
+void
+init_colors(void)
 {
 	reg int i, j;
 	reg char *str;
@@ -155,7 +146,8 @@
  * init_names:
  *	Generate the names of the various scrolls
  */
-init_names()
+void
+init_names(void)
 {
 	reg int nsyl;
 	reg char *cp, *sp;
@@ -189,7 +181,8 @@
  *	Initialize the ring stone setting scheme for this time
  */
 
-init_stones()
+void
+init_stones(void)
 {
 	reg int i, j;
 	reg char *str;
@@ -217,7 +210,8 @@
  *	Initialize the construction materials for wands and staffs
  */
 
-init_materials()
+void
+init_materials(void)
 {
 	int i, j;
 	char *str;
@@ -264,9 +258,8 @@
 	badcheck("sticks", ws_magic);
 }
 
-badcheck(name, magic)
-char *name;
-struct magic_item *magic;
+void
+badcheck(char *name, struct magic_item *magic)
 {
 	struct magic_item *mg;
 
@@ -289,7 +282,8 @@
  *	roll up the rogue
  */
 
-init_player()
+void
+init_player(void)
 {
 	player.t_nomove = 0;
 	player.t_nocmd = 0;
@@ -315,7 +309,8 @@
  * pinit:
  *	Returns the best 3 of 4 on a 6-sided die
  */
-pinit()
+int
+pinit(void)
 {
 	int best[4];
 	reg int i, min, minind, dicetot;
@@ -337,3 +332,18 @@
 	}
 	return(dicetot);
 }
+
+/*
+ * init_everything:
+ *	Set up all important stuff.
+ */
+void
+init_everything(void)
+{
+	init_player();			/* Roll up the rogue */
+	init_things();			/* Set up probabilities */
+	init_names();			/* Set up names of scrolls */
+	init_colors();			/* Set up colors of potions */
+	init_stones();			/* Set up stones in rings */
+	init_materials();		/* Set up materials of wands */
+}