some variables not referenced in another translation unit made static

Also adds some cross-refence comments for some variables that are
referenced in another translation unit.
This commit is contained in:
nhmall
2024-03-15 16:00:14 -04:00
parent 243f6410d2
commit 79648c6ce2
31 changed files with 94 additions and 71 deletions
+8 -7
View File
@@ -1109,6 +1109,7 @@ timet_delta(time_t etim, time_t stim) /* end and start times */
#if !defined(NODUMPENUMS) || defined(ENHANCED_SYMBOLS) #if !defined(NODUMPENUMS) || defined(ENHANCED_SYMBOLS)
/* monsdump[] and objdump[] are also used in utf8map.c */ /* monsdump[] and objdump[] are also used in utf8map.c */
#define DUMP_ENUMS #define DUMP_ENUMS
struct enum_dump monsdump[] = { struct enum_dump monsdump[] = {
#include "monsters.h" #include "monsters.h"
@@ -1124,46 +1125,46 @@ struct enum_dump objdump[] = {
}; };
#define DUMP_ENUMS_PCHAR #define DUMP_ENUMS_PCHAR
struct enum_dump defsym_cmap_dump[] = { static struct enum_dump defsym_cmap_dump[] = {
#include "defsym.h" #include "defsym.h"
{ MAXPCHARS, "MAXPCHARS" }, { MAXPCHARS, "MAXPCHARS" },
}; };
#undef DUMP_ENUMS_PCHAR #undef DUMP_ENUMS_PCHAR
#define DUMP_ENUMS_MONSYMS #define DUMP_ENUMS_MONSYMS
struct enum_dump defsym_mon_syms_dump[] = { static struct enum_dump defsym_mon_syms_dump[] = {
#include "defsym.h" #include "defsym.h"
{ MAXMCLASSES, "MAXMCLASSES" }, { MAXMCLASSES, "MAXMCLASSES" },
}; };
#undef DUMP_ENUMS_MONSYMS #undef DUMP_ENUMS_MONSYMS
#define DUMP_ENUMS_MONSYMS_DEFCHAR #define DUMP_ENUMS_MONSYMS_DEFCHAR
struct enum_dump defsym_mon_defchars_dump[] = { static struct enum_dump defsym_mon_defchars_dump[] = {
#include "defsym.h" #include "defsym.h"
}; };
#undef DUMP_ENUMS_MONSYMS_DEFCHAR #undef DUMP_ENUMS_MONSYMS_DEFCHAR
#define DUMP_ENUMS_OBJCLASS_DEFCHARS #define DUMP_ENUMS_OBJCLASS_DEFCHARS
struct enum_dump objclass_defchars_dump[] = { static struct enum_dump objclass_defchars_dump[] = {
#include "defsym.h" #include "defsym.h"
}; };
#undef DUMP_ENUMS_OBJCLASS_DEFCHARS #undef DUMP_ENUMS_OBJCLASS_DEFCHARS
#define DUMP_ENUMS_OBJCLASS_CLASSES #define DUMP_ENUMS_OBJCLASS_CLASSES
struct enum_dump objclass_classes_dump[] = { static struct enum_dump objclass_classes_dump[] = {
#include "defsym.h" #include "defsym.h"
{ MAXOCLASSES, "MAXOCLASSES" }, { MAXOCLASSES, "MAXOCLASSES" },
}; };
#undef DUMP_ENUMS_OBJCLASS_CLASSES #undef DUMP_ENUMS_OBJCLASS_CLASSES
#define DUMP_ENUMS_OBJCLASS_SYMS #define DUMP_ENUMS_OBJCLASS_SYMS
struct enum_dump objclass_syms_dump[] = { static struct enum_dump objclass_syms_dump[] = {
#include "defsym.h" #include "defsym.h"
}; };
#undef DUMP_ENUMS_OBJCLASS_SYMS #undef DUMP_ENUMS_OBJCLASS_SYMS
#define DUMP_ARTI_ENUM #define DUMP_ARTI_ENUM
struct enum_dump arti_enum_dump[] = { static struct enum_dump arti_enum_dump[] = {
#include "artilist.h" #include "artilist.h"
{ AFTER_LAST_ARTIFACT, "AFTER_LAST_ARTIFACT" } { AFTER_LAST_ARTIFACT, "AFTER_LAST_ARTIFACT" }
}; };
+3 -1
View File
@@ -14,7 +14,9 @@ static const char
*const minusattr[] = { "weak", "stupid", *const minusattr[] = { "weak", "stupid",
"foolish", "clumsy", "foolish", "clumsy",
"fragile", "repulsive" }; "fragile", "repulsive" };
/* also used by enlightenment for non-abbreviated status info */ /* also used by enlightenment in insight.c for non-abbreviated status info */
extern const char *const attrname[6];
const char const char
*const attrname[] = { "strength", "intelligence", "wisdom", *const attrname[] = { "strength", "intelligence", "wisdom",
"dexterity", "constitution", "charisma" }; "dexterity", "constitution", "charisma" };
+2 -1
View File
@@ -10,6 +10,7 @@
extern const char *const hu_stat[]; /* defined in eat.c */ extern const char *const hu_stat[]; /* defined in eat.c */
/* also used in insight.c */
const char *const enc_stat[] = { const char *const enc_stat[] = {
"", "Burdened", "Stressed", "", "Burdened", "Stressed",
"Strained", "Overtaxed", "Overloaded" "Strained", "Overtaxed", "Overloaded"
@@ -591,7 +592,7 @@ static struct istat_s initblstats[MAXBLSTATS] = {
#ifdef STATUS_HILITES #ifdef STATUS_HILITES
const struct condmap condition_aliases[] = { static const struct condmap condition_aliases[] = {
{ "strangled", BL_MASK_STRNGL }, { "strangled", BL_MASK_STRNGL },
{ "all", BL_MASK_BAREH | BL_MASK_BLIND | BL_MASK_BUSY { "all", BL_MASK_BAREH | BL_MASK_BLIND | BL_MASK_BUSY
| BL_MASK_CONF | BL_MASK_DEAF | BL_MASK_ELF_IRON | BL_MASK_CONF | BL_MASK_DEAF | BL_MASK_ELF_IRON
+6 -3
View File
@@ -144,8 +144,10 @@ static char *doc_extcmd_flagstr(winid, const struct ext_func_tab *);
static const char *readchar_queue = ""; static const char *readchar_queue = "";
/* for rejecting attempts to use wizard mode commands */ /* for rejecting attempts to use wizard mode commands
* Also used in wizcmds.c */
const char unavailcmd[] = "Unavailable command '%s'."; const char unavailcmd[] = "Unavailable command '%s'.";
/* for rejecting #if !SHELL, !SUSPEND */ /* for rejecting #if !SHELL, !SUSPEND */
static const char cmdnotavail[] = "'%s' command not available."; static const char cmdnotavail[] = "'%s' command not available.";
@@ -1038,7 +1040,8 @@ makemap_prepost(boolean pre, boolean wiztower)
} }
/* temporary? hack, since level type codes aren't the same as screen /* temporary? hack, since level type codes aren't the same as screen
symbols and only the latter have easily accessible descriptions */ symbols and only the latter have easily accessible descriptions.
Also used by wizcmds.c */
const char *levltyp[MAX_TYPE + 2] = { const char *levltyp[MAX_TYPE + 2] = {
"stone", "vertical wall", "horizontal wall", "top-left corner wall", "stone", "vertical wall", "horizontal wall", "top-left corner wall",
"top-right corner wall", "bottom-left corner wall", "top-right corner wall", "bottom-left corner wall",
@@ -2029,7 +2032,7 @@ static const struct {
{ 0, (const char *) 0, FALSE } { 0, (const char *) 0, FALSE }
}; };
int extcmdlist_length = SIZE(extcmdlist) - 1; static int extcmdlist_length = SIZE(extcmdlist) - 1;
/* get entry i in the extended commands list. for windowport use. */ /* get entry i in the extended commands list. for windowport use. */
struct ext_func_tab * struct ext_func_tab *
+29 -29
View File
@@ -51,7 +51,7 @@ const struct c_common_strings c_common_strings =
{ "mon", "you" } { "mon", "you" }
}; };
const struct savefile_info default_sfinfo = { static const struct savefile_info default_sfinfo = {
#ifdef NHSTDC #ifdef NHSTDC
0x00000000UL 0x00000000UL
#else #else
@@ -143,7 +143,7 @@ const char *ARGV0;
#define IVMAGIC 0xdeadbeef #define IVMAGIC 0xdeadbeef
const struct Role urole_init_data = { static const struct Role urole_init_data = {
{ "Undefined", 0 }, { "Undefined", 0 },
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
@@ -168,7 +168,7 @@ const struct Role urole_init_data = {
-3 -3
}; };
const struct Race urace_init_data = { static const struct Race urace_init_data = {
"something", "something",
"undefined", "undefined",
"something", "something",
@@ -191,7 +191,7 @@ const struct Race urace_init_data = {
struct display_hints disp = { 0 }; struct display_hints disp = { 0 };
const struct instance_globals_a g_init_a = { static const struct instance_globals_a g_init_a = {
/* artifact.c */ /* artifact.c */
/* decl.c */ /* decl.c */
UNDEFINED_PTR, /* afternmv */ UNDEFINED_PTR, /* afternmv */
@@ -221,7 +221,7 @@ const struct instance_globals_a g_init_a = {
IVMAGIC /* a_magic to validate that structure layout has been preserved */ IVMAGIC /* a_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_b g_init_b = { static const struct instance_globals_b g_init_b = {
/* botl.c */ /* botl.c */
{ { { NULL, NULL, 0L, FALSE, FALSE, 0, 0U, { 0 }, { 0 }, NULL, 0, 0, 0 { { { NULL, NULL, 0L, FALSE, FALSE, 0, 0U, { 0 }, { 0 }, NULL, 0, 0, 0
#ifdef STATUS_HILITES #ifdef STATUS_HILITES
@@ -258,7 +258,7 @@ const struct instance_globals_b g_init_b = {
IVMAGIC /* b_magic to validate that structure layout has been preserved */ IVMAGIC /* b_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_c g_init_c = { static const struct instance_globals_c g_init_c = {
UNDEFINED_VALUES, /* command_queue */ UNDEFINED_VALUES, /* command_queue */
/* botl.c */ /* botl.c */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -310,7 +310,7 @@ const struct instance_globals_c g_init_c = {
IVMAGIC /* c_magic to validate that structure layout has been preserved */ IVMAGIC /* c_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_d g_init_d = { static const struct instance_globals_d g_init_d = {
/* decl.c */ /* decl.c */
0, /* doorindex */ 0, /* doorindex */
0L, /* done_money */ 0L, /* done_money */
@@ -349,7 +349,7 @@ const struct instance_globals_d g_init_d = {
IVMAGIC /* d_magic to validate that structure layout has been preserved */ IVMAGIC /* d_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_e g_init_e = { static const struct instance_globals_e g_init_e = {
/* cmd.c */ /* cmd.c */
WIN_ERR, /* en_win */ WIN_ERR, /* en_win */
FALSE, /* en_via_menu */ FALSE, /* en_via_menu */
@@ -365,7 +365,7 @@ const struct instance_globals_e g_init_e = {
IVMAGIC /* e_magic to validate that structure layout has been preserved */ IVMAGIC /* e_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_f g_init_f = { static const struct instance_globals_f g_init_f = {
/* decl.c */ /* decl.c */
UNDEFINED_PTR, /* ftrap */ UNDEFINED_PTR, /* ftrap */
{ NULL }, /* fqn_prefix */ { NULL }, /* fqn_prefix */
@@ -384,7 +384,7 @@ const struct instance_globals_f g_init_f = {
IVMAGIC /* f_magic to validate that structure layout has been preserved */ IVMAGIC /* f_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_g g_init_g = { static const struct instance_globals_g g_init_g = {
/* display.c */ /* display.c */
{ { { 0 } } }, /* gbuf */ { { { 0 } } }, /* gbuf */
UNDEFINED_VALUES, /* gbuf_start */ UNDEFINED_VALUES, /* gbuf_start */
@@ -416,7 +416,7 @@ const struct instance_globals_g g_init_g = {
IVMAGIC /* g_magic to validate that structure layout has been preserved */ IVMAGIC /* g_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_h g_init_h = { static const struct instance_globals_h g_init_h = {
/* decl.c */ /* decl.c */
NULL, /* hname */ NULL, /* hname */
0, /* hackpid */ 0, /* hackpid */
@@ -436,7 +436,7 @@ const struct instance_globals_h g_init_h = {
IVMAGIC /* h_magic to validate that structure layout has been preserved */ IVMAGIC /* h_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_i g_init_i = { static const struct instance_globals_i g_init_i = {
/* decl.c */ /* decl.c */
0, /* in_doagain */ 0, /* in_doagain */
{ 0, 0 } , /* inv_pos */ { 0, 0 } , /* inv_pos */
@@ -460,14 +460,14 @@ const struct instance_globals_i g_init_i = {
IVMAGIC /* i_magic to validate that structure layout has been preserved */ IVMAGIC /* i_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_j g_init_j = { static const struct instance_globals_j g_init_j = {
/* apply.c */ /* apply.c */
0, /* jumping_is_magic */ 0, /* jumping_is_magic */
TRUE, /* havestate*/ TRUE, /* havestate*/
IVMAGIC /* j_magic to validate that structure layout has been preserved */ IVMAGIC /* j_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_k g_init_k = { static const struct instance_globals_k g_init_k = {
/* decl.c */ /* decl.c */
UNDEFINED_PTR, /* kickedobj */ UNDEFINED_PTR, /* kickedobj */
DUMMY, /* killer */ DUMMY, /* killer */
@@ -477,7 +477,7 @@ const struct instance_globals_k g_init_k = {
IVMAGIC /* k_magic to validate that structure layout has been preserved */ IVMAGIC /* k_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_l g_init_l = { static const struct instance_globals_l g_init_l = {
/* cmd.c */ /* cmd.c */
UNDEFINED_VALUE, /* last_command_count */ UNDEFINED_VALUE, /* last_command_count */
/* decl.c */ /* decl.c */
@@ -533,7 +533,7 @@ const struct instance_globals_l g_init_l = {
IVMAGIC /* l_magic to validate that structure layout has been preserved */ IVMAGIC /* l_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_m g_init_m = { static const struct instance_globals_m g_init_m = {
/* apply.c */ /* apply.c */
0, /* mkot_trap_warn_count */ 0, /* mkot_trap_warn_count */
/* botl.c */ /* botl.c */
@@ -586,7 +586,7 @@ const struct instance_globals_m g_init_m = {
IVMAGIC /* m_magic to validate that structure layout has been preserved */ IVMAGIC /* m_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_n g_init_n = { static const struct instance_globals_n g_init_n = {
/* botl.c */ /* botl.c */
0, /* now_or_before_idx */ 0, /* now_or_before_idx */
/* decl.c */ /* decl.c */
@@ -626,7 +626,7 @@ const struct instance_globals_n g_init_n = {
IVMAGIC /* n_magic to validate that structure layout has been preserved */ IVMAGIC /* n_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_o g_init_o = { static const struct instance_globals_o g_init_o = {
/* dbridge.c */ /* dbridge.c */
{ { 0 } }, /* occupants */ { { 0 } }, /* occupants */
/* decl.c */ /* decl.c */
@@ -666,7 +666,7 @@ const struct instance_globals_o g_init_o = {
IVMAGIC /* o_magic to validate that structure layout has been preserved */ IVMAGIC /* o_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_p g_init_p = { static const struct instance_globals_p g_init_p = {
/* apply.c */ /* apply.c */
-1, /* polearm_range_min */ -1, /* polearm_range_min */
-1, /* polearm_range_max */ -1, /* polearm_range_max */
@@ -706,14 +706,14 @@ const struct instance_globals_p g_init_p = {
IVMAGIC /* p_magic to validate that structure layout has been preserved */ IVMAGIC /* p_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_q g_init_q = { static const struct instance_globals_q g_init_q = {
/* quest.c */ /* quest.c */
DUMMY, /* quest_status */ DUMMY, /* quest_status */
TRUE, /* havestate*/ TRUE, /* havestate*/
IVMAGIC /* q_magic to validate that structure layout has been preserved */ IVMAGIC /* q_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_r g_init_r = { static const struct instance_globals_r g_init_r = {
/* decl.c */ /* decl.c */
{ DUMMY }, /* rooms */ { DUMMY }, /* rooms */
/* symbols.c */ /* symbols.c */
@@ -736,7 +736,7 @@ const struct instance_globals_r g_init_r = {
IVMAGIC /* r_magic to validate that structure layout has been preserved */ IVMAGIC /* r_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_s g_init_s = { static const struct instance_globals_s g_init_s = {
/* artifact.c */ /* artifact.c */
0, /* spec_dbon_applies */ 0, /* spec_dbon_applies */
/* decl.c */ /* decl.c */
@@ -796,7 +796,7 @@ const struct instance_globals_s g_init_s = {
IVMAGIC /* s_magic to validate that structure layout has been preserved */ IVMAGIC /* s_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_t g_init_t = { static const struct instance_globals_t g_init_t = {
/* apply.c */ /* apply.c */
UNDEFINED_VALUES, /* trapinfo */ UNDEFINED_VALUES, /* trapinfo */
/* decl.c */ /* decl.c */
@@ -833,7 +833,7 @@ const struct instance_globals_t g_init_t = {
IVMAGIC /* t_magic to validate that structure layout has been preserved */ IVMAGIC /* t_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_u g_init_u = { static const struct instance_globals_u g_init_u = {
/* botl.c */ /* botl.c */
FALSE, /* update_all */ FALSE, /* update_all */
/* decl.c */ /* decl.c */
@@ -848,7 +848,7 @@ const struct instance_globals_u g_init_u = {
IVMAGIC /* u_magic to validate that structure layout has been preserved */ IVMAGIC /* u_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_v g_init_v = { static const struct instance_globals_v g_init_v = {
/* botl.c */ /* botl.c */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* valset */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* valset */
@@ -874,7 +874,7 @@ const struct instance_globals_v g_init_v = {
IVMAGIC /* v_magic to validate that structure layout has been preserved */ IVMAGIC /* v_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_w g_init_w = { static const struct instance_globals_w g_init_w = {
/* decl.c */ /* decl.c */
0, /* warn_obj_cnt */ 0, /* warn_obj_cnt */
0L, /* wailmsg */ 0L, /* wailmsg */
@@ -892,7 +892,7 @@ const struct instance_globals_w g_init_w = {
IVMAGIC /* w_magic to validate that structure layout has been preserved */ IVMAGIC /* w_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_x g_init_x = { static const struct instance_globals_x g_init_x = {
/* decl.c */ /* decl.c */
(COLNO - 1) & ~1, /* x_maze_max */ (COLNO - 1) & ~1, /* x_maze_max */
/* lock.c */ /* lock.c */
@@ -909,7 +909,7 @@ const struct instance_globals_x g_init_x = {
IVMAGIC /* x_magic to validate that structure layout has been preserved */ IVMAGIC /* x_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_y g_init_y = { static const struct instance_globals_y g_init_y = {
/* decl.c */ /* decl.c */
(ROWNO - 1) & ~1, /* y_maze_max */ (ROWNO - 1) & ~1, /* y_maze_max */
DUMMY, /* youmonst */ DUMMY, /* youmonst */
@@ -926,7 +926,7 @@ const struct instance_globals_y g_init_y = {
IVMAGIC /* y_magic to validate that structure layout has been preserved */ IVMAGIC /* y_magic to validate that structure layout has been preserved */
}; };
const struct instance_globals_z g_init_z = { static const struct instance_globals_z g_init_z = {
/* mon.c */ /* mon.c */
FALSE, /* zombify */ FALSE, /* zombify */
/* muse.c */ /* muse.c */
+2 -2
View File
@@ -393,7 +393,7 @@ lib_dlb_ftell(dlb *dp)
return dp->mark; return dp->mark;
} }
const dlb_procs_t lib_dlb_procs = { lib_dlb_init, lib_dlb_cleanup, static const dlb_procs_t lib_dlb_procs = { lib_dlb_init, lib_dlb_cleanup,
lib_dlb_fopen, lib_dlb_fclose, lib_dlb_fopen, lib_dlb_fclose,
lib_dlb_fread, lib_dlb_fseek, lib_dlb_fread, lib_dlb_fseek,
lib_dlb_fgets, lib_dlb_fgetc, lib_dlb_fgets, lib_dlb_fgetc,
@@ -402,7 +402,7 @@ const dlb_procs_t lib_dlb_procs = { lib_dlb_init, lib_dlb_cleanup,
#endif /* DLBLIB */ #endif /* DLBLIB */
#ifdef DLBRSRC #ifdef DLBRSRC
const dlb_procs_t rsrc_dlb_procs = { rsrc_dlb_init, rsrc_dlb_cleanup, static const dlb_procs_t rsrc_dlb_procs = { rsrc_dlb_init, rsrc_dlb_cleanup,
rsrc_dlb_fopen, rsrc_dlb_fclose, rsrc_dlb_fopen, rsrc_dlb_fclose,
rsrc_dlb_fread, rsrc_dlb_fseek, rsrc_dlb_fread, rsrc_dlb_fseek,
rsrc_dlb_fgets, rsrc_dlb_fgetc, rsrc_dlb_fgets, rsrc_dlb_fgetc,
+2 -1
View File
@@ -1318,7 +1318,8 @@ obj_pmname(struct obj *obj)
/* used by bogusmon(next) and also by init_CapMons(rumors.c); /* used by bogusmon(next) and also by init_CapMons(rumors.c);
bogon_is_pname(below) checks a hard-coded subset of these rather than bogon_is_pname(below) checks a hard-coded subset of these rather than
use this list */ use this list.
Also used in rumors.c */
const char bogon_codes[] = "-_+|="; /* see dat/bonusmon.txt */ const char bogon_codes[] = "-_+|="; /* see dat/bonusmon.txt */
/* fake monsters used to be in a hard-coded array, now in a data file */ /* fake monsters used to be in a hard-coded array, now in a data file */
+5
View File
@@ -9,6 +9,11 @@
#include "wintype.h" #include "wintype.h"
#include "sym.h" #include "sym.h"
extern const struct symparse loadsyms[];
extern const struct class_sym def_oc_syms[MAXOCLASSES];
extern const struct class_sym def_monsyms[MAXMCLASSES];
extern const uchar def_r_oc_syms[MAXOCLASSES];
/* Relevant header information in rm.h, objclass.h, sym.h, defsym.h. */ /* Relevant header information in rm.h, objclass.h, sym.h, defsym.h. */
/* Default object class symbols. See objclass.h. /* Default object class symbols. See objclass.h.
+2 -1
View File
@@ -64,7 +64,8 @@ static int tin_ok(struct obj *);
#define nonrotting_food(otyp) \ #define nonrotting_food(otyp) \
((otyp) == LEMBAS_WAFER || (otyp) == CRAM_RATION) ((otyp) == LEMBAS_WAFER || (otyp) == CRAM_RATION)
/* see hunger states in hack.h - texts used on bottom line */ /* see hunger states in hack.h - texts used on bottom line
Also used in botl.c and insight.c */
const char *const hu_stat[] = { const char *const hu_stat[] = {
"Satiated", " ", "Hungry ", "Weak ", "Satiated", " ", "Hungry ", "Weak ",
"Fainting", "Fainted ", "Starved " "Fainting", "Fainted ", "Starved "
+4 -4
View File
@@ -492,7 +492,7 @@ fopen_datafile(const char *filename, const char *mode, int prefix)
/* ---------- EXTERNAL FILE SUPPORT ----------- */ /* ---------- EXTERNAL FILE SUPPORT ----------- */
/* determine byte order */ /* determine byte order */
const int bei = 1; static const int bei = 1;
#define IS_BIGENDIAN() ( (*(char*)&bei) == 0 ) #define IS_BIGENDIAN() ( (*(char*)&bei) == 0 )
void void
@@ -1824,7 +1824,7 @@ docompress_file(const char *filename, boolean uncomp)
static int lockfd = -1; /* for lock_file() to pass to unlock_file() */ static int lockfd = -1; /* for lock_file() to pass to unlock_file() */
#endif #endif
#ifdef USE_FCNTL #ifdef USE_FCNTL
struct flock sflock; /* for unlocking, same as above */ static struct flock sflock; /* for unlocking, same as above */
#endif #endif
#if defined(HANGUPHANDLING) #if defined(HANGUPHANDLING)
@@ -2082,7 +2082,7 @@ unlock_file(const char *filename)
/* ---------- BEGIN CONFIG FILE HANDLING ----------- */ /* ---------- BEGIN CONFIG FILE HANDLING ----------- */
const char *default_configfile = static const char *default_configfile =
#ifdef UNIX #ifdef UNIX
".nethackrc"; ".nethackrc";
#else #else
@@ -2097,7 +2097,7 @@ const char *default_configfile =
#endif #endif
#endif #endif
/* used for messaging */ /* used for messaging. Also used in options.c */
char configfile[BUFSZ]; char configfile[BUFSZ];
#ifdef MSDOS #ifdef MSDOS
+2 -1
View File
@@ -2547,7 +2547,8 @@ show_gamelog(int final)
* Vanquished monsters. * Vanquished monsters.
*/ */
/* the two uppercase choices are implemented but suppressed from menu */ /* the two uppercase choices are implemented but suppressed from menu.
also used in options.c */
const char *const vanqorders[NUM_VANQ_ORDER_MODES][3] = { const char *const vanqorders[NUM_VANQ_ORDER_MODES][3] = {
{ "t", "traditional: by monster level", { "t", "traditional: by monster level",
"traditional: by monster level, by internal monster index" }, "traditional: by monster level, by internal monster index" },
+1 -1
View File
@@ -95,7 +95,7 @@ static char *opttext[MAXOPT] = { 0 };
((void) ((idxopttext < MAXOPT) \ ((void) ((idxopttext < MAXOPT) \
? (opttext[idxopttext++] = dupstr(line)) \ ? (opttext[idxopttext++] = dupstr(line)) \
: 0)) : 0))
char optbuf[COLBUFSZ]; static char optbuf[COLBUFSZ];
static struct version_info version; static struct version_info version;
static const char opt_indent[] = " "; static const char opt_indent[] = " ";
+4 -1
View File
@@ -10,6 +10,9 @@
#include "color.h" #include "color.h"
extern const struct attack c_sa_yes[NATTK];
extern const struct attack c_sa_no[NATTK];
#define NO_ATTK { 0, 0, 0, 0 } #define NO_ATTK { 0, 0, 0, 0 }
/* monster type with single name */ /* monster type with single name */
@@ -32,7 +35,7 @@
#define ATTK(at, ad, n, d) { at, ad, n, d } #define ATTK(at, ad, n, d) { at, ad, n, d }
#define A(a1, a2, a3, a4, a5, a6) { a1, a2, a3, a4, a5, a6 } #define A(a1, a2, a3, a4, a5, a6) { a1, a2, a3, a4, a5, a6 }
struct permonst mons_init[NUMMONS + 1] = { static struct permonst mons_init[NUMMONS + 1] = {
#include "monsters.h" #include "monsters.h"
/* /*
* Array terminator, added to the end of the entries in monsters.h. * Array terminator, added to the end of the entries in monsters.h.
+1 -1
View File
@@ -26,7 +26,7 @@ static NEARDATA const char *breathwep[] = {
}; };
/* hallucinatory ray types */ /* hallucinatory ray types */
const char *const hallublasts[] = { static const char *const hallublasts[] = {
"asteroids", "beads", "bubbles", "butterflies", "champagne", "chaos", "asteroids", "beads", "bubbles", "butterflies", "champagne", "chaos",
"coins", "cotton candy", "crumbs", "dark matter", "darkness", "dust specks", "coins", "cotton candy", "crumbs", "dark matter", "darkness", "dust specks",
"emoticons", "emotions", "entropy", "flowers", "foam", "fog", "gamma rays", "emoticons", "emotions", "entropy", "flowers", "foam", "fog", "gamma rays",
+1 -1
View File
@@ -472,7 +472,7 @@ generic_lvl_desc(void)
return "dungeon"; return "dungeon";
} }
const char *beats[] = { static const char *beats[] = {
"stepper", "one drop", "slow two", "triple stroke roll", "stepper", "one drop", "slow two", "triple stroke roll",
"double shuffle", "half-time shuffle", "second line", "train" "double shuffle", "half-time shuffle", "second line", "train"
}; };
+1 -1
View File
@@ -329,7 +329,7 @@ nhl_add_table_entry_region(lua_State *L, const char *name, coordxy x1,
/* converting from special level "map character" to levl location type /* converting from special level "map character" to levl location type
and back. order here is important. */ and back. order here is important. */
const struct { static const struct {
char ch; char ch;
schar typ; schar typ;
} char2typ[] = { } char2typ[] = {
+2 -2
View File
@@ -562,8 +562,8 @@ sortloot_descr(int otyp, char *outbuf)
#define DISCO_ALPHABYCLASS 2 /* alphabetized within each class */ #define DISCO_ALPHABYCLASS 2 /* alphabetized within each class */
#define DISCO_ALPHABETIZED 3 /* alphabetized across all classes */ #define DISCO_ALPHABETIZED 3 /* alphabetized across all classes */
/* also used in options.c (optfn_sortdiscoveries) */ /* also used in options.c (optfn_sortdiscoveries) */
const char disco_order_let[] = "osca"; static const char disco_order_let[] = "osca";
const char *const disco_orders_descr[] = { static const char *const disco_orders_descr[] = {
"by order of discovery within each class", "by order of discovery within each class",
"sortloot order (by class with some sub-class groupings)", "sortloot order (by class with some sub-class groupings)",
"alphabetical within each class", "alphabetical within each class",
+2 -2
View File
@@ -10,13 +10,13 @@
#include "color.h" #include "color.h"
#include "objclass.h" #include "objclass.h"
NEARDATA struct objdescr obj_descr_init[NUM_OBJECTS + 1] = { static struct objdescr obj_descr_init[NUM_OBJECTS + 1] = {
#define OBJECTS_DESCR_INIT #define OBJECTS_DESCR_INIT
#include "objects.h" #include "objects.h"
#undef OBJECTS_DESCR_INIT #undef OBJECTS_DESCR_INIT
}; };
NEARDATA struct objclass obj_init[NUM_OBJECTS + 1] = { static struct objclass obj_init[NUM_OBJECTS + 1] = {
#define OBJECTS_INIT #define OBJECTS_INIT
#include "objects.h" #include "objects.h"
#undef OBJECTS_INIT #undef OBJECTS_INIT
+1 -1
View File
@@ -111,7 +111,7 @@ static struct allopt_t allopt[SIZE(allopt_init)];
/* use rest of file */ /* use rest of file */
extern char configfile[]; /* for messages */ extern char configfile[]; /* for messages; files.c */
extern const struct symparse loadsyms[]; extern const struct symparse loadsyms[];
#if defined(TOS) #if defined(TOS)
extern boolean colors_changed; /* in tos.c */ extern boolean colors_changed; /* in tos.c */
+1 -1
View File
@@ -1562,7 +1562,7 @@ add_quoted_engraving(coordxy x, coordxy y, char *buf)
return TRUE; return TRUE;
} }
/* also used by getpos hack in do_name.c */ /* also used by getpos hack in getpos.c */
const char what_is_an_unknown_object[] = "an unknown object"; const char what_is_an_unknown_object[] = "an unknown object";
int int
+2 -2
View File
@@ -1455,9 +1455,9 @@ strange_feeling(struct obj *obj, const char *txt)
useup(obj); useup(obj);
} }
const char *bottlenames[] = { "bottle", "phial", "flagon", "carafe", static const char *bottlenames[] = { "bottle", "phial", "flagon", "carafe",
"flask", "jar", "vial" }; "flask", "jar", "vial" };
const char *hbottlenames[] = { static const char *hbottlenames[] = {
"jug", "pitcher", "barrel", "tin", "bag", "box", "glass", "beaker", "jug", "pitcher", "barrel", "tin", "bag", "box", "glass", "beaker",
"tumbler", "vase", "flowerpot", "pan", "thingy", "mug", "teacup", "tumbler", "vase", "flowerpot", "pan", "thingy", "mug", "teacup",
"teapot", "keg", "bucket", "thermos", "amphora", "wineskin", "parcel", "teapot", "keg", "bucket", "thermos", "amphora", "wineskin", "parcel",
+1 -1
View File
@@ -4923,7 +4923,7 @@ shk_embellish(struct obj *itm, long cost)
DISABLE_WARNING_FORMAT_NONLITERAL DISABLE_WARNING_FORMAT_NONLITERAL
/* First 4 supplied by Ronen and Tamar, remainder by development team */ /* First 4 supplied by Ronen and Tamar, remainder by development team */
const char *Izchak_speaks[] = { static const char *Izchak_speaks[] = {
"%s says: 'These shopping malls give me a headache.'", "%s says: 'These shopping malls give me a headache.'",
"%s says: 'Slow down. Think clearly.'", "%s says: 'Slow down. Think clearly.'",
"%s says: 'You need to take things one at a time.'", "%s says: 'You need to take things one at a time.'",
+1
View File
@@ -201,6 +201,7 @@ static const char *const shkhealthfoods[] = {
* *_CLASS enum value) or a specific object enum value. * *_CLASS enum value) or a specific object enum value.
* In the latter case, prepend it with a unary minus so the code can know * In the latter case, prepend it with a unary minus so the code can know
* (by testing the sign) whether to use mkobj() or mksobj(). * (by testing the sign) whether to use mkobj() or mksobj().
* shtypes[] is externally referenced from mkroom.c, mon.c and shk.c.
*/ */
const struct shclass shtypes[] = { const struct shclass shtypes[] = {
{ "general store", { "general store",
+1 -1
View File
@@ -1714,7 +1714,7 @@ extern struct sound_procs macsound_procs;
extern struct sound_procs qtsound_procs; extern struct sound_procs qtsound_procs;
#endif #endif
struct sound_procs nosound_procs = { static struct sound_procs nosound_procs = {
SOUNDID(nosound), SOUNDID(nosound),
0L, 0L,
(void (*)(void)) 0, /* init_nhsound */ (void (*)(void)) 0, /* init_nhsound */
+1
View File
@@ -373,6 +373,7 @@ symset_is_compatible(
* particular types of symset "handling", define a * particular types of symset "handling", define a
* H_XXX macro in include/sym.h and add the name * H_XXX macro in include/sym.h and add the name
* to this array at the matching offset. * to this array at the matching offset.
* Externally referenced from files.c, options.c, utf8map.c.
*/ */
const char *const known_handling[] = { const char *const known_handling[] = {
"UNKNOWN", /* H_UNK */ "UNKNOWN", /* H_UNK */
+2 -1
View File
@@ -52,7 +52,8 @@ struct toptenentry {
char plalign[ROLESZ + 1]; char plalign[ROLESZ + 1];
char name[NAMSZ + 1]; char name[NAMSZ + 1];
char death[DTHSZ + 1]; char death[DTHSZ + 1];
} *tt_head; };
static struct toptenentry *tt_head;
/* size big enough to read in all the string fields at once; includes /* size big enough to read in all the string fields at once; includes
room for separating space or trailing newline plus string terminator */ room for separating space or trailing newline plus string terminator */
#define SCANBUFSZ (4 * (ROLESZ + 1) + (NAMSZ + 1) + (DTHSZ + 1) + 1) #define SCANBUFSZ (4 * (ROLESZ + 1) + (NAMSZ + 1) + (DTHSZ + 1) + 1)
+2 -2
View File
@@ -28,7 +28,7 @@ struct find_struct {
enum reserved_activities restype; enum reserved_activities restype;
genericptr_t reserved; genericptr_t reserved;
}; };
const struct find_struct zero_find = { 0 }; static const struct find_struct zero_find = { 0 };
struct glyphid_cache_t { struct glyphid_cache_t {
int glyphnum; int glyphnum;
char *id; char *id;
@@ -36,7 +36,7 @@ struct glyphid_cache_t {
static struct glyphid_cache_t *glyphid_cache; static struct glyphid_cache_t *glyphid_cache;
static unsigned glyphid_cache_lsize; static unsigned glyphid_cache_lsize;
static size_t glyphid_cache_size; static size_t glyphid_cache_size;
struct find_struct glyphcache_find, to_custom_symbol_find; static struct find_struct glyphcache_find, to_custom_symbol_find;
static void init_glyph_cache(void); static void init_glyph_cache(void);
static void add_glyph_to_cache(int glyphnum, const char *id); static void add_glyph_to_cache(int glyphnum, const char *id);
static int find_glyph_in_cache(const char *id); static int find_glyph_in_cache(const char *id);
+2 -1
View File
@@ -22,7 +22,8 @@
* ....X +4 * ....X +4
* @...X +4 * @...X +4
* *
*/ * Externally referenced from light.c
*/
const coordxy circle_data[] = { const coordxy circle_data[] = {
/* 0*/ 0, /* 0*/ 0,
/* 1*/ 1, 1, /* 1*/ 1, 1,
+1 -1
View File
@@ -10,7 +10,7 @@ static void clear_bypass(struct obj *) NO_NNARGS;
static void m_dowear_type(struct monst *, long, boolean, boolean) NONNULLARG1; static void m_dowear_type(struct monst *, long, boolean, boolean) NONNULLARG1;
static int extra_pref(struct monst *, struct obj *) NONNULLARG1; static int extra_pref(struct monst *, struct obj *) NONNULLARG1;
const struct worn { static const struct worn {
long w_mask; long w_mask;
struct obj **w_obj; struct obj **w_obj;
const char *w_what; /* for failing sanity check's feedback */ const char *w_what; /* for failing sanity check's feedback */
+1
View File
@@ -5589,6 +5589,7 @@ item_what(int dmgtyp)
* [6] shocked wand * [6] shocked wand
* (books, rings, and wands don't stack so don't need plural form; * (books, rings, and wands don't stack so don't need plural form;
* crumbling ring doesn't do damage so doesn't need killer reason) * crumbling ring doesn't do damage so doesn't need killer reason)
* externally referenced from trap.c.
*/ */
const char *const destroy_strings[][3] = { const char *const destroy_strings[][3] = {
/* also used in trap.c */ /* also used in trap.c */
+1 -1
View File
@@ -19,7 +19,7 @@ extern void vms_abort(void);
#endif #endif
/*VARARGS1*/ /*VARARGS1*/
boolean panicking; static boolean panicking;
void panic(const char *, ...); void panic(const char *, ...);
DISABLE_WARNING_FORMAT_NONLITERAL DISABLE_WARNING_FORMAT_NONLITERAL