texlive[54904] Build/source/texk/web2c: [CWEB] Use enum'erated

commits+ascherer at tug.org commits+ascherer at tug.org
Mon Apr 27 09:00:57 CEST 2020


Revision: 54904
          http://tug.org/svn/texlive?view=revision&revision=54904
Author:   ascherer
Date:     2020-04-27 09:00:56 +0200 (Mon, 27 Apr 2020)
Log Message:
-----------
[CWEB] Use enum'erated program identifiers.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ChangeLog
    trunk/Build/source/texk/web2c/ctangleboot.cin
    trunk/Build/source/texk/web2c/cwebboot.cin
    trunk/Build/source/texk/web2c/cwebdir/ChangeLog
    trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch
    trunk/Build/source/texk/web2c/cwebdir/comm-w2c.h

Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog	2020-04-26 23:54:20 UTC (rev 54903)
+++ trunk/Build/source/texk/web2c/ChangeLog	2020-04-27 07:00:56 UTC (rev 54904)
@@ -1,3 +1,8 @@
+2020-04-27  Andreas Scherer  <https://ascherer.github.io>
+
+	* ctangleboot.cin,
+	* cwebboot.cin: Use enum'erated program identifiers.
+
 2020-04-23  Tomas Rokicki  <rokicki at gmail.com>
         and Karl Berry  <karl at freefriends.org>
 

Modified: trunk/Build/source/texk/web2c/ctangleboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/ctangleboot.cin	2020-04-26 23:54:20 UTC (rev 54903)
+++ trunk/Build/source/texk/web2c/ctangleboot.cin	2020-04-27 07:00:56 UTC (rev 54904)
@@ -47,10 +47,6 @@
 #define stack_size 50
 #define buf_size 1000 \
 
-#define ctangle 0
-#define cweave 1
-#define ctwill 2 \
-
 #define _(STRING) gettext(STRING)  \
 
 #define and_and 04
@@ -166,12 +162,15 @@
 #line 66 "cwebdir/ctangle.w"
 
 /*5:*/
-#line 37 "cwebdir/comm-w2c.h"
+#line 34 "cwebdir/comm-w2c.h"
 
 typedef bool boolean;
 typedef uint8_t eight_bits;
 typedef uint16_t sixteen_bits;
-extern int program;
+typedef enum{
+ctangle,cweave,ctwill
+}cweb;
+extern cweb program;
 extern int phase;
 
 /*:5*//*7:*/

Modified: trunk/Build/source/texk/web2c/cwebboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/cwebboot.cin	2020-04-26 23:54:20 UTC (rev 54903)
+++ trunk/Build/source/texk/web2c/cwebboot.cin	2020-04-27 07:00:56 UTC (rev 54904)
@@ -62,10 +62,6 @@
 /*:90*/
 #line 59 "cwebdir/common.w"
 
-#define ctangle 0
-#define cweave 1
-#define ctwill 2 \
-
 #define and_and 04
 #define lt_lt 020
 #define gt_gt 021
@@ -188,8 +184,11 @@
 /*2:*/
 #line 73 "cwebdir/common.w"
 
-#line 56 "cwebdir/comm-w2c.ch"
-int program;
+#line 53 "cwebdir/comm-w2c.ch"
+typedef enum{
+ctangle,cweave,ctwill
+}cweb;
+cweb program;
 #line 76 "cwebdir/common.w"
 
 /*:2*//*6:*/

Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2020-04-26 23:54:20 UTC (rev 54903)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2020-04-27 07:00:56 UTC (rev 54904)
@@ -1,3 +1,8 @@
+2020-04-27  Andreas Scherer  <https://ascherer.github.io>
+
+	* comm-w2c.ch,
+	* comm-w2c.h: Use enum'erated program identifiers.
+
 2020-04-16  Andreas Scherer  <https://ascherer.github.io>
 
 	* cweav-w2c.ch,

Modified: trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch	2020-04-26 23:54:20 UTC (rev 54903)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch	2020-04-27 07:00:56 UTC (rev 54904)
@@ -44,9 +44,6 @@
 @y
 |program|. And \.{CTWILL} adds some extra twists.
 
- at d ctangle 0
- at d cweave 1
- at d ctwill 2
 @z
 
 @x
@@ -53,7 +50,10 @@
 typedef short boolean;
 boolean program; /* \.{CWEAVE} or \.{CTANGLE}? */
 @y
-int program; /* \.{CWEAVE} or \.{CTANGLE} or \.{CTWILL}? */
+typedef enum {
+  ctangle, cweave, ctwill
+} cweb;
+cweb program; /* \.{CTANGLE} or \.{CWEAVE} or \.{CTWILL}? */
 @z
 
 @x

Modified: trunk/Build/source/texk/web2c/cwebdir/comm-w2c.h
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-w2c.h	2020-04-26 23:54:20 UTC (rev 54903)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-w2c.h	2020-04-27 07:00:56 UTC (rev 54904)
@@ -26,9 +26,6 @@
 
 First comes general stuff:
 
- at d ctangle 0
- at d cweave 1
- at d ctwill 2
 
 @s boolean int
 @s uint8_t int
@@ -38,7 +35,10 @@
 typedef bool boolean;
 typedef uint8_t eight_bits;
 typedef uint16_t sixteen_bits;
-extern int program; /* \.{CWEAVE} or \.{CTANGLE} or \.{CTWILL}? */
+typedef enum {
+  ctangle, cweave, ctwill
+} cweb;
+extern cweb program; /* \.{CTANGLE} or \.{CWEAVE} or \.{CTWILL}? */
 extern int phase; /* which phase are we in? */
 
 @ You may have noticed that almost all \.{"strings"} in the \.{CWEB} sources



More information about the tex-live-commits mailing list.