diff rogue4/main.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 ee250e3646fd
children 3d4252fa2ed3
line wrap: on
line diff
--- a/rogue4/main.c	Sat Jan 23 09:35:14 2016 -0500
+++ b/rogue4/main.c	Wed Jan 27 19:41:05 2016 -0500
@@ -18,15 +18,15 @@
 #include <signal.h>
 #include <limits.h>
 #include <string.h>
+#include <time.h>
 #include "rogue.h"
 
 /*
  * main:
  *	The main program, of course
  */
-main(argc, argv, envp)
-char **argv;
-char **envp;
+int
+main(int argc, char *argv[], char *envp[])
 {
     register char *env;
     int lowtime;
@@ -113,7 +113,7 @@
     if (argc == 2 && strcmp(argv[1], "-s") == 0)
     {
 	noscore = TRUE;
-	score(0, -1);
+	score(0, -1, 0);
 	exit(0);
     }
     init_check();			/* check for legal startup */
@@ -227,8 +227,8 @@
  * fatal:
  *	Exit the program, printing a message.
  */
-fatal(s)
-char *s;
+void
+fatal(char *s)
 {
     clear();
     move(LINES-2, 0);
@@ -242,8 +242,8 @@
  * rnd:
  *	Pick a very random number.
  */
-rnd(range)
-register int range;
+int
+rnd(int range)
 {
     return range == 0 ? 0 : abs((int) RN) % range;
 }
@@ -252,8 +252,8 @@
  * roll:
  *	Roll a number of dice
  */
-roll(number, sides)
-register int number, sides;
+int
+roll(int number, int sides)
 {
     register int dtotal = 0;
 
@@ -299,7 +299,8 @@
  *	The main loop of the program.  Loop until the game is over,
  *	refreshing things and looking at the proper times.
  */
-playit()
+void
+playit(void)
 {
     register char *opts;
 
@@ -352,7 +353,7 @@
 	move(LINES - 1, 0);
 	refresh();
 	writelog(purse, 1, 0);
-	score(purse, 1);
+	score(purse, 1, 0);
 	printf("[Press return to exit]\n");
 	fflush(NULL);
 	getchar();
@@ -391,7 +392,8 @@
  * shell:
  *	Let him escape for a while
  */
-shell()
+void
+shell(void)
 {
     /*
      * Set the terminal back to original mode