CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 23:51:32 UTC 2023

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/indent: Makefile fmt_decl.c
src/usr.bin/indent: debug.c indent.c indent.h lexi.c
Added Files:
src/tests/usr.bin/indent: lsym_type.c
Removed Files:
src/tests/usr.bin/indent: lsym_type_in_parentheses.c
lsym_type_outside_parentheses.c

Log Message:
indent: merge lexer symbols for type in/outside parentheses


To generate a diff of this commit:
cvs rdiff -u -r1.1270 -r1.1271 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.48 -r1.49 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r1.58 -r1.59 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/lsym_type.c
cvs rdiff -u -r1.4 -r0 src/tests/usr.bin/indent/lsym_type_in_parentheses.c
cvs rdiff -u -r1.7 -r0 \
src/tests/usr.bin/indent/lsym_type_outside_parentheses.c
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/indent/debug.c
cvs rdiff -u -r1.378 -r1.379 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.201 -r1.202 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.229 -r1.230 src/usr.bin/indent/lexi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1270 src/distrib/sets/lists/tests/mi:1.1271
--- src/distrib/sets/lists/tests/mi:1.1270	Fri Jun 16 20:38:19 2023
+++ src/distrib/sets/lists/tests/mi	Fri Jun 16 23:51:31 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1270 2023/06/16 20:38:19 wiz Exp $
+# $NetBSD: mi,v 1.1271 2023/06/16 23:51:31 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4973,8 +4973,9 @@
 ./usr/tests/usr.bin/indent/lsym_string_prefix.ctests-obsolete		obsolete,atf
 ./usr/tests/usr.bin/indent/lsym_switch.ctests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/lsym_tag.c	tests-usr.bin-tests	compattestfile,atf
-./usr/tests/usr.bin/indent/lsym_type_in_parentheses.c			tests-usr.bin-tests	compattestfile,atf
-./usr/tests/usr.bin/indent/lsym_type_outside_parentheses.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/indent/lsym_type.c	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/indent/lsym_type_in_parentheses.c			tests-obsolete		obsolete,atf
+./usr/tests/usr.bin/indent/lsym_type_outside_parentheses.c		tests-obsolete		obsolete,atf
 ./usr/tests/usr.bin/indent/lsym_typedef.ctests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/lsym_unary_op.ctests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/lsym_while.c	tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/indent/Makefile
diff -u src/tests/usr.bin/indent/Makefile:1.48 src/tests/usr.bin/indent/Makefile:1.49
--- src/tests/usr.bin/indent/Makefile:1.48	Wed Jun 14 07:20:55 2023
+++ src/tests/usr.bin/indent/Makefile	Fri Jun 16 23:51:32 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.48 2023/06/14 07:20:55 rillig Exp $
+#	$NetBSD: Makefile,v 1.49 2023/06/16 23:51:32 rillig Exp $
 
 .include 
 
@@ -48,8 +48,7 @@ FILES+=		lsym_sizeof.c
 FILES+=		lsym_storage_class.c
 FILES+=		lsym_switch.c
 FILES+=		lsym_tag.c
-FILES+=		lsym_type_in_parentheses.c
-FILES+=		lsym_type_outside_parentheses.c
+FILES+=		lsym_type.c
 FILES+=		lsym_typedef.c
 FILES+=		lsym_unary_op.c
 FILES+=		lsym_while.c

Index: src/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.58 src/tests/usr.bin/indent/fmt_decl.c:1.59
--- src/tests/usr.bin/indent/fmt_decl.c:1.58	Fri Jun 16 12:30:45 2023
+++ src/tests/usr.bin/indent/fmt_decl.c	Fri Jun 16 23:51:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: fmt_decl.c,v 1.58 2023/06/16 12:30:45 rillig Exp $	*/
+/*	$NetBSD: fmt_decl.c,v 1.59 2023/06/16 23:51:32 rillig Exp $	*/
 
 /*
  * Tests for declarations of global variables, external functions, and local
@@ -927,10 +927,6 @@ ch_isalpha(char ch)
 //indent run -i4 -di0
 // $ FIXME: 'buffer' is classified as 'word'.
 // $
-// $ XXX: 'char' is classified as 'type_in_parentheses'; check whether
-// $ XXX: lsym_type_in_parentheses should only be used for types in cast
-// $ XXX: expressions.
-// $
 // $ FIXME: 'size_t' is classified as 'word'.
 void buf_add_chars(struct buffer *, const char *, size_t);
 

Index: src/usr.bin/indent/debug.c
diff -u src/usr.bin/indent/debug.c:1.65 src/usr.bin/indent/debug.c:1.66
--- src/usr.bin/indent/debug.c:1.65	Fri Jun 16 23:17:22 2023
+++ src/usr.bin/indent/debug.c	Fri Jun 16 23:51:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.c,v 1.65 2023/06/16 23:17:22 rillig Exp $	*/
+/*	$NetBSD: debug.c,v 1.66 2023/06/16 23:51:32 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: debug.c,v 1.65 2023/06/16 23:17:22 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.66 2023/06/16 23:51:32 rillig Exp $");
 
 #include 
 #include 
@@ -70,8 

CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 23:51:32 UTC 2023

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/indent: Makefile fmt_decl.c
src/usr.bin/indent: debug.c indent.c indent.h lexi.c
Added Files:
src/tests/usr.bin/indent: lsym_type.c
Removed Files:
src/tests/usr.bin/indent: lsym_type_in_parentheses.c
lsym_type_outside_parentheses.c

Log Message:
indent: merge lexer symbols for type in/outside parentheses


To generate a diff of this commit:
cvs rdiff -u -r1.1270 -r1.1271 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.48 -r1.49 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r1.58 -r1.59 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/lsym_type.c
cvs rdiff -u -r1.4 -r0 src/tests/usr.bin/indent/lsym_type_in_parentheses.c
cvs rdiff -u -r1.7 -r0 \
src/tests/usr.bin/indent/lsym_type_outside_parentheses.c
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/indent/debug.c
cvs rdiff -u -r1.378 -r1.379 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.201 -r1.202 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.229 -r1.230 src/usr.bin/indent/lexi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/patch

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 23:36:26 UTC 2023

Modified Files:
src/usr.bin/patch: inp.c

Log Message:
Fix memory leak

CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/patch/inp.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/patch/inp.c
diff -u src/usr.bin/patch/inp.c:1.29 src/usr.bin/patch/inp.c:1.30
--- src/usr.bin/patch/inp.c:1.29	Fri Jun 16 23:32:37 2023
+++ src/usr.bin/patch/inp.c	Fri Jun 16 23:36:26 2023
@@ -1,7 +1,7 @@
 /*
  * $OpenBSD: inp.c,v 1.34 2006/03/11 19:41:30 otto Exp $
  * $DragonFly: src/usr.bin/patch/inp.c,v 1.6 2007/09/29 23:11:10 swildner Exp $
- * $NetBSD: inp.c,v 1.29 2023/06/16 23:32:37 wiz Exp $
+ * $NetBSD: inp.c,v 1.30 2023/06/16 23:36:26 wiz Exp $
  */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: inp.c,v 1.29 2023/06/16 23:32:37 wiz Exp $");
+__RCSID("$NetBSD: inp.c,v 1.30 2023/06/16 23:36:26 wiz Exp $");
 
 #include 
 #include 
@@ -271,6 +271,7 @@ plan_a(const char *filename)
 		} else if (statfailed) {
 			fatal("can't find %s\n", filename);
 		}
+		free(lbuf);
 		free(tmp_filename1);
 		free(tmp_filename2);
 	}



CVS commit: src/usr.bin/patch

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 23:36:26 UTC 2023

Modified Files:
src/usr.bin/patch: inp.c

Log Message:
Fix memory leak

CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/patch/inp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/patch

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 23:32:37 UTC 2023

Modified Files:
src/usr.bin/patch: inp.c

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/patch/inp.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/patch/inp.c
diff -u src/usr.bin/patch/inp.c:1.28 src/usr.bin/patch/inp.c:1.29
--- src/usr.bin/patch/inp.c:1.28	Wed May 26 07:57:05 2021
+++ src/usr.bin/patch/inp.c	Fri Jun 16 23:32:37 2023
@@ -1,19 +1,19 @@
 /*
  * $OpenBSD: inp.c,v 1.34 2006/03/11 19:41:30 otto Exp $
  * $DragonFly: src/usr.bin/patch/inp.c,v 1.6 2007/09/29 23:11:10 swildner Exp $
- * $NetBSD: inp.c,v 1.28 2021/05/26 07:57:05 cjep Exp $
+ * $NetBSD: inp.c,v 1.29 2023/06/16 23:32:37 wiz Exp $
  */
 
 /*
  * patch - a program to apply diffs to original files
- * 
+ *
  * Copyright 1986, Larry Wall
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following condition is met:
  * 1. Redistributions of source code must retain the above copyright notice,
  * this condition and the following disclaimer.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -25,13 +25,13 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- * 
+ *
  * -C option added in 1998, original code by Marc Espie, based on FreeBSD
  * behaviour
  */
 
 #include 
-__RCSID("$NetBSD: inp.c,v 1.28 2021/05/26 07:57:05 cjep Exp $");
+__RCSID("$NetBSD: inp.c,v 1.29 2023/06/16 23:32:37 wiz Exp $");
 
 #include 
 #include 
@@ -142,7 +142,7 @@ static bool
 plan_a(const char *filename)
 {
 	int		ifd, statfailed, devnull, pstat;
-	char		*p, *s, *lbuf; 
+	char		*p, *s, *lbuf;
 	struct stat	filestat;
 	off_t		i;
 	ptrdiff_t	sz;
@@ -190,7 +190,7 @@ plan_a(const char *filename)
 		tmp_filename2 = strdup(filename);
 		if (tmp_filename1 == NULL || tmp_filename2 == NULL)
 			fatal("strdupping filename");
- 
+
  		filebase = basename(tmp_filename1);
  		filedir = dirname(tmp_filename2);
 
@@ -198,7 +198,7 @@ plan_a(const char *filename)
 		if ((lbuf = malloc(bufsz)) == NULL)
 			pfatal("allocating line buffer");
 		lbuf[0] = '\0';
- 
+
 #define try(f, a1, a2, a3) \
 	(snprintf(lbuf, lbufsz, f, a1, a2, a3), stat(lbuf, ) == 0)
 



CVS commit: src/usr.bin/patch

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 23:32:37 UTC 2023

Modified Files:
src/usr.bin/patch: inp.c

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/patch/inp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/patch

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 23:31:54 UTC 2023

Modified Files:
src/usr.bin/patch: pch.c

Log Message:
Comment out variable assignations that are not used.

Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/patch/pch.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/patch/pch.c
diff -u src/usr.bin/patch/pch.c:1.32 src/usr.bin/patch/pch.c:1.33
--- src/usr.bin/patch/pch.c:1.32	Tue May 25 11:25:59 2021
+++ src/usr.bin/patch/pch.c	Fri Jun 16 23:31:53 2023
@@ -1,19 +1,19 @@
 /*
  * $OpenBSD: pch.c,v 1.37 2007/09/02 15:19:33 deraadt Exp $
  * $DragonFly: src/usr.bin/patch/pch.c,v 1.6 2008/08/10 23:35:40 joerg Exp $
- * $NetBSD: pch.c,v 1.32 2021/05/25 11:25:59 cjep Exp $
+ * $NetBSD: pch.c,v 1.33 2023/06/16 23:31:53 wiz Exp $
  */
 
 /*
  * patch - a program to apply diffs to original files
- * 
+ *
  * Copyright 1986, Larry Wall
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following condition is met:
  * 1. Redistributions of source code must retain the above copyright notice,
  * this condition and the following disclaimer.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -25,13 +25,13 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- * 
+ *
  * -C option added in 1998, original code by Marc Espie, based on FreeBSD
  * behaviour
  */
 
 #include 
-__RCSID("$NetBSD: pch.c,v 1.32 2021/05/25 11:25:59 cjep Exp $");
+__RCSID("$NetBSD: pch.c,v 1.33 2023/06/16 23:31:53 wiz Exp $");
 
 #include 
 #include 
@@ -553,7 +553,7 @@ another_hunk(void)
 		p_context = 100;
 		p_hunk_beg = p_input_line + 1;
 		while (p_end < p_max) {
-			line_beginning = ftell(pfp);
+			// line_beginning = ftell(pfp);
 			ret = pgetline(, , pfp);
 			p_input_line++;
 			if (ret == -1) {
@@ -935,7 +935,7 @@ hunk_done:
 		context = 0;
 		p_hunk_beg = p_input_line + 1;
 		while (fillold <= p_ptrn_lines || fillnew <= p_end) {
-			line_beginning = ftell(pfp);
+			// line_beginning = ftell(pfp);
 			ret = pgetline(, , pfp);
 			p_input_line++;
 			if (ret == -1) {



CVS commit: src/usr.bin/patch

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 23:31:54 UTC 2023

Modified Files:
src/usr.bin/patch: pch.c

Log Message:
Comment out variable assignations that are not used.

Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/patch/pch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/usr.bin/indent

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 23:19:01 UTC 2023

Modified Files:
src/tests/usr.bin/indent: fmt_expr.c lsym_lbrace.c lsym_preprocessing.c
lsym_semicolon.c psym_else.c psym_rbrace.c t_options.lua

Log Message:
tests/indent: format stderr output as end-of-line comments

This generates fewer error markers in syntax-aware editors.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/indent/fmt_expr.c \
src/tests/usr.bin/indent/lsym_lbrace.c
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/indent/lsym_preprocessing.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/lsym_semicolon.c \
src/tests/usr.bin/indent/t_options.lua
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/psym_else.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/indent/psym_rbrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/fmt_expr.c
diff -u src/tests/usr.bin/indent/fmt_expr.c:1.9 src/tests/usr.bin/indent/fmt_expr.c:1.10
--- src/tests/usr.bin/indent/fmt_expr.c:1.9	Fri Jun 16 12:55:57 2023
+++ src/tests/usr.bin/indent/fmt_expr.c	Fri Jun 16 23:19:01 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: fmt_expr.c,v 1.9 2023/06/16 12:55:57 rillig Exp $ */
+/* $NetBSD: fmt_expr.c,v 1.10 2023/06/16 23:19:01 rillig Exp $ */
 
 /*
  * Tests for all kinds of expressions that are not directly related to unary
@@ -53,7 +53,7 @@
 		stmt;
 	});
 }
-exit 1
-error: Standard Input:7: Unbalanced parentheses
-warning: Standard Input:9: Extra ')'
+// exit 1
+// error: Standard Input:7: Unbalanced parentheses
+// warning: Standard Input:9: Extra ')'
 //indent end
Index: src/tests/usr.bin/indent/lsym_lbrace.c
diff -u src/tests/usr.bin/indent/lsym_lbrace.c:1.9 src/tests/usr.bin/indent/lsym_lbrace.c:1.10
--- src/tests/usr.bin/indent/lsym_lbrace.c:1.9	Thu Jun 15 09:19:07 2023
+++ src/tests/usr.bin/indent/lsym_lbrace.c	Fri Jun 16 23:19:01 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_lbrace.c,v 1.9 2023/06/15 09:19:07 rillig Exp $ */
+/* $NetBSD: lsym_lbrace.c,v 1.10 2023/06/16 23:19:01 rillig Exp $ */
 
 /*
  * Tests for the token lsym_lbrace, which represents a '{' in these contexts:
@@ -99,9 +99,9 @@ origin(void)
 		switch (expr rparen {
 		}
 }
-exit 1
-error: Standard Input:2: Unbalanced parentheses
-error: Standard Input:4: Unbalanced parentheses
+// exit 1
+// error: Standard Input:2: Unbalanced parentheses
+// error: Standard Input:4: Unbalanced parentheses
 //indent end
 
 

Index: src/tests/usr.bin/indent/lsym_preprocessing.c
diff -u src/tests/usr.bin/indent/lsym_preprocessing.c:1.14 src/tests/usr.bin/indent/lsym_preprocessing.c:1.15
--- src/tests/usr.bin/indent/lsym_preprocessing.c:1.14	Wed Jun 14 20:46:08 2023
+++ src/tests/usr.bin/indent/lsym_preprocessing.c	Fri Jun 16 23:19:01 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_preprocessing.c,v 1.14 2023/06/14 20:46:08 rillig Exp $ */
+/* $NetBSD: lsym_preprocessing.c,v 1.15 2023/06/16 23:19:01 rillig Exp $ */
 
 /*
  * Tests for the token lsym_preprocessing, which represents a '#' that starts
@@ -301,11 +301,11 @@ int before;
 
 #unknown
 # 3 "file.c"
-exit 1
-error: Standard Input:1: Unmatched #else
-error: Standard Input:2: Unmatched #elif
-error: Standard Input:3: Unmatched #elifdef
-error: Standard Input:4: Unmatched #endif
+// exit 1
+// error: Standard Input:1: Unmatched #else
+// error: Standard Input:2: Unmatched #elif
+// error: Standard Input:3: Unmatched #elifdef
+// error: Standard Input:4: Unmatched #endif
 //indent end
 
 

Index: src/tests/usr.bin/indent/lsym_semicolon.c
diff -u src/tests/usr.bin/indent/lsym_semicolon.c:1.5 src/tests/usr.bin/indent/lsym_semicolon.c:1.6
--- src/tests/usr.bin/indent/lsym_semicolon.c:1.5	Thu Jun 15 09:19:07 2023
+++ src/tests/usr.bin/indent/lsym_semicolon.c	Fri Jun 16 23:19:01 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_semicolon.c,v 1.5 2023/06/15 09:19:07 rillig Exp $ */
+/* $NetBSD: lsym_semicolon.c,v 1.6 2023/06/16 23:19:01 rillig Exp $ */
 
 /*
  * Tests for the token lsym_semicolon, which represents ';' in these contexts:
@@ -84,8 +84,8 @@ int b = 3;
 //indent run -di0
 int a = {{;
 		int b = 3;
-exit 1
-error: Standard Input:2: Stuff missing from end of file
+// exit 1
+// error: Standard Input:2: Stuff missing from end of file
 //indent end
 
 
@@ -101,6 +101,6 @@ error: Standard Input:2: Stuff missing f
 	int a = {{;
 			int b = 3;
 	}
-exit 1
-error: Standard Input:4: Stuff missing from end of file
+// exit 1
+// error: Standard Input:4: Stuff missing from end of file
 //indent end
Index: src/tests/usr.bin/indent/t_options.lua
diff -u src/tests/usr.bin/indent/t_options.lua:1.5 src/tests/usr.bin/indent/t_options.lua:1.6
--- src/tests/usr.bin/indent/t_options.lua:1.5	Wed Jun 14 17:07:32 2023
+++ src/tests/usr.bin/indent/t_options.lua	Fri Jun 16 23:19:01 2023
@@ -1,4 +1,4 @@
--- $NetBSD: t_options.lua,v 1.5 2023/06/14 17:07:32 rillig Exp $
+-- $NetBSD: t_options.lua,v 1.6 2023/06/16 

CVS commit: src/tests/usr.bin/indent

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 23:19:01 UTC 2023

Modified Files:
src/tests/usr.bin/indent: fmt_expr.c lsym_lbrace.c lsym_preprocessing.c
lsym_semicolon.c psym_else.c psym_rbrace.c t_options.lua

Log Message:
tests/indent: format stderr output as end-of-line comments

This generates fewer error markers in syntax-aware editors.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/indent/fmt_expr.c \
src/tests/usr.bin/indent/lsym_lbrace.c
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/indent/lsym_preprocessing.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/lsym_semicolon.c \
src/tests/usr.bin/indent/t_options.lua
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/psym_else.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/indent/psym_rbrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/indent

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 23:17:22 UTC 2023

Modified Files:
src/usr.bin/indent: debug.c

Log Message:
indent: add debug output for typedef declarations


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/indent/debug.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/indent

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 23:17:22 UTC 2023

Modified Files:
src/usr.bin/indent: debug.c

Log Message:
indent: add debug output for typedef declarations


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/indent/debug.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/indent/debug.c
diff -u src/usr.bin/indent/debug.c:1.64 src/usr.bin/indent/debug.c:1.65
--- src/usr.bin/indent/debug.c:1.64	Fri Jun 16 11:48:32 2023
+++ src/usr.bin/indent/debug.c	Fri Jun 16 23:17:22 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.c,v 1.64 2023/06/16 11:48:32 rillig Exp $	*/
+/*	$NetBSD: debug.c,v 1.65 2023/06/16 23:17:22 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: debug.c,v 1.64 2023/06/16 11:48:32 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.65 2023/06/16 23:17:22 rillig Exp $");
 
 #include 
 #include 
@@ -330,6 +330,7 @@ debug_parser_state(void)
 	debug_ps_enum(prev_lsym, lsym_name);
 	debug_ps_bool(in_stmt_or_decl);
 	debug_ps_bool(in_decl);
+	debug_ps_bool(in_typedef_decl);
 	debug_ps_bool(in_var_decl);
 	debug_ps_bool(in_init);
 	debug_ps_int(init_level);



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 23:07:53 UTC 2023

Modified Files:
src/tests/usr.bin/indent: lsym_lparen_or_lbracket.c opt_pcs.c
src/usr.bin/indent: indent.c

Log Message:
indent: fix spacing between postfix operator and left parenthesis


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c \
src/tests/usr.bin/indent/opt_pcs.c
cvs rdiff -u -r1.377 -r1.378 src/usr.bin/indent/indent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c
diff -u src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c:1.17 src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c:1.18
--- src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c:1.17	Wed Jun 14 14:11:28 2023
+++ src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c	Fri Jun 16 23:07:52 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_lparen_or_lbracket.c,v 1.17 2023/06/14 14:11:28 rillig Exp $ */
+/* $NetBSD: lsym_lparen_or_lbracket.c,v 1.18 2023/06/16 23:07:52 rillig Exp $ */
 
 /*
  * Tests for the token lsym_lparen_or_lbracket, which represents a '(' or '['
@@ -295,7 +295,7 @@ cover_want_blank_before_lparen(void)
 	int rparen_or_rbracket = a[3](5);
 	+(unary_op);
 	3 + (binary_op);
-	a++ (postfix_op);	/* unlikely to be seen in practice */
+	a++(postfix_op);	/* unlikely to be seen in practice */
 	cond ? (question) : (5);
 	switch (expr) {
 	case (case_label): ;
Index: src/tests/usr.bin/indent/opt_pcs.c
diff -u src/tests/usr.bin/indent/opt_pcs.c:1.17 src/tests/usr.bin/indent/opt_pcs.c:1.18
--- src/tests/usr.bin/indent/opt_pcs.c:1.17	Wed Jun 14 14:11:28 2023
+++ src/tests/usr.bin/indent/opt_pcs.c	Fri Jun 16 23:07:52 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_pcs.c,v 1.17 2023/06/14 14:11:28 rillig Exp $ */
+/* $NetBSD: opt_pcs.c,v 1.18 2023/06/16 23:07:52 rillig Exp $ */
 
 /*
  * Tests for the options '-pcs' and '-npcs'.
@@ -114,8 +114,7 @@ int offset = offsetof(struct s, member);
 
 //indent input
 int unary = +call();
-// $ FIXME: Unusual, but there should be no space.
-int postfix = step++ ();
+int postfix = step++();
 int binary = 1 + call();
 //indent end
 

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.377 src/usr.bin/indent/indent.c:1.378
--- src/usr.bin/indent/indent.c:1.377	Fri Jun 16 14:26:26 2023
+++ src/usr.bin/indent/indent.c	Fri Jun 16 23:07:52 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.377 2023/06/16 14:26:26 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.378 2023/06/16 23:07:52 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: indent.c,v 1.377 2023/06/16 14:26:26 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.378 2023/06/16 23:07:52 rillig Exp $");
 
 #include 
 #include 
@@ -574,13 +574,14 @@ want_blank_before_lparen(void)
 {
 	if (opt.proc_calls_space)
 		return true;
-	if (ps.prev_lsym == lsym_rparen || ps.prev_lsym == lsym_rbracket)
-		return false;
-	if (ps.prev_lsym == lsym_offsetof)
-		return false;
 	if (ps.prev_lsym == lsym_sizeof)
 		return opt.blank_after_sizeof;
-	if (ps.prev_lsym == lsym_word || ps.prev_lsym == lsym_funcname)
+	if (ps.prev_lsym == lsym_rparen
+	|| ps.prev_lsym == lsym_rbracket
+	|| ps.prev_lsym == lsym_postfix_op
+	|| ps.prev_lsym == lsym_offsetof
+	|| ps.prev_lsym == lsym_word
+	|| ps.prev_lsym == lsym_funcname)
 		return false;
 	return true;
 }



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 23:07:53 UTC 2023

Modified Files:
src/tests/usr.bin/indent: lsym_lparen_or_lbracket.c opt_pcs.c
src/usr.bin/indent: indent.c

Log Message:
indent: fix spacing between postfix operator and left parenthesis


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c \
src/tests/usr.bin/indent/opt_pcs.c
cvs rdiff -u -r1.377 -r1.378 src/usr.bin/indent/indent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/make

2023-06-16 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Fri Jun 16 22:30:35 UTC 2023

Modified Files:
src/usr.bin/make: var.c

Log Message:
make: do not allow delete of readOnly variable.

Sometimes we mark a variable readOnly to guard against .undef


To generate a diff of this commit:
cvs rdiff -u -r1.1055 -r1.1056 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.



CVS commit: src/usr.bin/make

2023-06-16 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Fri Jun 16 22:30:35 UTC 2023

Modified Files:
src/usr.bin/make: var.c

Log Message:
make: do not allow delete of readOnly variable.

Sometimes we mark a variable readOnly to guard against .undef


To generate a diff of this commit:
cvs rdiff -u -r1.1055 -r1.1056 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/var.c
diff -u src/usr.bin/make/var.c:1.1055 src/usr.bin/make/var.c:1.1056
--- src/usr.bin/make/var.c:1.1055	Thu Jun  1 07:44:10 2023
+++ src/usr.bin/make/var.c	Fri Jun 16 22:30:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1055 2023/06/01 07:44:10 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.1056 2023/06/16 22:30:35 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -139,7 +139,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1055 2023/06/01 07:44:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1056 2023/06/16 22:30:35 sjg Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -513,6 +513,11 @@ Var_Delete(GNode *scope, const char *var
 
 	DEBUG2(VAR, "%s: delete %s\n", scope->name, varname);
 	v = he->value;
+	if (v->readOnly) {
+		DEBUG2(VAR, "%s: delete %s (readOnly)\n",
+		scope->name, varname);
+		return;
+	}
 	if (v->inUse) {
 		Parse_Error(PARSE_FATAL,
 		"Cannot delete variable \"%s\" while it is used",



CVS commit: src/distrib/sets/lists/comp

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 22:18:02 UTC 2023

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
add missing 'obsolete' keyword


To generate a diff of this commit:
cvs rdiff -u -r1.2431 -r1.2432 src/distrib/sets/lists/comp/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/comp

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 22:18:02 UTC 2023

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
add missing 'obsolete' keyword


To generate a diff of this commit:
cvs rdiff -u -r1.2431 -r1.2432 src/distrib/sets/lists/comp/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2431 src/distrib/sets/lists/comp/mi:1.2432
--- src/distrib/sets/lists/comp/mi:1.2431	Fri Jun 16 20:38:18 2023
+++ src/distrib/sets/lists/comp/mi	Fri Jun 16 22:18:02 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2431 2023/06/16 20:38:18 wiz Exp $
+#	$NetBSD: mi,v 1.2432 2023/06/16 22:18:02 wiz Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -3030,7 +3030,7 @@
 ./usr/include/openssl/provider.h		comp-c-include		openssl=30
 ./usr/include/openssl/rand.h			comp-c-include
 ./usr/include/openssl/rand_drbg.h		comp-c-include	openssl=11
-./usr/include/openssl/rand_drbg.h		comp-obsolete	openssl=30
+./usr/include/openssl/rand_drbg.h		comp-obsolete	obsolete,openssl=30
 ./usr/include/openssl/randerr.h			comp-c-include
 ./usr/include/openssl/rc2.h			comp-c-include
 ./usr/include/openssl/rc4.h			comp-c-include



CVS commit: src/distrib/sets/lists

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 20:38:19 UTC 2023

Modified Files:
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi

Log Message:
mark some openssl 1.1 files as obsolete with openssl 3


To generate a diff of this commit:
cvs rdiff -u -r1.2430 -r1.2431 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.403 -r1.404 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1269 -r1.1270 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 20:38:19 UTC 2023

Modified Files:
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi

Log Message:
mark some openssl 1.1 files as obsolete with openssl 3


To generate a diff of this commit:
cvs rdiff -u -r1.2430 -r1.2431 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.403 -r1.404 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1269 -r1.1270 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2430 src/distrib/sets/lists/comp/mi:1.2431
--- src/distrib/sets/lists/comp/mi:1.2430	Fri Jun  9 03:43:02 2023
+++ src/distrib/sets/lists/comp/mi	Fri Jun 16 20:38:18 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2430 2023/06/09 03:43:02 simonb Exp $
+#	$NetBSD: mi,v 1.2431 2023/06/16 20:38:18 wiz Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -3030,6 +3030,7 @@
 ./usr/include/openssl/provider.h		comp-c-include		openssl=30
 ./usr/include/openssl/rand.h			comp-c-include
 ./usr/include/openssl/rand_drbg.h		comp-c-include	openssl=11
+./usr/include/openssl/rand_drbg.h		comp-obsolete	openssl=30
 ./usr/include/openssl/randerr.h			comp-c-include
 ./usr/include/openssl/rc2.h			comp-c-include
 ./usr/include/openssl/rc4.h			comp-c-include

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.403 src/distrib/sets/lists/debug/mi:1.404
--- src/distrib/sets/lists/debug/mi:1.403	Tue Jun  6 08:27:44 2023
+++ src/distrib/sets/lists/debug/mi	Fri Jun 16 20:38:19 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.403 2023/06/06 08:27:44 martin Exp $
+# $NetBSD: mi,v 1.404 2023/06/16 20:38:19 wiz Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -1624,7 +1624,9 @@
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_divtest.debug		tests-crypto-debug	debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_dsatest.debug		tests-crypto-debug	debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_ecdhtest.debug		tests-crypto-debug	debug,atf,compattestfile,openssl=11
+./usr/libdata/debug/usr/tests/crypto/libcrypto/h_ecdhtest.debug		tests-obsolete		obsolete,openssl=30
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_ecdsatest.debug	tests-crypto-debug	debug,atf,compattestfile,openssl=11
+./usr/libdata/debug/usr/tests/crypto/libcrypto/h_ecdsatest.debug	tests-obsolete		obsolete,openssl=30
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_ectest.debug		tests-crypto-debug	debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_enginetest.debug	tests-crypto-debug	debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_evp_test.debug		tests-crypto-debug	debug,atf,compattestfile
@@ -1633,6 +1635,7 @@
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_ideatest.debug		tests-crypto-debug	debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_lhashtest.debug	tests-crypto-debug	debug,atf,compattestfile,openssl=10
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_md2test.debug		tests-crypto-debug	debug,atf,compattestfile,openssl=11
+./usr/libdata/debug/usr/tests/crypto/libcrypto/h_md2test.debug		tests-obsolete		obsolete,openssl=30
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_md4test.debug		tests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_md5test.debug		tests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_mdc2test.debug		tests-crypto-debug	debug,atf,compattestfile

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1269 src/distrib/sets/lists/tests/mi:1.1270
--- src/distrib/sets/lists/tests/mi:1.1269	Fri Jun 16 09:25:13 2023
+++ src/distrib/sets/lists/tests/mi	Fri Jun 16 20:38:19 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1269 2023/06/16 09:25:13 rillig Exp $
+# $NetBSD: mi,v 1.1270 2023/06/16 20:38:19 wiz Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1336,7 +1336,9 @@
 ./usr/tests/crypto/libcrypto/d_server.pem		tests-crypto-tests	compattestfile,atf
 ./usr/tests/crypto/libcrypto/default.cnf		tests-crypto-tests	atf,compattestfile,openssl=30
 ./usr/tests/crypto/libcrypto/evpcase.txt		tests-crypto-tests	compattestfile,atf,openssl=11
+./usr/tests/crypto/libcrypto/evpcase.txt		tests-obsolete		obsolete,openssl=30
 ./usr/tests/crypto/libcrypto/evpciph.txt		tests-crypto-tests	compattestfile,atf,openssl=11
+./usr/tests/crypto/libcrypto/evpciph.txt		tests-obsolete		obsolete,openssl=30
 ./usr/tests/crypto/libcrypto/evpciph_aes_ccm_cavs.txt	tests-crypto-tests	atf,compattestfile,openssl=30
 

CVS commit: src

2023-06-16 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Jun 16 20:01:20 UTC 2023

Modified Files:
src/lib/libc/rpc: xdr_rec.c
src/sys/arch/next68k/next68k: locore.s

Log Message:
fix typos in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libc/rpc/xdr_rec.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/next68k/next68k/locore.s

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/rpc/xdr_rec.c
diff -u src/lib/libc/rpc/xdr_rec.c:1.38 src/lib/libc/rpc/xdr_rec.c:1.39
--- src/lib/libc/rpc/xdr_rec.c:1.38	Sat Aug 21 23:00:30 2021
+++ src/lib/libc/rpc/xdr_rec.c	Fri Jun 16 20:01:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xdr_rec.c,v 1.38 2021/08/21 23:00:30 andvar Exp $	*/
+/*	$NetBSD: xdr_rec.c,v 1.39 2023/06/16 20:01:20 andvar Exp $	*/
 
 /*
  * Copyright (c) 2010, Oracle America, Inc.
@@ -37,7 +37,7 @@
 static char *sccsid = "@(#)xdr_rec.c 1.21 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)xdr_rec.c	2.2 88/08/01 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: xdr_rec.c,v 1.38 2021/08/21 23:00:30 andvar Exp $");
+__RCSID("$NetBSD: xdr_rec.c,v 1.39 2023/06/16 20:01:20 andvar Exp $");
 #endif
 #endif
 
@@ -132,7 +132,7 @@ typedef struct rec_strm {
 	char *out_base;	/* output buffer (points to frag header) */
 	char *out_finger;	/* next output position */
 	char *out_boundry;	/* data cannot up to this address */
-	uint32_t *frag_header;	/* beginning of curren fragment */
+	uint32_t *frag_header;	/* beginning of current fragment */
 	bool_t frag_sent;	/* true if buffer sent in middle of record */
 	/*
 	 * in-coming bits

Index: src/sys/arch/next68k/next68k/locore.s
diff -u src/sys/arch/next68k/next68k/locore.s:1.72 src/sys/arch/next68k/next68k/locore.s:1.73
--- src/sys/arch/next68k/next68k/locore.s:1.72	Sat Feb 11 02:31:34 2023
+++ src/sys/arch/next68k/next68k/locore.s	Fri Jun 16 20:01:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.72 2023/02/11 02:31:34 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.73 2023/06/16 20:01:20 andvar Exp $	*/
 
 /*
  * Copyright (c) 1998 Darrin B. Jewell
@@ -359,7 +359,7 @@ Lstploaddone:
 	jne	Lmotommu2		| no, skip
 
 	| This is a hack to get PA=KVA when turning on MMU as mentioned above.
-	| Currintly this will only work on 68040's.  We should also provide
+	| Currently this will only work on 68040's.  We should also provide
 	| %tt0 and %tt1 settings to boot 68030's later.
 	movel	#0x0200c040,%d0		| intio devices are at 0x0200
 	.long	0x4e7b0004		| movc %d0,%itt0



CVS commit: src

2023-06-16 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Jun 16 20:01:20 UTC 2023

Modified Files:
src/lib/libc/rpc: xdr_rec.c
src/sys/arch/next68k/next68k: locore.s

Log Message:
fix typos in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libc/rpc/xdr_rec.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/next68k/next68k/locore.s

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/nfs/common

2023-06-16 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Jun 16 19:40:46 UTC 2023

Modified Files:
src/sys/fs/nfs/common: nfs_commonkrpc.c

Log Message:
s/curent/current/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/nfs/common/nfs_commonkrpc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/nfs/common

2023-06-16 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Jun 16 19:40:46 UTC 2023

Modified Files:
src/sys/fs/nfs/common: nfs_commonkrpc.c

Log Message:
s/curent/current/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/nfs/common/nfs_commonkrpc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/nfs/common/nfs_commonkrpc.c
diff -u src/sys/fs/nfs/common/nfs_commonkrpc.c:1.2 src/sys/fs/nfs/common/nfs_commonkrpc.c:1.3
--- src/sys/fs/nfs/common/nfs_commonkrpc.c:1.2	Tue Dec 13 22:31:51 2016
+++ src/sys/fs/nfs/common/nfs_commonkrpc.c	Fri Jun 16 19:40:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_commonkrpc.c,v 1.2 2016/12/13 22:31:51 pgoyette Exp $	*/
+/*	$NetBSD: nfs_commonkrpc.c,v 1.3 2023/06/16 19:40:46 andvar Exp $	*/
 /*-
  * Copyright (c) 1989, 1991, 1993, 1995
  *	The Regents of the University of California.  All rights reserved.
@@ -34,7 +34,7 @@
 
 #include 
 /* __FBSDID("FreeBSD: head/sys/fs/nfs/nfs_commonkrpc.c 304026 2016-08-12 22:44:59Z rmacklem "); */
-__RCSID("$NetBSD: nfs_commonkrpc.c,v 1.2 2016/12/13 22:31:51 pgoyette Exp $");
+__RCSID("$NetBSD: nfs_commonkrpc.c,v 1.3 2023/06/16 19:40:46 andvar Exp $");
 
 /*
  * Socket operations for use by nfs
@@ -181,7 +181,7 @@ newnfs_connect(struct nfsmount *nmp, str
 	/*
 	 * We need to establish the socket using the credentials of
 	 * the mountpoint.  Some parts of this process (such as
-	 * sobind() and soconnect()) will use the curent thread's
+	 * sobind() and soconnect()) will use the current thread's
 	 * credential instead of the socket credential.  To work
 	 * around this, temporarily change the current thread's
 	 * credential to that of the mountpoint.



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 14:26:27 UTC 2023

Modified Files:
src/tests/usr.bin/indent: lsym_rparen_or_rbracket.c
src/usr.bin/indent: indent.c

Log Message:
indent: improve heuristics for cast expressions


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c
cvs rdiff -u -r1.376 -r1.377 src/usr.bin/indent/indent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 14:26:27 UTC 2023

Modified Files:
src/tests/usr.bin/indent: lsym_rparen_or_rbracket.c
src/usr.bin/indent: indent.c

Log Message:
indent: improve heuristics for cast expressions


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c
cvs rdiff -u -r1.376 -r1.377 src/usr.bin/indent/indent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c
diff -u src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c:1.7 src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c:1.8
--- src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c:1.7	Fri Jun 16 14:12:10 2023
+++ src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c	Fri Jun 16 14:26:27 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_rparen_or_rbracket.c,v 1.7 2023/06/16 14:12:10 rillig Exp $ */
+/* $NetBSD: lsym_rparen_or_rbracket.c,v 1.8 2023/06/16 14:26:27 rillig Exp $ */
 
 /*
  * Tests for the token lsym_rparen_or_lbracket, which represents ')' or ']',
@@ -56,7 +56,13 @@ int a = array[
 //indent end
 
 
+/*
+ * Cast expressions and compound expressions, taken from lint and make.
+ */
 //indent input
+// This ')' is not a cast.
+char *Buf_DoneData(Buffer *) MAKE_ATTR_USE;
+
 {
 	dcs_align((u_int)dcs);
 	mpools.pools[i] = (memory_pool){NULL, 0, 0};
@@ -64,13 +70,4 @@ int a = array[
 }
 //indent end
 
-//indent run -ci4 -di0 -nlp
-{
-	dcs_align((u_int)dcs);
-// $ FIXME: Don't add newlines.
-	mpools.pools[i] = (memory_pool) {
-		NULL, 0, 0
-	};
-	list_add(l, (const char[3]){'-', (char)c, '\0'});
-}
-//indent end
+//indent run-equals-input -ci4 -di0 -nlp

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.376 src/usr.bin/indent/indent.c:1.377
--- src/usr.bin/indent/indent.c:1.376	Fri Jun 16 14:12:10 2023
+++ src/usr.bin/indent/indent.c	Fri Jun 16 14:26:26 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.376 2023/06/16 14:12:10 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.377 2023/06/16 14:26:26 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: indent.c,v 1.376 2023/06/16 14:12:10 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.377 2023/06/16 14:26:26 rillig Exp $");
 
 #include 
 #include 
@@ -622,11 +622,13 @@ rparen_is_cast(bool paren_cast)
 {
 	if (ps.in_func_def_params)
 		return false;
+	if (ps.line_has_decl && !ps.in_init)
+		return false;
 	if (ps.prev_lsym == lsym_unary_op)
 		return true;
-	if (ps.line_has_decl && !ps.in_init)
+	if (ps.spaced_expr_psym != psym_0 && ps.paren.len == 0)
 		return false;
-	return paren_cast || ch_isalpha(inp_p[0]);
+	return paren_cast || ch_isalpha(inp_p[0]) || inp_p[0] == '{';
 }
 
 static void



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 14:12:10 UTC 2023

Modified Files:
src/tests/usr.bin/indent: lsym_rparen_or_rbracket.c
src/usr.bin/indent: indent.c

Log Message:
indent: improve heuristics for cast expressions


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c
cvs rdiff -u -r1.375 -r1.376 src/usr.bin/indent/indent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c
diff -u src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c:1.6 src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c:1.7
--- src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c:1.6	Fri Jun 16 13:43:30 2023
+++ src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c	Fri Jun 16 14:12:10 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_rparen_or_rbracket.c,v 1.6 2023/06/16 13:43:30 rillig Exp $ */
+/* $NetBSD: lsym_rparen_or_rbracket.c,v 1.7 2023/06/16 14:12:10 rillig Exp $ */
 
 /*
  * Tests for the token lsym_rparen_or_lbracket, which represents ')' or ']',
@@ -66,8 +66,7 @@ int a = array[
 
 //indent run -ci4 -di0 -nlp
 {
-// $ FIXME: No space after cast.
-	dcs_align((u_int) dcs);
+	dcs_align((u_int)dcs);
 // $ FIXME: Don't add newlines.
 	mpools.pools[i] = (memory_pool) {
 		NULL, 0, 0

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.375 src/usr.bin/indent/indent.c:1.376
--- src/usr.bin/indent/indent.c:1.375	Fri Jun 16 12:55:57 2023
+++ src/usr.bin/indent/indent.c	Fri Jun 16 14:12:10 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.375 2023/06/16 12:55:57 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.376 2023/06/16 14:12:10 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: indent.c,v 1.375 2023/06/16 12:55:57 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.376 2023/06/16 14:12:10 rillig Exp $");
 
 #include 
 #include 
@@ -617,18 +617,27 @@ process_lparen(void)
 	paren_stack_push(, ind_add(0, code.s, code.len), cast);
 }
 
+static bool
+rparen_is_cast(bool paren_cast)
+{
+	if (ps.in_func_def_params)
+		return false;
+	if (ps.prev_lsym == lsym_unary_op)
+		return true;
+	if (ps.line_has_decl && !ps.in_init)
+		return false;
+	return paren_cast || ch_isalpha(inp_p[0]);
+}
+
 static void
 process_rparen(void)
 {
 	if (ps.paren.len == 0)
 		diag(0, "Extra '%c'", *token.s);
 
-	ps.prev_paren_was_cast = ps.paren.len > 0
-	&& ps.paren.item[--ps.paren.len].cast == cast_maybe
-	&& !ps.in_func_def_params
-	&& !(ps.line_has_decl && !ps.in_init);
-	if (ps.prev_lsym == lsym_unary_op)
-		ps.prev_paren_was_cast = true;
+	bool paren_cast = ps.paren.len > 0
+	&& ps.paren.item[--ps.paren.len].cast == cast_maybe;
+	ps.prev_paren_was_cast = rparen_is_cast(paren_cast);
 	if (ps.prev_paren_was_cast) {
 		ps.next_unary = true;
 		ps.want_blank = opt.space_after_cast;



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 14:12:10 UTC 2023

Modified Files:
src/tests/usr.bin/indent: lsym_rparen_or_rbracket.c
src/usr.bin/indent: indent.c

Log Message:
indent: improve heuristics for cast expressions


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c
cvs rdiff -u -r1.375 -r1.376 src/usr.bin/indent/indent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/usr.bin/indent

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 13:43:30 UTC 2023

Modified Files:
src/tests/usr.bin/indent: lsym_rparen_or_rbracket.c

Log Message:
tests/indent: add a few code snippets from usr.bin/xlint


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c
diff -u src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c:1.5 src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c:1.6
--- src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c:1.5	Thu Jun 15 09:19:07 2023
+++ src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c	Fri Jun 16 13:43:30 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_rparen_or_rbracket.c,v 1.5 2023/06/15 09:19:07 rillig Exp $ */
+/* $NetBSD: lsym_rparen_or_rbracket.c,v 1.6 2023/06/16 13:43:30 rillig Exp $ */
 
 /*
  * Tests for the token lsym_rparen_or_lbracket, which represents ')' or ']',
@@ -54,3 +54,24 @@ int a = array[
 		];
 }
 //indent end
+
+
+//indent input
+{
+	dcs_align((u_int)dcs);
+	mpools.pools[i] = (memory_pool){NULL, 0, 0};
+	list_add(l, (const char[3]){'-', (char)c, '\0'});
+}
+//indent end
+
+//indent run -ci4 -di0 -nlp
+{
+// $ FIXME: No space after cast.
+	dcs_align((u_int) dcs);
+// $ FIXME: Don't add newlines.
+	mpools.pools[i] = (memory_pool) {
+		NULL, 0, 0
+	};
+	list_add(l, (const char[3]){'-', (char)c, '\0'});
+}
+//indent end



CVS commit: src/tests/usr.bin/indent

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 13:43:30 UTC 2023

Modified Files:
src/tests/usr.bin/indent: lsym_rparen_or_rbracket.c

Log Message:
tests/indent: add a few code snippets from usr.bin/xlint


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 12:55:57 UTC 2023

Modified Files:
src/tests/usr.bin/indent: fmt_expr.c lsym_unary_op.c
src/usr.bin/indent: indent.c

Log Message:
indent: improve heuristics for casts


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/indent/fmt_expr.c
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/indent/lsym_unary_op.c
cvs rdiff -u -r1.374 -r1.375 src/usr.bin/indent/indent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 12:55:57 UTC 2023

Modified Files:
src/tests/usr.bin/indent: fmt_expr.c lsym_unary_op.c
src/usr.bin/indent: indent.c

Log Message:
indent: improve heuristics for casts


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/indent/fmt_expr.c
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/indent/lsym_unary_op.c
cvs rdiff -u -r1.374 -r1.375 src/usr.bin/indent/indent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/fmt_expr.c
diff -u src/tests/usr.bin/indent/fmt_expr.c:1.8 src/tests/usr.bin/indent/fmt_expr.c:1.9
--- src/tests/usr.bin/indent/fmt_expr.c:1.8	Wed Jun 14 17:07:32 2023
+++ src/tests/usr.bin/indent/fmt_expr.c	Fri Jun 16 12:55:57 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: fmt_expr.c,v 1.8 2023/06/14 17:07:32 rillig Exp $ */
+/* $NetBSD: fmt_expr.c,v 1.9 2023/06/16 12:55:57 rillig Exp $ */
 
 /*
  * Tests for all kinds of expressions that are not directly related to unary
@@ -19,8 +19,7 @@
 	x = ((struct point){0, 0}).x;
 
 	for (ln = gnodes->first; ln != NULL; ln = ln->next)
-// $ FIXME: No space after the cast.
-		*(GNode **) Vector_Push() = ln->datum;
+		*(GNode **)Vector_Push() = ln->datum;
 }
 //indent end
 

Index: src/tests/usr.bin/indent/lsym_unary_op.c
diff -u src/tests/usr.bin/indent/lsym_unary_op.c:1.10 src/tests/usr.bin/indent/lsym_unary_op.c:1.11
--- src/tests/usr.bin/indent/lsym_unary_op.c:1.10	Thu Jun  8 21:18:54 2023
+++ src/tests/usr.bin/indent/lsym_unary_op.c	Fri Jun 16 12:55:57 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_unary_op.c,v 1.10 2023/06/08 21:18:54 rillig Exp $ */
+/* $NetBSD: lsym_unary_op.c,v 1.11 2023/06/16 12:55:57 rillig Exp $ */
 
 /*
  * Tests for the token lsym_unary_op, which represents a unary operator.
@@ -85,17 +85,10 @@ unary_operators(void)
  */
 //indent input
 {
-sbuf_t *sb = *(sbuf_t **)sp;
-return (int)(a * (float)b);
-a = (2 * b == c);
-}
-//indent end
-
-//indent run -di0
-{
-// $ FIXME: Wrong spacing after the cast.
-	sbuf_t *sb = *(sbuf_t **) sp;
+	sbuf_t *sb = *(sbuf_t **)sp;
 	return (int)(a * (float)b);
 	a = (2 * b == c);
 }
 //indent end
+
+//indent run-equals-input -di0

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.374 src/usr.bin/indent/indent.c:1.375
--- src/usr.bin/indent/indent.c:1.374	Fri Jun 16 12:30:45 2023
+++ src/usr.bin/indent/indent.c	Fri Jun 16 12:55:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.374 2023/06/16 12:30:45 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.375 2023/06/16 12:55:57 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: indent.c,v 1.374 2023/06/16 12:30:45 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.375 2023/06/16 12:55:57 rillig Exp $");
 
 #include 
 #include 
@@ -627,6 +627,8 @@ process_rparen(void)
 	&& ps.paren.item[--ps.paren.len].cast == cast_maybe
 	&& !ps.in_func_def_params
 	&& !(ps.line_has_decl && !ps.in_init);
+	if (ps.prev_lsym == lsym_unary_op)
+		ps.prev_paren_was_cast = true;
 	if (ps.prev_paren_was_cast) {
 		ps.next_unary = true;
 		ps.want_blank = opt.space_after_cast;



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 12:30:45 UTC 2023

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c lsym_typedef.c
src/usr.bin/indent: indent.c indent.h

Log Message:
indent: fix indentation and linebreaks in typedef declarations


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/indent/lsym_typedef.c
cvs rdiff -u -r1.373 -r1.374 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.200 -r1.201 src/usr.bin/indent/indent.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.57 src/tests/usr.bin/indent/fmt_decl.c:1.58
--- src/tests/usr.bin/indent/fmt_decl.c:1.57	Thu Jun 15 09:19:07 2023
+++ src/tests/usr.bin/indent/fmt_decl.c	Fri Jun 16 12:30:45 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: fmt_decl.c,v 1.57 2023/06/15 09:19:07 rillig Exp $	*/
+/*	$NetBSD: fmt_decl.c,v 1.58 2023/06/16 12:30:45 rillig Exp $	*/
 
 /*
  * Tests for declarations of global variables, external functions, and local
@@ -83,7 +83,7 @@ typedef struct Complex
 {
 	double		x;
 	double		y;
-}		Complex;
+} Complex;
 //indent end
 
 
@@ -606,7 +606,7 @@ ToToken(bool cond)
 typedef struct OpenDirs {
 	CachedDirList	list;
 	HashTable /* of CachedDirListNode */ table;
-}		OpenDirs;
+} OpenDirs;
 //indent end
 
 //indent run-equals-input -THashTable
@@ -1041,9 +1041,7 @@ ParseVErrorInternal(FILE *f, bool useVar
 
 typedef struct {
 	const char *m_name;
-}
-// $ FIXME: Remove this line break.
-mod_t;
+} mod_t;
 //indent end
 
 

Index: src/tests/usr.bin/indent/lsym_typedef.c
diff -u src/tests/usr.bin/indent/lsym_typedef.c:1.7 src/tests/usr.bin/indent/lsym_typedef.c:1.8
--- src/tests/usr.bin/indent/lsym_typedef.c:1.7	Fri Jun 16 11:58:33 2023
+++ src/tests/usr.bin/indent/lsym_typedef.c	Fri Jun 16 12:30:45 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_typedef.c,v 1.7 2023/06/16 11:58:33 rillig Exp $ */
+/* $NetBSD: lsym_typedef.c,v 1.8 2023/06/16 12:30:45 rillig Exp $ */
 
 /*
  * Tests for the token lsym_typedef, which represents the keyword 'typedef'
@@ -70,14 +70,23 @@ typedef struct {
 	int member;
 	bool bit:1;
 } typedef_name;
+
+struct {
+	int member;
+	bool bit:1;
+} var_name;
 //indent end
 
-//indent run -di0
+//indent run
 typedef struct {
-	int member;
-// $ FIXME: No space after the ':' here.
-	bool bit: 1;
-}
-// $ FIXME: No linebreak here.
-typedef_name;
+	int		member;
+	bool		bit:1;
+} typedef_name;
+
+struct {
+	int		member;
+	bool		bit:1;
+}		var_name;
 //indent end
+
+//indent run-equals-input -di0

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.373 src/usr.bin/indent/indent.c:1.374
--- src/usr.bin/indent/indent.c:1.373	Fri Jun 16 11:48:32 2023
+++ src/usr.bin/indent/indent.c	Fri Jun 16 12:30:45 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.373 2023/06/16 11:48:32 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.374 2023/06/16 12:30:45 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: indent.c,v 1.373 2023/06/16 11:48:32 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.374 2023/06/16 12:30:45 rillig Exp $");
 
 #include 
 #include 
@@ -377,6 +377,7 @@ static bool
 is_function_pointer_declaration(void)
 {
 	return ps.in_decl
+	&& !ps.in_typedef_decl
 	&& !ps.in_init
 	&& !ps.decl_indent_done
 	&& !ps.line_has_func_def
@@ -870,8 +871,10 @@ process_semicolon(void)
 {
 	if (out.line_kind == lk_stmt_head)
 		out.line_kind = lk_other;
-	if (ps.decl_level == 0)
+	if (ps.decl_level == 0) {
 		ps.in_var_decl = false;
+		ps.in_typedef_decl = false;
+	}
 	ps.seen_case = false;	/* only needs to be reset on error */
 	ps.quest_level = 0;	/* only needs to be reset on error */
 	if (ps.prev_lsym == lsym_rparen)
@@ -924,7 +927,7 @@ process_type_outside_parentheses(void)
 	}
 
 	ps.in_var_decl = /* maybe */ true;
-	ps.in_decl = ps.prev_lsym != lsym_typedef;
+	ps.in_decl = true;
 	ps.line_has_decl = ps.in_decl;
 	if (ps.decl_level == 0)
 		ps.declaration = decl_begin;
@@ -951,7 +954,8 @@ process_word(lexer_symbol lsym)
 			else if (ps.want_blank)
 buf_add_char(, ' ');
 			ps.want_blank = false;
-
+		} else if (ps.in_typedef_decl && ps.decl_level == 0) {
+			/* Do not indent typedef declarators. */
 		} else if (!ps.in_init && !ps.decl_indent_done &&
 		ps.ind_paren_level == 0) {
 			if (opt.decl_indent == 0
@@ -1020,7 +1024,7 @@ process_lsym(lexer_symbol lsym)
 	case lsym_other_colon:	process_other_colon();	break;
 	case lsym_comma:	process_comma();	break;
 	case lsym_semicolon:	process_semicolon();	break;
-	case lsym_typedef:goto copy_token;
+	case lsym_typedef:	ps.in_typedef_decl = true; goto copy_token;
 	case lsym_modifier:goto copy_token;
 	case lsym_case:		ps.seen_case = true;	goto copy_token;
 	case lsym_default:	ps.seen_case = true;	

CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 12:30:45 UTC 2023

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c lsym_typedef.c
src/usr.bin/indent: indent.c indent.h

Log Message:
indent: fix indentation and linebreaks in typedef declarations


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/indent/lsym_typedef.c
cvs rdiff -u -r1.373 -r1.374 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.200 -r1.201 src/usr.bin/indent/indent.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/usr.bin/indent

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 11:58:33 UTC 2023

Modified Files:
src/tests/usr.bin/indent: lsym_typedef.c

Log Message:
tests/indent: demonstrate wrong tokenization after typedef

Since 2023-06-10 06:52, which fixed the indentation of C11 _Generic
expressions.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/lsym_typedef.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/lsym_typedef.c
diff -u src/tests/usr.bin/indent/lsym_typedef.c:1.6 src/tests/usr.bin/indent/lsym_typedef.c:1.7
--- src/tests/usr.bin/indent/lsym_typedef.c:1.6	Sun Apr 24 10:36:37 2022
+++ src/tests/usr.bin/indent/lsym_typedef.c	Fri Jun 16 11:58:33 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_typedef.c,v 1.6 2022/04/24 10:36:37 rillig Exp $ */
+/* $NetBSD: lsym_typedef.c,v 1.7 2023/06/16 11:58:33 rillig Exp $ */
 
 /*
  * Tests for the token lsym_typedef, which represents the keyword 'typedef'
@@ -59,3 +59,25 @@ typedef int number;
 //indent end
 
 //indent run-equals-input
+
+
+/*
+ * Ensure that a typedef declaration does not introduce an unnecessary line
+ * break after the '}'.
+ */
+//indent input
+typedef struct {
+	int member;
+	bool bit:1;
+} typedef_name;
+//indent end
+
+//indent run -di0
+typedef struct {
+	int member;
+// $ FIXME: No space after the ':' here.
+	bool bit: 1;
+}
+// $ FIXME: No linebreak here.
+typedef_name;
+//indent end



CVS commit: src/tests/usr.bin/indent

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 11:58:33 UTC 2023

Modified Files:
src/tests/usr.bin/indent: lsym_typedef.c

Log Message:
tests/indent: demonstrate wrong tokenization after typedef

Since 2023-06-10 06:52, which fixed the indentation of C11 _Generic
expressions.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/lsym_typedef.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 11:48:32 UTC 2023

Modified Files:
src/tests/usr.bin/indent: opt_bap.c
src/usr.bin/indent: debug.c indent.c indent.h io.c

Log Message:
indent: don't force a blank line between '}' and preprocessing line


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/indent/opt_bap.c
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/indent/debug.c
cvs rdiff -u -r1.372 -r1.373 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.199 -r1.200 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.226 -r1.227 src/usr.bin/indent/io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/opt_bap.c
diff -u src/tests/usr.bin/indent/opt_bap.c:1.9 src/tests/usr.bin/indent/opt_bap.c:1.10
--- src/tests/usr.bin/indent/opt_bap.c:1.9	Tue May 23 06:18:00 2023
+++ src/tests/usr.bin/indent/opt_bap.c	Fri Jun 16 11:48:32 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_bap.c,v 1.9 2023/05/23 06:18:00 rillig Exp $ */
+/* $NetBSD: opt_bap.c,v 1.10 2023/06/16 11:48:32 rillig Exp $ */
 
 /*
  * Tests for the options '-bap' and '-nbap' ("blank line after procedure
@@ -113,6 +113,10 @@ example(void)
 //indent run-equals-input -bap
 
 
+/*
+ * A preprocessing line after the end of a function body does not force a blank
+ * line, as these lines are not a different syntactic layer.
+ */
 //indent input
 #if 0
 void
@@ -123,17 +127,20 @@ f(void)
 #endif
 //indent end
 
-//indent run -bacc -bap
-#if 0
-void
-f(void)
+//indent run-equals-input -bacc -bap
+
+
+/*
+ * Do not add a blank line between the end of a function body and an '#undef',
+ * as this is a common way to undefine a function-local macro.
+ */
+//indent input
+#define replace
 {
 }
-// $ The following blank line may be considered optional, as it precedes a
-// $ preprocessing line.  In that case, the -bap option would only apply to
-// $ elements on the same syntactic level, such as function definitions and
-// $ other declarations.
-
-#else
-#endif
+#undef replace
 //indent end
+
+//indent run-equals-input -bap
+
+//indent run-equals-input -bap -bacc

Index: src/usr.bin/indent/debug.c
diff -u src/usr.bin/indent/debug.c:1.63 src/usr.bin/indent/debug.c:1.64
--- src/usr.bin/indent/debug.c:1.63	Fri Jun 16 11:27:49 2023
+++ src/usr.bin/indent/debug.c	Fri Jun 16 11:48:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.c,v 1.63 2023/06/16 11:27:49 rillig Exp $	*/
+/*	$NetBSD: debug.c,v 1.64 2023/06/16 11:48:32 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: debug.c,v 1.63 2023/06/16 11:27:49 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.64 2023/06/16 11:48:32 rillig Exp $");
 
 #include 
 #include 
@@ -125,6 +125,7 @@ const char *const line_kind_name[] = {
 	"blank",
 	"#if",
 	"#endif",
+	"#other",
 	"stmt head",
 	"}",
 	"block comment",

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.372 src/usr.bin/indent/indent.c:1.373
--- src/usr.bin/indent/indent.c:1.372	Thu Jun 15 11:27:36 2023
+++ src/usr.bin/indent/indent.c	Fri Jun 16 11:48:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.372 2023/06/15 11:27:36 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.373 2023/06/16 11:48:32 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: indent.c,v 1.372 2023/06/15 11:27:36 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.373 2023/06/16 11:48:32 rillig Exp $");
 
 #include 
 #include 
@@ -527,21 +527,23 @@ process_preprocessing(void)
 sizeof(ifdef.item[0]) * ifdef.cap));
 		}
 		parser_state_back_up(ifdef.item + ifdef.len++);
-		out.line_kind = lk_if;
+		out.line_kind = lk_pre_if;
 
 	} else if (dir_len >= 2 && memcmp(dir, "el", 2) == 0) {
 		if (ifdef.len == 0)
 			diag(1, "Unmatched #%.*s", (int)dir_len, dir);
 		else
 			parser_state_restore(ifdef.item + ifdef.len - 1);
+		out.line_kind = lk_pre_other;
 
 	} else if (dir_len == 5 && memcmp(dir, "endif", 5) == 0) {
 		if (ifdef.len == 0)
 			diag(1, "Unmatched #endif");
 		else
 			parser_state_free(ifdef.item + --ifdef.len);
-		out.line_kind = lk_endif;
-	}
+		out.line_kind = lk_pre_endif;
+	} else
+		out.line_kind = lk_pre_other;
 }
 
 static void

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.199 src/usr.bin/indent/indent.h:1.200
--- src/usr.bin/indent/indent.h:1.199	Fri Jun 16 11:27:49 2023
+++ src/usr.bin/indent/indent.h	Fri Jun 16 11:48:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.199 2023/06/16 11:27:49 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.200 2023/06/16 11:48:32 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -410,8 +410,9 @@ extern struct output_state {
 	enum line_kind {
 		lk_other,
 		lk_blank,
-		lk_if,		/* #if, #ifdef, #ifndef */
-		lk_endif,	/* #endif */
+		lk_pre_if,	/* #if, #ifdef, #ifndef */
+		lk_pre_endif,	/* #endif */
+		

CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 11:48:32 UTC 2023

Modified Files:
src/tests/usr.bin/indent: opt_bap.c
src/usr.bin/indent: debug.c indent.c indent.h io.c

Log Message:
indent: don't force a blank line between '}' and preprocessing line


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/indent/opt_bap.c
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/indent/debug.c
cvs rdiff -u -r1.372 -r1.373 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.199 -r1.200 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.226 -r1.227 src/usr.bin/indent/io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/indent

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 11:27:49 UTC 2023

Modified Files:
src/usr.bin/indent: debug.c indent.h io.c pr_comment.c

Log Message:
indent: rename a field of the parser state

The previous name 'comment_in_first_line' was misleading, as it could
mean that there was a comment in the first line of the file.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/indent/debug.c
cvs rdiff -u -r1.198 -r1.199 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.225 -r1.226 src/usr.bin/indent/io.c
cvs rdiff -u -r1.165 -r1.166 src/usr.bin/indent/pr_comment.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/indent/debug.c
diff -u src/usr.bin/indent/debug.c:1.62 src/usr.bin/indent/debug.c:1.63
--- src/usr.bin/indent/debug.c:1.62	Thu Jun 15 10:59:06 2023
+++ src/usr.bin/indent/debug.c	Fri Jun 16 11:27:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.c,v 1.62 2023/06/15 10:59:06 rillig Exp $	*/
+/*	$NetBSD: debug.c,v 1.63 2023/06/16 11:27:49 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: debug.c,v 1.62 2023/06/15 10:59:06 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.63 2023/06/16 11:27:49 rillig Exp $");
 
 #include 
 #include 
@@ -363,7 +363,7 @@ debug_parser_state(void)
 	state.heading = "indentation of comments";
 	debug_ps_int(comment_ind);
 	debug_ps_int(comment_shift);
-	debug_ps_bool(comment_in_first_line);
+	debug_ps_bool(comment_cont);
 
 	state.heading = "vertical spacing";
 	debug_ps_bool(break_after_comma);

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.198 src/usr.bin/indent/indent.h:1.199
--- src/usr.bin/indent/indent.h:1.198	Thu Jun 15 10:59:06 2023
+++ src/usr.bin/indent/indent.h	Fri Jun 16 11:27:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.198 2023/06/15 10:59:06 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.199 2023/06/16 11:27:49 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -383,10 +383,10 @@ extern struct parser_state {
 
 	/* Indentation of comments */
 
-	int comment_ind;	/* indentation of the current comment */
+	int comment_ind;	/* total indentation of the current comment */
 	int comment_shift;	/* all but the first line of a boxed comment
  * are shifted this much to the right */
-	bool comment_in_first_line;
+	bool comment_cont;	/* after the first line of a comment */
 
 	/* Vertical spacing */
 

Index: src/usr.bin/indent/io.c
diff -u src/usr.bin/indent/io.c:1.225 src/usr.bin/indent/io.c:1.226
--- src/usr.bin/indent/io.c:1.225	Thu Jun 15 11:27:36 2023
+++ src/usr.bin/indent/io.c	Fri Jun 16 11:27:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.c,v 1.225 2023/06/15 11:27:36 rillig Exp $	*/
+/*	$NetBSD: io.c,v 1.226 2023/06/16 11:27:49 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: io.c,v 1.225 2023/06/15 11:27:36 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.226 2023/06/16 11:27:49 rillig Exp $");
 
 #include 
 
@@ -300,9 +300,9 @@ output_comment(void)
 	int target_ind = ps.comment_ind;
 	const char *p;
 
-	if (!ps.comment_in_first_line)
+	if (ps.comment_cont)
 		target_ind += ps.comment_shift;
-	ps.comment_in_first_line = false;
+	ps.comment_cont = true;
 
 	/* consider the original indentation in case this is a box comment */
 	for (p = com.s; *p == '\t'; p++)

Index: src/usr.bin/indent/pr_comment.c
diff -u src/usr.bin/indent/pr_comment.c:1.165 src/usr.bin/indent/pr_comment.c:1.166
--- src/usr.bin/indent/pr_comment.c:1.165	Wed Jun 14 14:11:28 2023
+++ src/usr.bin/indent/pr_comment.c	Fri Jun 16 11:27:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pr_comment.c,v 1.165 2023/06/14 14:11:28 rillig Exp $	*/
+/*	$NetBSD: pr_comment.c,v 1.166 2023/06/16 11:27:49 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pr_comment.c,v 1.165 2023/06/14 14:11:28 rillig Exp $");
+__RCSID("$NetBSD: pr_comment.c,v 1.166 2023/06/16 11:27:49 rillig Exp $");
 
 #include 
 
@@ -142,7 +142,7 @@ analyze_comment(bool *p_may_wrap, bool *
 static void
 copy_comment_start(bool may_wrap, bool *delim, int line_length)
 {
-	ps.comment_in_first_line = true;
+	ps.comment_cont = false;
 	com_add_char('/');
 	com_add_char(token.s[token.len - 1]);	/* either '*' or '/' */
 



CVS commit: src/usr.bin/indent

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 11:27:49 UTC 2023

Modified Files:
src/usr.bin/indent: debug.c indent.h io.c pr_comment.c

Log Message:
indent: rename a field of the parser state

The previous name 'comment_in_first_line' was misleading, as it could
mean that there was a comment in the first line of the file.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/indent/debug.c
cvs rdiff -u -r1.198 -r1.199 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.225 -r1.226 src/usr.bin/indent/io.c
cvs rdiff -u -r1.165 -r1.166 src/usr.bin/indent/pr_comment.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/patch

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 11:27:00 UTC 2023

Modified Files:
src/usr.bin/patch: patch.1 patch.c

Log Message:
patch: add --backup-if-mismatch and --no-backup-if-mismatch for GNU patch 
compatibility

These options only make sense in POSIX mode, since NetBSD's patch
has --backup enabled by default and GNU patch doesn't.

In POSIX mode, GNU patch and NetBSD patch now behave the same for these
two options.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/patch/patch.1
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/patch/patch.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/patch/patch.1
diff -u src/usr.bin/patch/patch.1:1.21 src/usr.bin/patch/patch.1:1.22
--- src/usr.bin/patch/patch.1:1.21	Mon Jul  3 21:34:20 2017
+++ src/usr.bin/patch/patch.1	Fri Jun 16 11:27:00 2023
@@ -1,6 +1,6 @@
 .\"	$OpenBSD: patch.1,v 1.22 2008/06/06 20:44:00 jmc Exp $
 .\"	$DragonFly: src/usr.bin/patch/patch.1,v 1.10 2008/08/18 19:15:55 joerg Exp $
-.\"	$NetBSD: patch.1,v 1.21 2017/07/03 21:34:20 wiz Exp $
+.\"	$NetBSD: patch.1,v 1.22 2023/06/16 11:27:00 wiz Exp $
 .\" Copyright 1986, Larry Wall
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -21,7 +21,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd November 7, 2015
+.Dd June 16, 2023
 .Dt PATCH 1
 .Os
 .Sh NAME
@@ -41,6 +41,8 @@
 .Op Fl V Cm t | nil | never | none
 .Op Fl x Ar number
 .Op Fl z Ar backup-ext
+.Op Fl Fl backup-if-mismatch
+.Op Fl Fl no-backup-if-mismatch
 .Op Fl Fl posix
 .Op Ar origfile Op Ar patchfile
 .Nm
@@ -100,8 +102,15 @@ backup is made.
 This is equivalent to specifying
 .Qo Fl V Cm existing Qc .
 This option is currently the default, unless
-.Fl -posix
+.Fl Fl posix
 is specified.
+.It Fl Fl backup-if-mismatch
+Create a backup file if the patch doesn't apply cleanly.
+This option only makes sense when
+.Fl Fl backup
+is disabled, i.e. when in
+.Fl Fl posix
+mode.
 .It Fl C , Fl Fl check
 Checks that the patch would apply cleanly, but does not modify anything.
 .It Fl c , Fl Fl context
@@ -177,6 +186,10 @@ See also
 Forces
 .Nm
 to interpret the patch file as a normal diff.
+.It Fl Fl no-backup-if-mismatch
+Turn off
+.Fl Fl backup-if-mismatch .
+This option exists mostly for compatibility with GNU patch.
 .It Fl o Ar out-file , Fl Fl output Ar out-file
 Causes the next argument to be interpreted as the output file name.
 .It Fl p Ar strip-count , Fl Fl strip Ar strip-count
@@ -604,7 +617,7 @@ utility is compliant with the
 .St -p1003.1-2004
 specification
 (except as detailed above for the
-.Fl -posix
+.Fl Fl posix
 option),
 though the presence of
 .Nm
@@ -613,7 +626,7 @@ itself is optional.
 The flags
 .Op Fl CEfstuvBFVxz
 and
-.Op Fl -posix
+.Op Fl Fl posix
 are extensions to that specification.
 .Sh AUTHORS
 .An Larry Wall

Index: src/usr.bin/patch/patch.c
diff -u src/usr.bin/patch/patch.c:1.33 src/usr.bin/patch/patch.c:1.34
--- src/usr.bin/patch/patch.c:1.33	Mon Sep 20 23:22:36 2021
+++ src/usr.bin/patch/patch.c	Fri Jun 16 11:27:00 2023
@@ -1,7 +1,7 @@
 /*
  * $OpenBSD: patch.c,v 1.45 2007/04/18 21:52:24 sobrado Exp $
  * $DragonFly: src/usr.bin/patch/patch.c,v 1.10 2008/08/10 23:39:56 joerg Exp $
- * $NetBSD: patch.c,v 1.33 2021/09/20 23:22:36 dholland Exp $
+ * $NetBSD: patch.c,v 1.34 2023/06/16 11:27:00 wiz Exp $
  */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: patch.c,v 1.33 2021/09/20 23:22:36 dholland Exp $");
+__RCSID("$NetBSD: patch.c,v 1.34 2023/06/16 11:27:00 wiz Exp $");
 
 #include 
 #include 
@@ -91,6 +91,7 @@ int		diff_type = 0;
 char		*revision = NULL;	/* prerequisite revision, if any */
 LINENUM		input_lines = 0;	/* how long is input file in lines */
 int		posix = 0;		/* strict POSIX mode? */
+int		backup_if_mismatch = -1;/* create backup file when patch doesn't apply cleanly */
 
 static void	reinitialize_almost_everything(void);
 static void	get_some_switches(void);
@@ -374,12 +375,17 @@ main(int argc, char *argv[])
 			char	*realout = outname;
 
 			if (!check_only) {
+/* handle --backup-if-mismatch */
+enum backup_type saved = backup_type;
+if (failed > 0 && backup_if_mismatch > 0 && backup_type == none)
+	backup_type = simple;
 if (move_file(TMPOUTNAME, outname) < 0) {
 	toutkeep = true;
 	realout = TMPOUTNAME;
 	chmod(TMPOUTNAME, filemode);
 } else
 	chmod(outname, filemode);
+backup_type = saved;
 
 if (remove_empty_files &&
 stat(realout, ) == 0 &&
@@ -410,7 +416,7 @@ main(int argc, char *argv[])
 say("%d out of %d hunks ignored--saving rejects to %s\n",
 failed, hunk, rejname);
 			} else {
-say("%d out of %d hunks failed--saving rejects to %s\n",
+say("%d out of %d hunks FAILED -- saving rejects to %s\n",
 failed, hunk, rejname);
 			}
 			if (!check_only && 

CVS commit: src/usr.bin/patch

2023-06-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 16 11:27:00 UTC 2023

Modified Files:
src/usr.bin/patch: patch.1 patch.c

Log Message:
patch: add --backup-if-mismatch and --no-backup-if-mismatch for GNU patch 
compatibility

These options only make sense in POSIX mode, since NetBSD's patch
has --backup enabled by default and GNU patch doesn't.

In POSIX mode, GNU patch and NetBSD patch now behave the same for these
two options.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/patch/patch.1
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/patch/patch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 09:25:13 UTC 2023

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: directive-include-guard.exp
directive-include-guard.mk

Log Message:
tests/make: add test for multiple-inclusion guards


To generate a diff of this commit:
cvs rdiff -u -r1.1268 -r1.1269 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.337 -r1.338 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 \
src/usr.bin/make/unit-tests/directive-include-guard.exp \
src/usr.bin/make/unit-tests/directive-include-guard.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1268 src/distrib/sets/lists/tests/mi:1.1269
--- src/distrib/sets/lists/tests/mi:1.1268	Fri Jun 16 07:20:45 2023
+++ src/distrib/sets/lists/tests/mi	Fri Jun 16 09:25:13 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1268 2023/06/16 07:20:45 rillig Exp $
+# $NetBSD: mi,v 1.1269 2023/06/16 09:25:13 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5779,6 +5779,8 @@
 ./usr/tests/usr.bin/make/unit-tests/directive-ifnmake.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive-include-fatal.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive-include-fatal.mk			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/directive-include-guard.exp			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/directive-include-guard.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive-include.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive-include.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive-info.exptests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.337 src/usr.bin/make/unit-tests/Makefile:1.338
--- src/usr.bin/make/unit-tests/Makefile:1.337	Fri Jun 16 07:20:45 2023
+++ src/usr.bin/make/unit-tests/Makefile	Fri Jun 16 09:25:13 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.337 2023/06/16 07:20:45 rillig Exp $
+# $NetBSD: Makefile,v 1.338 2023/06/16 09:25:13 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -196,6 +196,7 @@ TESTS+=		directive-ifndef
 TESTS+=		directive-ifnmake
 TESTS+=		directive-include
 TESTS+=		directive-include-fatal
+TESTS+=		directive-include-guard
 TESTS+=		directive-info
 TESTS+=		directive-misspellings
 TESTS+=		directive-sinclude
@@ -504,6 +505,11 @@ FLAGS.varname-empty=		-dv '$${:U}=cmdlin
 # Some tests need extra postprocessing.
 SED_CMDS.deptgt-phony=	${STD_SED_CMDS.dd}
 SED_CMDS.dir=		${STD_SED_CMDS.dd}
+SED_CMDS.directive-include-guard= \
+	-e '/\.MAKEFLAGS/d' \
+	-e '/^Parsing line/d' \
+	-e '/^SetFilenameVars:/d' \
+	-e '/^ParseEOF:/d'
 SED_CMDS.export=	-e '/^[^=_A-Za-z0-9]*=/d'
 SED_CMDS.export-all=	${SED_CMDS.export}
 SED_CMDS.export-env=	${SED_CMDS.export}

Added files:

Index: src/usr.bin/make/unit-tests/directive-include-guard.exp
diff -u /dev/null src/usr.bin/make/unit-tests/directive-include-guard.exp:1.1
--- /dev/null	Fri Jun 16 09:25:13 2023
+++ src/usr.bin/make/unit-tests/directive-include-guard.exp	Fri Jun 16 09:25:13 2023
@@ -0,0 +1,25 @@
+Parse_PushInput: file directive-include-guard-guarded-ifndef.tmp, line 1
+Parse_PushInput: file directive-include-guard-guarded-ifndef.tmp, line 1
+Parse_PushInput: file directive-include-guard-comments.tmp, line 1
+Parse_PushInput: file directive-include-guard-comments.tmp, line 1
+Parse_PushInput: file directive-include-guard-guarded-if.tmp, line 1
+Parse_PushInput: file directive-include-guard-guarded-if.tmp, line 1
+Parse_PushInput: file directive-include-guard-triple-negation.tmp, line 1
+Parse_PushInput: file directive-include-guard-triple-negation.tmp, line 1
+Parse_PushInput: file directive-include-guard-varname-mismatch.tmp, line 1
+Parse_PushInput: file directive-include-guard-varname-mismatch.tmp, line 1
+Parse_PushInput: file directive-include-guard-varname-indirect.tmp, line 1
+Parse_PushInput: file directive-include-guard-varname-indirect.tmp, line 1
+Parse_PushInput: file directive-include-guard-late-assignment.tmp, line 1
+Parse_PushInput: file directive-include-guard-late-assignment.tmp, line 1
+Parse_PushInput: file directive-include-guard-two-conditions.tmp, line 1
+Parse_PushInput: file directive-include-guard-two-conditions.tmp, line 1
+Parse_PushInput: file directive-include-guard-already-set.tmp, line 1
+Parse_PushInput: file directive-include-guard-already-set.tmp, line 1
+Parse_PushInput: file directive-include-guard-twice.tmp, line 1
+Parse_PushInput: file 

CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 09:25:13 UTC 2023

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: directive-include-guard.exp
directive-include-guard.mk

Log Message:
tests/make: add test for multiple-inclusion guards


To generate a diff of this commit:
cvs rdiff -u -r1.1268 -r1.1269 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.337 -r1.338 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 \
src/usr.bin/make/unit-tests/directive-include-guard.exp \
src/usr.bin/make/unit-tests/directive-include-guard.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 07:20:45 UTC 2023

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile modmisc.exp modmisc.mk
varmod-subst.mk
Removed Files:
src/usr.bin/make/unit-tests: modmatch.exp modmatch.mk

Log Message:
tests/make: clean up tests for the ':M' and ':S' modifiers


To generate a diff of this commit:
cvs rdiff -u -r1.1267 -r1.1268 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.336 -r1.337 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.4 -r0 src/usr.bin/make/unit-tests/modmatch.exp
cvs rdiff -u -r1.9 -r0 src/usr.bin/make/unit-tests/modmatch.mk
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/make/unit-tests/modmisc.exp
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/make/unit-tests/modmisc.mk
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/varmod-subst.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1267 src/distrib/sets/lists/tests/mi:1.1268
--- src/distrib/sets/lists/tests/mi:1.1267	Wed Jun 14 07:20:54 2023
+++ src/distrib/sets/lists/tests/mi	Fri Jun 16 07:20:45 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1267 2023/06/14 07:20:54 rillig Exp $
+# $NetBSD: mi,v 1.1268 2023/06/16 07:20:45 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5864,8 +5864,8 @@
 ./usr/tests/usr.bin/make/unit-tests/misc.mk	tests-obsolete		obsolete
 ./usr/tests/usr.bin/make/unit-tests/moderrs.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/moderrs.mk	tests-usr.bin-tests	compattestfile,atf
-./usr/tests/usr.bin/make/unit-tests/modmatch.exptests-usr.bin-tests	compattestfile,atf
-./usr/tests/usr.bin/make/unit-tests/modmatch.mk	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/modmatch.exptests-obsolete		obsolete,atf
+./usr/tests/usr.bin/make/unit-tests/modmatch.mk	tests-obsolete		obsolete,atf
 ./usr/tests/usr.bin/make/unit-tests/modmisc.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/modmisc.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/modorder.exptests-obsolete		obsolete

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.336 src/usr.bin/make/unit-tests/Makefile:1.337
--- src/usr.bin/make/unit-tests/Makefile:1.336	Thu Jun  1 07:27:30 2023
+++ src/usr.bin/make/unit-tests/Makefile	Fri Jun 16 07:20:45 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.336 2023/06/01 07:27:30 rillig Exp $
+# $NetBSD: Makefile,v 1.337 2023/06/16 07:20:45 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -228,7 +228,6 @@ TESTS+=		lint
 TESTS+=		make-exported
 TESTS+=		meta-cmd-cmp
 TESTS+=		moderrs
-TESTS+=		modmatch
 TESTS+=		modmisc
 .if ${.MAKE.UID} > 0
 TESTS+=		objdir-writable

Index: src/usr.bin/make/unit-tests/modmisc.exp
diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.47 src/usr.bin/make/unit-tests/modmisc.exp:1.48
--- src/usr.bin/make/unit-tests/modmisc.exp:1.47	Sun Dec 20 19:29:06 2020
+++ src/usr.bin/make/unit-tests/modmisc.exp	Fri Jun 16 07:20:45 2023
@@ -6,7 +6,6 @@ path='/bin':'/tmp':'/':'/no/such/dir'
 path_/usr/xbin=/opt/xbin/
 paths=/bin /tmp / /no/such/dir /opt/xbin
 PATHS=/BIN /TMP / /NO/SUCH/DIR /OPT/XBIN
-The answer is 42
 S:
 C:
 @:

Index: src/usr.bin/make/unit-tests/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.52 src/usr.bin/make/unit-tests/modmisc.mk:1.53
--- src/usr.bin/make/unit-tests/modmisc.mk:1.52	Sun Dec 20 19:29:06 2020
+++ src/usr.bin/make/unit-tests/modmisc.mk	Fri Jun 16 07:20:45 2023
@@ -1,4 +1,4 @@
-# $NetBSD: modmisc.mk,v 1.52 2020/12/20 19:29:06 rillig Exp $
+# $NetBSD: modmisc.mk,v 1.53 2023/06/16 07:20:45 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -15,14 +15,10 @@ MOD_HOMES=	S,/home/,/homes/,
 MOD_OPT=	@d@$${exists($$d):?$$d:$${d:S,/usr,/opt,}}@
 MOD_SEP=	S,:, ,g
 
-all:	modvar modvarloop modsysv emptyvar undefvar
+all:	modvar modvarloop emptyvar undefvar
 all:	mod-quote
 all:	mod-break-many-words
 
-# See also sysv.mk.
-modsysv:
-	@echo "The answer is ${libfoo.a:L:libfoo.a=42}"
-
 # Demonstrates modifiers that are given indirectly from a variable.
 modvar:
 	@echo "path='${path}'"
@@ -60,6 +56,6 @@ undefvar:
 mod-quote:
 	@echo $@: new${.newline:Q}${.newline:Q}line
 
-# Cover the bmake_realloc in Str_Words.
+# Cover the bmake_realloc in Substring_Words.
 mod-break-many-words:
 	@echo $@: ${UNDEF:U:range=500:[#]}

Index: src/usr.bin/make/unit-tests/varmod-subst.mk
diff -u src/usr.bin/make/unit-tests/varmod-subst.mk:1.11 src/usr.bin/make/unit-tests/varmod-subst.mk:1.12
--- src/usr.bin/make/unit-tests/varmod-subst.mk:1.11	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/varmod-subst.mk	Fri Jun 16 07:20:45 2023
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-subst.mk,v 1.11 

CVS commit: src

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 07:20:45 UTC 2023

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile modmisc.exp modmisc.mk
varmod-subst.mk
Removed Files:
src/usr.bin/make/unit-tests: modmatch.exp modmatch.mk

Log Message:
tests/make: clean up tests for the ':M' and ':S' modifiers


To generate a diff of this commit:
cvs rdiff -u -r1.1267 -r1.1268 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.336 -r1.337 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.4 -r0 src/usr.bin/make/unit-tests/modmatch.exp
cvs rdiff -u -r1.9 -r0 src/usr.bin/make/unit-tests/modmatch.mk
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/make/unit-tests/modmisc.exp
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/make/unit-tests/modmisc.mk
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/varmod-subst.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/make

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 07:12:46 UTC 2023

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

Log Message:
make: remove parameter names from function declarations

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.345 -r1.346 src/usr.bin/make/cond.c
cvs rdiff -u -r1.320 -r1.321 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/cond.c
diff -u src/usr.bin/make/cond.c:1.345 src/usr.bin/make/cond.c:1.346
--- src/usr.bin/make/cond.c:1.345	Thu Jun  1 07:44:10 2023
+++ src/usr.bin/make/cond.c	Fri Jun 16 07:12:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.345 2023/06/01 07:44:10 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.346 2023/06/16 07:12:46 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -92,7 +92,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.345 2023/06/01 07:44:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.346 2023/06/16 07:12:46 rillig Exp $");
 
 /*
  * Conditional expressions conform to this grammar:
@@ -173,7 +173,7 @@ typedef struct CondParser {
 	bool printedError;
 } CondParser;
 
-static CondResult CondParser_Or(CondParser *par, bool);
+static CondResult CondParser_Or(CondParser *, bool);
 
 unsigned int cond_depth = 0;	/* current .if nesting level */
 

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.320 src/usr.bin/make/make.h:1.321
--- src/usr.bin/make/make.h:1.320	Thu Jun  1 07:44:10 2023
+++ src/usr.bin/make/make.h	Fri Jun 16 07:12:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.320 2023/06/01 07:44:10 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.321 2023/06/16 07:12:46 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -778,8 +778,8 @@ void Arch_End(void);
 bool Arch_ParseArchive(char **, GNodeList *, GNode *);
 void Arch_Touch(GNode *);
 void Arch_TouchLib(GNode *);
-void Arch_UpdateMTime(GNode *gn);
-void Arch_UpdateMemberMTime(GNode *gn);
+void Arch_UpdateMTime(GNode *);
+void Arch_UpdateMemberMTime(GNode *);
 void Arch_FindLib(GNode *, SearchPath *);
 bool Arch_LibOODate(GNode *) MAKE_ATTR_USE;
 bool Arch_IsLib(GNode *) MAKE_ATTR_USE;



CVS commit: src/usr.bin/make

2023-06-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 16 07:12:46 UTC 2023

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

Log Message:
make: remove parameter names from function declarations

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.345 -r1.346 src/usr.bin/make/cond.c
cvs rdiff -u -r1.320 -r1.321 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.