Module Name: src
Committed By: rillig
Date: Sat Aug 22 13:44:17 UTC 2020
Modified Files:
src/usr.bin/make: make.c parse.c
Log Message:
make(1): replace two instances of Lst_AtFront with Lst_Prepend
In these cases, the list is guaranteed to be valid, therefore no
assertion is expected.
For comparison, the Lst_AtFront in dir.c needs to be kept since the path
may be null there.
To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/usr.bin/make/make.c
cvs rdiff -u -r1.254 -r1.255 src/usr.bin/make/parse.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/make.c
diff -u src/usr.bin/make/make.c:1.113 src/usr.bin/make/make.c:1.114
--- src/usr.bin/make/make.c:1.113 Sat Aug 22 13:28:20 2020
+++ src/usr.bin/make/make.c Sat Aug 22 13:44:17 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.113 2020/08/22 13:28:20 rillig Exp $ */
+/* $NetBSD: make.c,v 1.114 2020/08/22 13:44:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.113 2020/08/22 13:28:20 rillig Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.114 2020/08/22 13:44:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: make.c,v 1.113 2020/08/22 13:28:20 rillig Exp $");
+__RCSID("$NetBSD: make.c,v 1.114 2020/08/22 13:44:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -1395,7 +1395,7 @@ Make_ProcessWait(Lst targs)
pgn->flags = REMAKE;
pgn->type = OP_PHONY | OP_DEPENDS;
/* Get it displayed in the diag dumps */
- Lst_AtFront(Targ_List(), pgn);
+ Lst_PrependS(Targ_List(), pgn);
Lst_ForEach(targs, link_parent, pgn);
Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.254 src/usr.bin/make/parse.c:1.255
--- src/usr.bin/make/parse.c:1.254 Sat Aug 22 13:28:20 2020
+++ src/usr.bin/make/parse.c Sat Aug 22 13:44:17 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.254 2020/08/22 13:28:20 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.255 2020/08/22 13:44:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.254 2020/08/22 13:28:20 rillig Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.255 2020/08/22 13:44:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.254 2020/08/22 13:28:20 rillig Exp $");
+__RCSID("$NetBSD: parse.c,v 1.255 2020/08/22 13:44:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -2479,7 +2479,7 @@ Parse_SetInput(const char *name, int lin
if (curFile != NULL)
/* Save exiting file info */
- Lst_AtFront(includes, curFile);
+ Lst_PrependS(includes, curFile);
/* Allocate and fill in new structure */
curFile = bmake_malloc(sizeof *curFile);