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): inline SuffSuffIsPrefix into SuffParse...



details:   https://anonhg.NetBSD.org/src/rev/8f32dea7a52b
branches:  trunk
changeset: 941422:8f32dea7a52b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Oct 20 20:55:35 2020 +0000

description:
make(1): inline SuffSuffIsPrefix into SuffParseTransform

diffstat:

 usr.bin/make/suff.c |  16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diffs (44 lines):

diff -r b833f94d46a8 -r 8f32dea7a52b usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Tue Oct 20 20:51:15 2020 +0000
+++ b/usr.bin/make/suff.c       Tue Oct 20 20:55:35 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.196 2020/10/20 20:51:15 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.197 2020/10/20 20:55:35 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include "dir.h"
 
 /*     "@(#)suff.c     8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.196 2020/10/20 20:51:15 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.197 2020/10/20 20:55:35 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -287,15 +287,6 @@
     return NULL;
 }
 
-/* See if the suffix name is a prefix of the string. Care must be taken when
- * using this to search for transformations and what-not, since there could
- * well be two suffixes, one of which is a prefix of the other... */
-static Boolean
-SuffSuffIsPrefix(const void *s, const void *str)
-{
-    return SuffStrIsPrefix(((const Suff *)s)->name, str) != NULL;
-}
-
 /* See if the graph node has the desired name. */
 static Boolean
 SuffGNHasName(const void *gn, const void *desiredName)
@@ -451,7 +442,8 @@
      */
     for (ln = sufflist->first; ln != NULL; ln = ln->next) {
        Suff *src = ln->datum;
-        if (!SuffSuffIsPrefix(src, str))
+
+       if (SuffStrIsPrefix(src->name, str) == NULL)
            continue;
 
        if (str[src->nameLen] == '\0') {



Home | Main Index | Thread Index | Old Index