Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/indent indent: remove space between ')' and '(' in d...
details: https://anonhg.NetBSD.org/src/rev/ac2a23c75eb2
branches: trunk
changeset: 1023899:ac2a23c75eb2
user: rillig <rillig%NetBSD.org@localhost>
date: Thu Sep 30 21:48:12 2021 +0000
description:
indent: remove space between ')' and '(' in declarations
diffstat:
tests/usr.bin/indent/declarations.0.stdout | 8 ++++----
tests/usr.bin/indent/parens.0.stdout | 14 +++++++-------
tests/usr.bin/indent/token-lparen.0.stdout | 5 ++---
usr.bin/indent/indent.c | 6 ++++--
4 files changed, 17 insertions(+), 16 deletions(-)
diffs (101 lines):
diff -r 4777c5f4077a -r ac2a23c75eb2 tests/usr.bin/indent/declarations.0.stdout
--- a/tests/usr.bin/indent/declarations.0.stdout Thu Sep 30 21:38:43 2021 +0000
+++ b/tests/usr.bin/indent/declarations.0.stdout Thu Sep 30 21:48:12 2021 +0000
@@ -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 @@
void
t1(char *a, int b,
- void (*fn) (void))
+ void (*fn)(void))
{
}
@@ -33,7 +33,7 @@
int a, b, c;
int
*d, *e, *f;
- int (*g) (), (*h) (), (*i) ();
+ int (*g)(), (*h)(), (*i)();
int j, k, l;
int m
,n
diff -r 4777c5f4077a -r ac2a23c75eb2 tests/usr.bin/indent/parens.0.stdout
--- a/tests/usr.bin/indent/parens.0.stdout Thu Sep 30 21:38:43 2021 +0000
+++ b/tests/usr.bin/indent/parens.0.stdout Thu Sep 30 21:48:12 2021 +0000
@@ -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)
diff -r 4777c5f4077a -r ac2a23c75eb2 tests/usr.bin/indent/token-lparen.0.stdout
--- a/tests/usr.bin/indent/token-lparen.0.stdout Thu Sep 30 21:38:43 2021 +0000
+++ b/tests/usr.bin/indent/token-lparen.0.stdout Thu Sep 30 21:48:12 2021 +0000
@@ -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)
diff -r 4777c5f4077a -r ac2a23c75eb2 usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c Thu Sep 30 21:38:43 2021 +0000
+++ b/usr.bin/indent/indent.c Thu Sep 30 21:48:12 2021 +0000
@@ -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 @@
#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 @@
{
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)
Home |
Main Index |
Thread Index |
Old Index