Module Name: src
Committed By: rillig
Date: Sun Dec 12 14:27:48 UTC 2021
Modified Files:
src/usr.bin/make: for.c
Log Message:
make: rename ForLoop.sub_next to nextItem
This matches the naming style of the other ForLoop members.
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/usr.bin/make/for.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/for.c
diff -u src/usr.bin/make/for.c:1.148 src/usr.bin/make/for.c:1.149
--- src/usr.bin/make/for.c:1.148 Sun Dec 5 11:40:03 2021
+++ src/usr.bin/make/for.c Sun Dec 12 14:27:48 2021
@@ -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 @@ typedef struct ForLoop {
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 @@ ForLoop_New(void)
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 @@ ForLoop_SubstVarLong(ForLoop *f, const c
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 @@ found:
/* 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 @@ ForReadMore(void *v_arg, size_t *out_len
{
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 @@ ForReadMore(void *v_arg, size_t *out_len
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;