Module Name: src
Committed By: rillig
Date: Sat Sep 12 15:03:40 UTC 2020
Modified Files:
src/usr.bin/make: compat.c job.c nonints.h
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/usr.bin/make/compat.c
cvs rdiff -u -r1.230 -r1.231 src/usr.bin/make/job.c
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/make/nonints.h
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.141 src/usr.bin/make/compat.c:1.142
--- src/usr.bin/make/compat.c:1.141 Sat Sep 12 14:41:00 2020
+++ src/usr.bin/make/compat.c Sat Sep 12 15:03:39 2020
@@ -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 @@ CompatInterrupt(int signo)
*-----------------------------------------------------------------------
*/
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 @@ CompatRunCommand(void *cmdp, void *gnp)
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 @@ CompatRunCommand(void *cmdp, void *gnp)
return status;
}
+static int
+CompatRunCommand(void *cmd, void *gn)
+{
+ return Compat_RunCommand(cmd, gn);
+}
+
/*-
*-----------------------------------------------------------------------
* Compat_Make --
Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.230 src/usr.bin/make/job.c:1.231
--- src/usr.bin/make/job.c:1.230 Fri Sep 11 17:32:36 2020
+++ src/usr.bin/make/job.c Sat Sep 12 15:03:40 2020
@@ -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 @@ JobPrintCommand(void *cmdp, void *jobp)
* 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;
}
Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.107 src/usr.bin/make/nonints.h:1.108
--- src/usr.bin/make/nonints.h:1.107 Sat Sep 12 10:14:16 2020
+++ src/usr.bin/make/nonints.h Sat Sep 12 15:03:40 2020
@@ -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 @@ void Arch_End(void);
Boolean Arch_IsLib(GNode *);
/* compat.c */
-int CompatRunCommand(void *, void *);
+int Compat_RunCommand(char *, GNode *);
void Compat_Run(Lst);
int Compat_Make(void *, void *);