From 87d25c40a989b50b41748dfc88040270306019b0 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Tue, 9 Mar 2010 14:46:22 +0000 Subject: minor bibtex/bibtex8/bibtexu clean up git-svn-id: svn://tug.org/texlive/trunk@17397 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/ChangeLog | 4 ++ Build/source/texk/Makefile.am | 2 +- Build/source/texk/Makefile.in | 2 +- Build/source/texk/bibtex8/ChangeLog | 4 ++ Build/source/texk/bibtex8/bibtex-1.c | 2 +- Build/source/texk/bibtexu/ChangeLog | 4 ++ Build/source/texk/bibtexu/bibtex-1.c | 2 +- Build/source/texk/web2c/ChangeLog | 9 +++ Build/source/texk/web2c/bibtex.ch | 82 +++++++++++++++++----------- Build/source/texk/web2c/cpascal.h | 7 +++ Build/source/texk/web2c/web2c/ChangeLog | 4 ++ Build/source/texk/web2c/web2c/common.defines | 1 + 12 files changed, 86 insertions(+), 37 deletions(-) (limited to 'Build/source/texk') diff --git a/Build/source/texk/ChangeLog b/Build/source/texk/ChangeLog index 71230e63cbd..520d6125aab 100644 --- a/Build/source/texk/ChangeLog +++ b/Build/source/texk/ChangeLog @@ -1,3 +1,7 @@ +2010-03-09 Peter Breitenlohner + + * Makefile.am (EXTRA_DIST): Distribute the whole tests/ tree. + 2010-03-04 Peter Breitenlohner * Makefile.am (triptrap): New target to first ensure that diff --git a/Build/source/texk/Makefile.am b/Build/source/texk/Makefile.am index bdc1e314966..29d41c58625 100644 --- a/Build/source/texk/Makefile.am +++ b/Build/source/texk/Makefile.am @@ -59,7 +59,7 @@ subtexk: $(CONFIG_AUX) exit 1 # Common infrastructure for tests -EXTRA_DIST = tests/common-test.pl +EXTRA_DIST = tests # Special target to run TRIP and TRAP tests and create diffs. .PHONY: triptrap diff --git a/Build/source/texk/Makefile.in b/Build/source/texk/Makefile.in index 16bb42515af..179c570fd92 100644 --- a/Build/source/texk/Makefile.in +++ b/Build/source/texk/Makefile.in @@ -277,7 +277,7 @@ DIST_SUBDIRS = $(DIST_SUBTEXK) CONFIG_AUX = ../subsubdir-conf.cmd # Common infrastructure for tests -EXTRA_DIST = tests/common-test.pl +EXTRA_DIST = tests all: all-recursive .SUFFIXES: diff --git a/Build/source/texk/bibtex8/ChangeLog b/Build/source/texk/bibtex8/ChangeLog index 2663ff5eab2..bb552950ec1 100644 --- a/Build/source/texk/bibtex8/ChangeLog +++ b/Build/source/texk/bibtex8/ChangeLog @@ -1,3 +1,7 @@ +2010-03-09 Peter Breitenlohner + + * bibtex-1.c: Remove spurious format spec in BIBTEX_OVERFLOW. + 2010-03-02 Peter Breitenlohner * bibtex-1.c, bibtex.h: Adapt to bibtex.web 0.99d test 1 diff --git a/Build/source/texk/bibtex8/bibtex-1.c b/Build/source/texk/bibtex8/bibtex-1.c index 9a19d20b80b..c9282bdd9dc 100644 --- a/Build/source/texk/bibtex8/bibtex-1.c +++ b/Build/source/texk/bibtex8/bibtex-1.c @@ -2611,7 +2611,7 @@ BEGIN FN_INFO[fn_loc] = num_glb_strs; if (num_glb_strs == MAX_GLOB_STRS) BEGIN - BIBTEX_OVERFLOW ("number of string global-variables %ld", MAX_GLOB_STRS); + BIBTEX_OVERFLOW ("number of string global-variables ", MAX_GLOB_STRS); END INCR (num_glb_strs); END diff --git a/Build/source/texk/bibtexu/ChangeLog b/Build/source/texk/bibtexu/ChangeLog index 3dfe408f8ee..8bed614fb35 100644 --- a/Build/source/texk/bibtexu/ChangeLog +++ b/Build/source/texk/bibtexu/ChangeLog @@ -1,3 +1,7 @@ +2010-03-09 Peter Breitenlohner + + * bibtex-1.c: Remove spurious format spec in BIBTEX_OVERFLOW. + 2010-03-02 Peter Breitenlohner * bibtex-1.c, bibtex.h: Adapt to bibtex.web 0.99d test 1 diff --git a/Build/source/texk/bibtexu/bibtex-1.c b/Build/source/texk/bibtexu/bibtex-1.c index 71fcad87e62..cc29f1c2cf4 100644 --- a/Build/source/texk/bibtexu/bibtex-1.c +++ b/Build/source/texk/bibtexu/bibtex-1.c @@ -2622,7 +2622,7 @@ BEGIN FN_INFO[fn_loc] = num_glb_strs; if (num_glb_strs == MAX_GLOB_STRS) BEGIN - BIBTEX_OVERFLOW ("number of string global-variables %ld", MAX_GLOB_STRS); + BIBTEX_OVERFLOW ("number of string global-variables ", MAX_GLOB_STRS); END INCR (num_glb_strs); END diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog index c23b8f27322..09f225cd55b 100644 --- a/Build/source/texk/web2c/ChangeLog +++ b/Build/source/texk/web2c/ChangeLog @@ -1,3 +1,12 @@ +2010-03-09 Peter Breitenlohner + + * cpascal.h (BIBXRETALLOCNOSET): New macro to resize BibTeX + arrays but not increasing the size parameter. + * bibtex.ch: Use BIB_XRETALLOC_NOSET when resizing several + arrays with the same size, to obtain accurate log entries. + (add_out_pool): Dynamic output buffer, don't call overflow(). + (add_area): Remove unused procedure. + 2010-03-08 Karl Berry * tests/bibtex-openout-test.pl: allow running standalone. diff --git a/Build/source/texk/web2c/bibtex.ch b/Build/source/texk/web2c/bibtex.ch index a9d02437095..5beca8e13f6 100644 --- a/Build/source/texk/web2c/bibtex.ch +++ b/Build/source/texk/web2c/bibtex.ch @@ -388,29 +388,20 @@ File closing will be done in C, too. @z @x [46] Dynamic buf_size. -procedure buffer_overflow; -begin overflow('buffer size ',buf_size); -end; @y -procedure buffer_overflow; -var cur_size:integer; -begin -cur_size := buf_size; -BIB_XRETALLOC('buffer', buffer, ASCII_code, cur_size, cur_size + BUF_SIZE); -cur_size := buf_size; -BIB_XRETALLOC('sv_buffer', sv_buffer, ASCII_code, cur_size, cur_size+BUF_SIZE); -cur_size := buf_size; -BIB_XRETALLOC('ex_buf', ex_buf, ASCII_code, cur_size, cur_size+BUF_SIZE); -cur_size := buf_size; -BIB_XRETALLOC('out_buf', out_buf, ASCII_code, cur_size, cur_size+BUF_SIZE); -cur_size := buf_size; -BIB_XRETALLOC('name_tok', name_tok, buf_pointer, cur_size, cur_size+BUF_SIZE); -cur_size := buf_size; -BIB_XRETALLOC('name_sep_char', name_sep_char, ASCII_code, cur_size, - cur_size+BUF_SIZE); -buf_size := cur_size; -end; +BIB_XRETALLOC_NOSET ('buffer', buffer, ASCII_code, + buf_size, buf_size + BUF_SIZE); +BIB_XRETALLOC_NOSET ('sv_buffer', sv_buffer, ASCII_code, + buf_size, buf_size + BUF_SIZE); +BIB_XRETALLOC_NOSET ('ex_buf', ex_buf, ASCII_code, + buf_size, buf_size + BUF_SIZE); +BIB_XRETALLOC_NOSET ('out_buf', out_buf, ASCII_code, + buf_size, buf_size + BUF_SIZE); +BIB_XRETALLOC_NOSET ('name_tok', name_tok, buf_pointer, + buf_size, buf_size + BUF_SIZE); +BIB_XRETALLOC ('name_sep_char', name_sep_char, ASCII_code, + buf_size, buf_size + BUF_SIZE); @z @x [47] web2c doesn't understand f^. @@ -456,7 +447,7 @@ BIB_XRETALLOC ('str_pool', str_pool, ASCII_code, pool_size, pool_size + POOL_SIZE); @z -% [58] (start_name) reallocate name_of_file for the new name and +% [59] (start_name) reallocate name_of_file for the new name and % terminate with null. @x name_ptr := 1; @@ -496,13 +487,32 @@ while (name_ptr <= file_name_size) do {pad with blanks} name_of_file[name_length + 1] := 0; @z -@x [61] (add_area) Delete this print of name_of_file as well. +@x [62] (add_area) This function is not used. +@= +procedure add_area(@!area:str_number); +var p_ptr: pool_pointer; {running index} +begin if (name_length + length(area) > file_name_size) then begin print ('File='); print_pool_str (area); print (name_of_file,','); file_nm_size_overflow; end; +name_ptr := name_length; +while (name_ptr > 0) do {shift up name} + begin + name_of_file[name_ptr+length(area)] := name_of_file[name_ptr]; + decr(name_ptr); + end; +name_ptr := 1; +p_ptr := str_start[area]; +while (p_ptr < str_start[area+1]) do + begin + name_of_file[name_ptr] := chr (str_pool[p_ptr]); + incr(name_ptr); incr(p_ptr); + end; +name_length := name_length + length(area); +end; @y @z @@ -751,13 +761,13 @@ end; overflow('number of database files ',max_bib_files); @y begin - BIB_XRETALLOC ('bib_list', bib_list, str_number, max_bib_files, + {Keep old value of |max_bib_files| for the last array.} + BIB_XRETALLOC_NOSET ('bib_list', bib_list, str_number, max_bib_files, + max_bib_files + MAX_BIB_FILES); + BIB_XRETALLOC_NOSET ('bib_file', bib_file, alpha_file, max_bib_files, max_bib_files + MAX_BIB_FILES); - {Already increased |max_bib_files|, so don't need to do it again.} - BIB_XRETALLOC ('bib_file', bib_file, alpha_file, max_bib_files, - max_bib_files); BIB_XRETALLOC ('s_preamble', s_preamble, str_number, max_bib_files, - max_bib_files); + max_bib_files + MAX_BIB_FILES); end; @z @@ -996,13 +1006,13 @@ if (total_fields > max_fields) then bib_err ('You''ve exceeded ',max_bib_files:0,' preamble commands'); @y begin - BIB_XRETALLOC ('bib_list', bib_list, str_number, max_bib_files, + {Keep old value of |max_bib_files| for the last array.} + BIB_XRETALLOC_NOSET ('bib_list', bib_list, str_number, max_bib_files, + max_bib_files + MAX_BIB_FILES); + BIB_XRETALLOC_NOSET ('bib_file', bib_file, alpha_file, max_bib_files, max_bib_files + MAX_BIB_FILES); - {Already increased |max_bib_files|, so don't need to do it again.} - BIB_XRETALLOC ('bib_file', bib_file, alpha_file, max_bib_files, - max_bib_files); BIB_XRETALLOC ('s_preamble', s_preamble, str_number, max_bib_files, - max_bib_files); + max_bib_files + MAX_BIB_FILES); end; @z @@ -1096,6 +1106,12 @@ end; char2 := x_entry_strs(ptr2)(char_ptr); @z +@x [323] Dynamic buf_size. + overflow('output buffer size ',buf_size); +@y + buffer_overflow; +@z + % We shouldn't try to split a \% combo, as the result is an escaped % at % end-of-line, and a line beginning with a %, which leads to rest being % ignored. This is a special case of the general problem that we shouldn't diff --git a/Build/source/texk/web2c/cpascal.h b/Build/source/texk/web2c/cpascal.h index b1e96ac5473..5428f8ecb44 100644 --- a/Build/source/texk/web2c/cpascal.h +++ b/Build/source/texk/web2c/cpascal.h @@ -172,6 +172,13 @@ typedef unsigned char *pointertobyte; XRETALLOC (array_var, new_size + 1, type); \ size_var = new_size; \ } while (0) +/* Same as above, but don't increase SIZE_VAR when more arrays when + additional arrays with the same size parameter will be resized. */ +#define BIBXRETALLOCNOSET(array_name, array_var, type, size_var, new_size) do { \ + 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) /* Need precisely int for getopt, etc. */ #define cinttype int diff --git a/Build/source/texk/web2c/web2c/ChangeLog b/Build/source/texk/web2c/web2c/ChangeLog index 97149d714aa..1e46cbe3a0b 100644 --- a/Build/source/texk/web2c/web2c/ChangeLog +++ b/Build/source/texk/web2c/web2c/ChangeLog @@ -1,3 +1,7 @@ +2010-03-09 Peter Breitenlohner + + * common.defines (BIBXRETALLOCNOSET): New procedure. + 2010-03-05 Peter Breitenlohner * texmf.defines: Moved setupboundvariable from here ... diff --git a/Build/source/texk/web2c/web2c/common.defines b/Build/source/texk/web2c/web2c/common.defines index e13a2fa525f..44f0a0d6034 100644 --- a/Build/source/texk/web2c/web2c/common.defines +++ b/Build/source/texk/web2c/web2c/common.defines @@ -153,6 +153,7 @@ @define procedure aclose (); @define procedure BIBXRETALLOC (); {For BibTeX.} +@define procedure BIBXRETALLOCNOSET (); @define procedure decr (); @define procedure fflush (); {can't keep |break|, since it's a reserved word} @define procedure free (); -- cgit v1.2.3