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): replace end-of-line comments with bloc...
details: https://anonhg.NetBSD.org/src/rev/ba3cc5023897
branches: trunk
changeset: 974584:ba3cc5023897
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Aug 03 20:43:41 2020 +0000
description:
make(1): replace end-of-line comments with block comments
Just in case someone wants to port the current NetBSD make to an ancient
compiler that knows only C90.
diffstat:
usr.bin/make/metachar.c | 36 ++++++++++++++++++------------------
usr.bin/make/parse.c | 34 +++++++++++++---------------------
2 files changed, 31 insertions(+), 39 deletions(-)
diffs (194 lines):
diff -r 8c5313edc075 -r ba3cc5023897 usr.bin/make/metachar.c
--- a/usr.bin/make/metachar.c Mon Aug 03 20:26:09 2020 +0000
+++ b/usr.bin/make/metachar.c Mon Aug 03 20:43:41 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: metachar.c,v 1.5 2015/06/19 08:03:35 mlelstv Exp $ */
+/* $NetBSD: metachar.c,v 1.6 2020/08/03 20:43:41 rillig Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#endif
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: metachar.c,v 1.5 2015/06/19 08:03:35 mlelstv Exp $");
+__RCSID("$NetBSD: metachar.c,v 1.6 2020/08/03 20:43:41 rillig Exp $");
#endif
#include "metachar.h"
@@ -52,37 +52,37 @@
*/
unsigned char _metachar[128] = {
-// nul soh stx etx eot enq ack bel
+/* nul soh stx etx eot enq ack bel */
1, 0, 0, 0, 0, 0, 0, 0,
-// bs ht nl vt np cr so si
+/* bs ht nl vt np cr so si */
0, 0, 1, 0, 0, 0, 0, 0,
-// dle dc1 dc2 dc3 dc4 nak syn etb
+/* dle dc1 dc2 dc3 dc4 nak syn etb */
0, 0, 0, 0, 0, 0, 0, 0,
-// can em sub esc fs gs rs us
+/* can em sub esc fs gs rs us */
0, 0, 0, 0, 0, 0, 0, 0,
-// sp ! " # $ % & '
+/* sp ! " # $ % & ' */
0, 1, 1, 1, 1, 0, 1, 1,
-// ( ) * + , - . /
+/* ( ) * + , - . / */
1, 1, 1, 0, 0, 0, 0, 0,
-// 0 1 2 3 4 5 6 7
+/* 0 1 2 3 4 5 6 7 */
0, 0, 0, 0, 0, 0, 0, 0,
-// 8 9 : ; < = > ?
+/* 8 9 : ; < = > ? */
0, 0, 0, 1, 1, 0, 1, 1,
-// @ A B C D E F G
+/* @ A B C D E F G */
0, 0, 0, 0, 0, 0, 0, 0,
-// H I J K L M N O
+/* H I J K L M N O */
0, 0, 0, 0, 0, 0, 0, 0,
-// P Q R S T U V W
+/* P Q R S T U V W */
0, 0, 0, 0, 0, 0, 0, 0,
-// X Y Z [ \ ] ^ _
+/* X Y Z [ \ ] ^ _ */
0, 0, 0, 1, 1, 1, 1, 0,
-// ` a b c d e f g
+/* ` a b c d e f g */
1, 0, 0, 0, 0, 0, 0, 0,
-// h i j k l m n o
+/* h i j k l m n o */
0, 0, 0, 0, 0, 0, 0, 0,
-// p q r s t u v w
+/* p q r s t u v w */
0, 0, 0, 0, 0, 0, 0, 0,
-// x y z { | } ~ del
+/* x y z { | } ~ del */
0, 0, 0, 1, 1, 1, 1, 0,
};
diff -r 8c5313edc075 -r ba3cc5023897 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c Mon Aug 03 20:26:09 2020 +0000
+++ b/usr.bin/make/parse.c Mon Aug 03 20:43:41 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.247 2020/08/03 20:26:09 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.248 2020/08/03 20:43:41 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.247 2020/08/03 20:26:09 rillig Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.248 2020/08/03 20:43:41 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.247 2020/08/03 20:26:09 rillig Exp $");
+__RCSID("$NetBSD: parse.c,v 1.248 2020/08/03 20:43:41 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -147,8 +147,7 @@
#include "buf.h"
#include "pathnames.h"
-////////////////////////////////////////////////////////////
-// types and constants
+/* types and constants */
/*
* Structure for a file being read ("included file")
@@ -225,8 +224,7 @@
#define RPAREN ')'
-////////////////////////////////////////////////////////////
-// result data
+/* result data */
/*
* The main target to create. This is the first target on the first
@@ -234,8 +232,7 @@
*/
static GNode *mainNode;
-////////////////////////////////////////////////////////////
-// eval state
+/* eval state */
/* targets we're working on */
static Lst targets;
@@ -259,8 +256,7 @@
*/
static GNode *predecessor;
-////////////////////////////////////////////////////////////
-// parser state
+/* parser state */
/* true if currently in a dependency line or its commands */
static Boolean inLine;
@@ -283,8 +279,7 @@
Lst sysIncPath; /* dirs for <...> includes */
Lst defIncPath; /* default for sysIncPath */
-////////////////////////////////////////////////////////////
-// parser tables
+/* parser tables */
/*
* The parseKeywords table is searched using binary search when deciding
@@ -344,8 +339,7 @@
{ ".WAIT", Wait, 0 },
};
-////////////////////////////////////////////////////////////
-// local functions
+/* local functions */
static int ParseIsEscaped(const char *, const char *);
static void ParseErrorInternal(const char *, size_t, int, const char *, ...)
@@ -373,8 +367,7 @@
static void ParseFinishLine(void);
static void ParseMark(GNode *);
-////////////////////////////////////////////////////////////
-// file loader
+/* file loader */
struct loadedfile {
const char *path; /* name, for error reports */
@@ -585,8 +578,7 @@
return lf;
}
-////////////////////////////////////////////////////////////
-// old code
+/* old code */
/*-
*----------------------------------------------------------------------
@@ -2544,13 +2536,13 @@
static const char inc[] = "include";
static const size_t inclen = sizeof(inc) - 1;
- // 'd' is not valid for sysv
+ /* 'd' is not valid for sysv */
int o = strchr(&("ds-"[sysv]), *line) != NULL;
if (strncmp(line + o, inc, inclen) != 0)
return FALSE;
- // Space is not mandatory for BSD .include
+ /* Space is not mandatory for BSD .include */
return !sysv || isspace((unsigned char)line[inclen + o]);
}
Home |
Main Index |
Thread Index |
Old Index