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): remove lengthy comments from archive h...



details:   https://anonhg.NetBSD.org/src/rev/b8180456156f
branches:  trunk
changeset: 977420:b8180456156f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 24 03:45:02 2020 +0000

description:
make(1): remove lengthy comments from archive handling

The relevant information is already documented on OP_ARCHV, but only
since a few weeks.

diffstat:

 usr.bin/make/arch.c |  21 +++++----------------
 usr.bin/make/make.h |  12 +++++++-----
 2 files changed, 12 insertions(+), 21 deletions(-)

diffs (85 lines):

diff -r e5a287a8a8e4 -r b8180456156f usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Sat Oct 24 03:30:25 2020 +0000
+++ b/usr.bin/make/arch.c       Sat Oct 24 03:45:02 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.140 2020/10/23 19:48:17 rillig Exp $        */
+/*     $NetBSD: arch.c,v 1.141 2020/10/24 03:45:02 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include    "config.h"
 
 /*     "@(#)arch.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: arch.c,v 1.140 2020/10/23 19:48:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.141 2020/10/24 03:45:02 rillig Exp $");
 
 #ifdef TARGET_MACHINE
 #undef MAKE_MACHINE
@@ -345,17 +345,12 @@
                Lst_Append(nodeLst, gn);
 
            } else if (!Arch_ParseArchive(&sacrifice, nodeLst, ctxt)) {
-               /*
-                * Error in nested call -- free buffer and return FALSE
-                * ourselves.
-                */
+               /* Error in nested call. */
                free(buf);
                return FALSE;
            }
-           /*
-            * Free buffer and continue with our work.
-            */
            free(buf);
+
        } else if (Dir_HasWildcards(memName)) {
            StringList *members = Lst_New();
            Dir_Expand(memName, dirSearchPath, members);
@@ -368,17 +363,11 @@
                gn = Targ_GetNode(fullname);
                free(fullname);
 
-               /*
-                * We've found the node, but have to make sure the rest of
-                * the world knows it's an archive member, without having
-                * to constantly check for parentheses, so we type the
-                * thing with the OP_ARCHV bit before we place it on the
-                * end of the provided list.
-                */
                gn->type |= OP_ARCHV;
                Lst_Append(nodeLst, gn);
            }
            Lst_Free(members);
+
        } else {
            char *fullname = str_concat4(libName, "(", memName, ")");
            gn = Targ_GetNode(fullname);
diff -r e5a287a8a8e4 -r b8180456156f usr.bin/make/make.h
--- a/usr.bin/make/make.h       Sat Oct 24 03:30:25 2020 +0000
+++ b/usr.bin/make/make.h       Sat Oct 24 03:45:02 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.168 2020/10/23 20:14:50 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.169 2020/10/24 03:45:02 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -254,12 +254,14 @@
     /* The node is a transformation rule */
     OP_TRANSFORM       = 1 << 31,
     /* Target is a member of an archive */
+    /* XXX: How does this differ from OP_ARCHV? */
     OP_MEMBER          = 1 << 30,
-    /* Target is a library;
-     * the node's name has the form "-l<libname>" */
+    /* The node is a library,
+     * its name has the form "-l<libname>" */
     OP_LIB             = 1 << 29,
-    /* Target is an archive construct;
-     * the node's name has the form "archive(member)" */
+    /* The node is an archive member,
+     * its name has the form "archive(member)" */
+    /* XXX: How does this differ from OP_MEMBER? */
     OP_ARCHV           = 1 << 28,
     /* Target has all the commands it should. Used when parsing to catch
      * multiple command groups for a target.  Only applies to the dependency



Home | Main Index | Thread Index | Old Index