texlive[68356] Build/source/texk/web2c/cwebdir: [CWEB] Purge two

commits+ascherer at tug.org commits+ascherer at tug.org
Sun Sep 24 15:13:07 CEST 2023


Revision: 68356
          https://tug.org/svn/texlive?view=revision&revision=68356
Author:   ascherer
Date:     2023-09-24 15:13:07 +0200 (Sun, 24 Sep 2023)
Log Message:
-----------
[CWEB] Purge two scrap pointers.

Make the 'shift' arithmetic in section 182 clearer (without 'i1'/'o')
and avoid shadowing variable/parameter 'k' in section 187.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/cwebdir/ChangeLog
    trunk/Build/source/texk/web2c/cwebdir/cweave.w

Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2023-09-23 23:53:16 UTC (rev 68355)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2023-09-24 13:13:07 UTC (rev 68356)
@@ -1,3 +1,7 @@
+2023-09-24  Andreas Scherer  <https://ascherer.github.io>
+
+	* cweave.w: Purge two scrap pointers.
+
 2023-09-23  Andreas Scherer  <https://ascherer.github.io>
 
 	* ctwill-mini.ch,

Modified: trunk/Build/source/texk/web2c/cwebdir/cweave.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweave.w	2023-09-23 23:53:16 UTC (rev 68355)
+++ trunk/Build/source/texk/web2c/cwebdir/cweave.w	2023-09-24 13:13:07 UTC (rev 68356)
@@ -3195,7 +3195,8 @@
 static void squash(scrap_pointer,short,eight_bits,short,short);
 
 @ Now here's the |reduce| procedure used in our code for productions,
-which takes advantage of the simplification that occurs when |k==0|.
+which takes advantage of the simplifications that occur when |k==0|
+or |k==1|.
 
 @c
 static void
@@ -3204,7 +3205,7 @@
 eight_bits c,
 short d, short n)
 {
-  scrap_pointer i, o; /* pointers into scrap memory */
+  scrap_pointer i; /* pointer into scrap memory */
   j->cat=c;
   if (k>0) {
     j->trans=text_ptr;
@@ -3212,8 +3213,8 @@
     freeze_text();
   }
   if (k>1) {
-    for (i=j+k, o=j+1; i<=lo_ptr; i++, o++)
-      *o=*i;@^system dependencies@>
+    for (i=j+k; i<=lo_ptr; i++)
+      *(i-k+1)=*i;@^system dependencies@>
     lo_ptr=lo_ptr-k+1;
   }
   pp=(pp+d<scrap_base? scrap_base: pp+d);
@@ -3294,15 +3295,14 @@
 
 @ @<Print a snapsh...@>=
 if (tracing==fully) {
-  scrap_pointer k; /* pointer into |scrap_info|; shadows |short k| */
   printf("\n%d:",n);
-  for (k=scrap_base; k<=lo_ptr; k++) {
-    if (k==pp) putchar('*'); else putchar(' ');
-    if (k->mathness %4 == yes_math) putchar('+');
-    else if (k->mathness %4 == no_math) putchar('-');
-    print_cat(k->cat);
-    if (k->mathness /4 == yes_math) putchar('+');
-    else if (k->mathness /4 == no_math) putchar('-');
+  for (i=scrap_base; i<=lo_ptr; i++) {
+    putchar(i==pp?'*':' ');
+    if (i->mathness %4 == yes_math) putchar('+');
+    else if (i->mathness %4 == no_math) putchar('-');
+    print_cat(i->cat);
+    if (i->mathness /4 == yes_math) putchar('+');
+    else if (i->mathness /4 == no_math) putchar('-');
   }
   if (hi_ptr<=scrap_ptr) printf("..."); /* indicate that more is coming */
 }



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