diff srogue/main.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 3de8058dd549
children b922f66acf4d
line wrap: on
line diff
--- a/srogue/main.c	Thu Jan 28 18:55:47 2016 -0500
+++ b/srogue/main.c	Sun Jan 31 13:45:07 2016 -0500
@@ -34,14 +34,14 @@
 
 #include "rogue.ext"
 
+char *roguehome(void);
 void open_records(void);
 
 extern int scorefd;
 extern FILE *logfile;
 
-main(argc, argv, envp)
-char **argv;
-char **envp;
+int
+main(int argc, char *argv[], char *envp[])
 {
 	register char *env;
 	register struct linked_list *item;
@@ -50,7 +50,6 @@
 	char *getpass(), *xcrypt(), *strrchr();
 	int lowtime;
 	time_t now;
-        char *roguehome();
 	char *homedir = roguehome();
 
 #ifdef __DJGPP__
@@ -322,8 +321,8 @@
  *	Exit the program, printing a message.
  */
 
-fatal(s)
-char *s;
+void
+fatal(char *s)
 {
 	clear();
 	refresh();
@@ -340,8 +339,7 @@
  */
 
 void
-byebye(how)
-int how;
+byebye(int how)
 {
 	if (!isendwin())
 		endwin();
@@ -354,8 +352,8 @@
  * rnd:
  *	Pick a very random number.
  */
-rnd(range)
-int range;
+int
+rnd(int range)
 {
 	reg int wh;
 
@@ -372,8 +370,8 @@
  * roll:
  *	roll a number of dice
  */
-roll(number, sides)
-int number, sides;
+int
+roll(int number, int sides)
 {
 	reg int dtotal = 0;
 
@@ -386,7 +384,8 @@
 /*
 ** setup: 	Setup signal catching functions
 */
-setup()
+void
+setup(void)
 {
 	md_onsignal_autosave();
 
@@ -400,7 +399,8 @@
 **		refreshing things and looking at the proper times.
 */
 
-playit()
+void
+playit(void)
 {
 	reg char *opts;
 
@@ -421,7 +421,8 @@
 /*
 ** author:	See if a user is an author of the program
 */
-author()
+bool
+author(void)
 {
 	switch (playuid) {
 		case 100:
@@ -444,7 +445,7 @@
 }
 
 char *
-roguehome()
+roguehome(void)
 {
     static char path[LINLEN+16];
     char *end,*home;