some lint cleanup

Using
	gcc -Wall -Wshadow -Wpointer-arith -Wwrite-strings \
	    -Wmissing-braces -Wmissing-prototypes
with an old version of gcc.

mhitu.c: In function `hitmu':
mhitu.c:1176: warning: declaration of `buf' shadows previous local
options.c: In function `special_handling':
options.c:2712: warning: initialization discards `const' from pointer target type
options.c:2745: warning: initialization discards `const' from pointer target typ
trap.c: In function `dotrap':
trap.c:1111: warning: `saddle' might be used uninitialized in this function

The first one is no longer present in the trunk code.  The last one is
bogus as its wishy-washy wording suggests.
This commit is contained in:
nethack.rankin
2003-10-21 05:59:33 +00:00
parent 15bd245d2b
commit 08639fdda8
2 changed files with 13 additions and 13 deletions
+7 -7
View File
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)options.c 3.4 2003/05/19 */ /* SCCS Id: @(#)options.c 3.4 2003/10/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -2704,12 +2704,12 @@ boolean setinitial,setfromfile;
} }
destroy_nhwindow(tmpwin); destroy_nhwindow(tmpwin);
retval = TRUE; retval = TRUE;
} } else if (!strcmp("number_pad", optname)) {
else if (!strcmp("number_pad", optname)) {
static const char *npchoices[3] = static const char *npchoices[3] =
{"0 (off)", "1 (on)", "2 (on, DOS compatible)"}; {"0 (off)", "1 (on)", "2 (on, DOS compatible)"};
char *npletters = "abc"; const char *npletters = "abc";
menu_item *mode_pick = (menu_item *)0; menu_item *mode_pick = (menu_item *)0;
tmpwin = create_nhwindow(NHW_MENU); tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin); start_menu(tmpwin);
for (i = 0; i < SIZE(npchoices); i++) { for (i = 0; i < SIZE(npchoices); i++) {
@@ -2738,11 +2738,11 @@ boolean setinitial,setfromfile;
} }
destroy_nhwindow(tmpwin); destroy_nhwindow(tmpwin);
retval = TRUE; retval = TRUE;
} } else if (!strcmp("menu_headings", optname)) {
else if (!strcmp("menu_headings", optname)) {
static const char *mhchoices[3] = {"bold", "inverse", "underline"}; static const char *mhchoices[3] = {"bold", "inverse", "underline"};
char *npletters = "biu"; const char *npletters = "biu";
menu_item *mode_pick = (menu_item *)0; menu_item *mode_pick = (menu_item *)0;
tmpwin = create_nhwindow(NHW_MENU); tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin); start_menu(tmpwin);
for (i = 0; i < SIZE(mhchoices); i++) { for (i = 0; i < SIZE(mhchoices); i++) {
+2 -2
View File
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)trap.c 3.4 2003/09/25 */ /* SCCS Id: @(#)trap.c 3.4 2003/10/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1095,7 +1095,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
case LANDMINE: { case LANDMINE: {
#ifdef STEED #ifdef STEED
unsigned steed_mid = 0; unsigned steed_mid = 0;
struct obj *saddle; struct obj *saddle = 0;
#endif #endif
if (Levitation || Flying) { if (Levitation || Flying) {
if (!already_seen && rn2(3)) break; if (!already_seen && rn2(3)) break;