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): make parameter of Compat_RunCommand const
details: https://anonhg.NetBSD.org/src/rev/6c30d0400c17
branches: trunk
changeset: 939421:6c30d0400c17
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Sep 27 11:37:19 2020 +0000
description:
make(1): make parameter of Compat_RunCommand const
diffstat:
usr.bin/make/compat.c | 11 ++++++-----
usr.bin/make/nonints.h | 4 ++--
2 files changed, 8 insertions(+), 7 deletions(-)
diffs (66 lines):
diff -r e59608d72ec9 -r 6c30d0400c17 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c Sun Sep 27 11:14:03 2020 +0000
+++ b/usr.bin/make/compat.c Sun Sep 27 11:37:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.152 2020/09/26 16:41:42 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.153 2020/09/27 11:37:19 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -99,7 +99,7 @@
#include "pathnames.h"
/* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.152 2020/09/26 16:41:42 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.153 2020/09/27 11:37:19 rillig Exp $");
static GNode *curTarg = NULL;
static void CompatInterrupt(int);
@@ -185,10 +185,10 @@
*-----------------------------------------------------------------------
*/
int
-Compat_RunCommand(char *cmdp, struct GNode *gn)
+Compat_RunCommand(const char *cmdp, struct GNode *gn)
{
char *cmdStart; /* Start of expanded command */
- char *cp, *bp;
+ char *bp;
Boolean silent, /* Don't print command */
doIt; /* Execute even if -n */
volatile Boolean errCheck; /* Check errors */
@@ -201,7 +201,7 @@
char ** volatile mav;/* Copy of the argument vector for freeing */
Boolean useShell; /* TRUE if command should be executed
* using a shell */
- char * volatile cmd = (char *)cmdp;
+ const char * volatile cmd = cmdp;
silent = (gn->type & OP_SILENT) != 0;
errCheck = !(gn->type & OP_IGNORE);
@@ -403,6 +403,7 @@
#endif
if (status != 0) {
if (DEBUG(ERROR)) {
+ const char *cp;
fprintf(debug_file, "\n*** Failed target: %s\n*** Failed command: ",
gn->name);
for (cp = cmd; *cp; ) {
diff -r e59608d72ec9 -r 6c30d0400c17 usr.bin/make/nonints.h
--- a/usr.bin/make/nonints.h Sun Sep 27 11:14:03 2020 +0000
+++ b/usr.bin/make/nonints.h Sun Sep 27 11:37:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nonints.h,v 1.131 2020/09/26 16:41:42 rillig Exp $ */
+/* $NetBSD: nonints.h,v 1.132 2020/09/27 11:37:19 rillig Exp $ */
/*-
* Copyright (c) 1988, 1989, 1990, 1993
@@ -85,7 +85,7 @@
Boolean Arch_IsLib(GNode *);
/* compat.c */
-int Compat_RunCommand(char *, GNode *);
+int Compat_RunCommand(const char *, GNode *);
void Compat_Run(GNodeList *);
void Compat_Make(GNode *, GNode *);
Home |
Main Index |
Thread Index |
Old Index