Fix an assortment of compiler warnings.

A few potential bugs were removed in the process.  Much code cleanup
remains to be done.
This commit is contained in:
John "Elwin" Edwards 2019-11-22 21:18:27 -05:00
parent de95b19cee
commit 7d459d7d36
47 changed files with 608 additions and 591 deletions

View file

@ -160,143 +160,143 @@ static char *game_begin ="To be updated...";
/* help list */
static struct h_list helpstr[] = {
'?', " Print help",
'/', " Identify object",
'=', " Identify a screen character",
' ', "",
'h', " Move left",
'j', " Move down",
'k', " Move up",
'l', " Move right",
'y', " Move up and left",
'u', " Move up and right",
'b', " Move down and left",
'n', " Move down and 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",
' ', "",
'>', " Go down a staircase",
'<', " Go up a staircase",
'\\', " Game descriptions",
'.', " Rest for a while",
'*', " Count gold pieces",
'a', " Affect the undead",
'A', " Choose artifact (equipage)",
'c', " Chant a mantra",
'C', " Cast a spell",
'd', " Drop something",
'D', " Dip something (into a pool)",
'e', " Eat food or fruit",
'f', "<dir> Forward until find something",
'F', " Frighten a monster",
'g', " Give food to monster",
'G', " Sense for gold",
'i', " Inventory",
'I', " Inventory (single item)",
'm', " Mark an object (specific)",
'o', " Examine and/or set options",
'O', " Character type and quest item",
'p', " Pray to the powers that be",
'P', " Pick up object(s)",
'q', " Quaff a potion",
'Q', " Quit the game",
'r', " Read a scroll",
's', " Search for a trap/secret door",
'S', " Save your game",
't', "<dir> Throw something",
'T', " Take off something",
'v', " Print program version",
'w', " Wield a weapon",
'W', " Wear something",
'X', " Sense for traps",
'z', "<dir> Zap a wand or staff",
' ', "",
'^', " Set a trap",
'$', " Price an item (trading post)",
'#', " Buy an item (trading post)",
'%', " Sell an item (trading post)",
'!', " Shell escape",
ESC, " Cancel command (Esc)",
' ', "",
CTRL('B'), " Current score (if you win)",
CTRL('E'), " Current food level",
CTRL('L'), " Redraw the screen",
CTRL('N'), " Name an object or a monster",
CTRL('O'), " Character affect status",
CTRL('R'), " Repeat last message",
CTRL('T'), "<dir> Take (steal) from (direction)",
CTRL('U'), " Use a magic item",
0, 0
{ '?', " Print help" },
{ '/', " Identify object" },
{ '=', " Identify a screen character" },
{ ' ', "" },
{ 'h', " Move left" },
{ 'j', " Move down" },
{ 'k', " Move up" },
{ 'l', " Move right" },
{ 'y', " Move up and left" },
{ 'u', " Move up and right" },
{ 'b', " Move down and left" },
{ 'n', " Move down and 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" },
{ ' ', "" },
{ '>', " Go down a staircase" },
{ '<', " Go up a staircase" },
{ '\\', " Game descriptions" },
{ '.', " Rest for a while" },
{ '*', " Count gold pieces" },
{ 'a', " Affect the undead" },
{ 'A', " Choose artifact (equipage)" },
{ 'c', " Chant a mantra" },
{ 'C', " Cast a spell" },
{ 'd', " Drop something" },
{ 'D', " Dip something (into a pool)" },
{ 'e', " Eat food or fruit" },
{ 'f', "<dir> Forward until find something" },
{ 'F', " Frighten a monster" },
{ 'g', " Give food to monster" },
{ 'G', " Sense for gold" },
{ 'i', " Inventory" },
{ 'I', " Inventory (single item)" },
{ 'm', " Mark an object (specific)" },
{ 'o', " Examine and/or set options" },
{ 'O', " Character type and quest item" },
{ 'p', " Pray to the powers that be" },
{ 'P', " Pick up object(s)" },
{ 'q', " Quaff a potion" },
{ 'Q', " Quit the game" },
{ 'r', " Read a scroll" },
{ 's', " Search for a trap/secret door" },
{ 'S', " Save your game" },
{ 't', "<dir> Throw something" },
{ 'T', " Take off something" },
{ 'v', " Print program version" },
{ 'w', " Wield a weapon" },
{ 'W', " Wear something" },
{ 'X', " Sense for traps" },
{ 'z', "<dir> Zap a wand or staff" },
{ ' ', "" },
{ '^', " Set a trap" },
{ '$', " Price an item (trading post)" },
{ '#', " Buy an item (trading post)" },
{ '%', " Sell an item (trading post)" },
{ '!', " Shell escape" },
{ ESC, " Cancel command (Esc)" },
{ ' ', "" },
{ CTRL('B'), " Current score (if you win)" },
{ CTRL('E'), " Current food level" },
{ CTRL('L'), " Redraw the screen" },
{ CTRL('N'), " Name an object or a monster" },
{ CTRL('O'), " Character affect status" },
{ CTRL('R'), " Repeat last message" },
{ CTRL('T'), "<dir> Take (steal) from (direction)" },
{ CTRL('U'), " Use a magic item" },
{ 0, "" }
} ;
/* wizard help list */
static struct h_list wiz_help[] = {
' ', "",
'+', " Random fortunes",
'M', " Make an object",
'V', " Display vlevel and turns",
CTRL('A'), " System activity",
CTRL('C'), " Move to another dungeon level",
CTRL('D'), " Go down 1 dungeon level",
CTRL('F'), " Display the entire level",
CTRL('G'), " Charge wands and staffs",
CTRL('H'), " Jump 9 experience levels",
CTRL('I'), " Inventory of level",
CTRL('J'), " Teleport somewhere",
CTRL('K'), " Identify an object",
CTRL('M'), " Recharge wand or staff",
CTRL('P'), " Toggle wizard status",
CTRL('X'), " Detect monsters",
CTRL('Y'), " Display food levels",
0, 0
{ ' ', "" },
{ '+', " Random fortunes" },
{ 'M', " Make an object" },
{ 'V', " Display vlevel and turns" },
{ CTRL('A'), " System activity" },
{ CTRL('C'), " Move to another dungeon level" },
{ CTRL('D'), " Go down 1 dungeon level" },
{ CTRL('F'), " Display the entire level" },
{ CTRL('G'), " Charge wands and staffs" },
{ CTRL('H'), " Jump 9 experience levels" },
{ CTRL('I'), " Inventory of level" },
{ CTRL('J'), " Teleport somewhere" },
{ CTRL('K'), " Identify an object" },
{ CTRL('M'), " Recharge wand or staff" },
{ CTRL('P'), " Toggle wizard status" },
{ CTRL('X'), " Detect monsters" },
{ CTRL('Y'), " Display food levels" },
{ 0, "" }
};
/* item help list */
static struct item_list item_help[] = {
'@', " You (visible)",
'_', " You (invisible)",
' ', "",
':', " Food ration or fruit (eat)",
'!', " Potion (quaff)",
'?', " Scroll (read)",
'=', " Ring (wear)",
')', " Weapon (wield)",
']', " Armor (wear)",
'/', " Wand or staff (zap)",
';', " Magic item (use)",
',', " Artifact (quest item)",
'*', " Gold or zapped missile",
' ', "",
'$', " Magical item in room",
'>', " Blessed magical item",
'<', " Cursed magical item",
' ', " ",
'`', " Dart trap",
'{', " Arrow trap",
'}', " Bear trap",
'~', " Teleport trap",
'$', " Sleeping gas trap",
'>', " Trap door",
'<', " Outer region entrance",
'\'', " Maze entrance",
'^', " Trading post entrance",
'"', " Magic pool or lake",
' ', " Solid rock or mountain",
'.', " Floor of a room or meadow",
'%', " Stairs (up or down)",
'+', " Doorway",
'&', " Secret doorway",
'#', " Passage between rooms",
'\\', " Forest",
HORZWALL, " Horizontal wall of a room",
VERTWALL, " Vertical wall of a room",
0, 0
{ '@', " You (visible)" },
{ '_', " You (invisible)" },
{ ' ', "" },
{ ':', " Food ration or fruit (eat)" },
{ '!', " Potion (quaff)" },
{ '?', " Scroll (read)" },
{ '=', " Ring (wear)" },
{ ')', " Weapon (wield)" },
{ ']', " Armor (wear)" },
{ '/', " Wand or staff (zap)" },
{ ';', " Magic item (use)" },
{ ',', " Artifact (quest item)" },
{ '*', " Gold or zapped missile" },
{ ' ', "" },
{ '$', " Magical item in room" },
{ '>', " Blessed magical item" },
{ '<', " Cursed magical item" },
{ ' ', " " },
{ '`', " Dart trap" },
{ '{', " Arrow trap" },
{ '}', " Bear trap" },
{ '~', " Teleport trap" },
{ '$', " Sleeping gas trap" },
{ '>', " Trap door" },
{ '<', " Outer region entrance" },
{ '\'', " Maze entrance" },
{ '^', " Trading post entrance" },
{ '"', " Magic pool or lake" },
{ ' ', " Solid rock or mountain" },
{ '.', " Floor of a room or meadow" },
{ '%', " Stairs (up or down)" },
{ '+', " Doorway" },
{ '&', " Secret doorway" },
{ '#', " Passage between rooms" },
{ '\\', " Forest" },
{ HORZWALL, " Horizontal wall of a room" },
{ VERTWALL, " Vertical wall of a room" },
{ 0, "" }
};
void