Skip to content

Commit

Permalink
[CWEB] Finally make use of type 'mode' -- C-style.
Browse files Browse the repository at this point in the history
'typedef int mode' was never actually used in CWEB 2.7 and up (and, most
likely, down).  However, 'boolean' and the two @definitions isn't quite
correct either.  See line 3907 of WEAVE.WEB for the original intent.

The new 'typedef enum' restores the classic code in C-style.

git-svn-id: svn://tug.org/texlive/trunk/Build/source@67627 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
Andreas Scherer committed Jul 14, 2023
1 parent 8640fa8 commit 5157a09
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions texk/web2c/cwebdir/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2023-07-14 Andreas Scherer <https://ascherer.github.io>

* ctwill.bux,
* cweave.w: Finally make use of type 'mode' -- C-style.

2023-07-13 Andreas Scherer <https://ascherer.github.io>

* ctang-{bs,w2c}.ch,
Expand Down
3 changes: 3 additions & 0 deletions texk/web2c/cwebdir/ctwill.bux
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@

@$cb_show_banner {COMMON.W}99 \&{void} (\,)@>

@$inner {CTWILL}227 =$0$@>
@$outer {CTWILL}227 =$1$@>

@$kpse_cweb_format "<kpathsea/types.h>" \zip@>
@$kpse_find_file "<kpathsea/tex-file.h>" \zip@>
@$versionstring "<lib/lib.h>" \zip@>
10 changes: 6 additions & 4 deletions texk/web2c/cwebdir/cweave.w
Original file line number Diff line number Diff line change
Expand Up @@ -3763,14 +3763,16 @@ currently in progress. The end of output occurs when an |end_translation|
token is found, so the stack is never empty except when we first begin the
output process.

@d inner false /* mode value for \CEE/ texts within \TEX/ texts */
@d outer true /* mode value for \CEE/ texts in sections */

@s mode int
@<Typed...@>=
typedef enum {
@!inner, /* value of |mode| for \CEE/ texts within \TEX/ texts */
@!outer /* value of |mode| for \CEE/ texts in sections */
} mode;
typedef struct {
token_pointer end_field; /* ending location of token list */
token_pointer tok_field; /* present location within token list */
boolean mode_field; /* interpretation of control tokens */
mode mode_field; /* interpretation of control tokens */
} output_state;
typedef output_state *stack_pointer;

Expand Down

0 comments on commit 5157a09

Please sign in to comment.