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/908f7f0f5b19
branches:  trunk
changeset: 379880:908f7f0f5b19
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 07fcf8b5d1c4 -r 908f7f0f5b19 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 @@ typedef struct ForLoop {
        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 @@ ForLoop_SubstVarLong(ForLoop *f, const c
        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 @@ static void
 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