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: sprinkle const



details:   https://anonhg.NetBSD.org/src/rev/a1c04894c69c
branches:  trunk
changeset: 984154:a1c04894c69c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Jun 24 23:19:52 2021 +0000

description:
make: sprinkle const

diffstat:

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

diffs (58 lines):

diff -r 07821ba24ea6 -r a1c04894c69c usr.bin/make/for.c
--- a/usr.bin/make/for.c        Thu Jun 24 23:01:36 2021 +0000
+++ b/usr.bin/make/for.c        Thu Jun 24 23:19:52 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: for.c,v 1.142 2021/04/03 11:08:40 rillig Exp $ */
+/*     $NetBSD: for.c,v 1.143 2021/06/24 23:19:52 rillig Exp $ */
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -58,7 +58,7 @@
 #include "make.h"
 
 /*     "@(#)for.c      8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: for.c,v 1.142 2021/04/03 11:08:40 rillig Exp $");
+MAKE_RCSID("$NetBSD: for.c,v 1.143 2021/06/24 23:19:52 rillig Exp $");
 
 
 /* One of the variables to the left of the "in" in a .for loop. */
@@ -72,15 +72,15 @@
        Vector /* of ForVar */ vars; /* Iteration variables */
        Words items;            /* Substitution items */
        Buffer curBody;         /* Expanded body of the current iteration */
-       /* Is any of the names 1 character long? If so, when the variable values
-        * are substituted, the parser must handle $V expressions as well, not
-        * only ${V} and $(V). */
+       /* Is any of the names 1 character long? If so, when the variable
+        * values are substituted, the parser must handle $V expressions as
+        * well, not only ${V} and $(V). */
        bool short_var;
        unsigned int sub_next;  /* Where to continue iterating */
 } ForLoop;
 
 
-static ForLoop *accumFor;              /* Loop being accumulated */
+static ForLoop *accumFor;      /* Loop being accumulated */
 static int forLevel = 0;       /* Nesting level */
 
 
@@ -376,8 +376,8 @@
        const char *p = *pp;
 
        for (i = 0; i < f->vars.len; i++) {
-               ForVar *forVar = Vector_Get(&f->vars, i);
-               char *varname = forVar->name;
+               const ForVar *forVar = Vector_Get(&f->vars, i);
+               const char *varname = forVar->name;
                size_t varnameLen = forVar->nameLen;
 
                if (varnameLen >= (size_t)(bodyEnd - p))
@@ -413,7 +413,7 @@
 ForLoop_SubstVarShort(ForLoop *f, const char *p, const char **inout_mark)
 {
        const char ch = *p;
-       ForVar *vars;
+       const ForVar *vars;
        size_t i;
 
        /* Skip $$ and stupid ones. */



Home | Main Index | Thread Index | Old Index