Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make: rename ForLoop.sub_next to nextItem



details:   https://anonhg.NetBSD.org/src/rev/4456def1789d
branches:  trunk
changeset: 1027582:4456def1789d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 12 14:27:48 2021 +0000

description:
make: rename ForLoop.sub_next to nextItem

This matches the naming style of the other ForLoop members.

No functional change.

diffstat:

 usr.bin/make/for.c |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (85 lines):

diff -r 742089430ef2 -r 4456def1789d usr.bin/make/for.c
--- a/usr.bin/make/for.c        Sun Dec 12 13:43:47 2021 +0000
+++ b/usr.bin/make/for.c        Sun Dec 12 14:27:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: for.c,v 1.148 2021/12/05 11:40:03 rillig Exp $ */
+/*     $NetBSD: for.c,v 1.149 2021/12/12 14:27:48 rillig Exp $ */
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -45,9 +45,9 @@
  *
  * After reaching the .endfor, the values from the .for line are grouped
  * according to the number of variables.  For each such group, the unexpanded
- * body is scanned for variable expressions, and those that match the variable
- * names are replaced with expressions of the form ${:U...} or $(:U...).
- * After that, the body is treated like a file from an .include directive.
+ * body is scanned for variable expressions, and those that match the
+ * variable names are replaced with expressions of the form ${:U...}.  After
+ * that, the body is treated like a file from an .include directive.
  *
  * Interface:
  *     For_Eval        Evaluate the loop in the passed line.
@@ -58,7 +58,7 @@
 #include "make.h"
 
 /*     "@(#)for.c      8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: for.c,v 1.148 2021/12/05 11:40:03 rillig Exp $");
+MAKE_RCSID("$NetBSD: for.c,v 1.149 2021/12/12 14:27:48 rillig Exp $");
 
 
 /* One of the variables to the left of the "in" in a .for loop. */
@@ -72,7 +72,7 @@
        Vector /* of ForVar */ vars; /* Iteration variables */
        SubstringWords items;   /* Substitution items */
        Buffer curBody;         /* Expanded body of the current iteration */
-       unsigned int sub_next;  /* Where to continue iterating */
+       unsigned int nextItem;  /* Where to continue iterating */
 } ForLoop;
 
 
@@ -89,7 +89,7 @@
        Vector_Init(&f->vars, sizeof(ForVar));
        SubstringWords_Init(&f->items);
        Buf_Init(&f->curBody);
-       f->sub_next = 0;
+       f->nextItem = 0;
 
        return f;
 }
@@ -398,7 +398,7 @@
                Buf_AddBytesBetween(&f->curBody, *inout_mark, p);
                Buf_AddStr(&f->curBody, ":U");
                Buf_AddEscaped(&f->curBody,
-                   f->items.words[f->sub_next + i], endc);
+                   f->items.words[f->nextItem + i], endc);
 
                p += varnameLen;
                *inout_mark = p;
@@ -436,7 +436,7 @@
 
        /* Replace $<ch> with ${:U<value>} */
        Buf_AddStr(&f->curBody, "{:U");
-       Buf_AddEscaped(&f->curBody, f->items.words[f->sub_next + i], '}');
+       Buf_AddEscaped(&f->curBody, f->items.words[f->nextItem + i], '}');
        Buf_AddByte(&f->curBody, '}');
 }
 
@@ -487,7 +487,7 @@
 {
        ForLoop *f = v_arg;
 
-       if (f->sub_next == f->items.len) {
+       if (f->nextItem == f->items.len) {
                /* No more iterations */
                ForLoop_Free(f);
                return NULL;
@@ -495,7 +495,7 @@
 
        ForLoop_SubstBody(f);
        DEBUG1(FOR, "For: loop body:\n%s", f->curBody.data);
-       f->sub_next += (unsigned int)f->vars.len;
+       f->nextItem += (unsigned int)f->vars.len;
 
        *out_len = f->curBody.len;
        return f->curBody.data;



Home | Main Index | Thread Index | Old Index