E struct instance_globals g;
-E void instance_globals_init();
+E void decl_globals_init();
#undef E
/* ### decl.c ### */
-E void NDECL(decl_init);
+E void NDECL(decl_globals_init);
/* ### detect.c ### */
/* ### objects.c ### */
-E void NDECL(objects_init);
+E void NDECL(objects_globals_init);
/* ### objnam.c ### */
/* Note: these initializers don't do anything except guarantee that
we're linked properly.
*/
- decl_init();
monst_init();
- objects_init();
/* if a save file created in normal mode is now being restored in
explore mode, treat it as normal restore followed by 'X' command
/* support for lint.h */
unsigned nhUse_dummy = 0;
-/* dummy routine used to force linkage */
-void
-decl_init()
-{
- return;
-}
-
#define IVMAGIC 0xdeadbeef
const struct instance_globals g_init = {
struct instance_globals g;
void
-instance_globals_init()
+decl_globals_init()
{
g = g_init;
cost,sdam,ldam,oc1,oc2,nut,color) { obj }
#define None (char *) 0 /* less visual distraction for 'no description' */
-NEARDATA struct objdescr obj_descr[] =
+NEARDATA struct objdescr obj_descr_init[] =
#else
/* second pass -- object definitions */
#define BITS(nmkn,mrg,uskn,ctnr,mgc,chrg,uniq,nwsh,big,tuf,dir,sub,mtrl) \
#define HARDGEM(n) (0)
#endif
-NEARDATA struct objclass objects[] =
+NEARDATA struct objclass obj_init[] =
#endif
{
/* dummy object[0] -- description [2nd arg] *must* be NULL */
/* clang-format on */
/* *INDENT-ON* */
-void NDECL(objects_init);
+struct objdescr obj_descr[SIZE(obj_descr_init)];
+struct objclass objects[SIZE(obj_init)];
-/* dummy routine used to force linkage */
void
-objects_init()
+objects_globals_init()
{
- return;
+ memcpy(obj_descr, obj_descr_init, sizeof(obj_descr));
+ memcpy(objects, obj_init, sizeof(objects));
}
#endif /* !OBJECTS_PASS_2_ */
void
sys_early_init()
{
+ decl_globals_init();
+ objects_globals_init();
+
sysopt.support = (char *) 0;
sysopt.recover = (char *) 0;
#ifdef SYSCF
nethack_enter(argc, argv);
- instance_globals_init();
sys_early_init();
#if defined(WIN32) && defined(TTY_GRAPHICS)
{
boolean resuming;
- icontext_init();
- sys_early_init();
+ early_init();
Strcpy(default_window_sys, "tty");
resuming = pcmain(argc, argv);
moveloop(resuming);
void FDECL(splev_add_from, (sp_lev *, sp_lev *));
extern void NDECL(monst_init);
-extern void NDECL(objects_init);
-extern void NDECL(decl_init);
+extern void NDECL(objects_globals_init);
void FDECL(add_opcode, (sp_lev *, int, genericptr_t));
argc = SIZE(mac_argv);
argv = mac_argv;
#endif
+
+ decl_globals_init();
+ objects_globals_init();
+
/* Note: these initializers don't do anything except guarantee that
* we're linked properly.
*/
monst_init();
- objects_init();
- decl_init();
+
/* this one does something... */
init_obj_classes();
void NDECL(do_vision);
extern void NDECL(monst_init); /* monst.c */
-extern void NDECL(objects_init); /* objects.c */
+extern void NDECL(objects_globals_init); /* objects.c */
static void NDECL(link_sanity_check);
static char *FDECL(name_file, (const char *, const char *));
we're linked properly.
*/
monst_init();
- objects_init();
}
{
boolean more_than_one;
+ objects_globals_init();
+
link_sanity_check();
/* construct the current version number */
}
#endif
+ objects_globals_init();
+
tilecount = 0;
xoffset = yoffset = 0;
initflag = 0;
we're linked properly.
*/
monst_init();
- objects_init();
(void) def_char_to_objclass(']');
condnum = tilenum = 0;
win10_init();
- instance_globals_init();
sys_early_init();
/* init applicatio structure */