X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Ffiles.c;h=70cfc90705de86c9289e4f8e72e2c6e91593aee0;hb=c881aa3386c00d7021ffabf2f66275d6c110c1c1;hp=6e4bec4314c757805640562a28cb57b75041902d;hpb=81ffe9a7de1db0b3a318a053b38882d1b7ab304c;p=inform.git diff --git a/src/files.c b/src/files.c index 6e4bec4..70cfc90 100644 --- a/src/files.c +++ b/src/files.c @@ -7,9 +7,8 @@ /* routines in "inform.c", since they are tied up with ICL */ /* settings and are very host OS-dependent. */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2018 */ -/* */ -/* This file is part of Inform. */ +/* Part of Inform 6.35 */ +/* copyright (c) Graham Nelson 1993 - 2021 */ /* */ /* Inform is free software: you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ @@ -196,6 +195,7 @@ extern void close_all_source(void) extern int register_orig_sourcefile(char *filename) { int ix; + char *name; /* If the filename has already been used as an origsource filename, return that entry. We check the most-recently-used file first, and @@ -217,7 +217,7 @@ extern int register_orig_sourcefile(char *filename) /* This filename has never been used before. Allocate a new InputFiles entry. */ - char *name = filename; /* no translation */ + name = filename; /* no translation */ if (total_files == MAX_SOURCE_FILES) memoryerror("MAX_SOURCE_FILES", MAX_SOURCE_FILES); @@ -1184,12 +1184,57 @@ game features require version 0x%08lx", (long)requested_glulx_version, (long)Ver } - /* (4.5) Output any null bytes (required to reach a GPAGESIZE address) + /* (5) Output static arrays (if any). */ + { + /* We have to backpatch entries mentioned in staticarray_backpatch_table. */ + int32 size_before_arrays = size; + int32 val, ix, jx; + for (ix=0, jx=0; ix> 24) & 0xFF); + sf_put((val >> 16) & 0xFF); + sf_put((val >> 8) & 0xFF); + sf_put((val) & 0xFF); + size += 4; + } + + /* Flush out the last bit of static_array_area, after the last backpatch marker. */ + offset = static_array_area_size; + while (jx