CVS commit: src

2023-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 22:36:15 UTC 2023

Modified Files:
src/tests/usr.bin/indent: psym_semicolon.c
src/usr.bin/indent: parse.c

Log Message:
tests/indent: test pushing the placeholder symbol to the parser stack


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/indent/psym_semicolon.c
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/indent/parse.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-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 22:38:47 UTC 2023

Modified Files:
src/usr.bin/indent: indent.c indent.h parse.c

Log Message:
indent: rename placeholder symbol for parser stack

No functional change outside debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.255 -r1.256 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.121 -r1.122 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/indent/parse.c

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

Modified files:

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.255 src/usr.bin/indent/indent.c:1.256
--- src/usr.bin/indent/indent.c:1.255	Fri May 12 15:36:02 2023
+++ src/usr.bin/indent/indent.c	Fri May 12 22:38:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.255 2023/05/12 15:36:02 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.256 2023/05/12 22:38:47 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.255 2023/05/12 15:36:02 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.256 2023/05/12 22:38:47 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -485,7 +485,7 @@ process_lparen_or_lbracket(void)
 debug_println("paren_indents[%d] is now %d",
 	ps.nparen - 1, ps.paren[ps.nparen - 1].indent);
 
-if (ps.spaced_expr_psym != psym_semicolon
+if (ps.spaced_expr_psym != psym_0
 	&& ps.nparen == 1 && opt.extra_expr_indent
 	&& ps.paren[0].indent < 2 * opt.indent_size) {
 	ps.paren[0].indent = (short)(2 * opt.indent_size);
@@ -497,7 +497,7 @@ process_lparen_or_lbracket(void)
 	 * this is a kluge to make sure that declarations will be aligned
 	 * right if proc decl has an explicit type on it, i.e. "int a(x) {..."
 	 */
-	parse(psym_semicolon);	/* I said this was a kluge... */
+	parse(psym_0);
 	ps.init_or_struct = false;
 }
 
@@ -528,12 +528,12 @@ process_rparen_or_rbracket(void)
 
 *code.e++ = token.s[0];
 
-if (ps.spaced_expr_psym != psym_semicolon && ps.nparen == 0) {
+if (ps.spaced_expr_psym != psym_0 && ps.nparen == 0) {
 	ps.force_nl = true;
 	ps.next_unary = true;
 	ps.in_stmt_or_decl = false;
 	parse(ps.spaced_expr_psym);
-	ps.spaced_expr_psym = psym_semicolon;
+	ps.spaced_expr_psym = psym_0;
 }
 }
 
@@ -651,17 +651,17 @@ process_semicolon(void)
 	 */
 	diag(1, "Unbalanced parentheses");
 	ps.nparen = 0;
-	if (ps.spaced_expr_psym != psym_semicolon) {
+	if (ps.spaced_expr_psym != psym_0) {
 	parse(ps.spaced_expr_psym);
-	ps.spaced_expr_psym = psym_semicolon;
+	ps.spaced_expr_psym = psym_0;
 	}
 }
 *code.e++ = ';';
 ps.want_blank = true;
 ps.in_stmt_or_decl = ps.nparen > 0;
 
-if (ps.spaced_expr_psym == psym_semicolon) {
-	parse(psym_semicolon);	/* let parser know about end of stmt */
+if (ps.spaced_expr_psym == psym_0) {
+	parse(psym_0);	/* let parser know about end of stmt */
 	ps.force_nl = true;
 }
 }
@@ -696,9 +696,9 @@ process_lbrace(void)
 if (ps.nparen > 0) {
 	diag(1, "Unbalanced parentheses");
 	ps.nparen = 0;
-	if (ps.spaced_expr_psym != psym_semicolon) {
+	if (ps.spaced_expr_psym != psym_0) {
 	parse(ps.spaced_expr_psym);
-	ps.spaced_expr_psym = psym_semicolon;
+	ps.spaced_expr_psym = psym_0;
 	ps.ind_level = ps.ind_level_follow;
 	}
 }
@@ -735,7 +735,7 @@ process_rbrace(void)
 if (ps.nparen > 0) {	/* check for unclosed if, for, else. */
 	diag(1, "Unbalanced parentheses");
 	ps.nparen = 0;
-	ps.spaced_expr_psym = psym_semicolon;
+	ps.spaced_expr_psym = psym_0;
 }
 
 ps.just_saw_decl = 0;
@@ -849,12 +849,12 @@ process_ident(lexer_symbol lsym)
 	ps.want_blank = false;
 	}
 
-} else if (ps.spaced_expr_psym != psym_semicolon && ps.nparen == 0) {
+} else if (ps.spaced_expr_psym != psym_0 && ps.nparen == 0) {
 	ps.force_nl = true;
 	ps.next_unary = true;
 	ps.in_stmt_or_decl = false;
 	parse(ps.spaced_expr_psym);
-	ps.spaced_expr_psym = psym_semicolon;
+	ps.spaced_expr_psym = psym_0;
 }
 }
 

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.121 src/usr.bin/indent/indent.h:1.122
--- src/usr.bin/indent/indent.h:1.121	Fri May 12 10:53:33 2023
+++ src/usr.bin/indent/indent.h	Fri May 12 22:38:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.121 2023/05/12 10:53:33 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.122 2023/05/12 22:38:47 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -110,7 +110,7 @@ typedef enum lexer_symbol {
 } lexer_symbol;
 
 typedef enum parser_symbol {
-psym_semicolon,		/* rather a placeholder than a semicolon */
+psym_0,			/* a placeholder */
 psym_lbrace,
 psym_rbrace,
 psym_decl,
@@ -337,7 +337,7 @@ extern struct parser_state {
 parser_symbol 

CVS commit: src/usr.bin/indent

2023-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 22:38:47 UTC 2023

Modified Files:
src/usr.bin/indent: indent.c indent.h parse.c

Log Message:
indent: rename placeholder symbol for parser stack

No functional change outside debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.255 -r1.256 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.121 -r1.122 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/indent/parse.c

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



CVS commit: src

2023-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 22:36:15 UTC 2023

Modified Files:
src/tests/usr.bin/indent: psym_semicolon.c
src/usr.bin/indent: parse.c

Log Message:
tests/indent: test pushing the placeholder symbol to the parser stack


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/indent/psym_semicolon.c
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/indent/parse.c

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

Modified files:

Index: src/tests/usr.bin/indent/psym_semicolon.c
diff -u src/tests/usr.bin/indent/psym_semicolon.c:1.3 src/tests/usr.bin/indent/psym_semicolon.c:1.4
--- src/tests/usr.bin/indent/psym_semicolon.c:1.3	Sun Apr 24 09:04:12 2022
+++ src/tests/usr.bin/indent/psym_semicolon.c	Fri May 12 22:36:15 2023
@@ -1,14 +1,34 @@
-/* $NetBSD: psym_semicolon.c,v 1.3 2022/04/24 09:04:12 rillig Exp $ */
+/* $NetBSD: psym_semicolon.c,v 1.4 2023/05/12 22:36:15 rillig Exp $ */
 
 /*
- * Tests for the parser symbol psym_semicolon, which pushes a new statement on
- * the stack.
+ * Tests for the parser symbol psym_0 (formerly named psym_semicolon), which
+ * pushes a new statement on the stack.
  *
  * This token is never stored on the stack itself.
  */
 
 //indent input
-// TODO: add input
+void func(void) { stmt(); }
 //indent end
 
-//indent run-equals-input
+//indent run
+void
+func(void)
+{
+	stmt();
+}
+//indent end
+
+//indent run -npsl
+void func(void)
+{
+	stmt();
+}
+//indent end
+
+//indent run -nfbs
+void
+func(void) {
+	stmt();
+}
+//indent end

Index: src/usr.bin/indent/parse.c
diff -u src/usr.bin/indent/parse.c:1.51 src/usr.bin/indent/parse.c:1.52
--- src/usr.bin/indent/parse.c:1.51	Fri May 12 08:40:54 2023
+++ src/usr.bin/indent/parse.c	Fri May 12 22:36:15 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.51 2023/05/12 08:40:54 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.52 2023/05/12 22:36:15 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)parse.c	8.1 
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: parse.c,v 1.51 2023/05/12 08:40:54 rillig Exp $");
+__RCSID("$NetBSD: parse.c,v 1.52 2023/05/12 22:36:15 rillig Exp $");
 #else
 __FBSDID("$FreeBSD: head/usr.bin/indent/parse.c 337651 2018-08-11 19:20:06Z pstef $");
 #endif
@@ -91,6 +91,21 @@ decl_level(void)
 return level;
 }
 
+#ifdef debug
+static void
+debug_parse_stack(const char *situation)
+{
+printf("parse stack %s:", situation);
+for (int i = 1; i <= ps.tos; ++i)
+	printf(" %s %d", psym_name(ps.s_sym[i]), ps.s_ind_level[i]);
+if (ps.tos == 0)
+	printf(" empty");
+printf("\n");
+}
+#else
+#define debug_parse_stack(situation) do { } while (false)
+#endif
+
 /*
  * Shift the token onto the parser stack, or reduce it by combining it with
  * previous tokens.
@@ -220,16 +235,9 @@ parse(parser_symbol psym)
 if (ps.tos >= STACKSIZE - 1)
 	errx(1, "Parser stack overflow");
 
+debug_parse_stack("before reduction");
 reduce();			/* see if any reduction can be done */
-
-#ifdef debug
-printf("parse stack:");
-for (int i = 1; i <= ps.tos; ++i)
-	printf(" %s %d", psym_name(ps.s_sym[i]), ps.s_ind_level[i]);
-if (ps.tos == 0)
-	printf(" empty");
-printf("\n");
-#endif
+debug_parse_stack("after reduction");
 }
 
 /*



CVS commit: src/usr.bin/indent

2023-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 15:36:02 UTC 2023

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

Log Message:
indent: remove code for parsing declarations without semicolon

The statement from the comment that declarations do not need semicolons
is wrong. A possible input that matched this rule is 'void f(void) { int
a }'.


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 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/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.254 src/usr.bin/indent/indent.c:1.255
--- src/usr.bin/indent/indent.c:1.254	Fri May 12 10:53:33 2023
+++ src/usr.bin/indent/indent.c	Fri May 12 15:36:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.254 2023/05/12 10:53:33 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.255 2023/05/12 15:36:02 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.254 2023/05/12 10:53:33 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.255 2023/05/12 15:36:02 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -732,11 +732,6 @@ process_lbrace(void)
 static void
 process_rbrace(void)
 {
-if (ps.s_sym[ps.tos] == psym_decl && !ps.block_init) {
-	/* semicolons can be omitted in declarations */
-	parse(psym_semicolon);
-}
-
 if (ps.nparen > 0) {	/* check for unclosed if, for, else. */
 	diag(1, "Unbalanced parentheses");
 	ps.nparen = 0;



CVS commit: src/usr.bin/indent

2023-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 15:36:02 UTC 2023

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

Log Message:
indent: remove code for parsing declarations without semicolon

The statement from the comment that declarations do not need semicolons
is wrong. A possible input that matched this rule is 'void f(void) { int
a }'.


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 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/games/worms

2023-05-12 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri May 12 13:29:41 UTC 2023

Modified Files:
src/games/worms: worms.c

Log Message:
When using -H, make the appearance of the worm head depend upon the body
(more than it did before).


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/games/worms/worms.c

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

Modified files:

Index: src/games/worms/worms.c
diff -u src/games/worms/worms.c:1.30 src/games/worms/worms.c:1.31
--- src/games/worms/worms.c:1.30	Wed Apr 26 22:58:09 2023
+++ src/games/worms/worms.c	Fri May 12 13:29:41 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: worms.c,v 1.30 2023/04/26 22:58:09 kre Exp $	*/
+/*	$NetBSD: worms.c,v 1.31 2023/05/12 13:29:41 kre Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)worms.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: worms.c,v 1.30 2023/04/26 22:58:09 kre Exp $");
+__RCSID("$NetBSD: worms.c,v 1.31 2023/05/12 13:29:41 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -173,6 +173,11 @@ static const char	flavor[] = {
 	'+', 'x', ':', '^', '_', '&', '@', 'w'
 };
 static const int flavors = __arraycount(flavor);
+static const char	eyeball[] = {
+	'0', 'X', '@', 'S', 'X', '@', 'O', '=',
+	'#', '*', '=', 'v', 'L', '@', 'o', 'm'
+};
+__CTASSERT(sizeof(flavor) == sizeof(eyeball));
 
 static const short	xinc[] = {
 	1,  1,  1,  0, -1, -1, -1,  0
@@ -182,7 +187,7 @@ static const short	xinc[] = {
 static struct	worm {
 	int orientation, head, len;
 	short *xpos, *ypos;
-	chtype ch, attr;
+	chtype ch, eye, attr;
 } *worm;
 
 static volatile sig_atomic_t sig_caught;
@@ -447,6 +452,7 @@ main(int argc, char *argv[])
 		w->attr = nc ? ctab[n % nc] : 0;
 		i = (nc && number > flavors ? n / nc : n) % flavors;
 		w->ch = flavor[i];
+		w->eye = eyeball[i];
 
 		if (!(ip = malloc((size_t)(w->len * sizeof(short)
 			nomem();
@@ -493,7 +499,7 @@ main(int argc, char *argv[])
 sleep(delay / 100);
 		}
 		for (n = 0, w = [0]; n < number; n++, w++) {
-			chtype c = docaput ? (w->ch == '@' ? '0' : '@') : w->ch;
+			chtype c = docaput ? w->eye : w->ch;
 
 			if ((x = w->xpos[h = w->head]) < 0) {
 mvaddch(y = w->ypos[h] = bottom,



CVS commit: src/games/worms

2023-05-12 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri May 12 13:29:41 UTC 2023

Modified Files:
src/games/worms: worms.c

Log Message:
When using -H, make the appearance of the worm head depend upon the body
(more than it did before).


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/games/worms/worms.c

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



CVS commit: src/share/mk

2023-05-12 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri May 12 11:49:47 UTC 2023

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Fix broken conditional


To generate a diff of this commit:
cvs rdiff -u -r1.1317 -r1.1318 src/share/mk/bsd.own.mk

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



CVS commit: src/share/mk

2023-05-12 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri May 12 11:49:47 UTC 2023

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Fix broken conditional


To generate a diff of this commit:
cvs rdiff -u -r1.1317 -r1.1318 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1317 src/share/mk/bsd.own.mk:1.1318
--- src/share/mk/bsd.own.mk:1.1317	Fri May 12 11:27:48 2023
+++ src/share/mk/bsd.own.mk	Fri May 12 11:49:47 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1317 2023/05/12 11:27:48 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1318 2023/05/12 11:49:47 ryoon Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -133,7 +133,7 @@ EXTERNAL_GDB_SUBDIR=		/does/not/exist
 #
 .if ${MACHINE} == "amd64" || \
 ${MACHINE_ARCH:Maarch64*} || \
-${MACHINE_ARCH} == "sparc64" \\
+${MACHINE_ARCH} == "sparc64" || \
 ${MACHINE} == "vax"
 HAVE_OPENSSL?=	30
 .else



CVS commit: src/share/mk

2023-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 12 11:27:48 UTC 2023

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
switch vax to OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.1316 -r1.1317 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1316 src/share/mk/bsd.own.mk:1.1317
--- src/share/mk/bsd.own.mk:1.1316	Thu May 11 13:57:14 2023
+++ src/share/mk/bsd.own.mk	Fri May 12 07:27:48 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1316 2023/05/11 17:57:14 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1317 2023/05/12 11:27:48 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -133,7 +133,8 @@ EXTERNAL_GDB_SUBDIR=		/does/not/exist
 #
 .if ${MACHINE} == "amd64" || \
 ${MACHINE_ARCH:Maarch64*} || \
-${MACHINE_ARCH} == "sparc64"
+${MACHINE_ARCH} == "sparc64" \\
+${MACHINE} == "vax"
 HAVE_OPENSSL?=	30
 .else
 HAVE_OPENSSL?=  11



CVS commit: src/share/mk

2023-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 12 11:27:48 UTC 2023

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
switch vax to OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.1316 -r1.1317 src/share/mk/bsd.own.mk

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-05-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 12 11:13:09 UTC 2023

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

Log Message:
distrib/sets/lists: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.1316 -r1.1317 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.2427 -r1.2428 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/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1316 src/distrib/sets/lists/base/mi:1.1317
--- src/distrib/sets/lists/base/mi:1.1316	Wed May 10 15:52:07 2023
+++ src/distrib/sets/lists/base/mi	Fri May 12 11:13:09 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1316 2023/05/10 15:52:07 christos Exp $
+# $NetBSD: mi,v 1.1317 2023/05/12 11:13:09 riastradh Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -1210,9 +1210,9 @@
 ./usr/lib/lua/5.4base-sys-usr		compatfile
 ./usr/lib/named	base-sys-usr
 ./usr/lib/npf	base-obsolete		obsolete
-./usr/lib/opensslbase-crypto-usr		
-./usr/lib/openssl/engines			base-crypto-usr		
-./usr/lib/openssl/modules			base-crypto-usr		
+./usr/lib/opensslbase-crypto-usr
+./usr/lib/openssl/engines			base-crypto-usr
+./usr/lib/openssl/modules			base-crypto-usr
 ./usr/lib/openssl/modules/legacy.so		base-crypto-usr		pic,openssl=30
 ./usr/lib/postfixbase-postfix-usr
 ./usr/lib/runemodulebase-obsolete		obsolete

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2427 src/distrib/sets/lists/comp/mi:1.2428
--- src/distrib/sets/lists/comp/mi:1.2427	Wed May 10 15:52:07 2023
+++ src/distrib/sets/lists/comp/mi	Fri May 12 11:13:09 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2427 2023/05/10 15:52:07 christos Exp $
+#	$NetBSD: mi,v 1.2428 2023/05/12 11:13:09 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -2922,20 +2922,20 @@
 ./usr/include/openpgpsdk/version.h		comp-obsolete		obsolete
 ./usr/include/openpgpsdk/writer.h		comp-obsolete		obsolete
 ./usr/include/openpgpsdk/writer_armoured.h	comp-obsolete		obsolete
-./usr/include/openssl/aes.h			comp-c-include	
-./usr/include/openssl/asn1.h			comp-c-include	
-./usr/include/openssl/asn1_mac.h		comp-c-include	
-./usr/include/openssl/asn1err.h			comp-c-include	
-./usr/include/openssl/asn1t.h			comp-c-include	
-./usr/include/openssl/async.h			comp-c-include	
-./usr/include/openssl/asyncerr.h		comp-c-include	
+./usr/include/openssl/aes.h			comp-c-include
+./usr/include/openssl/asn1.h			comp-c-include
+./usr/include/openssl/asn1_mac.h		comp-c-include
+./usr/include/openssl/asn1err.h			comp-c-include
+./usr/include/openssl/asn1t.h			comp-c-include
+./usr/include/openssl/async.h			comp-c-include
+./usr/include/openssl/asyncerr.h		comp-c-include
 ./usr/include/openssl/bio.h			comp-c-include
-./usr/include/openssl/bioerr.h			comp-c-include	
+./usr/include/openssl/bioerr.h			comp-c-include
 ./usr/include/openssl/blowfish.h		comp-c-include
 ./usr/include/openssl/bn.h			comp-c-include
-./usr/include/openssl/bnerr.h			comp-c-include	
+./usr/include/openssl/bnerr.h			comp-c-include
 ./usr/include/openssl/buffer.h			comp-c-include
-./usr/include/openssl/buffererr.h		comp-c-include	
+./usr/include/openssl/buffererr.h		comp-c-include
 ./usr/include/openssl/camellia.h		comp-c-include
 ./usr/include/openssl/cast.h			comp-c-include
 ./usr/include/openssl/cmac.h			comp-c-include
@@ -2943,12 +2943,12 @@
 ./usr/include/openssl/cmp_util.h		comp-c-include		openssl=30
 ./usr/include/openssl/cmperr.h			comp-c-include		openssl=30
 ./usr/include/openssl/cms.h			comp-c-include
-./usr/include/openssl/cmserr.h			comp-c-include	
+./usr/include/openssl/cmserr.h			comp-c-include
 ./usr/include/openssl/comp.h			comp-c-include
-./usr/include/openssl/comperr.h			comp-c-include	
+./usr/include/openssl/comperr.h			comp-c-include
 ./usr/include/openssl/conf.h			comp-c-include
 ./usr/include/openssl/conf_api.h		comp-c-include
-./usr/include/openssl/conferr.h			comp-c-include	
+./usr/include/openssl/conferr.h			comp-c-include
 ./usr/include/openssl/configuration.h		comp-c-include		openssl=30
 ./usr/include/openssl/conftypes.h		comp-c-include		openssl=30
 ./usr/include/openssl/core.h			comp-c-include		openssl=30
@@ -2958,17 +2958,17 @@
 ./usr/include/openssl/crmf.h			comp-c-include		openssl=30
 ./usr/include/openssl/crmferr.h			comp-c-include		openssl=30
 ./usr/include/openssl/crypto.h			comp-c-include
-./usr/include/openssl/cryptoerr.h		comp-c-include	
+./usr/include/openssl/cryptoerr.h		comp-c-include
 ./usr/include/openssl/cryptoerr_legacy.h	comp-c-include		openssl=30
-./usr/include/openssl/ct.h			comp-c-include	
-./usr/include/openssl/cterr.h			comp-c-include	
+./usr/include/openssl/ct.h			comp-c-include

CVS commit: src/distrib/sets/lists

2023-05-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 12 11:13:09 UTC 2023

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

Log Message:
distrib/sets/lists: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.1316 -r1.1317 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.2427 -r1.2428 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/usr.bin/indent

2023-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 11:01:11 UTC 2023

Modified Files:
src/usr.bin/indent: indent.1

Log Message:
indent: sync manual page with recent changes


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/indent/indent.1

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-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 11:01:11 UTC 2023

Modified Files:
src/usr.bin/indent: indent.1

Log Message:
indent: sync manual page with recent changes


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/indent/indent.1

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/indent.1
diff -u src/usr.bin/indent/indent.1:1.30 src/usr.bin/indent/indent.1:1.31
--- src/usr.bin/indent/indent.1:1.30	Sun Sep 26 21:31:57 2021
+++ src/usr.bin/indent/indent.1	Fri May 12 11:01:11 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: indent.1,v 1.30 2021/09/26 21:31:57 rillig Exp $
+.\"	$NetBSD: indent.1,v 1.31 2023/05/12 11:01:11 rillig Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"	@(#)indent.1	8.1 (Berkeley) 7/1/93
 .\" $FreeBSD: head/usr.bin/indent/indent.1 334944 2018-06-11 05:35:57Z pstef $
 .\"
-.Dd September 26, 2021
+.Dd May 12, 2023
 .Dt INDENT 1
 .Os
 .Sh NAME
@@ -491,8 +491,7 @@ turns on `verbose' mode;
 turns it off.
 When in verbose mode,
 .Nm
-reports when it splits one line of input into two or more lines of output,
-and gives some size statistics at completion.
+reports when it splits one line of input into two or more lines of output.
 The default is
 .Fl \ .
 .It Fl -version
@@ -554,10 +553,6 @@ automatically extended in extreme cases.
 In general,
 .Nm
 leaves preprocessor lines alone.
-The only
-reformatting that it will do is to straighten up trailing comments.
-It
-leaves embedded comments alone.
 Conditional compilation
 .Pq Ic #ifdef...#endif
 is recognized and



CVS commit: src

2023-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 10:53:33 UTC 2023

Modified Files:
src/tests/usr.bin/indent: opt_v.c t_misc.sh
src/usr.bin/indent: indent.c indent.h io.c pr_comment.c

Log Message:
indent: remove statistics

The numbers from the statistics were wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/indent/opt_v.c
cvs rdiff -u -r1.21 -r1.22 src/tests/usr.bin/indent/t_misc.sh
cvs rdiff -u -r1.253 -r1.254 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.120 -r1.121 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.154 -r1.155 src/usr.bin/indent/io.c
cvs rdiff -u -r1.129 -r1.130 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/tests/usr.bin/indent/opt_v.c
diff -u src/tests/usr.bin/indent/opt_v.c:1.11 src/tests/usr.bin/indent/opt_v.c:1.12
--- src/tests/usr.bin/indent/opt_v.c:1.11	Thu May 11 19:01:35 2023
+++ src/tests/usr.bin/indent/opt_v.c	Fri May 12 10:53:33 2023
@@ -1,16 +1,20 @@
-/* $NetBSD: opt_v.c,v 1.11 2023/05/11 19:01:35 rillig Exp $ */
+/* $NetBSD: opt_v.c,v 1.12 2023/05/12 10:53:33 rillig Exp $ */
 
 /*
  * Tests for the options '-v' and '-nv'.
  *
  * The option '-v' enables verbose mode. It outputs some information about
- * what's going on under the hood, especially when lines are broken. It also
- * outputs a few statistics about line counts and comments at the end.
+ * what's going on under the hood, especially when lines are broken.
  *
  * The option '-nv' disables verbose mode. Only errors and warnings are output
  * in this mode, but no progress messages.
  */
 
+/*
+ * XXX: It's rather strange that -v writes to stdout, even in filter mode.
+ * This output belongs on stderr instead.
+ */
+
 //indent input
 /*
  * A block comment.
@@ -41,8 +45,6 @@ example(void)
 #define macro1 /* prefix */ suffix
 
 #define macro2 prefix /* suffix */
-There were 12 output lines and 1 comments
-(Lines with comments)/(Lines with code):  0.429
 //indent end
 
 
@@ -67,34 +69,9 @@ example(void)
 //indent end
 
 
-//indent input
-/* Demonstrates line number counting in verbose mode. */
-
-int *function(void)
-{
-}
-//indent end
-
-//indent run -v
-/* Demonstrates line number counting in verbose mode. */
-
-int *
-function(void)
-{
-}
-There were 6 output lines and 1 comments
-(Lines with comments)/(Lines with code):  0.250
-//indent end
-/* In the above output, the '5' means 5 non-empty lines. */
-
 /*
- * XXX: It's rather strange that -v writes to stdout, even in filter mode.
- * This output belongs on stderr instead.
- */
-
-
-/*
- * Test line counting in preprocessor directives.
+ * Before 2023-05-12, indent wrote some wrong statistics to stdout, in which
+ * the line numbers were counted wrong.
  */
 //indent input
 #if 0
@@ -106,18 +83,4 @@ int line = 5;
 #endif
 //indent end
 
-//indent run -v -di0
-#if 0
-int line = 1;
-int line = 2;
-int line = 3;
-#else
-int line = 5;
-#endif
-There were 3 output lines and 0 comments
-(Lines with comments)/(Lines with code):  0.000
-//indent end
-/*
- * FIXME: The lines within the conditional compilation directives must be
- * counted as well. TODO: Move stats out of parser_state.
- */
+//indent run-equals-input -v -di0

Index: src/tests/usr.bin/indent/t_misc.sh
diff -u src/tests/usr.bin/indent/t_misc.sh:1.21 src/tests/usr.bin/indent/t_misc.sh:1.22
--- src/tests/usr.bin/indent/t_misc.sh:1.21	Thu May 11 09:28:53 2023
+++ src/tests/usr.bin/indent/t_misc.sh	Fri May 12 10:53:33 2023
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: t_misc.sh,v 1.21 2023/05/11 09:28:53 rillig Exp $
+# $NetBSD: t_misc.sh,v 1.22 2023/05/12 10:53:33 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -86,8 +86,6 @@ verbose_profile_body()
 		profile: -bacc
 		profile: -v
 		profile: -fc1
-		There were 1 output lines and 0 comments
-		(Lines with comments)/(Lines with code):  0.000
 	EOF
 
 	# The code in args.c function set_profile suggests that options from

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.253 src/usr.bin/indent/indent.c:1.254
--- src/usr.bin/indent/indent.c:1.253	Fri May 12 08:40:54 2023
+++ src/usr.bin/indent/indent.c	Fri May 12 10:53:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.253 2023/05/12 08:40:54 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.254 2023/05/12 10:53:33 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.253 2023/05/12 08:40:54 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.254 2023/05/12 10:53:33 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -389,13 +389,6 @@ process_eof(void)
 if (ps.tos > 1)		/* check for balanced braces */
 	diag(1, "Stuff missing from end 

CVS commit: src

2023-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 10:53:33 UTC 2023

Modified Files:
src/tests/usr.bin/indent: opt_v.c t_misc.sh
src/usr.bin/indent: indent.c indent.h io.c pr_comment.c

Log Message:
indent: remove statistics

The numbers from the statistics were wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/indent/opt_v.c
cvs rdiff -u -r1.21 -r1.22 src/tests/usr.bin/indent/t_misc.sh
cvs rdiff -u -r1.253 -r1.254 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.120 -r1.121 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.154 -r1.155 src/usr.bin/indent/io.c
cvs rdiff -u -r1.129 -r1.130 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/sys/external/bsd/drm2/dist/drm/i915/gem

2023-05-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 12 10:13:37 UTC 2023

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_busy.c

Log Message:
i915: Avoid dereferencing null fence if resv has changed.

PR kern/57402

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_busy.c

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



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gem

2023-05-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 12 10:13:37 UTC 2023

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_busy.c

Log Message:
i915: Avoid dereferencing null fence if resv has changed.

PR kern/57402

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_busy.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/external/bsd/drm2/dist/drm/i915/gem/i915_gem_busy.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_busy.c:1.3 src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_busy.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_busy.c:1.3	Sun Dec 19 11:20:25 2021
+++ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_busy.c	Fri May 12 10:13:37 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_gem_busy.c,v 1.3 2021/12/19 11:20:25 riastradh Exp $	*/
+/*	$NetBSD: i915_gem_busy.c,v 1.4 2023/05/12 10:13:37 riastradh Exp $	*/
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_busy.c,v 1.3 2021/12/19 11:20:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_busy.c,v 1.4 2023/05/12 10:13:37 riastradh Exp $");
 
 #include "gt/intel_engine.h"
 
@@ -130,6 +130,8 @@ retry:
 			struct dma_fence *fence =
 rcu_dereference(list->shared[i]);
 
+			if (read_seqcount_retry(>base.resv->seq, seq))
+goto retry;
 			args->busy |= busy_check_reader(fence);
 		}
 	}



CVS commit: src/usr.bin/indent

2023-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 08:40:54 UTC 2023

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c parse.c

Log Message:
indent: condense code for handling spaced expressions

No functional change outside debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.119 -r1.120 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.175 -r1.176 src/usr.bin/indent/lexi.c
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/indent/parse.c

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

Modified files:

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.252 src/usr.bin/indent/indent.c:1.253
--- src/usr.bin/indent/indent.c:1.252	Thu May 11 19:01:35 2023
+++ src/usr.bin/indent/indent.c	Fri May 12 08:40:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.252 2023/05/11 19:01:35 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.253 2023/05/12 08:40:54 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.252 2023/05/11 19:01:35 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.253 2023/05/12 08:40:54 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -492,7 +492,8 @@ process_lparen_or_lbracket(void)
 debug_println("paren_indents[%d] is now %d",
 	ps.nparen - 1, ps.paren[ps.nparen - 1].indent);
 
-if (ps.spaced_expr && ps.nparen == 1 && opt.extra_expr_indent
+if (ps.spaced_expr_psym != psym_semicolon
+	&& ps.nparen == 1 && opt.extra_expr_indent
 	&& ps.paren[0].indent < 2 * opt.indent_size) {
 	ps.paren[0].indent = (short)(2 * opt.indent_size);
 	debug_println("paren_indents[0] is now %d", ps.paren[0].indent);
@@ -534,14 +535,12 @@ process_rparen_or_rbracket(void)
 
 *code.e++ = token.s[0];
 
-if (ps.spaced_expr && ps.nparen == 0) {
-	ps.spaced_expr = false;
+if (ps.spaced_expr_psym != psym_semicolon && ps.nparen == 0) {
 	ps.force_nl = true;
 	ps.next_unary = true;
-	ps.in_stmt_or_decl = false;	/* don't use stmt continuation
-	 * indentation */
-
-	parse_stmt_head(ps.hd);
+	ps.in_stmt_or_decl = false;
+	parse(ps.spaced_expr_psym);
+	ps.spaced_expr_psym = psym_semicolon;
 }
 }
 
@@ -652,24 +651,23 @@ process_semicolon(void)
 	 * structure declaration before, we
 	 * aren't anymore */
 
-if ((!ps.spaced_expr || ps.hd != hd_for) && ps.nparen > 0) {
-
+if (ps.nparen > 0 && ps.spaced_expr_psym != psym_for_exprs) {
 	/*
 	 * There were unbalanced parentheses in the statement. It is a bit
 	 * complicated, because the semicolon might be in a for statement.
 	 */
 	diag(1, "Unbalanced parentheses");
 	ps.nparen = 0;
-	if (ps.spaced_expr) {
-	ps.spaced_expr = false;
-	parse_stmt_head(ps.hd);
+	if (ps.spaced_expr_psym != psym_semicolon) {
+	parse(ps.spaced_expr_psym);
+	ps.spaced_expr_psym = psym_semicolon;
 	}
 }
 *code.e++ = ';';
 ps.want_blank = true;
 ps.in_stmt_or_decl = ps.nparen > 0;
 
-if (!ps.spaced_expr) {
+if (ps.spaced_expr_psym == psym_semicolon) {
 	parse(psym_semicolon);	/* let parser know about end of stmt */
 	ps.force_nl = true;
 }
@@ -705,9 +703,9 @@ process_lbrace(void)
 if (ps.nparen > 0) {
 	diag(1, "Unbalanced parentheses");
 	ps.nparen = 0;
-	if (ps.spaced_expr) {
-	ps.spaced_expr = false;
-	parse_stmt_head(ps.hd);
+	if (ps.spaced_expr_psym != psym_semicolon) {
+	parse(ps.spaced_expr_psym);
+	ps.spaced_expr_psym = psym_semicolon;
 	ps.ind_level = ps.ind_level_follow;
 	}
 }
@@ -749,7 +747,7 @@ process_rbrace(void)
 if (ps.nparen > 0) {	/* check for unclosed if, for, else. */
 	diag(1, "Unbalanced parentheses");
 	ps.nparen = 0;
-	ps.spaced_expr = false;
+	ps.spaced_expr_psym = psym_semicolon;
 }
 
 ps.just_saw_decl = 0;
@@ -863,12 +861,12 @@ process_ident(lexer_symbol lsym)
 	ps.want_blank = false;
 	}
 
-} else if (ps.spaced_expr && ps.nparen == 0) {
-	ps.spaced_expr = false;
+} else if (ps.spaced_expr_psym != psym_semicolon && ps.nparen == 0) {
 	ps.force_nl = true;
 	ps.next_unary = true;
 	ps.in_stmt_or_decl = false;
-	parse_stmt_head(ps.hd);
+	parse(ps.spaced_expr_psym);
+	ps.spaced_expr_psym = psym_semicolon;
 }
 }
 
@@ -1102,23 +1100,19 @@ main_loop(void)
 	break;
 
 	case lsym_switch:
-	ps.spaced_expr = true;
-	ps.hd = hd_switch;
+	ps.spaced_expr_psym = psym_switch_expr;
 	goto copy_token;
 
 	case lsym_for:
-	ps.spaced_expr = true;
-	ps.hd = hd_for;
+	ps.spaced_expr_psym = psym_for_exprs;
 	goto copy_token;
 
 	case lsym_if:
-	ps.spaced_expr = true;
-	ps.hd = hd_if;
+	ps.spaced_expr_psym = psym_if_expr;
 	goto copy_token;
 
 	case lsym_while:
-	ps.spaced_expr = true;
-	ps.hd = 

CVS commit: src/usr.bin/indent

2023-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 12 08:40:54 UTC 2023

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c parse.c

Log Message:
indent: condense code for handling spaced expressions

No functional change outside debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.119 -r1.120 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.175 -r1.176 src/usr.bin/indent/lexi.c
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/indent/parse.c

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