From 08639fdda850485f651b5987e3163564d1e1d07c Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Tue, 21 Oct 2003 05:59:33 +0000 Subject: [PATCH] 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. --- src/options.c | 18 +++++++++--------- src/trap.c | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/options.c b/src/options.c index 651581a8f..b705c1138 100644 --- a/src/options.c +++ b/src/options.c @@ -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. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2704,13 +2704,13 @@ boolean setinitial,setfromfile; } destroy_nhwindow(tmpwin); retval = TRUE; - } - else if (!strcmp("number_pad", optname)) { + } else if (!strcmp("number_pad", optname)) { static const char *npchoices[3] = {"0 (off)", "1 (on)", "2 (on, DOS compatible)"}; - char *npletters = "abc"; + const char *npletters = "abc"; menu_item *mode_pick = (menu_item *)0; - tmpwin = create_nhwindow(NHW_MENU); + + tmpwin = create_nhwindow(NHW_MENU); start_menu(tmpwin); for (i = 0; i < SIZE(npchoices); i++) { any.a_int = i + 1; @@ -2738,12 +2738,12 @@ boolean setinitial,setfromfile; } destroy_nhwindow(tmpwin); retval = TRUE; - } - else if (!strcmp("menu_headings", optname)) { + } else if (!strcmp("menu_headings", optname)) { static const char *mhchoices[3] = {"bold", "inverse", "underline"}; - char *npletters = "biu"; + const char *npletters = "biu"; menu_item *mode_pick = (menu_item *)0; - tmpwin = create_nhwindow(NHW_MENU); + + tmpwin = create_nhwindow(NHW_MENU); start_menu(tmpwin); for (i = 0; i < SIZE(mhchoices); i++) { any.a_int = i + 1; diff --git a/src/trap.c b/src/trap.c index 4f5bb871b..d0a8869e1 100644 --- a/src/trap.c +++ b/src/trap.c @@ -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. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1095,7 +1095,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); case LANDMINE: { #ifdef STEED unsigned steed_mid = 0; - struct obj *saddle; + struct obj *saddle = 0; #endif if (Levitation || Flying) { if (!already_seen && rn2(3)) break; @@ -1106,8 +1106,8 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); "a trigger"); if (already_seen && rn2(3)) break; pline("KAABLAMM!!! %s %s%s off!", - forcebungle ? "Your inept attempt sets" : - "The air currents set", + forcebungle ? "Your inept attempt sets" : + "The air currents set", already_seen ? a_your[trap->madeby_u] : "", already_seen ? " land mine" : "it"); } else { -- 2.40.0