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): format multi-line comments



details:   https://anonhg.NetBSD.org/src/rev/a7c55356e301
branches:  trunk
changeset: 1017526:a7c55356e301
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 30 10:03:16 2020 +0000

description:
make(1): format multi-line comments

diffstat:

 usr.bin/make/arch.c        |   40 ++++++---
 usr.bin/make/buf.c         |   22 +++--
 usr.bin/make/compat.c      |   16 ++-
 usr.bin/make/cond.c        |   61 ++++++++++-----
 usr.bin/make/dir.c         |  106 ++++++++++++++++++---------
 usr.bin/make/enum.c        |   10 +-
 usr.bin/make/enum.h        |   62 ++++++++++-----
 usr.bin/make/for.c         |   31 +++++--
 usr.bin/make/hash.c        |   28 ++++--
 usr.bin/make/job.c         |   46 +++++++----
 usr.bin/make/job.h         |    8 +-
 usr.bin/make/lst.c         |   46 +++++++----
 usr.bin/make/lst.h         |   14 ++-
 usr.bin/make/main.c        |   88 +++++++++++++++-------
 usr.bin/make/make.c        |   43 +++++++---
 usr.bin/make/make.h        |   50 ++++++++----
 usr.bin/make/make_malloc.h |    8 +-
 usr.bin/make/parse.c       |   91 +++++++++++++++--------
 usr.bin/make/str.c         |    7 +-
 usr.bin/make/suff.c        |   28 ++++--
 usr.bin/make/util.c        |    7 +-
 usr.bin/make/var.c         |  172 +++++++++++++++++++++++++++++---------------
 22 files changed, 643 insertions(+), 341 deletions(-)

diffs (truncated from 2574 to 300 lines):

diff -r 13baf0a96b00 -r a7c55356e301 usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Wed Dec 30 01:44:32 2020 +0000
+++ b/usr.bin/make/arch.c       Wed Dec 30 10:03:16 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.191 2020/12/20 13:46:27 rillig Exp $        */
+/*     $NetBSD: arch.c,v 1.192 2020/12/30 10:03:16 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -68,7 +68,8 @@
  * SUCH DAMAGE.
  */
 
-/* Manipulate libraries, archives and their members.
+/*
+ * Manipulate libraries, archives and their members.
  *
  * The first time an archive is referenced, all of its members' headers are
  * read and cached and the archive closed again.  All cached archives are kept
@@ -125,7 +126,7 @@
 #include "config.h"
 
 /*     "@(#)arch.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: arch.c,v 1.191 2020/12/20 13:46:27 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.192 2020/12/30 10:03:16 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -387,7 +388,8 @@
        return TRUE;
 }
 
-/* Locate a member of an archive, given the path of the archive and the path
+/*
+ * Locate a member of an archive, given the path of the archive and the path
  * of the desired member.
  *
  * Input:
@@ -688,7 +690,8 @@
        return FALSE;
 }
 
-/* Locate a member of an archive, given the path of the archive and the path
+/*
+ * Locate a member of an archive, given the path of the archive and the path
  * of the desired member.
  *
  * Input:
@@ -832,7 +835,8 @@
        return NULL;
 }
 
-/* Touch a member of an archive, on disk.
+/*
+ * Touch a member of an archive, on disk.
  * The GNode's modification time is left as-is.
  *
  * The st_mtime of the entire archive is also changed.
@@ -860,11 +864,13 @@
        fclose(f);              /* TODO: handle errors */
 }
 
-/* Given a node which represents a library, touch the thing, making sure that
+/*
+ * Given a node which represents a library, touch the thing, making sure that
  * the table of contents is also touched.
  *
  * Both the modification time of the library and of the RANLIBMAG member are
- * set to 'now'. */
+ * set to 'now'.
+ */
 void
 Arch_TouchLib(GNode *gn MAKE_ATTR_UNUSED)
 {
@@ -886,8 +892,10 @@
 #endif
 }
 
-/* Update the mtime of the GNode with the mtime from the archive member on
- * disk (or in the cache). */
+/*
+ * Update the mtime of the GNode with the mtime from the archive member on
+ * disk (or in the cache).
+ */
 void
 Arch_UpdateMTime(GNode *gn)
 {
@@ -900,8 +908,10 @@
                gn->mtime = 0;
 }
 
-/* Given a nonexistent archive member's node, update gn->mtime from its
- * archived form, if it exists. */
+/*
+ * Given a nonexistent archive member's node, update gn->mtime from its
+ * archived form, if it exists.
+ */
 void
 Arch_UpdateMemberMTime(GNode *gn)
 {
@@ -939,7 +949,8 @@
        }
 }
 
-/* Search for a library along the given search path.
+/*
+ * Search for a library along the given search path.
  *
  * The node's 'path' field is set to the found path (including the
  * actual file name, not -l...). If the system can handle the -L
@@ -967,7 +978,8 @@
 #endif
 }
 
-/* Decide if a node with the OP_LIB attribute is out-of-date. Called from
+/*
+ * Decide if a node with the OP_LIB attribute is out-of-date. Called from
  * GNode_IsOODate to make its life easier.
  * The library is cached if it hasn't been already.
  *
diff -r 13baf0a96b00 -r a7c55356e301 usr.bin/make/buf.c
--- a/usr.bin/make/buf.c        Wed Dec 30 01:44:32 2020 +0000
+++ b/usr.bin/make/buf.c        Wed Dec 30 10:03:16 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: buf.c,v 1.46 2020/12/28 15:42:53 rillig Exp $  */
+/*     $NetBSD: buf.c,v 1.47 2020/12/30 10:03:16 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -75,7 +75,7 @@
 #include "make.h"
 
 /*     "@(#)buf.c      8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: buf.c,v 1.46 2020/12/28 15:42:53 rillig Exp $");
+MAKE_RCSID("$NetBSD: buf.c,v 1.47 2020/12/30 10:03:16 rillig Exp $");
 
 /* Make space in the buffer for adding at least 16 more bytes. */
 void
@@ -135,11 +135,13 @@
        Buf_AddBytes(buf, str, len);
 }
 
-/* Get the data (usually a string) from the buffer.
+/*
+ * Get the data (usually a string) from the buffer.
  * The returned data is valid until the next modifying operation
  * on the buffer.
  *
- * Returns the data and optionally the length of the data. */
+ * Returns the data and optionally the length of the data.
+ */
 char *
 Buf_GetAll(Buffer *buf, size_t *out_len)
 {
@@ -172,9 +174,11 @@
        Buf_InitSize(buf, 256);
 }
 
-/* Reset the buffer.
+/*
+ * Reset the buffer.
  * If freeData is TRUE, the data from the buffer is freed as well.
- * Otherwise it is kept and returned. */
+ * Otherwise it is kept and returned.
+ */
 char *
 Buf_Destroy(Buffer *buf, Boolean freeData)
 {
@@ -195,10 +199,12 @@
 # define BUF_COMPACT_LIMIT 128 /* worthwhile saving */
 #endif
 
-/* Reset the buffer and return its data.
+/*
+ * Reset the buffer and return its data.
  *
  * If the buffer size is much greater than its content,
- * a new buffer will be allocated and the old one freed. */
+ * a new buffer will be allocated and the old one freed.
+ */
 char *
 Buf_DestroyCompact(Buffer *buf)
 {
diff -r 13baf0a96b00 -r a7c55356e301 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Wed Dec 30 01:44:32 2020 +0000
+++ b/usr.bin/make/compat.c     Wed Dec 30 10:03:16 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.217 2020/12/27 05:16:26 rillig Exp $      */
+/*     $NetBSD: compat.c,v 1.218 2020/12/30 10:03:16 rillig Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*     "@(#)compat.c   8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.217 2020/12/27 05:16:26 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.218 2020/12/30 10:03:16 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -118,7 +118,8 @@
        }
 }
 
-/* Interrupt the creation of the current target and remove it if it ain't
+/*
+ * Interrupt the creation of the current target and remove it if it ain't
  * precious. Then exit.
  *
  * If .INTERRUPT exists, its commands are run first WITH INTERRUPTS IGNORED.
@@ -206,7 +207,8 @@
 #endif
 }
 
-/* Execute the next command for a target. If the command returns an error,
+/*
+ * Execute the next command for a target. If the command returns an error,
  * the node's made field is set to ERROR and creation stops.
  *
  * Input:
@@ -624,7 +626,8 @@
        }
 }
 
-/* Make a target.
+/*
+ * Make a target.
  *
  * If an error is detected and not being ignored, the process exits.
  *
@@ -693,7 +696,8 @@
                bmake_signal(SIGQUIT, CompatInterrupt);
 }
 
-/* Initialize this module and start making.
+/*
+ * Initialize this module and start making.
  *
  * Input:
  *     targs           The target nodes to re-create
diff -r 13baf0a96b00 -r a7c55356e301 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Wed Dec 30 01:44:32 2020 +0000
+++ b/usr.bin/make/cond.c       Wed Dec 30 10:03:16 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.232 2020/12/27 10:53:23 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.233 2020/12/30 10:03:16 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -69,7 +69,8 @@
  * SUCH DAMAGE.
  */
 
-/* Handling of conditionals in a makefile.
+/*
+ * Handling of conditionals in a makefile.
  *
  * Interface:
  *     Cond_EvalLine   Evaluate the conditional directive, such as
@@ -94,7 +95,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.232 2020/12/27 10:53:23 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.233 2020/12/30 10:03:16 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -198,7 +199,8 @@
        cpp_skip_whitespace(&par->p);
 }
 
-/* Parse the argument of a built-in function.
+/*
+ * Parse the argument of a built-in function.
  *
  * Arguments:
  *     *pp initially points at the '(',
@@ -209,7 +211,8 @@
  *     func says whether the argument belongs to an actual function, or
  *     whether the parsed argument is passed to the default function.
  *
- * Return the length of the argument, or 0 on error. */
+ * Return the length of the argument, or 0 on error.
+ */
 static size_t
 ParseFuncArg(const char **pp, Boolean doEval, const char *func,
             char **out_arg)
@@ -327,8 +330,10 @@
        return gn != NULL && GNode_IsTarget(gn);
 }
 
-/* See if the given node exists and is an actual target with commands
- * associated with it. */
+/*
+ * See if the given node exists and is an actual target with commands
+ * associated with it.
+ */
 static Boolean



Home | Main Index | Thread Index | Old Index