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:
nethack.allison
2002-08-20 08:05:20 +00:00
parent ab63d7830e
commit fc319a4be0
27 changed files with 128 additions and 128 deletions

View File

@@ -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!",