Module Name: src Committed By: rillig Date: Thu Sep 30 21:48:12 UTC 2021
Modified Files: src/tests/usr.bin/indent: declarations.0.stdout parens.0.stdout token-lparen.0.stdout src/usr.bin/indent: indent.c Log Message: indent: remove space between ')' and '(' in declarations To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/indent/declarations.0.stdout cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/parens.0.stdout cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/indent/token-lparen.0.stdout cvs rdiff -u -r1.95 -r1.96 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/declarations.0.stdout diff -u src/tests/usr.bin/indent/declarations.0.stdout:1.4 src/tests/usr.bin/indent/declarations.0.stdout:1.5 --- src/tests/usr.bin/indent/declarations.0.stdout:1.4 Sun Sep 26 18:52:16 2021 +++ src/tests/usr.bin/indent/declarations.0.stdout Thu Sep 30 21:48:12 2021 @@ -1,8 +1,8 @@ -/* $NetBSD: declarations.0.stdout,v 1.4 2021/09/26 18:52:16 rillig Exp $ */ +/* $NetBSD: declarations.0.stdout,v 1.5 2021/09/30 21:48:12 rillig Exp $ */ /* $FreeBSD: head/usr.bin/indent/tests/declarations.0.stdout 334480 2018-06-01 09:58:44Z pstef $ */ /* See r303570 */ -typedef void (*voidptr) (int *); +typedef void (*voidptr)(int *); static const struct { double x; @@ -23,7 +23,7 @@ typedef struct Complex { void t1(char *a, int b, - void (*fn) (void)) + void (*fn)(void)) { } @@ -33,7 +33,7 @@ t2(char *x, int y) int a, b, c; int *d, *e, *f; - int (*g) (), (*h) (), (*i) (); + int (*g)(), (*h)(), (*i)(); int j, k, l; int m ,n Index: src/tests/usr.bin/indent/parens.0.stdout diff -u src/tests/usr.bin/indent/parens.0.stdout:1.1 src/tests/usr.bin/indent/parens.0.stdout:1.2 --- src/tests/usr.bin/indent/parens.0.stdout:1.1 Thu Apr 4 15:27:35 2019 +++ src/tests/usr.bin/indent/parens.0.stdout Thu Sep 30 21:48:12 2021 @@ -1,12 +1,12 @@ -/* $NetBSD: parens.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */ +/* $NetBSD: parens.0.stdout,v 1.2 2021/09/30 21:48:12 rillig Exp $ */ /* $FreeBSD: head/usr.bin/indent/tests/parens.0.stdout 334583 2018-06-03 19:05:20Z pstef $ */ -typedef void (*xxxxxxxxxxx) (int, - char); +typedef void (*xxxxxxxxxxx)(int, + char); -typedef char (*xxxxxxxxxxxxxxxxxxxxxxxxxxxx) (int *, - unsigned *, - char, - float *); +typedef char (*xxxxxxxxxxxxxxxxxxxxxxxxxxxx)(int *, + unsigned *, + char, + float *); void test(void) Index: src/tests/usr.bin/indent/token-lparen.0.stdout diff -u src/tests/usr.bin/indent/token-lparen.0.stdout:1.3 src/tests/usr.bin/indent/token-lparen.0.stdout:1.4 --- src/tests/usr.bin/indent/token-lparen.0.stdout:1.3 Thu Sep 30 20:58:26 2021 +++ src/tests/usr.bin/indent/token-lparen.0.stdout Thu Sep 30 21:48:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: token-lparen.0.stdout,v 1.3 2021/09/30 20:58:26 rillig Exp $ */ +/* $NetBSD: token-lparen.0.stdout,v 1.4 2021/09/30 21:48:12 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -18,8 +18,7 @@ /* This is the maximum supported number of parentheses. */ int zero = (((((((((((((((((((0))))))))))))))))))); -/* $ XXX: The space between the parentheses is unusual. */ -void (*action) (void); +void (*action)(void); #define macro(arg) ((arg) + 1) Index: src/usr.bin/indent/indent.c diff -u src/usr.bin/indent/indent.c:1.95 src/usr.bin/indent/indent.c:1.96 --- src/usr.bin/indent/indent.c:1.95 Thu Sep 30 21:38:43 2021 +++ src/usr.bin/indent/indent.c Thu Sep 30 21:48:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: indent.c,v 1.95 2021/09/30 21:38:43 rillig Exp $ */ +/* $NetBSD: indent.c,v 1.96 2021/09/30 21:48:12 rillig Exp $ */ /*- * SPDX-License-Identifier: BSD-4-Clause @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c 5.1 #include <sys/cdefs.h> #if defined(__NetBSD__) -__RCSID("$NetBSD: indent.c,v 1.95 2021/09/30 21:38:43 rillig Exp $"); +__RCSID("$NetBSD: indent.c,v 1.96 2021/09/30 21:48:12 rillig Exp $"); #elif defined(__FreeBSD__) __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $"); #endif @@ -598,6 +598,8 @@ want_blank_before_lparen(void) { if (!ps.want_blank) return false; + if (ps.last_token == rparen) + return false; if (ps.last_token != ident && ps.last_token != funcname) return true; if (opt.proc_calls_space)