From d1090135a32de7b38b48c55d4e21f95da4c405bc Mon Sep 17 00:00:00 2001 From: Jason Self Date: Mon, 2 Jul 2018 15:40:51 -0700 Subject: [PATCH] Sync with upstream Updating compiler to commit a44f7597596539f2201f8ccc6a87dbd3b829a8ad from upstream dated June 28 2018. These changes are similiarly relicensed to GPL per Section 4(c)(ii) of the Artistic License 2.0. --- arrays.c | 2 +- asm.c | 2 +- bpatch.c | 2 +- chars.c | 2 +- directs.c | 2 +- errors.c | 2 +- expressc.c | 2 +- expressp.c | 2 +- files.c | 2 +- header.h | 4 ++-- inform.c | 13 ++++++++++--- lexer.c | 2 +- linker.c | 2 +- memory.c | 16 +++++++++++++--- objects.c | 3 +-- states.c | 2 +- symbols.c | 2 +- syntax.c | 2 +- tables.c | 2 +- text.c | 2 +- veneer.c | 2 +- verbs.c | 2 +- 22 files changed, 44 insertions(+), 28 deletions(-) diff --git a/arrays.c b/arrays.c index 0f1d3e5..93cc31e 100644 --- a/arrays.c +++ b/arrays.c @@ -3,7 +3,7 @@ /* likewise global variables, which are in some ways a */ /* simpler form of the same thing. */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/asm.c b/asm.c index d3a9d99..a5444fd 100644 --- a/asm.c +++ b/asm.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "asm" : The Inform assembler */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/bpatch.c b/bpatch.c index 2775f45..ccc87ba 100644 --- a/bpatch.c +++ b/bpatch.c @@ -2,7 +2,7 @@ /* "bpatch" : Keeps track of, and finally acts on, backpatch markers, */ /* correcting symbol values not known at compilation time */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/chars.c b/chars.c index f0fb36b..e91e9c1 100644 --- a/chars.c +++ b/chars.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "chars" : Character set mappings and the Z-machine alphabet table */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/directs.c b/directs.c index 5c622ba..d3b7f32 100644 --- a/directs.c +++ b/directs.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "directs" : Directives (# commands) */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/errors.c b/errors.c index 0ea92b1..b76aa7d 100644 --- a/errors.c +++ b/errors.c @@ -2,7 +2,7 @@ /* "errors" : Warnings, errors and fatal errors */ /* (with error throwback code for RISC OS machines) */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/expressc.c b/expressc.c index e0e8c2f..e6db119 100644 --- a/expressc.c +++ b/expressc.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "expressc" : The expression code generator */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/expressp.c b/expressp.c index 270f308..79f7c7a 100644 --- a/expressp.c +++ b/expressp.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "expressp" : The expression parser */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/files.c b/files.c index 4e7377e..6e4bec4 100644 --- a/files.c +++ b/files.c @@ -7,7 +7,7 @@ /* routines in "inform.c", since they are tied up with ICL */ /* settings and are very host OS-dependent. */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/header.h b/header.h index 90715a5..3faa6a4 100644 --- a/header.h +++ b/header.h @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* Header file for Inform: Z-machine ("Infocom" format) compiler */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2017 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ @@ -32,7 +32,7 @@ /* */ /* ------------------------------------------------------------------------- */ -#define RELEASE_DATE "16 Aug 2017" +#define RELEASE_DATE "28th June 2018" #define RELEASE_NUMBER 1634 #define GLULX_RELEASE_NUMBER 38 #define MODULE_VERSION_NUMBER 1 diff --git a/inform.c b/inform.c index bb845c5..793d534 100644 --- a/inform.c +++ b/inform.c @@ -2,7 +2,7 @@ /* "inform" : The top level of Inform: switches, pathnames, filenaming */ /* conventions, ICL (Inform Command Line) files, main */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ @@ -121,8 +121,11 @@ static void select_target(int targ) /* Z-machine */ WORDSIZE = 2; MAXINTWORD = 0x7FFF; - INDIV_PROP_START = 64; + if (INDIV_PROP_START != 64) { + INDIV_PROP_START = 64; + fatalerror("You cannot change INDIV_PROP_START in Z-code"); + } if (DICT_WORD_SIZE != 6) { DICT_WORD_SIZE = 6; fatalerror("You cannot change DICT_WORD_SIZE in Z-code"); @@ -152,9 +155,13 @@ static void select_target(int targ) /* Glulx */ WORDSIZE = 4; MAXINTWORD = 0x7FFFFFFF; - INDIV_PROP_START = 256; /* This could be a memory setting */ scale_factor = 0; /* It should never even get used in Glulx */ + if (INDIV_PROP_START < 256) { + INDIV_PROP_START = 256; + warning_numbered("INDIV_PROP_START should be at least 256 in Glulx. Setting to", INDIV_PROP_START); + } + if (NUM_ATTR_BYTES % 4 != 3) { NUM_ATTR_BYTES += (3 - (NUM_ATTR_BYTES % 4)); warning_numbered("NUM_ATTR_BYTES must be a multiple of four, plus three. Increasing to", NUM_ATTR_BYTES); diff --git a/lexer.c b/lexer.c index 5cccffe..f03aba5 100644 --- a/lexer.c +++ b/lexer.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "lexer" : Lexical analyser */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/linker.c b/linker.c index 9439920..5841fdc 100644 --- a/linker.c +++ b/linker.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "linker" : For compiling and linking modules */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/memory.c b/memory.c index 2108bfb..fc8a446 100644 --- a/memory.c +++ b/memory.c @@ -2,7 +2,7 @@ /* "memory" : Memory management and ICL memory setting commands */ /* (For "memoryerror", see "errors.c") */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ @@ -319,8 +319,8 @@ static void list_memory_sizes(void) if (!glulx_mode) printf("| %25s = %-7d |\n","ZCODE_HEADER_FLAGS_3",ZCODE_HEADER_FLAGS_3); printf("| %25s = %-7d |\n","MAX_INCLUSION_DEPTH",MAX_INCLUSION_DEPTH); - printf("| %25s = %-7d |\n","MAX_INDIV_PROP_TABLE_SIZE", - MAX_INDIV_PROP_TABLE_SIZE); + printf("| %25s = %-7d |\n","MAX_INDIV_PROP_TABLE_SIZE", MAX_INDIV_PROP_TABLE_SIZE); + printf("| %25s = %-7d |\n","INDIV_PROP_START", INDIV_PROP_START); printf("| %25s = %-7d |\n","MAX_LABELS",MAX_LABELS); printf("| %25s = %-7d |\n","MAX_LINESPACE",MAX_LINESPACE); printf("| %25s = %-7d |\n","MAX_LINK_DATA_SIZE",MAX_LINK_DATA_SIZE); @@ -561,6 +561,7 @@ extern void adjust_memory_sizes() DICT_WORD_SIZE = DICT_WORD_SIZE_z; NUM_ATTR_BYTES = NUM_ATTR_BYTES_z; ALLOC_CHUNK_SIZE = ALLOC_CHUNK_SIZE_z; + INDIV_PROP_START = 64; } else { MAX_ZCODE_SIZE = MAX_ZCODE_SIZE_g; @@ -570,6 +571,7 @@ extern void adjust_memory_sizes() DICT_WORD_SIZE = DICT_WORD_SIZE_g; NUM_ATTR_BYTES = NUM_ATTR_BYTES_g; ALLOC_CHUNK_SIZE = ALLOC_CHUNK_SIZE_g; + INDIV_PROP_START = 256; } } @@ -794,6 +796,12 @@ static void explain_parameter(char *command) table of ..variable values.\n"); return; } + if (strcmp(command,"INDIV_PROP_START")==0) + { printf( +" Properties 1 to INDIV_PROP_START-1 are common properties; individual\n\ + properties are numbered INDIV_PROP_START and up.\n"); + return; + } if (strcmp(command,"MAX_OBJ_PROP_COUNT")==0) { printf( " MAX_OBJ_PROP_COUNT is the maximum number of properties a single object \n\ @@ -1054,6 +1062,8 @@ extern void memory_command(char *command) MAX_SOURCE_FILES=j, flag=1; if (strcmp(command,"MAX_INDIV_PROP_TABLE_SIZE")==0) MAX_INDIV_PROP_TABLE_SIZE=j, flag=1; + if (strcmp(command,"INDIV_PROP_START")==0) + INDIV_PROP_START=j, flag=1; if (strcmp(command,"MAX_OBJ_PROP_TABLE_SIZE")==0) MAX_OBJ_PROP_TABLE_SIZE=j, flag=1; if (strcmp(command,"MAX_OBJ_PROP_COUNT")==0) diff --git a/objects.c b/objects.c index c29b260..88b1b6a 100644 --- a/objects.c +++ b/objects.c @@ -6,7 +6,7 @@ /* checks syntax and translates such directives into */ /* specifications for the object-maker. */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ @@ -200,7 +200,6 @@ Advanced game to get an extra 62)"); } } else { - /* INDIV_PROP_START could be a memory setting */ if (no_properties==INDIV_PROP_START) { discard_token_location(beginning_debug_location); error_numbered("All properties already declared -- max is", diff --git a/states.c b/states.c index d8c69ff..cd3b695 100644 --- a/states.c +++ b/states.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "states" : Statement translator */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/symbols.c b/symbols.c index 13a5aee..3263166 100644 --- a/symbols.c +++ b/symbols.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "symbols" : The symbols table; creating stock of reserved words */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/syntax.c b/syntax.c index 505269a..2486dec 100644 --- a/syntax.c +++ b/syntax.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "syntax" : Syntax analyser and compiler */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/tables.c b/tables.c index 7a18dbd..103f6f9 100644 --- a/tables.c +++ b/tables.c @@ -3,7 +3,7 @@ /* end of dynamic memory, gluing together all the required */ /* tables. */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/text.c b/text.c index 1831057..cd2fcd8 100644 --- a/text.c +++ b/text.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "text" : Text translation, the abbreviations optimiser, the dictionary */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/veneer.c b/veneer.c index ca27590..2f70159 100644 --- a/veneer.c +++ b/veneer.c @@ -3,7 +3,7 @@ /* by the compiler (e.g. DefArt) which the program doesn't */ /* provide */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ diff --git a/verbs.c b/verbs.c index c4e5027..1116e09 100644 --- a/verbs.c +++ b/verbs.c @@ -2,7 +2,7 @@ /* "verbs" : Manages actions and grammar tables; parses the directives */ /* Verb and Extend. */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2017 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ -- 2.31.1