Module Name:    src
Committed By:   rillig
Date:           Sun Oct 31 19:13:41 UTC 2021

Modified Files:
        src/tests/usr.bin/indent: fmt_decl.c lex_ident.c
        src/usr.bin/indent: lexi.c

Log Message:
indent: remove support for pre-1978 variable initialization


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/lex_ident.c
cvs rdiff -u -r1.122 -r1.123 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/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.10 src/tests/usr.bin/indent/fmt_decl.c:1.11
--- src/tests/usr.bin/indent/fmt_decl.c:1.10	Sun Oct 31 19:08:39 2021
+++ src/tests/usr.bin/indent/fmt_decl.c	Sun Oct 31 19:13:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fmt_decl.c,v 1.10 2021/10/31 19:08:39 rillig Exp $	*/
+/*	$NetBSD: fmt_decl.c,v 1.11 2021/10/31 19:13:41 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /* See FreeBSD r303570 */
@@ -446,8 +446,8 @@ int a - 1;
 #indent end
 
 #indent run -di0
-int a -1;
+int a - 1;
 {
-	int a -1;
+	int a - 1;
 }
 #indent end

Index: src/tests/usr.bin/indent/lex_ident.c
diff -u src/tests/usr.bin/indent/lex_ident.c:1.1 src/tests/usr.bin/indent/lex_ident.c:1.2
--- src/tests/usr.bin/indent/lex_ident.c:1.1	Fri Oct 22 19:27:53 2021
+++ src/tests/usr.bin/indent/lex_ident.c	Sun Oct 31 19:13:41 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_ident.c,v 1.1 2021/10/22 19:27:53 rillig Exp $ */
+/* $NetBSD: lex_ident.c,v 1.2 2021/10/31 19:13:41 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -62,5 +62,5 @@ int identifier\n;
 #indent end
 
 #indent run
-int		identifier \n;
+int		identifier \ n;
 #indent end

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.122 src/usr.bin/indent/lexi.c:1.123
--- src/usr.bin/indent/lexi.c:1.122	Sun Oct 31 17:22:47 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 19:13:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.122 2021/10/31 17:22:47 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.123 2021/10/31 19:13:41 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.122 2021/10/31 17:22:47 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.123 2021/10/31 19:13:41 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -576,10 +576,6 @@ no_function_definition:;
 	return lsym_type;
     }
 
-    if (ps.prev_token == lsym_type)	/* if this is a declared variable,
-					 * then following sign is unary */
-	ps.next_unary = true;	/* will make "int a -1" work */
-
     return lsym_ident;		/* the ident is not in the list */
 }
 

Reply via email to