Module Name:    src
Committed By:   rillig
Date:           Sat Oct 24 03:45:02 UTC 2020

Modified Files:
        src/usr.bin/make: arch.c make.h

Log Message:
make(1): remove lengthy comments from archive handling

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


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/usr.bin/make/arch.c
cvs rdiff -u -r1.168 -r1.169 src/usr.bin/make/make.h

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/arch.c
diff -u src/usr.bin/make/arch.c:1.140 src/usr.bin/make/arch.c:1.141
--- src/usr.bin/make/arch.c:1.140	Fri Oct 23 19:48:17 2020
+++ src/usr.bin/make/arch.c	Sat Oct 24 03:45:02 2020
@@ -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 @@ Arch_ParseArchive(char **linePtr, GNodeL
 		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 @@ Arch_ParseArchive(char **linePtr, GNodeL
 		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);

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.168 src/usr.bin/make/make.h:1.169
--- src/usr.bin/make/make.h:1.168	Fri Oct 23 20:14:50 2020
+++ src/usr.bin/make/make.h	Sat Oct 24 03:45:02 2020
@@ -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 @@ typedef enum GNodeType {
     /* 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

Reply via email to