diff rogue4/extern.c @ 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 d3968e9cb98d
children acc3718f50ab
line wrap: on
line diff
--- a/rogue4/extern.c	Sun Feb 11 15:37:33 2018 -0500
+++ b/rogue4/extern.c	Fri Nov 22 21:18:27 2019 -0500
@@ -145,21 +145,25 @@
 
 struct room *oldrp;			/* Roomin(&oldpos) */
 struct room rooms[MAXROOMS];		/* One for each room -- A level */
+#define NON {0, 0}
+#define NON12 { NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, NON }
 struct room passages[MAXPASS] =		/* One for each passage */
 {
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 },
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 },
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 },
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 },
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 },
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 },
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 },
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 },
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 },
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 },
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 },
-    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
+    { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 }
 };
+#undef NON12
+#undef NON
 
 #define ___ 1
 #define XX 10
@@ -276,51 +280,51 @@
 };
 
 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 in a direction",
-    '^',	"<dir>	identify trap type",
-    's',	"	search for trap/secret door",
-    '>',	"	go down a staircase",
-    '<',	"	go up a staircase",
-    '.',	"	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 armor",
-    'T',	"	take armor off",
-    'P',	"	put on ring",
-    'R',	"	remove ring",
-    'd',	"	drop object",
-    'c',	"	call object",
-    'D',	"	recall what's been discovered",
-    'o',	"	examine/set options",
-    CTRL('L'),	"	redraw screen",
-    CTRL('R'),	"	repeat last message",
-    ESCAPE,	"	cancel command",
-    '!',	"	shell escape",
-    'S',	"	save game",
-    'Q',	"	quit",
-    0, 0
+    { '?',	"	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 in a direction" },
+    { '^',	"<dir>	identify trap type" },
+    { 's',	"	search for trap/secret door" },
+    { '>',	"	go down a staircase" },
+    { '<',	"	go up a staircase" },
+    { '.',	"	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 armor" },
+    { 'T',	"	take armor off" },
+    { 'P',	"	put on ring" },
+    { 'R',	"	remove ring" },
+    { 'd',	"	drop object" },
+    { 'c',	"	call object" },
+    { 'D',	"	recall what's been discovered" },
+    { 'o',	"	examine/set options" },
+    { CTRL('L'),	"	redraw screen" },
+    { CTRL('R'),	"	repeat last message" },
+    { ESCAPE,	"	cancel command" },
+    { '!',	"	shell escape" },
+    { 'S',	"	save game" },
+    { 'Q',	"	quit" },
+    { 0, 0 }
 };