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(1): remove const from function parameters



details:   https://anonhg.NetBSD.org/src/rev/de35c579d6c4
branches:  trunk
changeset: 979030:de35c579d6c4
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Dec 12 00:33:25 2020 +0000

description:
make(1): remove const from function parameters

These have been left-overs from refactoring, when these pieces were
extracted to separate functions.

diffstat:

 usr.bin/make/compat.c |   6 +++---
 usr.bin/make/cond.c   |   6 +++---
 usr.bin/make/for.c    |   6 +++---
 usr.bin/make/job.c    |  11 +++++------
 usr.bin/make/var.c    |  35 ++++++++++++++++-------------------
 5 files changed, 30 insertions(+), 34 deletions(-)

diffs (197 lines):

diff -r ab499d6807e8 -r de35c579d6c4 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Sat Dec 12 00:05:05 2020 +0000
+++ b/usr.bin/make/compat.c     Sat Dec 12 00:33:25 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.206 2020/12/12 00:05:05 rillig Exp $      */
+/*     $NetBSD: compat.c,v 1.207 2020/12/12 00:33:25 rillig Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*     "@(#)compat.c   8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.206 2020/12/12 00:05:05 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.207 2020/12/12 00:33:25 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -468,7 +468,7 @@
 }
 
 static Boolean
-MakeUnmade(GNode *const gn, GNode *const pgn)
+MakeUnmade(GNode *gn, GNode *pgn)
 {
 
        assert(gn->made == UNMADE);
diff -r ab499d6807e8 -r de35c579d6c4 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Sat Dec 12 00:05:05 2020 +0000
+++ b/usr.bin/make/cond.c       Sat Dec 12 00:33:25 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.221 2020/12/05 18:15:40 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.222 2020/12/12 00:33:25 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -94,7 +94,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.221 2020/12/05 18:15:40 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.222 2020/12/12 00:33:25 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -1117,7 +1117,7 @@
  *                     or because the condition could not be evaluated
  */
 CondEvalResult
-Cond_EvalLine(const char *const line)
+Cond_EvalLine(const char *line)
 {
        typedef enum IfState {
 
diff -r ab499d6807e8 -r de35c579d6c4 usr.bin/make/for.c
--- a/usr.bin/make/for.c        Sat Dec 12 00:05:05 2020 +0000
+++ b/usr.bin/make/for.c        Sat Dec 12 00:33:25 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: for.c,v 1.115 2020/11/07 21:04:43 rillig Exp $ */
+/*     $NetBSD: for.c,v 1.116 2020/12/12 00:33:25 rillig Exp $ */
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -60,7 +60,7 @@
 #include "make.h"
 
 /*     "@(#)for.c      8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: for.c,v 1.115 2020/11/07 21:04:43 rillig Exp $");
+MAKE_RCSID("$NetBSD: for.c,v 1.116 2020/12/12 00:33:25 rillig Exp $");
 
 static int forLevel = 0;       /* Nesting level */
 
@@ -375,7 +375,7 @@
 /* While expanding the body of a .for loop, replace single-character
  * variable expressions like $i with their ${:U...} expansion. */
 static void
-SubstVarShort(For *f, char const ch, const char **pp, const char **inout_mark)
+SubstVarShort(For *f, char ch, const char **pp, const char **inout_mark)
 {
     const char *p = *pp;
     size_t i;
diff -r ab499d6807e8 -r de35c579d6c4 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Sat Dec 12 00:05:05 2020 +0000
+++ b/usr.bin/make/job.c        Sat Dec 12 00:33:25 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.369 2020/12/12 00:05:05 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.370 2020/12/12 00:33:25 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.369 2020/12/12 00:05:05 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.370 2020/12/12 00:33:25 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -805,9 +805,8 @@
 }
 
 static void
-JobPrintSpecials(Job *const job, const char *const escCmd,
-                Boolean const run, CommandFlags *const inout_cmdFlags,
-                const char **const inout_cmdTemplate)
+JobPrintSpecials(Job *job, const char *escCmd, Boolean run,
+                CommandFlags *inout_cmdFlags, const char **inout_cmdTemplate)
 {
        if (!run)
                inout_cmdFlags->ignerr = FALSE;
@@ -836,7 +835,7 @@
  * after all other targets have been made.
  */
 static void
-JobPrintCommand(Job *job, const char * const ucmd)
+JobPrintCommand(Job *job, const char *ucmd)
 {
        Boolean run;
 
diff -r ab499d6807e8 -r de35c579d6c4 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sat Dec 12 00:05:05 2020 +0000
+++ b/usr.bin/make/var.c        Sat Dec 12 00:33:25 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.719 2020/12/07 01:50:19 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.720 2020/12/12 00:33:25 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.719 2020/12/07 01:50:19 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.720 2020/12/12 00:33:25 rillig Exp $");
 
 /* A string that may need to be freed after use. */
 typedef struct FStr {
@@ -3269,7 +3269,7 @@
 #endif
 
 static void
-LogBeforeApply(const ApplyModifiersState *st, const char *mod, const char endc)
+LogBeforeApply(const ApplyModifiersState *st, const char *mod, char endc)
 {
        char eflags_str[VarEvalFlags_ToStringSize];
        char vflags_str[VarFlags_ToStringSize];
@@ -3388,11 +3388,8 @@
 /* While expanding a variable expression, expand and apply indirect
  * modifiers such as in ${VAR:${M_indirect}}. */
 static ApplyModifiersIndirectResult
-ApplyModifiersIndirect(
-    ApplyModifiersState *const st,
-    const char **const inout_p,
-    void **const inout_freeIt
-)
+ApplyModifiersIndirect(ApplyModifiersState *st, const char **inout_p,
+                      void **inout_freeIt)
 {
        const char *p = *inout_p;
        const char *mods;
@@ -3454,15 +3451,15 @@
 /* Apply any modifiers (such as :Mpattern or :@var@loop@ or :Q or ::=value). */
 static char *
 ApplyModifiers(
-    const char **const pp,     /* the parsing position, updated upon return */
-    char *const val,           /* the current value of the expression */
-    char const startc,         /* '(' or '{', or '\0' for indirect modifiers */
-    char const endc,           /* ')' or '}', or '\0' for indirect modifiers */
-    Var *const v,
-    VarExprFlags *const exprFlags,
-    GNode *const ctxt,         /* for looking up and modifying variables */
-    VarEvalFlags const eflags,
-    void **const inout_freeIt  /* free this after using the return value */
+    const char **pp,           /* the parsing position, updated upon return */
+    char *val,                 /* the current value of the expression */
+    char startc,               /* '(' or '{', or '\0' for indirect modifiers */
+    char endc,                 /* ')' or '}', or '\0' for indirect modifiers */
+    Var *v,
+    VarExprFlags *exprFlags,
+    GNode *ctxt,               /* for looking up and modifying variables */
+    VarEvalFlags eflags,
+    void **inout_freeIt                /* free this after using the return value */
 )
 {
        ApplyModifiersState st = {
@@ -4120,8 +4117,8 @@
 }
 
 static void
-VarSubstNested(const char **const pp, Buffer *const buf, GNode *const ctxt,
-              VarEvalFlags const eflags, Boolean *inout_errorReported)
+VarSubstNested(const char **pp, Buffer *buf, GNode *ctxt,
+              VarEvalFlags eflags, Boolean *inout_errorReported)
 {
        const char *p = *pp;
        const char *nested_p = p;



Home | Main Index | Thread Index | Old Index