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): replace two instances of Lst_AtFront w...



details:   https://anonhg.NetBSD.org/src/rev/47e03ce2ce7b
branches:  trunk
changeset: 975142:47e03ce2ce7b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 22 13:44:17 2020 +0000

description:
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.

diffstat:

 usr.bin/make/make.c  |  8 ++++----
 usr.bin/make/parse.c |  8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (70 lines):

diff -r 09425ea96469 -r 47e03ce2ce7b usr.bin/make/make.c
--- a/usr.bin/make/make.c       Sat Aug 22 13:28:20 2020 +0000
+++ b/usr.bin/make/make.c       Sat Aug 22 13:44:17 2020 +0000
@@ -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 @@
     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);
 
diff -r 09425ea96469 -r 47e03ce2ce7b usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sat Aug 22 13:28:20 2020 +0000
+++ b/usr.bin/make/parse.c      Sat Aug 22 13:44:17 2020 +0000
@@ -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 @@
 
     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);



Home | Main Index | Thread Index | Old Index