Module Name:    src
Committed By:   rillig
Date:           Sun Aug  9 09:44:14 UTC 2020

Modified Files:
        src/usr.bin/make: enum.c enum.h main.c var.c

Log Message:
make(1): clean up indentation, includes, add documentation


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/enum.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/enum.h
cvs rdiff -u -r1.301 -r1.302 src/usr.bin/make/main.c
cvs rdiff -u -r1.438 -r1.439 src/usr.bin/make/var.c

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/enum.c
diff -u src/usr.bin/make/enum.c:1.2 src/usr.bin/make/enum.c:1.3
--- src/usr.bin/make/enum.c:1.2	Sat Aug  8 14:43:28 2020
+++ src/usr.bin/make/enum.c	Sun Aug  9 09:44:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: enum.c,v 1.2 2020/08/08 14:43:28 rillig Exp $	*/
+/*	$NetBSD: enum.c,v 1.3 2020/08/09 09:44:14 rillig Exp $	*/
 
 /*
  Copyright (c) 2020 Roland Illig <[email protected]>
@@ -28,11 +28,11 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: enum.c,v 1.2 2020/08/08 14:43:28 rillig Exp $";
+static char rcsid[] = "$NetBSD: enum.c,v 1.3 2020/08/09 09:44:14 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: enum.c,v 1.2 2020/08/08 14:43:28 rillig Exp $");
+__RCSID("$NetBSD: enum.c,v 1.3 2020/08/09 09:44:14 rillig Exp $");
 #endif
 #endif
 
@@ -75,7 +75,7 @@ Enum_ToString(char *buf, size_t buf_size
 	assert(value == 0);
 
 	if (buf == buf_start)
-		    return "none";
+		return "none";
 
 	assert(buf_size >= 1);
 	buf[0] = '\0';

Index: src/usr.bin/make/enum.h
diff -u src/usr.bin/make/enum.h:1.4 src/usr.bin/make/enum.h:1.5
--- src/usr.bin/make/enum.h:1.4	Sun Aug  9 07:03:06 2020
+++ src/usr.bin/make/enum.h	Sun Aug  9 09:44:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: enum.h,v 1.4 2020/08/09 07:03:06 rillig Exp $	*/
+/*	$NetBSD: enum.h,v 1.5 2020/08/09 09:44:14 rillig Exp $	*/
 
 /*
  Copyright (c) 2020 Roland Illig <[email protected]>
@@ -34,6 +34,8 @@
  * Generate string representation for bitmasks.
  */
 
+#include <stddef.h>
+
 typedef struct {
 	int es_value;
 	const char *es_name;

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.301 src/usr.bin/make/main.c:1.302
--- src/usr.bin/make/main.c:1.301	Sun Aug  9 09:27:44 2020
+++ src/usr.bin/make/main.c	Sun Aug  9 09:44:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.301 2020/08/09 09:27:44 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.302 2020/08/09 09:44:14 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.301 2020/08/09 09:27:44 rillig Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.302 2020/08/09 09:44:14 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.301 2020/08/09 09:27:44 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.302 2020/08/09 09:44:14 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -124,13 +124,13 @@ __RCSID("$NetBSD: main.c,v 1.301 2020/08
 #include <sys/utsname.h>
 #include <sys/wait.h>
 
+#include <ctype.h>
 #include <errno.h>
 #include <signal.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <ctype.h>
 
 #include "make.h"
 #include "hash.h"
@@ -1582,7 +1582,7 @@ found:
 /*-
  * Cmd_Exec --
  *	Execute the command in cmd, and return the output of that command
- *	in a string.
+ *	in a string.  In the output, newlines are replaced with spaces.
  *
  * Results:
  *	A string containing the output of the command, or the empty string.

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.438 src/usr.bin/make/var.c:1.439
--- src/usr.bin/make/var.c:1.438	Sun Aug  9 09:40:48 2020
+++ src/usr.bin/make/var.c	Sun Aug  9 09:44:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.438 2020/08/09 09:40:48 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.439 2020/08/09 09:44:14 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.438 2020/08/09 09:40:48 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.439 2020/08/09 09:44:14 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.438 2020/08/09 09:40:48 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.439 2020/08/09 09:44:14 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -131,9 +131,9 @@ __RCSID("$NetBSD: var.c,v 1.438 2020/08/
 #include    <stdlib.h>
 #include    <time.h>
 
-#include    "enum.h"
 #include    "make.h"
 #include    "buf.h"
+#include    "enum.h"
 #include    "dir.h"
 #include    "job.h"
 #include    "metachar.h"

Reply via email to