From a3b1cb84326fdcbd24419b027ec245ab6cd514b1 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Wed, 18 Feb 2015 23:51:08 -0500 Subject: [PATCH] Remove the 'nul' variable. --- include/decl.h | 1 - src/decl.c | 1 - src/dig.c | 2 +- src/eat.c | 2 +- src/hack.c | 2 +- src/mthrowu.c | 2 +- src/read.c | 16 ++++++++-------- src/save.c | 6 +----- 8 files changed, 13 insertions(+), 19 deletions(-) diff --git a/include/decl.h b/include/decl.h index e31d76bdb..e371c977f 100644 --- a/include/decl.h +++ b/include/decl.h @@ -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[]; diff --git a/src/decl.c b/src/decl.c index 775a06f4c..93036da34 100644 --- a/src/decl.c +++ b/src/decl.c @@ -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'; diff --git a/src/dig.c b/src/dig.c index 94ee98a18..5e0b40aca 100644 --- 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) { diff --git a/src/eat.c b/src/eat.c index 00173e583..8aa7f5da1 100644 --- 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: diff --git a/src/hack.c b/src/hack.c index 728e75774..792671075 100644 --- a/src/hack.c +++ b/src/hack.c @@ -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)); diff --git a/src/mthrowu.c b/src/mthrowu.c index 258dd4755..ea955d6a6 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -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(); diff --git a/src/read.c b/src/read.c index 686a837b1..755d09969 100644 --- a/src/read.c +++ b/src/read.c @@ -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); diff --git a/src/save.c b/src/save.c index 51ab3fc36..ce1073973 100644 --- a/src/save.c +++ b/src/save.c @@ -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) -- 2.40.0