changeset 300:0250220d8cdd

Fix an assortment of compiler warnings. A few potential bugs were removed in the process. Much code cleanup remains to be done.
author John "Elwin" Edwards
date Fri, 22 Nov 2019 21:18:27 -0500
parents 74351bf23e5e
children acc3718f50ab
files arogue5/daemon.c arogue5/list.c arogue5/maze.c arogue5/rip.c arogue5/rogue.c arogue7/list.c arogue7/maze.c arogue7/pack.c arogue7/rip.c arogue7/rogue.c rogue3/init.c rogue3/list.c rogue3/rip.c rogue3/things.c rogue3/weapons.c rogue4/extern.c rogue4/misc.c rogue4/passages.c rogue4/rip.c rogue4/things.c rogue4/weapons.c rogue5/rip.c rogue5/save.c srogue/global.c srogue/list.c srogue/main.c srogue/rip.c srogue/things.c srogue/trader.c urogue/bag.c urogue/chase.c urogue/getplay.c urogue/io.c urogue/monsters.c urogue/options.c urogue/potions.c urogue/rip.c urogue/state.c urogue/trader.c xrogue/daemons.c xrogue/help.c xrogue/init.c xrogue/list.c xrogue/maze.c xrogue/potions.c xrogue/rip.c xrogue/rogue.c
diffstat 47 files changed, 606 insertions(+), 589 deletions(-) [+]
line wrap: on
line diff
--- a/arogue5/daemon.c	Sun Feb 11 15:37:33 2018 -0500
+++ b/arogue5/daemon.c	Fri Nov 22 21:18:27 2019 -0500
@@ -238,7 +238,7 @@
 void
 activity(void)
 {
-	sprintf(outstring,"Daemons = %d : Fuses = %d : Memory Items = %d : Memory Used = %d",
+	sprintf(outstring,"Daemons = %d : Fuses = %d : Memory Items = %d : Memory Used = %ld",
 	    demoncnt,fusecnt,total,md_memused());
 	msg(outstring);
 }
--- a/arogue5/list.c	Sun Feb 11 15:37:33 2018 -0500
+++ b/arogue5/list.c	Fri Nov 22 21:18:27 2019 -0500
@@ -174,7 +174,7 @@
     static char errbuf[LINELEN];
 
     if (space == NULL) {
-	sprintf(errbuf,"Rogue ran out of memory (used = %d, wanted = %d).",
+	sprintf(errbuf,"Rogue ran out of memory (used = %ld, wanted = %d).",
 		md_memused(), size);
 	fatal(errbuf);
     }
--- a/arogue5/maze.c	Sun Feb 11 15:37:33 2018 -0500
+++ b/arogue5/maze.c	Fri Nov 22 21:18:27 2019 -0500
@@ -22,7 +22,7 @@
 };
 
 struct bordercells {
-	char num_pos;		/* number of frontier cells next to you */
+	unsigned char num_pos;	/* number of frontier cells next to you */
 	struct cell conn[4];	/* the y,x position of above cell */
 } border_cells;
 
--- a/arogue5/rip.c	Sun Feb 11 15:37:33 2018 -0500
+++ b/arogue5/rip.c	Fri Nov 22 21:18:27 2019 -0500
@@ -607,7 +607,7 @@
   else
     return;
 
-  fprintf(logfile, "%d %d %s %d %s %d %d %d %c %s\n", time(NULL), amount, 
+  fprintf(logfile, "%ld %ld %s %d %s %d %d %d %c %s\n", time(NULL), amount, 
           whoami, pstats.s_lvl, class, level, max_level, quest_item, had_quest, 
           fate);
   fclose(logfile);
--- a/arogue5/rogue.c	Sun Feb 11 15:37:33 2018 -0500
+++ b/arogue5/rogue.c	Fri Nov 22 21:18:27 2019 -0500
@@ -420,78 +420,78 @@
 } ;
 
 struct h_list helpstr[] = {
-    '?',	"	prints help",
-    '/',	"	identify object",
-    'h',	"	left",
-    'j',	"	down",
-    'k',	"	up",
-    'l',	"	right",
-    'y',	"	up & left",
-    'u',	"	up & right",
-    'b',	"	down & left",
-    'n',	"	down & right",
-    'H',	"	run left",
-    'J',	"	run down",
-    'K',	"	run up",
-    'L',	"	run right",
-    'Y',	"	run up & left",
-    'U',	"	run up & right",
-    'B',	"	run down & left",
-    'N',	"	run down & right",
-    't',	"<dir>	throw something",
-    'f',	"<dir>	forward until find something",
-    'z',	"<dir>	zap a wand or staff",
-    '>',	"	go down a staircase",
-    '<',	"	go up a staircase",
-    's',	"	search for trap/secret door",
-    '.',	"	rest for a while",
-    'i',	"	inventory",
-    'I',	"	inventory single item",
-    'q',	"	quaff potion",
-    'r',	"	read paper",
-    'e',	"	eat food",
-    'w',	"	wield a weapon",
-    'W',	"	wear something",
-    'T',	"	take off something",
-    'd',	"	drop object",
-    'P',	"	pick up object(s)",
-    'c',	"	call object (generic)",
-    'm',	"	mark object (specific)",
-    'o',	"	examine/set options",
-    'C',	"	cast a spell",
-    'p',	"	pray",