Module Name: src Committed By: rillig Date: Sat Dec 12 00:33:25 UTC 2020
Modified Files: src/usr.bin/make: compat.c cond.c for.c job.c var.c Log Message: make(1): remove const from function parameters These have been left-overs from refactoring, when these pieces were extracted to separate functions. To generate a diff of this commit: cvs rdiff -u -r1.206 -r1.207 src/usr.bin/make/compat.c cvs rdiff -u -r1.221 -r1.222 src/usr.bin/make/cond.c cvs rdiff -u -r1.115 -r1.116 src/usr.bin/make/for.c cvs rdiff -u -r1.369 -r1.370 src/usr.bin/make/job.c cvs rdiff -u -r1.719 -r1.720 src/usr.bin/make/var.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/compat.c diff -u src/usr.bin/make/compat.c:1.206 src/usr.bin/make/compat.c:1.207 --- src/usr.bin/make/compat.c:1.206 Sat Dec 12 00:05:05 2020 +++ src/usr.bin/make/compat.c Sat Dec 12 00:33:25 2020 @@ -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 @@ MakeNodes(GNodeList *gnodes, GNode *pgn) } static Boolean -MakeUnmade(GNode *const gn, GNode *const pgn) +MakeUnmade(GNode *gn, GNode *pgn) { assert(gn->made == UNMADE); Index: src/usr.bin/make/cond.c diff -u src/usr.bin/make/cond.c:1.221 src/usr.bin/make/cond.c:1.222 --- src/usr.bin/make/cond.c:1.221 Sat Dec 5 18:15:40 2020 +++ src/usr.bin/make/cond.c Sat Dec 12 00:33:25 2020 @@ -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 @@ Cond_EvalCondition(const char *cond, Boo * or because the condition could not be evaluated */ CondEvalResult -Cond_EvalLine(const char *const line) +Cond_EvalLine(const char *line) { typedef enum IfState { Index: src/usr.bin/make/for.c diff -u src/usr.bin/make/for.c:1.115 src/usr.bin/make/for.c:1.116 --- src/usr.bin/make/for.c:1.115 Sat Nov 7 21:04:43 2020 +++ src/usr.bin/make/for.c Sat Dec 12 00:33:25 2020 @@ -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 @@ SubstVarLong(For *f, const char **pp, co /* 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; Index: src/usr.bin/make/job.c diff -u src/usr.bin/make/job.c:1.369 src/usr.bin/make/job.c:1.370 --- src/usr.bin/make/job.c:1.369 Sat Dec 12 00:05:05 2020 +++ src/usr.bin/make/job.c Sat Dec 12 00:33:25 2020 @@ -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 @@ JobPrintSpecialsEchoCtl(Job *job, Comman } 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 @@ JobPrintSpecials(Job *const job, const c * after all other targets have been made. */ static void -JobPrintCommand(Job *job, const char * const ucmd) +JobPrintCommand(Job *job, const char *ucmd) { Boolean run; Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.719 src/usr.bin/make/var.c:1.720 --- src/usr.bin/make/var.c:1.719 Mon Dec 7 01:50:19 2020 +++ src/usr.bin/make/var.c Sat Dec 12 00:33:25 2020 @@ -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 @@ ApplyModifier_SunShell(const char **pp, #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 @@ typedef enum ApplyModifiersIndirectResul /* 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 @@ ApplyModifiersIndirect( /* 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 @@ Var_Parse(const char **pp, GNode *ctxt, } 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;