string constants
<Someone> wrote: > Linux, Redhat 7.1 nethack 3.4.0 > >Please see attached patch file. > >I'm attempting to move more stuff into the "read-only" area, in >preparation for a port to another OS.
This commit is contained in:
16
src/apply.c
16
src/apply.c
@@ -46,7 +46,7 @@ STATIC_DCL void FDECL(add_class, (char *, CHAR_P));
|
||||
void FDECL( amii_speaker, ( struct obj *, char *, int ) );
|
||||
#endif
|
||||
|
||||
static char no_elbow_room[] = "don't have enough elbow-room to maneuver.";
|
||||
static const char no_elbow_room[] = "don't have enough elbow-room to maneuver.";
|
||||
|
||||
#ifdef TOURIST
|
||||
STATIC_OVL int
|
||||
@@ -192,7 +192,7 @@ int rx, ry, *resp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static char hollow_str[] = "a hollow sound. This must be a secret %s!";
|
||||
static const char hollow_str[] = "a hollow sound. This must be a secret %s!";
|
||||
|
||||
/* Strictly speaking it makes no sense for usage of a stethoscope to
|
||||
not take any time; however, unless it did, the stethoscope would be
|
||||
@@ -291,7 +291,7 @@ use_stethoscope(obj)
|
||||
return res;
|
||||
}
|
||||
|
||||
static char whistle_str[] = "produce a %s whistling sound.";
|
||||
static const char whistle_str[] = "produce a %s whistling sound.";
|
||||
|
||||
STATIC_OVL void
|
||||
use_whistle(obj)
|
||||
@@ -617,7 +617,7 @@ struct obj *obj;
|
||||
|
||||
#define WEAK 3 /* from eat.c */
|
||||
|
||||
static char look_str[] = "look %s.";
|
||||
static const char look_str[] = "look %s.";
|
||||
|
||||
STATIC_OVL int
|
||||
use_mirror(obj)
|
||||
@@ -1839,7 +1839,7 @@ struct obj *tstone;
|
||||
const char *streak_color;
|
||||
char stonebuf[QBUFSZ];
|
||||
static const char scritch[] = "\"scritch, scritch\"";
|
||||
static char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
|
||||
static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
|
||||
#ifndef GOLDOBJ
|
||||
struct obj goldobj;
|
||||
#endif
|
||||
@@ -2317,9 +2317,9 @@ struct obj *obj;
|
||||
|
||||
|
||||
static const char
|
||||
*not_enough_room = "There's not enough room here to use that.",
|
||||
*where_to_hit = "Where do you want to hit?",
|
||||
*cant_see_spot = "won't hit anything if you can't see that spot.";
|
||||
not_enough_room[] = "There's not enough room here to use that.",
|
||||
where_to_hit[] = "Where do you want to hit?",
|
||||
cant_see_spot[] = "won't hit anything if you can't see that spot.";
|
||||
|
||||
/* Distance attacks by pole-weapons */
|
||||
STATIC_OVL int
|
||||
|
||||
@@ -876,7 +876,7 @@ int dieroll; /* needed for Magicbane and vorpal blades */
|
||||
}
|
||||
|
||||
if (youdefend || mdef->mhp > 0) { /* ??? -dkh- */
|
||||
static const char *mb_verb[4] =
|
||||
static const char * const mb_verb[4] =
|
||||
{"probe", "stun", "scare", "purge"};
|
||||
|
||||
if (youattack || youdefend || vis) {
|
||||
@@ -987,7 +987,7 @@ int dieroll; /* needed for Magicbane and vorpal blades */
|
||||
}
|
||||
} else if (otmp->oartifact == ART_VORPAL_BLADE &&
|
||||
(dieroll == 1 || mdef->data == &mons[PM_JABBERWOCK])) {
|
||||
static const char *behead_msg[2] = {
|
||||
static const char * const behead_msg[2] = {
|
||||
"%s beheads %s!",
|
||||
"%s decapitates %s!"
|
||||
};
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
|
||||
/* part of the output on gain or loss of attribute */
|
||||
static
|
||||
const char *plusattr[] = {
|
||||
const char * const plusattr[] = {
|
||||
"strong", "smart", "wise", "agile", "tough", "charismatic"
|
||||
},
|
||||
*minusattr[] = {
|
||||
* const minusattr[] = {
|
||||
"weak", "stupid", "foolish", "clumsy", "fragile", "repulsive"
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#ifdef OVL0
|
||||
extern const char *hu_stat[]; /* defined in eat.c */
|
||||
|
||||
const char *enc_stat[] = {
|
||||
const char * const enc_stat[] = {
|
||||
"",
|
||||
"Burdened",
|
||||
"Stressed",
|
||||
|
||||
24
src/cmd.c
24
src/cmd.c
@@ -736,13 +736,13 @@ wiz_show_wmodes()
|
||||
/* -enlightenment and conduct- */
|
||||
static winid en_win;
|
||||
static const char
|
||||
*You_ = "You ",
|
||||
*are = "are ", *were = "were ",
|
||||
*have = "have ", *had = "had ",
|
||||
*can = "can ", *could = "could ";
|
||||
You_[] = "You ",
|
||||
are[] = "are ", were[] = "were ",
|
||||
have[] = "have ", had[] = "had ",
|
||||
can[] = "can ", could[] = "could ";
|
||||
static const char
|
||||
*have_been = "have been ",
|
||||
*have_never = "have never ", *never = "never ";
|
||||
have_been[] = "have been ",
|
||||
have_never[] = "have never ", never[] = "never ";
|
||||
|
||||
#define enl_msg(prefix,present,past,suffix) \
|
||||
enlght_line(prefix, final ? past : present, suffix)
|
||||
@@ -776,7 +776,7 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
|
||||
|
||||
#ifdef ELBERETH
|
||||
if (u.uevent.uhand_of_elbereth) {
|
||||
static const char *hofe_titles[3] = {
|
||||
static const char * const hofe_titles[3] = {
|
||||
"the Hand of Elbereth",
|
||||
"the Envoy of Balance",
|
||||
"the Glory of Arioch"
|
||||
@@ -1061,8 +1061,8 @@ minimal_enlightenment()
|
||||
menu_item *selected;
|
||||
anything any;
|
||||
char buf[BUFSZ], buf2[BUFSZ];
|
||||
static char fmtstr[] = "%-15s: %-12s";
|
||||
static char deity_fmtstr[] = "%-17s%s";
|
||||
static const char fmtstr[] = "%-15s: %-12s";
|
||||
static const char deity_fmtstr[] = "%-17s%s";
|
||||
|
||||
any.a_void = 0;
|
||||
buf[0] = buf2[0] = '\0';
|
||||
@@ -1482,9 +1482,9 @@ add_debug_extended_commands()
|
||||
}
|
||||
|
||||
|
||||
static const char *template = "%-18s %4ld %6ld";
|
||||
static const char *count_str = " count bytes";
|
||||
static const char *separator = "------------------ ----- ------";
|
||||
static const char template[] = "%-18s %4ld %6ld";
|
||||
static const char count_str[] = " count bytes";
|
||||
static const char separator[] = "------------------ ----- ------";
|
||||
|
||||
STATIC_OVL void
|
||||
count_obj(chain, total_count, total_size, top, recurse)
|
||||
|
||||
@@ -753,7 +753,7 @@ d_level *where;
|
||||
else return "near you";
|
||||
}
|
||||
|
||||
static struct {
|
||||
static const struct {
|
||||
const char *what;
|
||||
d_level *where;
|
||||
} level_detects[] = {
|
||||
|
||||
@@ -410,7 +410,7 @@ cleanup:
|
||||
digging.level.dlevel = -1;
|
||||
return(0);
|
||||
} else { /* not enough effort has been spent yet */
|
||||
static const char *d_target[6] = {
|
||||
static const char *const d_target[6] = {
|
||||
"", "rock", "statue", "boulder", "door", "tree"
|
||||
};
|
||||
int dig_target = dig_typ(uwep, dpx, dpy);
|
||||
@@ -923,7 +923,7 @@ struct obj *obj;
|
||||
You("swing your %s through thin air.",
|
||||
aobjnam(obj, (char *)0));
|
||||
} else {
|
||||
static const char *d_action[6] = {
|
||||
static const char * const d_action[6] = {
|
||||
"swinging",
|
||||
"digging",
|
||||
"chipping the statue",
|
||||
|
||||
@@ -1857,7 +1857,7 @@ STATIC_OVL void
|
||||
t_warn(lev)
|
||||
struct rm *lev;
|
||||
{
|
||||
static const char *warn_str = "wall_angle: %s: case %d: seenv = 0x%x";
|
||||
static const char warn_str[] = "wall_angle: %s: case %d: seenv = 0x%x";
|
||||
const char *wname;
|
||||
|
||||
if (lev->typ == TUWALL) wname = "tuwall";
|
||||
|
||||
4
src/do.c
4
src/do.c
@@ -1233,13 +1233,13 @@ boolean at_stairs, falling, portal;
|
||||
}
|
||||
|
||||
if (familiar) {
|
||||
static const char *fam_msgs[4] = {
|
||||
static const char * const fam_msgs[4] = {
|
||||
"You have a sense of deja vu.",
|
||||
"You feel like you've been here before.",
|
||||
"This place %s familiar...",
|
||||
0 /* no message */
|
||||
};
|
||||
static const char *halu_fam_msgs[4] = {
|
||||
static const char * const halu_fam_msgs[4] = {
|
||||
"Whoa! Everything %s different.",
|
||||
"You are surrounded by twisty little passages, all alike.",
|
||||
"Gee, this %s like uncle Conan's place...",
|
||||
|
||||
@@ -49,7 +49,7 @@ const char *goal;
|
||||
int cx, cy, i, c;
|
||||
int sidx, tx, ty;
|
||||
boolean msg_given = TRUE; /* clear message window by default */
|
||||
static const char *pick_chars = ".,;:";
|
||||
static const char pick_chars[] = ".,;:";
|
||||
const char *cp;
|
||||
const char *sdp;
|
||||
if(iflags.num_pad) sdp = ndir; else sdp = sdir; /* DICE workaround */
|
||||
@@ -525,7 +525,7 @@ register struct obj *obj;
|
||||
#endif /*OVLB*/
|
||||
#ifdef OVL0
|
||||
|
||||
static const char *ghostnames[] = {
|
||||
static const char * const ghostnames[] = {
|
||||
/* these names should have length < PL_NSIZ */
|
||||
/* Capitalize the names for aesthetics -dgk */
|
||||
"Adri", "Andries", "Andreas", "Bert", "David", "Dirk", "Emile",
|
||||
@@ -871,7 +871,7 @@ char *outbuf;
|
||||
return outbuf;
|
||||
}
|
||||
|
||||
static const char *bogusmons[] = {
|
||||
static const char * const bogusmons[] = {
|
||||
"jumbo shrimp", "giant pigmy", "gnu", "killer penguin",
|
||||
"giant cockroach", "giant slug", "maggot", "pterodactyl",
|
||||
"tyrannosaurus rex", "basilisk", "beholder", "nightmare",
|
||||
@@ -968,7 +968,7 @@ roguename() /* Name of a Rogue player */
|
||||
|
||||
#ifdef OVL2
|
||||
|
||||
static NEARDATA const char *hcolors[] = {
|
||||
static NEARDATA const char * const hcolors[] = {
|
||||
"ultraviolet", "infrared", "bluish-orange",
|
||||
"reddish-green", "dark white", "light black", "sky blue-pink",
|
||||
"salty", "sweet", "sour", "bitter",
|
||||
@@ -991,7 +991,7 @@ const char *colorpref;
|
||||
/* Aliases for road-runner nemesis
|
||||
* See also http://www.geocities.com/EnchantedForest/1141/latin.html
|
||||
*/
|
||||
static const char *coynames[] = {
|
||||
static const char * const coynames[] = {
|
||||
"Carnivorous Vulgaris","Road-Runnerus Digestus",
|
||||
"Eatibus Anythingus" ,"Famishus-Famishus",
|
||||
"Eatibus Almost Anythingus","Eatius Birdius",
|
||||
|
||||
@@ -17,20 +17,20 @@ static boolean cancelled_don = FALSE;
|
||||
|
||||
static NEARDATA const char see_yourself[] = "see yourself";
|
||||
static NEARDATA const char unknown_type[] = "Unknown type of %s (%d)";
|
||||
static NEARDATA const char *c_armor = "armor",
|
||||
*c_suit = "suit",
|
||||
static NEARDATA const char c_armor[] = "armor",
|
||||
c_suit[] = "suit",
|
||||
#ifdef TOURIST
|
||||
*c_shirt = "shirt",
|
||||
c_shirt[] = "shirt",
|
||||
#endif
|
||||
*c_cloak = "cloak",
|
||||
*c_gloves = "gloves",
|
||||
*c_boots = "boots",
|
||||
*c_helmet = "helmet",
|
||||
*c_shield = "shield",
|
||||
*c_weapon = "weapon",
|
||||
*c_sword = "sword",
|
||||
*c_axe = "axe",
|
||||
*c_that_ = "that";
|
||||
c_cloak[] = "cloak",
|
||||
c_gloves[] = "gloves",
|
||||
c_boots[] = "boots",
|
||||
c_helmet[] = "helmet",
|
||||
c_shield[] = "shield",
|
||||
c_weapon[] = "weapon",
|
||||
c_sword[] = "sword",
|
||||
c_axe[] = "axe",
|
||||
c_that_[] = "that";
|
||||
|
||||
static NEARDATA const long takeoff_order[] = { WORN_BLINDF, W_WEP,
|
||||
WORN_SHIELD, WORN_GLOVES, LEFT_RING, RIGHT_RING, WORN_CLOAK,
|
||||
|
||||
@@ -46,10 +46,10 @@ const char def_oc_syms[MAXOCLASSES] = {
|
||||
VENOM_SYM
|
||||
};
|
||||
|
||||
const char *invisexplain = "remembered, unseen, creature";
|
||||
const char invisexplain[] = "remembered, unseen, creature";
|
||||
|
||||
/* Object descriptions. Used in do_look(). */
|
||||
const char *objexplain[] = { /* these match def_oc_syms, above */
|
||||
const char * const objexplain[] = { /* these match def_oc_syms, above */
|
||||
/* 0*/ 0,
|
||||
"strange object",
|
||||
"weapon",
|
||||
@@ -71,7 +71,7 @@ const char *objexplain[] = { /* these match def_oc_syms, above */
|
||||
};
|
||||
|
||||
/* Object class names. Used in object_detect(). */
|
||||
const char *oclass_names[] = {
|
||||
const char * const oclass_names[] = {
|
||||
/* 0*/ 0,
|
||||
"illegal objects",
|
||||
"weapons",
|
||||
@@ -161,7 +161,7 @@ const char def_monsyms[MAXMCLASSES] = {
|
||||
* for blessed genocide, so no text should wholly contain any later
|
||||
* text. They should also always contain obvious names (eg. cat/feline).
|
||||
*/
|
||||
const char *monexplain[MAXMCLASSES] = {
|
||||
const char * const monexplain[MAXMCLASSES] = {
|
||||
0,
|
||||
"ant or other insect", "blob", "cockatrice",
|
||||
"dog or other canine", "eye or sphere", "cat or other feline",
|
||||
|
||||
24
src/shknam.c
24
src/shknam.c
@@ -13,10 +13,10 @@ extern const struct shclass shtypes[];
|
||||
#else
|
||||
|
||||
STATIC_DCL void FDECL(mkshobj_at, (const struct shclass *,int,int));
|
||||
STATIC_DCL void FDECL(nameshk, (struct monst *,const char **));
|
||||
STATIC_DCL void FDECL(nameshk, (struct monst *,const char * const *));
|
||||
STATIC_DCL int FDECL(shkinit, (const struct shclass *,struct mkroom *));
|
||||
|
||||
static const char *shkliquors[] = {
|
||||
static const char * const shkliquors[] = {
|
||||
/* Ukraine */
|
||||
"Njezjin", "Tsjernigof", "Gomel", "Ossipewsk", "Gorlowka",
|
||||
/* N. Russia */
|
||||
@@ -31,7 +31,7 @@ static const char *shkliquors[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static const char *shkbooks[] = {
|
||||
static const char * const shkbooks[] = {
|
||||
/* Eire */
|
||||
"Skibbereen", "Kanturk", "Rath Luirc", "Ennistymon", "Lahinch",
|
||||
"Kinnegad", "Lugnaquillia", "Enniscorthy", "Gweebarra",
|
||||
@@ -42,7 +42,7 @@ static const char *shkbooks[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static const char *shkarmors[] = {
|
||||
static const char * const shkarmors[] = {
|
||||
/* Turquie */
|
||||
"Demirci", "Kalecik", "Boyabai", "Yildizeli", "Gaziantep",
|
||||
"Siirt", "Akhalataki", "Tirebolu", "Aksaray", "Ermenak",
|
||||
@@ -53,7 +53,7 @@ static const char *shkarmors[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static const char *shkwands[] = {
|
||||
static const char * const shkwands[] = {
|
||||
/* Wales */
|
||||
"Yr Wyddgrug", "Trallwng", "Mallwyd", "Pontarfynach",
|
||||
"Rhaeader", "Llandrindod", "Llanfair-ym-muallt",
|
||||
@@ -67,7 +67,7 @@ static const char *shkwands[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static const char *shkrings[] = {
|
||||
static const char * const shkrings[] = {
|
||||
/* Hollandse familienamen */
|
||||
"Feyfer", "Flugi", "Gheel", "Havic", "Haynin", "Hoboken",
|
||||
"Imbyze", "Juyn", "Kinsky", "Massis", "Matray", "Moy",
|
||||
@@ -80,7 +80,7 @@ static const char *shkrings[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static const char *shkfoods[] = {
|
||||
static const char * const shkfoods[] = {
|
||||
/* Indonesia */
|
||||
"Djasinga", "Tjibarusa", "Tjiwidej", "Pengalengan",
|
||||
"Bandjar", "Parbalingga", "Bojolali", "Sarangan",
|
||||
@@ -92,7 +92,7 @@ static const char *shkfoods[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static const char *shkweapons[] = {
|
||||
static const char * const shkweapons[] = {
|
||||
/* Perigord */
|
||||
"Voulgezac", "Rouffiac", "Lerignac", "Touverac", "Guizengeard",
|
||||
"Melac", "Neuvicq", "Vanzac", "Picq", "Urignac", "Corignac",
|
||||
@@ -103,7 +103,7 @@ static const char *shkweapons[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static const char *shktools[] = {
|
||||
static const char * const shktools[] = {
|
||||
/* Spmi */
|
||||
"Ymla", "Eed-morra", "Cubask", "Nieb", "Bnowr Falr", "Telloc Cyaj",
|
||||
"Sperc", "Noskcirdneh", "Yawolloh", "Hyeghu", "Niskal", "Trahnil",
|
||||
@@ -134,7 +134,7 @@ static const char *shktools[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static const char *shklight[] = {
|
||||
static const char * const shklight[] = {
|
||||
/* Romania */
|
||||
"Zarnesti", "Slanic", "Nehoiasu", "Ludus", "Sighisoara", "Nisipitu",
|
||||
"Razboieni", "Bicaz", "Dorohoi", "Vaslui", "Fetesti", "Tirgu Neamt",
|
||||
@@ -146,7 +146,7 @@ static const char *shklight[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static const char *shkgeneral[] = {
|
||||
static const char * const shkgeneral[] = {
|
||||
/* Suriname */
|
||||
"Hebiwerie", "Possogroenoe", "Asidonhopo", "Manlobbi",
|
||||
"Adjama", "Pakka Pakka", "Kabalebo", "Wonotobo",
|
||||
@@ -271,7 +271,7 @@ int sx, sy;
|
||||
STATIC_OVL void
|
||||
nameshk(shk, nlp)
|
||||
struct monst *shk;
|
||||
const char *nlp[];
|
||||
const char * const nlp[];
|
||||
{
|
||||
int i, trycnt, names_avail;
|
||||
const char *shname = 0;
|
||||
|
||||
@@ -37,7 +37,7 @@ take_gold()
|
||||
int
|
||||
dosit()
|
||||
{
|
||||
static const char *sit_message = "sit on the %s.";
|
||||
static const char sit_message[] = "sit on the %s.";
|
||||
register struct trap *trap;
|
||||
register int typ = levl[u.ux][u.uy].typ;
|
||||
|
||||
@@ -312,7 +312,7 @@ rndcurse() /* curse a few inventory items at random! */
|
||||
int nobj = 0;
|
||||
int cnt, onum;
|
||||
struct obj *otmp;
|
||||
static const char *mal_aura = "feel a malignant aura surround %s.";
|
||||
static const char mal_aura[] = "feel a malignant aura surround %s.";
|
||||
|
||||
if (uwep && (uwep->oartifact == ART_MAGICBANE) && rn2(20)) {
|
||||
You(mal_aura, "the magic-absorbing blade");
|
||||
|
||||
28
src/sounds.c
28
src/sounds.c
@@ -45,7 +45,7 @@ dosounds()
|
||||
hallu = Hallucination ? 1 : 0;
|
||||
|
||||
if (level.flags.nfountains && !rn2(400)) {
|
||||
static const char *fountain_msg[4] = {
|
||||
static const char * const fountain_msg[4] = {
|
||||
"bubbling water.",
|
||||
"water falling on coins.",
|
||||
"the splashing of a naiad.",
|
||||
@@ -55,7 +55,7 @@ dosounds()
|
||||
}
|
||||
#ifdef SINK
|
||||
if (level.flags.nsinks && !rn2(300)) {
|
||||
static const char *sink_msg[3] = {
|
||||
static const char * const sink_msg[3] = {
|
||||
"a slow drip.",
|
||||
"a gurgling noise.",
|
||||
"dishes being washed!",
|
||||
@@ -64,7 +64,7 @@ dosounds()
|
||||
}
|
||||
#endif
|
||||
if (level.flags.has_court && !rn2(200)) {
|
||||
static const char *throne_msg[4] = {
|
||||
static const char * const throne_msg[4] = {
|
||||
"the tones of courtly conversation.",
|
||||
"a sceptre pounded in judgment.",
|
||||
"Someone shouts \"Off with %s head!\"",
|
||||
@@ -86,7 +86,7 @@ dosounds()
|
||||
}
|
||||
}
|
||||
if (level.flags.has_swamp && !rn2(200)) {
|
||||
static const char *swamp_msg[3] = {
|
||||
static const char * const swamp_msg[3] = {
|
||||
"hear mosquitoes!",
|
||||
"smell marsh gas!", /* so it's a smell...*/
|
||||
"hear Donald Duck!",
|
||||
@@ -181,7 +181,7 @@ dosounds()
|
||||
}
|
||||
}
|
||||
if (level.flags.has_barracks && !rn2(200)) {
|
||||
static const char *barracks_msg[4] = {
|
||||
static const char * const barracks_msg[4] = {
|
||||
"blades being honed.",
|
||||
"loud snoring.",
|
||||
"dice being thrown.",
|
||||
@@ -205,7 +205,7 @@ dosounds()
|
||||
}
|
||||
}
|
||||
if (level.flags.has_zoo && !rn2(200)) {
|
||||
static const char *zoo_msg[3] = {
|
||||
static const char * const zoo_msg[3] = {
|
||||
"a sound reminiscent of an elephant stepping on a peanut.",
|
||||
"a sound reminiscent of a seal barking.",
|
||||
"Doctor Doolittle!",
|
||||
@@ -227,7 +227,7 @@ dosounds()
|
||||
}
|
||||
if (tended_shop(sroom) &&
|
||||
!index(u.ushops, ROOM_INDEX(sroom) + ROOMOFFSET)) {
|
||||
static const char *shop_msg[3] = {
|
||||
static const char * const shop_msg[3] = {
|
||||
"someone cursing shoplifters.",
|
||||
"the chime of a cash register.",
|
||||
"Neiman and Marcus arguing!",
|
||||
@@ -243,7 +243,7 @@ dosounds()
|
||||
break;
|
||||
/* and don't produce silly effects when she's clearly visible */
|
||||
if (mtmp && (hallu || !canseemon(mtmp))) {
|
||||
static const char *ora_msg[5] = {
|
||||
static const char * const ora_msg[5] = {
|
||||
"a strange wind.", /* Jupiter at Dodona */
|
||||
"convulsive ravings.", /* Apollo at Delphi */
|
||||
"snoring snakes.", /* AEsculapius at Epidaurus */
|
||||
@@ -259,7 +259,7 @@ dosounds()
|
||||
#endif /* OVL0 */
|
||||
#ifdef OVLB
|
||||
|
||||
static const char *h_sounds[] = {
|
||||
static const char * const h_sounds[] = {
|
||||
"beep", "boing", "sing", "belche", "creak", "cough", "rattle",
|
||||
"ululate", "pop", "jingle", "sniffle", "tinkle", "eep"
|
||||
};
|
||||
@@ -495,7 +495,7 @@ register struct monst *mtmp;
|
||||
verbl_msg = "I only drink... potions.";
|
||||
} else {
|
||||
int vampindex;
|
||||
static const char *vampmsg[] = {
|
||||
static const char * const vampmsg[] = {
|
||||
/* These first two (0 and 1) are specially handled below */
|
||||
"I vant to suck your %s!",
|
||||
"I vill come after %s without regret!",
|
||||
@@ -623,7 +623,7 @@ register struct monst *mtmp;
|
||||
break;
|
||||
case MS_LAUGH:
|
||||
{
|
||||
static const char *laugh_msg[4] = {
|
||||
static const char * const laugh_msg[4] = {
|
||||
"giggles.", "chuckles.", "snickers.", "laughs.",
|
||||
};
|
||||
pline_msg = laugh_msg[rn2(4)];
|
||||
@@ -739,7 +739,7 @@ register struct monst *mtmp;
|
||||
verbalize("Just the facts, %s.",
|
||||
flags.female ? "Ma'am" : "Sir");
|
||||
else {
|
||||
static const char *arrest_msg[3] = {
|
||||
static const char * const arrest_msg[3] = {
|
||||
"Anything you say can be used against you.",
|
||||
"You're under arrest!",
|
||||
"Stop in the name of the Law!",
|
||||
@@ -787,11 +787,11 @@ register struct monst *mtmp;
|
||||
break;
|
||||
case MS_SOLDIER:
|
||||
{
|
||||
static const char *soldier_foe_msg[3] = {
|
||||
static const char * const soldier_foe_msg[3] = {
|
||||
"Resistance is useless!",
|
||||
"You're dog meat!",
|
||||
"Surrender!",
|
||||
}, *soldier_pax_msg[3] = {
|
||||
}, * const soldier_pax_msg[3] = {
|
||||
"What lousy pay we're getting here!",
|
||||
"The food's not fit for Orcs!",
|
||||
"My feet hurt, I've been on them all day!",
|
||||
|
||||
@@ -313,7 +313,7 @@ gotobj:
|
||||
ostuck = (otmp->cursed && otmp->owornmask);
|
||||
|
||||
if (ostuck || !can_carry(mtmp, otmp)) {
|
||||
static const char *how[] = { "steal","snatch","grab","take" };
|
||||
static const char * const how[] = { "steal","snatch","grab","take" };
|
||||
cant_take:
|
||||
pline("%s tries to %s your %s but gives up.",
|
||||
Monnam(mtmp), how[rn2(SIZE(how))],
|
||||
|
||||
@@ -17,7 +17,7 @@ STATIC_DCL void FDECL(cleanup_burn, (genericptr_t,long));
|
||||
#ifdef OVLB
|
||||
|
||||
/* He is being petrified - dialogue by inmet!tower */
|
||||
static NEARDATA const char *stoned_texts[] = {
|
||||
static NEARDATA const char * const stoned_texts[] = {
|
||||
"You are slowing down.", /* 5 */
|
||||
"Your limbs are stiffening.", /* 4 */
|
||||
"Your limbs have turned to stone.", /* 3 */
|
||||
@@ -40,7 +40,7 @@ stoned_dialogue()
|
||||
}
|
||||
|
||||
/* He is getting sicker and sicker prior to vomiting */
|
||||
static NEARDATA const char *vomiting_texts[] = {
|
||||
static NEARDATA const char * const vomiting_texts[] = {
|
||||
"are feeling mildly nauseous.", /* 14 */
|
||||
"feel slightly confused.", /* 11 */
|
||||
"can't seem to think straight.", /* 8 */
|
||||
@@ -72,7 +72,7 @@ vomiting_dialogue()
|
||||
exercise(A_CON, FALSE);
|
||||
}
|
||||
|
||||
static NEARDATA const char *choke_texts[] = {
|
||||
static NEARDATA const char * const choke_texts[] = {
|
||||
"You find it hard to breathe.",
|
||||
"You're gasping for air.",
|
||||
"You can no longer breathe.",
|
||||
@@ -80,7 +80,7 @@ static NEARDATA const char *choke_texts[] = {
|
||||
"You suffocate."
|
||||
};
|
||||
|
||||
static NEARDATA const char *choke_texts2[] = {
|
||||
static NEARDATA const char * const choke_texts2[] = {
|
||||
"Your %s is becoming constricted.",
|
||||
"Your blood is having trouble reaching your brain.",
|
||||
"The pressure on your %s increases.",
|
||||
@@ -108,7 +108,7 @@ choke_dialogue()
|
||||
exercise(A_STR, FALSE);
|
||||
}
|
||||
|
||||
static NEARDATA const char *slime_texts[] = {
|
||||
static NEARDATA const char * const slime_texts[] = {
|
||||
"You are turning a little %s.", /* 5 */
|
||||
"Your limbs are getting oozy.", /* 4 */
|
||||
"Your skin begins to peel away.", /* 3 */
|
||||
@@ -1309,7 +1309,7 @@ typedef struct {
|
||||
} ttable;
|
||||
|
||||
/* table of timeout functions */
|
||||
static ttable timeout_funcs[NUM_TIME_FUNCS] = {
|
||||
static const ttable timeout_funcs[NUM_TIME_FUNCS] = {
|
||||
TTAB(rot_organic, (timeout_proc)0, "rot_organic"),
|
||||
TTAB(rot_corpse, (timeout_proc)0, "rot_corpse"),
|
||||
TTAB(revive_mon, (timeout_proc)0, "revive_mon"),
|
||||
|
||||
14
src/topten.c
14
src/topten.c
@@ -76,7 +76,7 @@ STATIC_DCL void FDECL(nsb_unmung_line,(char*));
|
||||
#endif
|
||||
|
||||
/* must fit with end.c; used in rip.c */
|
||||
NEARDATA const char *killed_by_prefix[] = {
|
||||
NEARDATA const char * const killed_by_prefix[] = {
|
||||
"killed by ", "choked on ", "poisoned by ", "", "drowned in ",
|
||||
"burned by ", "dissolved in ", "crushed to death by ", "petrified by ",
|
||||
"turned to slime by ", "killed by ", "", "", "", "", ""
|
||||
@@ -128,13 +128,13 @@ FILE *rfile;
|
||||
struct toptenentry *tt;
|
||||
{
|
||||
#ifdef NO_SCAN_BRACK /* Version_ Pts DgnLevs_ Hp___ Died__Born id */
|
||||
static const char *fmt = "%d %d %d %ld %d %d %d %d %d %d %ld %ld %d%*c";
|
||||
static const char *fmt32 = "%c%c %s %s%*c";
|
||||
static const char *fmt33 = "%s %s %s %s %s %s%*c";
|
||||
static const char fmt[] = "%d %d %d %ld %d %d %d %d %d %d %ld %ld %d%*c";
|
||||
static const char fmt32[] = "%c%c %s %s%*c";
|
||||
static const char fmt33[] = "%s %s %s %s %s %s%*c";
|
||||
#else
|
||||
static const char *fmt = "%d.%d.%d %ld %d %d %d %d %d %d %ld %ld %d ";
|
||||
static const char *fmt32 = "%c%c %[^,],%[^\n]%*c";
|
||||
static const char *fmt33 = "%s %s %s %s %[^,],%[^\n]%*c";
|
||||
static const char fmt[] = "%d.%d.%d %ld %d %d %d %d %d %d %ld %ld %d ";
|
||||
static const char fmt32[] = "%c%c %[^,],%[^\n]%*c";
|
||||
static const char fmt33[] = "%s %s %s %s %[^,],%[^\n]%*c";
|
||||
#endif
|
||||
|
||||
#ifdef UPDATE_RECORD_IN_PLACE
|
||||
|
||||
14
src/trap.c
14
src/trap.c
@@ -38,11 +38,11 @@ STATIC_VAR const char * const blindgas[6];
|
||||
|
||||
#else
|
||||
|
||||
STATIC_VAR const char *a_your[2] = { "a", "your" };
|
||||
STATIC_VAR const char *A_Your[2] = { "A", "Your" };
|
||||
STATIC_VAR const char *the_your[2] = { "the", "your" };
|
||||
STATIC_VAR const char * const a_your[2] = { "a", "your" };
|
||||
STATIC_VAR const char * const A_Your[2] = { "A", "Your" };
|
||||
STATIC_VAR const char * const the_your[2] = { "the", "your" };
|
||||
STATIC_VAR const char tower_of_flame[] = "tower of flame";
|
||||
STATIC_VAR const char *A_gush_of_water_hits = "A gush of water hits";
|
||||
STATIC_VAR const char * const A_gush_of_water_hits = "A gush of water hits";
|
||||
STATIC_VAR const char * const blindgas[6] =
|
||||
{"humid", "odorless", "pungent", "chilling", "acrid", "biting"};
|
||||
|
||||
@@ -120,8 +120,8 @@ int type;
|
||||
boolean print;
|
||||
struct monst *victim;
|
||||
{
|
||||
static NEARDATA const char *action[] = { "smoulder", "rust", "rot", "corrode" };
|
||||
static NEARDATA const char *msg[] = { "burnt", "rusted", "rotten", "corroded" };
|
||||
static NEARDATA const char * const action[] = { "smoulder", "rust", "rot", "corrode" };
|
||||
static NEARDATA const char * const msg[] = { "burnt", "rusted", "rotten", "corroded" };
|
||||
boolean vulnerable = FALSE;
|
||||
boolean grprot = FALSE;
|
||||
boolean is_primary = TRUE;
|
||||
@@ -3668,7 +3668,7 @@ unconscious()
|
||||
!strncmp(nomovemsg,"You are consci", 14))));
|
||||
}
|
||||
|
||||
static char lava_killer[] = "molten lava";
|
||||
static const char lava_killer[] = "molten lava";
|
||||
|
||||
boolean
|
||||
lava_effects()
|
||||
|
||||
28
src/u_init.c
28
src/u_init.c
@@ -251,7 +251,7 @@ static struct inv_sub { short race_pm, item_otyp, subs_otyp; } inv_subs[] = {
|
||||
{ NON_PM, STRANGE_OBJECT, STRANGE_OBJECT }
|
||||
};
|
||||
|
||||
static struct def_skill Skill_A[] = {
|
||||
static const struct def_skill Skill_A[] = {
|
||||
{ P_DAGGER, P_BASIC }, { P_KNIFE, P_BASIC },
|
||||
{ P_PICK_AXE, P_EXPERT }, { P_SHORT_SWORD, P_BASIC },
|
||||
{ P_SCIMITAR, P_SKILLED }, { P_SABER, P_EXPERT },
|
||||
@@ -269,7 +269,7 @@ static struct def_skill Skill_A[] = {
|
||||
{ P_NONE, 0 }
|
||||
};
|
||||
|
||||
static struct def_skill Skill_B[] = {
|
||||
static const struct def_skill Skill_B[] = {
|
||||
{ P_DAGGER, P_BASIC }, { P_AXE, P_EXPERT },
|
||||
{ P_PICK_AXE, P_EXPERT }, { P_SHORT_SWORD, P_BASIC },
|
||||
{ P_BROAD_SWORD, P_SKILLED }, { P_LONG_SWORD, P_SKILLED },
|
||||
@@ -288,7 +288,7 @@ static struct def_skill Skill_B[] = {
|
||||
{ P_NONE, 0 }
|
||||
};
|
||||
|
||||
static struct def_skill Skill_C[] = {
|
||||
static const struct def_skill Skill_C[] = {
|
||||
{ P_DAGGER, P_BASIC }, { P_KNIFE, P_SKILLED },
|
||||
{ P_AXE, P_SKILLED }, { P_PICK_AXE, P_BASIC },
|
||||
{ P_CLUB, P_EXPERT }, { P_MACE, P_EXPERT },
|
||||
@@ -303,7 +303,7 @@ static struct def_skill Skill_C[] = {
|
||||
{ P_NONE, 0 }
|
||||
};
|
||||
|
||||
static struct def_skill Skill_H[] = {
|
||||
static const struct def_skill Skill_H[] = {
|
||||
{ P_DAGGER, P_SKILLED }, { P_KNIFE, P_EXPERT },
|
||||
{ P_SHORT_SWORD, P_SKILLED }, { P_SCIMITAR, P_BASIC },
|
||||
{ P_SABER, P_BASIC }, { P_CLUB, P_SKILLED },
|
||||
@@ -317,7 +317,7 @@ static struct def_skill Skill_H[] = {
|
||||
{ P_NONE, 0 }
|
||||
};
|
||||
|
||||
static struct def_skill Skill_K[] = {
|
||||
static const struct def_skill Skill_K[] = {
|
||||
{ P_DAGGER, P_BASIC }, { P_KNIFE, P_BASIC },
|
||||
{ P_AXE, P_SKILLED }, { P_PICK_AXE, P_BASIC },
|
||||
{ P_SHORT_SWORD, P_SKILLED }, { P_BROAD_SWORD, P_SKILLED },
|
||||
@@ -339,7 +339,7 @@ static struct def_skill Skill_K[] = {
|
||||
{ P_NONE, 0 }
|
||||
};
|
||||
|
||||
static struct def_skill Skill_Mon[] = {
|
||||
static const struct def_skill Skill_Mon[] = {
|
||||
{ P_QUARTERSTAFF, P_BASIC }, { P_SPEAR, P_BASIC },
|
||||
{ P_JAVELIN, P_BASIC }, { P_CROSSBOW, P_BASIC },
|
||||
{ P_SHURIKEN, P_BASIC },
|
||||
@@ -351,7 +351,7 @@ static struct def_skill Skill_Mon[] = {
|
||||
{ P_NONE, 0 }
|
||||
};
|
||||
|
||||
static struct def_skill Skill_P[] = {
|
||||
static const struct def_skill Skill_P[] = {
|
||||
{ P_CLUB, P_EXPERT }, { P_MACE, P_EXPERT },
|
||||
{ P_MORNING_STAR, P_EXPERT }, { P_FLAIL, P_EXPERT },
|
||||
{ P_HAMMER, P_EXPERT }, { P_QUARTERSTAFF, P_EXPERT },
|
||||
@@ -367,7 +367,7 @@ static struct def_skill Skill_P[] = {
|
||||
{ P_NONE, 0 }
|
||||
};
|
||||
|
||||
static struct def_skill Skill_R[] = {
|
||||
static const struct def_skill Skill_R[] = {
|
||||
{ P_DAGGER, P_EXPERT }, { P_KNIFE, P_EXPERT },
|
||||
{ P_SHORT_SWORD, P_EXPERT }, { P_BROAD_SWORD, P_SKILLED },
|
||||
{ P_LONG_SWORD, P_SKILLED }, { P_TWO_HANDED_SWORD, P_BASIC },
|
||||
@@ -387,7 +387,7 @@ static struct def_skill Skill_R[] = {
|
||||
{ P_NONE, 0 }
|
||||
};
|
||||
|
||||
static struct def_skill Skill_Ran[] = {
|
||||
static const struct def_skill Skill_Ran[] = {
|
||||
{ P_DAGGER, P_EXPERT }, { P_KNIFE, P_SKILLED },
|
||||
{ P_AXE, P_SKILLED }, { P_PICK_AXE, P_BASIC },
|
||||
{ P_SHORT_SWORD, P_BASIC }, { P_MORNING_STAR, P_BASIC },
|
||||
@@ -408,7 +408,7 @@ static struct def_skill Skill_Ran[] = {
|
||||
{ P_NONE, 0 }
|
||||
};
|
||||
|
||||
static struct def_skill Skill_S[] = {
|
||||
static const struct def_skill Skill_S[] = {
|
||||
{ P_DAGGER, P_BASIC }, { P_KNIFE, P_SKILLED },
|
||||
{ P_SHORT_SWORD, P_EXPERT }, { P_BROAD_SWORD, P_SKILLED },
|
||||
{ P_LONG_SWORD, P_EXPERT }, { P_TWO_HANDED_SWORD, P_EXPERT },
|
||||
@@ -427,7 +427,7 @@ static struct def_skill Skill_S[] = {
|
||||
};
|
||||
|
||||
#ifdef TOURIST
|
||||
static struct def_skill Skill_T[] = {
|
||||
static const struct def_skill Skill_T[] = {
|
||||
{ P_DAGGER, P_EXPERT }, { P_KNIFE, P_SKILLED },
|
||||
{ P_AXE, P_BASIC }, { P_PICK_AXE, P_BASIC },
|
||||
{ P_SHORT_SWORD, P_EXPERT }, { P_BROAD_SWORD, P_BASIC },
|
||||
@@ -453,7 +453,7 @@ static struct def_skill Skill_T[] = {
|
||||
};
|
||||
#endif /* TOURIST */
|
||||
|
||||
static struct def_skill Skill_V[] = {
|
||||
static const struct def_skill Skill_V[] = {
|
||||
{ P_DAGGER, P_EXPERT }, { P_AXE, P_EXPERT },
|
||||
{ P_PICK_AXE, P_SKILLED }, { P_SHORT_SWORD, P_SKILLED },
|
||||
{ P_BROAD_SWORD, P_SKILLED }, { P_LONG_SWORD, P_EXPERT },
|
||||
@@ -472,7 +472,7 @@ static struct def_skill Skill_V[] = {
|
||||
{ P_NONE, 0 }
|
||||
};
|
||||
|
||||
static struct def_skill Skill_W[] = {
|
||||
static const struct def_skill Skill_W[] = {
|
||||
{ P_DAGGER, P_EXPERT }, { P_KNIFE, P_SKILLED },
|
||||
{ P_AXE, P_SKILLED }, { P_SHORT_SWORD, P_BASIC },
|
||||
{ P_CLUB, P_SKILLED }, { P_MACE, P_BASIC },
|
||||
@@ -850,7 +850,7 @@ STATIC_OVL boolean
|
||||
restricted_spell_discipline(otyp)
|
||||
int otyp;
|
||||
{
|
||||
struct def_skill *skills;
|
||||
const struct def_skill *skills;
|
||||
int this_skill = spell_skilltype(otyp);
|
||||
|
||||
switch (Role_switch) {
|
||||
|
||||
@@ -112,7 +112,7 @@ void
|
||||
store_version(fd)
|
||||
int fd;
|
||||
{
|
||||
static struct version_info version_data = {
|
||||
const static struct version_info version_data = {
|
||||
VERSION_NUMBER, VERSION_FEATURES,
|
||||
VERSION_SANITY1, VERSION_SANITY2
|
||||
};
|
||||
|
||||
10
src/weapon.c
10
src/weapon.c
@@ -56,7 +56,7 @@ STATIC_VAR NEARDATA const short skill_names_indices[P_NUM_SKILLS] = {
|
||||
};
|
||||
|
||||
/* note: entry [0] isn't used */
|
||||
STATIC_VAR NEARDATA const char *odd_skill_names[] = {
|
||||
STATIC_VAR NEARDATA const char * const odd_skill_names[] = {
|
||||
"no skill",
|
||||
"bare hands", /* use barehands_or_martial[] instead */
|
||||
"two weapon combat",
|
||||
@@ -74,7 +74,7 @@ STATIC_VAR NEARDATA const char *odd_skill_names[] = {
|
||||
"matter spells",
|
||||
};
|
||||
/* indexed vis `is_martial() */
|
||||
STATIC_VAR NEARDATA const char *barehands_or_martial[] = {
|
||||
STATIC_VAR NEARDATA const char * const barehands_or_martial[] = {
|
||||
"bare handed combat", "martial arts"
|
||||
};
|
||||
|
||||
@@ -472,7 +472,7 @@ register struct monst *mtmp;
|
||||
}
|
||||
|
||||
/* Weapons in order of preference */
|
||||
static NEARDATA short hwep[] = {
|
||||
static const NEARDATA short hwep[] = {
|
||||
CORPSE, /* cockatrice corpse */
|
||||
TSURUGI, RUNESWORD, DWARVISH_MATTOCK, TWO_HANDED_SWORD, BATTLE_AXE,
|
||||
KATANA, UNICORN_HORN, CRYSKNIFE, TRIDENT, LONG_SWORD,
|
||||
@@ -835,7 +835,7 @@ int skill;
|
||||
P_NAME(skill));
|
||||
}
|
||||
|
||||
static struct skill_range {
|
||||
const static struct skill_range {
|
||||
short first, last;
|
||||
const char *name;
|
||||
} skill_ranges[] = {
|
||||
@@ -1237,7 +1237,7 @@ struct obj *weapon;
|
||||
*/
|
||||
void
|
||||
skill_init(class_skill)
|
||||
struct def_skill *class_skill;
|
||||
const struct def_skill *class_skill;
|
||||
{
|
||||
struct obj *obj;
|
||||
int skmax, skill;
|
||||
|
||||
@@ -550,7 +550,7 @@ wizdead()
|
||||
}
|
||||
}
|
||||
|
||||
const char *random_insult[] = {
|
||||
const char * const random_insult[] = {
|
||||
"antic",
|
||||
"blackguard",
|
||||
"caitiff",
|
||||
@@ -581,7 +581,7 @@ const char *random_insult[] = {
|
||||
"wretch",
|
||||
};
|
||||
|
||||
const char *random_malediction[] = {
|
||||
const char * const random_malediction[] = {
|
||||
"Hell shall soon claim thy remains,",
|
||||
"I chortle at thee, thou pathetic",
|
||||
"Prepare to die, thou",
|
||||
|
||||
@@ -62,7 +62,7 @@ extern const char *flash_types[];
|
||||
#else
|
||||
STATIC_VAR const char are_blinded_by_the_flash[] = "are blinded by the flash!";
|
||||
|
||||
const char *flash_types[] = { /* also used in buzzmu(mcastu.c) */
|
||||
const char * const flash_types[] = { /* also used in buzzmu(mcastu.c) */
|
||||
"magic missile", /* Wands must be 0-9 */
|
||||
"bolt of fire",
|
||||
"bolt of cold",
|
||||
@@ -3752,7 +3752,7 @@ register struct obj *obj;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
const char *destroy_strings[] = {
|
||||
const char * const destroy_strings[] = {
|
||||
"freezes and shatters", "freeze and shatter", "shattered potion",
|
||||
"boils and explodes", "boil and explode", "boiling potion",
|
||||
"catches fire and burns", "catch fire and burn", "burning scroll",
|
||||
|
||||
Reference in New Issue
Block a user