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): migrate Lst_Last to Lst_LastS



details:   https://anonhg.NetBSD.org/src/rev/f135bf3fd58a
branches:  trunk
changeset: 975341:f135bf3fd58a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Aug 27 07:03:48 2020 +0000

description:
make(1): migrate Lst_Last to Lst_LastS

diffstat:

 usr.bin/make/lst.c   |  18 +++---------------
 usr.bin/make/parse.c |   8 ++++----
 usr.bin/make/suff.c  |  10 +++++-----
 3 files changed, 12 insertions(+), 24 deletions(-)

diffs (121 lines):

diff -r 7138365c03f5 -r f135bf3fd58a usr.bin/make/lst.c
--- a/usr.bin/make/lst.c        Thu Aug 27 07:00:29 2020 +0000
+++ b/usr.bin/make/lst.c        Thu Aug 27 07:03:48 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.45 2020/08/27 07:00:29 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.46 2020/08/27 07:03:48 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -37,11 +37,11 @@
 #include "make.h"
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lst.c,v 1.45 2020/08/27 07:00:29 rillig Exp $";
+static char rcsid[] = "$NetBSD: lst.c,v 1.46 2020/08/27 07:03:48 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: lst.c,v 1.45 2020/08/27 07:00:29 rillig Exp $");
+__RCSID("$NetBSD: lst.c,v 1.46 2020/08/27 07:03:48 rillig Exp $");
 #endif /* not lint */
 #endif
 
@@ -351,18 +351,6 @@
     return list->first;
 }
 
-/* Return the last node from the given list, or NULL if the list is empty or
- * invalid. */
-LstNode
-Lst_Last(Lst list)
-{
-    if (!LstIsValid(list) || LstIsEmpty(list)) {
-       return NULL;
-    } else {
-       return list->last;
-    }
-}
-
 /* Return the last node from the given list, or NULL if the list is empty. */
 LstNode
 Lst_LastS(Lst list)
diff -r 7138365c03f5 -r f135bf3fd58a usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Thu Aug 27 07:00:29 2020 +0000
+++ b/usr.bin/make/parse.c      Thu Aug 27 07:03:48 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.265 2020/08/27 06:53:57 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.266 2020/08/27 07:03:48 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.265 2020/08/27 06:53:57 rillig Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.266 2020/08/27 07:03:48 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.265 2020/08/27 06:53:57 rillig Exp $");
+__RCSID("$NetBSD: parse.c,v 1.266 2020/08/27 07:03:48 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2088,7 +2088,7 @@
 
     /* Add to last (ie current) cohort for :: targets */
     if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty(gn->cohorts))
-       gn = Lst_DatumS(Lst_Last(gn->cohorts));
+       gn = Lst_DatumS(Lst_LastS(gn->cohorts));
 
     /* if target already supplied, ignore commands */
     if (!(gn->type & OP_HAS_COMMANDS)) {
diff -r 7138365c03f5 -r f135bf3fd58a usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Thu Aug 27 07:00:29 2020 +0000
+++ b/usr.bin/make/suff.c       Thu Aug 27 07:03:48 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.119 2020/08/27 07:00:29 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.120 2020/08/27 07:03:48 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.119 2020/08/27 07:00:29 rillig Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.120 2020/08/27 07:03:48 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)suff.c     8.4 (Berkeley) 3/21/94";
 #else
-__RCSID("$NetBSD: suff.c,v 1.119 2020/08/27 07:00:29 rillig Exp $");
+__RCSID("$NetBSD: suff.c,v 1.120 2020/08/27 07:03:48 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -776,7 +776,7 @@
     GNode *gn = (GNode *)gnp;
 
     if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty(gn->cohorts))
-       gn = Lst_DatumS(Lst_Last(gn->cohorts));
+       gn = Lst_DatumS(Lst_LastS(gn->cohorts));
     if ((gn->type & OP_TRANSFORM) && Lst_IsEmpty(gn->commands) &&
        Lst_IsEmpty(gn->children))
     {
@@ -1836,7 +1836,7 @@
     /*
      * Record last child for expansion purposes
      */
-    ln = Lst_Last(tGn->children);
+    ln = Lst_LastS(tGn->children);
 
     /*
      * Pass the buck to Make_HandleUse to apply the rule



Home | Main Index | Thread Index | Old Index