Module Name: src Committed By: rillig Date: Mon Aug 3 20:43:42 UTC 2020
Modified Files: src/usr.bin/make: metachar.c parse.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/metachar.c cvs rdiff -u -r1.247 -r1.248 src/usr.bin/make/parse.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/metachar.c diff -u src/usr.bin/make/metachar.c:1.5 src/usr.bin/make/metachar.c:1.6 --- src/usr.bin/make/metachar.c:1.5 Fri Jun 19 08:03:35 2015 +++ src/usr.bin/make/metachar.c Mon Aug 3 20:43:41 2020 @@ -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 @@ __RCSID("$NetBSD: metachar.c,v 1.5 2015/ */ 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, }; Index: src/usr.bin/make/parse.c diff -u src/usr.bin/make/parse.c:1.247 src/usr.bin/make/parse.c:1.248 --- src/usr.bin/make/parse.c:1.247 Mon Aug 3 20:26:09 2020 +++ src/usr.bin/make/parse.c Mon Aug 3 20:43:41 2020 @@ -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 @@ __RCSID("$NetBSD: parse.c,v 1.247 2020/0 #include "buf.h" #include "pathnames.h" -//////////////////////////////////////////////////////////// -// types and constants +/* types and constants */ /* * Structure for a file being read ("included file") @@ -225,8 +224,7 @@ typedef enum { #define RPAREN ')' -//////////////////////////////////////////////////////////// -// result data +/* result data */ /* * The main target to create. This is the first target on the first @@ -234,8 +232,7 @@ typedef enum { */ static GNode *mainNode; -//////////////////////////////////////////////////////////// -// eval state +/* eval state */ /* targets we're working on */ static Lst targets; @@ -259,8 +256,7 @@ static ParseSpecial specType; */ 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 parseIncPath; /* dirs for "..." incl 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 @@ static const struct { { ".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 char *ParseReadLine(void); 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 @@ done: return lf; } -//////////////////////////////////////////////////////////// -// old code +/* old code */ /*- *---------------------------------------------------------------------- @@ -2544,13 +2536,13 @@ IsInclude(const char *line, Boolean sysv 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]); }