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): fix name and prototype of Compat_RunCo...
details: https://anonhg.NetBSD.org/src/rev/441ae85bfbd9
branches: trunk
changeset: 976075:441ae85bfbd9
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Sep 12 15:03:39 2020 +0000
description:
make(1): fix name and prototype of Compat_RunCommand
By convention, exported identifiers are written with underscore.
The prototype of an exported function must not use void * just because
it is used in Lst_ForEach. This is an implementation detail and must
remain so.
diffstat:
usr.bin/make/compat.c | 15 ++++++++++-----
usr.bin/make/job.c | 8 ++++----
usr.bin/make/nonints.h | 4 ++--
3 files changed, 16 insertions(+), 11 deletions(-)
diffs (109 lines):
diff -r b19c152309dc -r 441ae85bfbd9 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c Sat Sep 12 15:01:38 2020 +0000
+++ b/usr.bin/make/compat.c Sat Sep 12 15:03:39 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.141 2020/09/12 14:41:00 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.142 2020/09/12 15:03:39 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.141 2020/09/12 14:41:00 rillig Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.142 2020/09/12 15:03:39 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: compat.c,v 1.141 2020/09/12 14:41:00 rillig Exp $");
+__RCSID("$NetBSD: compat.c,v 1.142 2020/09/12 15:03:39 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -197,7 +197,7 @@
*-----------------------------------------------------------------------
*/
int
-CompatRunCommand(void *cmdp, void *gnp)
+Compat_RunCommand(char *cmdp, struct GNode *gn)
{
char *cmdStart; /* Start of expanded command */
char *cp, *bp;
@@ -214,7 +214,6 @@
Boolean useShell; /* TRUE if command should be executed
* using a shell */
char * volatile cmd = (char *)cmdp;
- GNode *gn = (GNode *)gnp;
silent = (gn->type & OP_SILENT) != 0;
errCheck = !(gn->type & OP_IGNORE);
@@ -480,6 +479,12 @@
return status;
}
+static int
+CompatRunCommand(void *cmd, void *gn)
+{
+ return Compat_RunCommand(cmd, gn);
+}
+
/*-
*-----------------------------------------------------------------------
* Compat_Make --
diff -r b19c152309dc -r 441ae85bfbd9 usr.bin/make/job.c
--- a/usr.bin/make/job.c Sat Sep 12 15:01:38 2020 +0000
+++ b/usr.bin/make/job.c Sat Sep 12 15:03:39 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.230 2020/09/11 17:32:36 rillig Exp $ */
+/* $NetBSD: job.c,v 1.231 2020/09/12 15:03:40 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.230 2020/09/11 17:32:36 rillig Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.231 2020/09/12 15:03:40 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: job.c,v 1.230 2020/09/11 17:32:36 rillig Exp $");
+__RCSID("$NetBSD: job.c,v 1.231 2020/09/12 15:03:40 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -742,7 +742,7 @@
* We're not actually executing anything...
* but this one needs to be - use compat mode just for it.
*/
- CompatRunCommand(cmdp, job->node);
+ Compat_RunCommand(cmdp, job->node);
free(cmdStart);
return 0;
}
diff -r b19c152309dc -r 441ae85bfbd9 usr.bin/make/nonints.h
--- a/usr.bin/make/nonints.h Sat Sep 12 15:01:38 2020 +0000
+++ b/usr.bin/make/nonints.h Sat Sep 12 15:03:39 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nonints.h,v 1.107 2020/09/12 10:14:16 rillig Exp $ */
+/* $NetBSD: nonints.h,v 1.108 2020/09/12 15:03:40 rillig Exp $ */
/*-
* Copyright (c) 1988, 1989, 1990, 1993
@@ -85,7 +85,7 @@
Boolean Arch_IsLib(GNode *);
/* compat.c */
-int CompatRunCommand(void *, void *);
+int Compat_RunCommand(char *, GNode *);
void Compat_Run(Lst);
int Compat_Make(void *, void *);
Home |
Main Index |
Thread Index |
Old Index