diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2021-07-14 09:23:02 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2021-07-14 09:23:02 +0000 |
commit | 274b2b3e8a9a283ddf07c2e4b7c4fc39cb889a2e (patch) | |
tree | 8f0b9090b8e5691b7bc2969a3dd6f6f1b8411776 /Build/source/texk/web2c/cwebdir/ctwill-mini.ch | |
parent | fe3a5e65c56c42bd8598b2a8c110ec250eb5214d (diff) |
[CWEB] New release 4.5.
This is a service release for CWEB 4.0.
* Upstream CWEB 4.5 was reviewed with the 'splint' utility. This
resulted in lots of cast changes and a few code improvements.
* All 'length' variables are retyped to 'size_t'.
* <stdbool.h> is replaced by <kpathsea/simpletypes.h> to keep CWEB
compatible with antique systems that still support TeX Live.
git-svn-id: svn://tug.org/texlive/trunk@59926 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/ctwill-mini.ch')
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctwill-mini.ch | 90 |
1 files changed, 52 insertions, 38 deletions
diff --git a/Build/source/texk/web2c/cwebdir/ctwill-mini.ch b/Build/source/texk/web2c/cwebdir/ctwill-mini.ch index ec0aec95ed8..4448b1a3d59 100644 --- a/Build/source/texk/web2c/cwebdir/ctwill-mini.ch +++ b/Build/source/texk/web2c/cwebdir/ctwill-mini.ch @@ -354,16 +354,16 @@ Section 52. id_first=--loc; do ++loc; - while (isalpha((eight_bits)*loc) || isdigit((eight_bits)*loc) @| - || isxalpha((eight_bits)*loc) || ishigh((eight_bits)*loc)); + while (isalpha((int)*loc) || isdigit((int)*loc) @| + || isxalpha(*loc) || ishigh(*loc)); id_loc=loc; return identifier; } @y id_first=--loc;@/ do ++loc; - while (isalpha((eight_bits)*loc) || isdigit((eight_bits)*loc) @| - || isxalpha((eight_bits)*loc) || ishigh((eight_bits)*loc));@/ + while (isalpha((int)*loc) || isdigit((int)*loc) @| + || isxalpha(*loc) || ishigh(*loc));@/ id_loc=loc;@/ return identifier; } @@ -1529,17 +1529,21 @@ Section 234--235. case end_translation: return; case identifier: case res_word: @<Output an identifier@>@; break; case section_code: @<Output a section name@>@; break; - case math_rel: out_str("\\MRL{"@q}@>); + case math_rel: out_str("\\MRL{"@q}@>); /* fall through */ @.\\MRL@> case noop: case inserted: break; case cancel: case big_cancel: c=0; b=a; while (true) { a=get_output(); if (a==inserted) continue; - if ((a<indent && !(b==big_cancel&&a==' ')) || a>big_force) break; - if (a==indent) c++; - else if (a==outdent) c--; - else if (a==opt) a=get_output(); + if ((a<indent && !(b==big_cancel&&a==' ')) @| + || (a>big_force && a!=dindent)) break; + switch (a) { + case indent: c++; break; + case outdent: c--; break; + case dindent: c+=2; break; + case opt: a=get_output(); + } } @<Output saved |indent| or |outdent| tokens@>@; goto reswitch; @@ -1551,7 +1555,7 @@ Section 234--235. case indent: case outdent: case opt: case backup: case break_space: case force: case big_force: case preproc_line: @<Output a control, look ahead in case of line breaks, possibly |goto reswitch|@>@; break; - case quoted_char: out(*(cur_tok++)); + case quoted_char: out(*(cur_tok++)); /* fall through */ case qualifier: break; default: out(a); /* otherwise |a| is an ordinary character */ } @@ -1567,17 +1571,21 @@ Section 234--235. case end_translation: return; case identifier: case res_word: @<Output an identifier@>@; break; case section_code: @<Output a section name@>@; break; - case math_rel: out_str("\\MRL{"@q}@>); + case math_rel: out_str("\\MRL{"@q}@>); /* fall through */ @.\\MRL@> case noop: case inserted: break; case cancel: case big_cancel: c=0; b=a; while (true) { a=get_output(); if (a==inserted) continue; - if ((a<indent && !(b==big_cancel&&a==' ')) || a>big_force) break; - if (a==indent) c++; - else if (a==outdent) c--; - else if (a==opt) a=get_output(); + if ((a<indent && !(b==big_cancel&&a==' ')) @| + || (a>big_force && a!=dindent)) break; + switch (a) { + case indent: c++; break; + case outdent: c--; break; + case dindent: c+=2; break; + case opt: a=get_output(); + } } @<Output saved |indent| or |outdent| tokens@>@; goto reswitch; @@ -1589,7 +1597,7 @@ Section 234--235. case indent: case outdent: case opt: case backup: case break_space: case force: case big_force: case preproc_line: @<Output a control, look ahead in case of line breaks, possibly |goto reswitch|@>@; break; - case quoted_char: out(*(cur_tok++)); + case quoted_char: out(*(cur_tok++)); /* fall through */ case qualifier: break; default: out(a); /* otherwise |a| is an ordinary character */ } @@ -1765,6 +1773,12 @@ Section 269. Section 271. @x +@ During the sorting phase we shall use the |cat| and |trans| arrays from +@y +@r @ During the sorting phase we shall use the |cat| and |trans| arrays from +@z + +@x @<Rest of |trans_plus| union@>= @y @<Rest of |trans_plus| union@>= @@ -1819,11 +1833,11 @@ Section 279. @x @ @<Split the list...@>= { - eight_bits c; + int c; next_name=sort_ptr->head; @y @ @<Split the list...@>= {@+ - eight_bits c; + int c; next_name=sort_ptr->head;@/ @z @@ -1849,61 +1863,61 @@ Section 288. @x puts(_("\nMemory usage statistics:")); @.Memory usage statistics:@> - printf(_("%ld names (out of %ld)\n"), + printf(_("%td names (out of %ld)\n"), (ptrdiff_t)(name_ptr-name_dir),(long)max_names); - printf(_("%ld cross-references (out of %ld)\n"), + printf(_("%td cross-references (out of %ld)\n"), (ptrdiff_t)(xref_ptr-xmem),(long)max_refs); - printf(_("%ld bytes (out of %ld)\n"), + printf(_("%td bytes (out of %ld)\n"), (ptrdiff_t)(byte_ptr-byte_mem),(long)max_bytes); - printf(_("%ld temp meanings (out of %ld)\n"), + printf(_("%td temp meanings (out of %ld)\n"), (ptrdiff_t)(max_temp_meaning_ptr-temp_meaning_stack), (long)max_meanings); - printf(_("%ld titles (out of %ld)\n"), + printf(_("%td titles (out of %ld)\n"), (ptrdiff_t)(title_code_ptr-title_code),(long)max_titles); puts(_("Parsing:")); - printf(_("%ld scraps (out of %ld)\n"), + printf(_("%td scraps (out of %ld)\n"), (ptrdiff_t)(max_scr_ptr-scrap_info),(long)max_scraps); - printf(_("%ld texts (out of %ld)\n"), + printf(_("%td texts (out of %ld)\n"), (ptrdiff_t)(max_text_ptr-tok_start),(long)max_texts); - printf(_("%ld tokens (out of %ld)\n"), + printf(_("%td tokens (out of %ld)\n"), (ptrdiff_t)(max_tok_ptr-tok_mem),(long)max_toks); - printf(_("%ld levels (out of %ld)\n"), + printf(_("%td levels (out of %ld)\n"), (ptrdiff_t)(max_stack_ptr-stack),(long)stack_size); puts(_("Sorting:")); - printf(_("%ld levels (out of %ld)\n"), + printf(_("%td levels (out of %ld)\n"), (ptrdiff_t)(max_sort_ptr-scrap_info),(long)max_scraps); @y puts(_("\nMemory usage statistics:"));@/ @.Memory usage statistics:@> - printf(_("%ld names (out of %ld)\n"), + printf(_("%td names (out of %ld)\n"), (ptrdiff_t)(name_ptr-name_dir),@/ @t\5\5\5\5@>(long)max_names);@/ - printf(_("%ld cross-references (out of %ld)\n"), + printf(_("%td cross-references (out of %ld)\n"), (ptrdiff_t)(xref_ptr-xmem),(long)max_refs);@/ - printf(_("%ld bytes (out of %ld)\n"), + printf(_("%td bytes (out of %ld)\n"), (ptrdiff_t)(byte_ptr-byte_mem),@/ @t\5\5\5\5@>(long)max_bytes);@/ - printf(_("%ld temp meanings (out of %ld)\n"), + printf(_("%td temp meanings (out of %ld)\n"), (ptrdiff_t)(max_temp_meaning_ptr-temp_meaning_stack),@/ @t\5\5\5\5@>(long)max_meanings);@/ - printf(_("%ld titles (out of %ld)\n"), + printf(_("%td titles (out of %ld)\n"), (ptrdiff_t)(title_code_ptr-title_code),@/ @t\5\5\5\5@>(long)max_titles);@/ puts(_("Parsing:"));@/ - printf(_("%ld scraps (out of %ld)\n"), + printf(_("%td scraps (out of %ld)\n"), (ptrdiff_t)(max_scr_ptr-scrap_info),@/ @t\5\5\5\5@>(long)max_scraps);@/ - printf(_("%ld texts (out of %ld)\n"), + printf(_("%td texts (out of %ld)\n"), (ptrdiff_t)(max_text_ptr-tok_start),@/ @t\5\5\5\5@>(long)max_texts);@/ - printf(_("%ld tokens (out of %ld)\n"), + printf(_("%td tokens (out of %ld)\n"), (ptrdiff_t)(max_tok_ptr-tok_mem),@/ @t\5\5\5\5@>(long)max_toks);@/ - printf(_("%ld levels (out of %ld)\n"), + printf(_("%td levels (out of %ld)\n"), (ptrdiff_t)(max_stack_ptr-stack),@/ @t\5\5\5\5@>(long)stack_size);@/ puts(_("Sorting:"));@/ - printf(_("%ld levels (out of %ld)\n"), + printf(_("%td levels (out of %ld)\n"), (ptrdiff_t)(max_sort_ptr-scrap_info),@/ @t\5\5\5\5@>(long)max_scraps); @z |