]> granicus.if.org Git - nethack/commitdiff
Remove the 'nul' variable.
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Thu, 19 Feb 2015 04:51:08 +0000 (23:51 -0500)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Thu, 19 Feb 2015 04:51:31 +0000 (23:51 -0500)
include/decl.h
src/decl.c
src/dig.c
src/eat.c
src/hack.c
src/mthrowu.c
src/read.c
src/save.c

index e31d76bdb2c31bb49b675571f020322d00b0ef36..e371c977facc806306bbd537b9ae4fb4ae427cfc 100644 (file)
@@ -196,7 +196,6 @@ E NEARDATA char horsename[];
 E char preferred_pet;
 E const char *occtxt;                  /* defined when occupation != NULL */
 E const char *nomovemsg;
-E const char nul[];
 E char lock[];
 
 E const schar xdir[], ydir[], zdir[];
index 775a06f4ce4f8922ad29b30a4310e0330f021849..93036da34a1c3e0dae75409f67e75c65166067cd 100644 (file)
@@ -52,7 +52,6 @@ NEARDATA struct kinfo killer = DUMMY;
 NEARDATA long done_money = 0;
 #endif
 const char *nomovemsg = 0;
-const char nul[40] = DUMMY;                    /* contains zeros */
 NEARDATA char plname[PL_NSIZ] = DUMMY;         /* player name */
 NEARDATA char pl_character[PL_CSIZ] = DUMMY;
 NEARDATA char pl_race = '\0';
index 94ee98a182a3944d3d64a3216b906574b097b22f..5e0b40acac776c14456cc76f3551dca8b1e7a944 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -1855,7 +1855,7 @@ long timeout;     /* unused */
                char *cname = corpse_xname(obj, (const char *)0, CXN_NO_PFX);
 
                Your("%s%s %s away%c",
-                    obj == uwep ? "wielded " : nul, cname,
+                    obj == uwep ? "wielded " : "", cname,
                     otense(obj, "rot"), obj == uwep ? '!' : '.');
            }
            if (obj == uwep) {
index 00173e5839ec2db29c88d048ef6f27eadf5ebf9a..8aa7f5da1525bc0d5a047b95ce28d911f68c87de 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -691,7 +691,7 @@ register int pm;
                if (!Slimed && !Unchanging && !slimeproof(youmonst.data)) {
                    You("don't feel very well.");
                    make_slimed(10L, (char*) 0);
-                   delayed_killer(SLIMED, KILLED_BY_AN, nul);
+                   delayed_killer(SLIMED, KILLED_BY_AN, "");
                }
                /* Fall through */
            default:
index 728e757748d4340dd50ba1e27a8d0f945c83b098..792671075ea6870e49dc71eecb9cf6cd5f4e226b 100644 (file)
@@ -207,7 +207,7 @@ moverock()
                        pline("%s%s and %s a %s in the %s!",
                          Tobjnam(otmp,
                           (ttmp->ttyp == TRAPDOOR) ? "trigger" : "fall"),
-                         (ttmp->ttyp == TRAPDOOR) ? nul : " into",
+                         (ttmp->ttyp == TRAPDOOR) ? "" : " into",
                          otense(otmp, "plug"),
                          (ttmp->ttyp == TRAPDOOR) ? "trap door" : "hole",
                          surface(rx, ry));
index 258dd4755a7ed7f442a32d187575f22830614a87..ea955d6a6ef7010acd4b6b720aad4bc15314fccf 100644 (file)
@@ -412,7 +412,7 @@ struct obj *obj;            /* missile (or stack providing it) */
                        if (!Stoned && !Stone_resistance
                            && !(poly_when_stoned(youmonst.data) &&
                                 polymon(PM_STONE_GOLEM))) {
-                           make_stoned(5L, (char *)0, KILLED_BY, nul);
+                           make_stoned(5L, (char *)0, KILLED_BY, "");
                        }
                    }
                    stop_occupation();
index 686a837b1074b7ae409bbdc5c39b9bae6b6b92e3..755d0996966386a8da4794e4f4c92da0aa43c32b 100644 (file)
@@ -228,7 +228,7 @@ register const char *color;
        pline("%s%s%s for a moment.",
                Yobjnam2(otmp, Blind ? "vibrate" : "glow"),
                Blind ? "" : " ",
-               Blind ? nul : hcolor(color));
+               Blind ? "" : hcolor(color));
 }
 
 /* Is the object chargeable?  For purposes of inventory display; it is */
@@ -806,8 +806,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
                        pline("%s violently %s%s%s for a while, then %s.",
                              Yname2(otmp),
                              otense(otmp, Blind ? "vibrate" : "glow"),
-                             (!Blind && !same_color) ? " " : nul,
-                             (Blind || same_color) ? nul :
+                             (!Blind && !same_color) ? " " : "",
+                             (Blind || same_color) ? "" :
                                hcolor(scursed ? NH_BLACK : NH_SILVER),
                              otense(otmp, "evaporate"));
                        remove_worn_item(otmp, FALSE);
@@ -836,10 +836,10 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
                }
                pline("%s %s%s%s%s for a %s.",
                      Yname2(otmp),
-                     s == 0 ? "violently " : nul,
+                     s == 0 ? "violently " : "",
                      otense(otmp, Blind ? "vibrate" : "glow"),
-                     (!Blind && !same_color) ? " " : nul,
-                     (Blind || same_color) ? nul :
+                     (!Blind && !same_color) ? " " : "",
+                     (Blind || same_color) ? "" :
                          hcolor(scursed ? NH_BLACK : NH_SILVER),
                      (s * s > 1) ? "while" : "moment");
                /* [this cost handling will need updating if shop pricing is
@@ -914,11 +914,11 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
                        Your("%s begin to %s%s.",
                            makeplural(body_part(HAND)),
                            Blind ? "tingle" : "glow ",
-                           Blind ? nul : hcolor(NH_PURPLE));
+                           Blind ? "" : hcolor(NH_PURPLE));
                        make_confused(HConfusion + rnd(100),FALSE);
                    } else {
                        pline("A %s%s surrounds your %s.",
-                           Blind ? nul : hcolor(NH_RED),
+                           Blind ? "" : hcolor(NH_RED),
                            Blind ? "faint buzz" : " glow",
                            body_part(HEAD));
                        make_confused(0L,TRUE);
index 51ab3fc36cb9631f553b7567838313a099308791..ce1073973fccc48f6ba38251110970a29ed17daa 100644 (file)
@@ -73,11 +73,7 @@ static struct save_procs {
 #endif
 };
 
-#ifdef GCC_WARN
-static long nulls[10];
-#else
-#define nulls nul
-#endif
+static long nulls[sizeof(struct trap) + sizeof(struct fruit)];
 
 #if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32)
 #define HUP    if (!program_state.done_hup)