First set of changes to move globals to instance_globals.

This commit is contained in:
Bart House
2018-11-23 21:29:19 -08:00
parent 616a469f0f
commit 912886a73f
51 changed files with 680 additions and 565 deletions

View File

@@ -109,8 +109,7 @@ struct lc_vardefs *FDECL(vardef_defined, (struct lc_vardefs *, char *, int));
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));
@@ -256,12 +255,15 @@ char **argv;
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();
@@ -1646,4 +1648,11 @@ short ospeed;
#endif
#endif /* STRICT_REF_DEF */
/* nhassert_failed is called when an nhassert's condition is false */
void nhassert_failed(const char * exp, const char * file, int line)
{
fprintf(stderr, "NHASSERT(%s) in '%s' at line %d\n", exp, file, line);
exit(EXIT_FAILURE);
}
/*lev_main.c*/

View File

@@ -176,7 +176,7 @@ void NDECL(do_fix_sampleconfig);
#endif
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 *));
@@ -308,7 +308,6 @@ link_sanity_check()
we're linked properly.
*/
monst_init();
objects_init();
}
@@ -318,6 +317,8 @@ char *options;
{
boolean more_than_one;
objects_globals_init();
link_sanity_check();
/* construct the current version number */