diff options
Diffstat (limited to 'Build/source/texk/web2c/cpascal.h')
-rw-r--r-- | Build/source/texk/web2c/cpascal.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Build/source/texk/web2c/cpascal.h b/Build/source/texk/web2c/cpascal.h index 7232af19523..63078cceb37 100644 --- a/Build/source/texk/web2c/cpascal.h +++ b/Build/source/texk/web2c/cpascal.h @@ -166,19 +166,21 @@ typedef unsigned char *pointertobyte; rely on stringification, or we could avoid the ARRAY_NAME arg. Actually allocate one more than requests, so we can index the last entry, as Pascal wants to do. */ -#define BIBXRETALLOC(array_name, array_var, type, size_var, new_size) do { \ +#define BIBXRETALLOCNOSET(array_name, array_var, type, size_var, new_size) \ fprintf (logfile, "Reallocated %s (elt_size=%d) to %ld items from %ld.\n", \ array_name, (int) sizeof (type), new_size, size_var); \ - XRETALLOC (array_var, new_size + 1, type); \ + XRETALLOC (array_var, new_size + 1, type) +/* Same as above, but also increase SIZE_VAR when no more arrays + with the same size parameter will be resized. */ +#define BIBXRETALLOC(array_name, array_var, type, size_var, new_size) do { \ + BIBXRETALLOCNOSET(array_name, array_var, type, size_var, new_size); \ size_var = new_size; \ } while (0) -/* Same as above, but don't increase SIZE_VAR when additional arrays - with the same size parameter will be resized. */ -#define BIBXRETALLOCNOSET(array_name, array_var, type, size_var, new_size) do { \ +/* Same as above, but for the pseudo-TYPE ASCII_code[LENGTH+1]. */ +#define BIBXRETALLOCSTRING(array_name, array_var, length, size_var, new_size) \ fprintf (logfile, "Reallocated %s (elt_size=%d) to %ld items from %ld.\n", \ - array_name, (int) sizeof (type), new_size, size_var); \ - XRETALLOC (array_var, new_size + 1, type); \ -} while (0) + array_name, (int) (length + 1), new_size, size_var); \ + XRETALLOC (array_var, new_size * (length + 1), ASCIIcode) /* Need precisely int for getopt, etc. */ #define cinttype int |