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: fix spacing around '*' in declarations
details: https://anonhg.NetBSD.org/src/rev/0e7e60a5c1b1
branches: trunk
changeset: 375960:0e7e60a5c1b1
user: rillig <rillig%NetBSD.org@localhost>
date: Tue May 23 06:43:19 2023 +0000
description:
indent: fix spacing around '*' in declarations
diffstat:
tests/usr.bin/indent/fmt_decl.c | 5 ++---
usr.bin/indent/indent.c | 6 ++++--
2 files changed, 6 insertions(+), 5 deletions(-)
diffs (46 lines):
diff -r 09a1963020c1 -r 0e7e60a5c1b1 tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c Tue May 23 06:35:01 2023 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c Tue May 23 06:43:19 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fmt_decl.c,v 1.44 2023/05/23 06:18:00 rillig Exp $ */
+/* $NetBSD: fmt_decl.c,v 1.45 2023/05/23 06:43:19 rillig Exp $ */
/*
* Tests for declarations of global variables, external functions, and local
@@ -1005,8 +1005,7 @@ void
//indent run -ci4 -di0 -ndj -nlp
void
// $ FIXME: Wrong indentation, should be 0 instead.
-// $ FIXME: Wrong spacing around '*'.
- (error_at)(int msgid, const pos_t * pos, ...)
+ (error_at)(int msgid, const pos_t *pos, ...)
{
}
//indent end
diff -r 09a1963020c1 -r 0e7e60a5c1b1 usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c Tue May 23 06:35:01 2023 +0000
+++ b/usr.bin/indent/indent.c Tue May 23 06:43:19 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: indent.c,v 1.305 2023/05/23 06:35:01 rillig Exp $ */
+/* $NetBSD: indent.c,v 1.306 2023/05/23 06:43:19 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: indent.c,v 1.305 2023/05/23 06:35:01 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.306 2023/05/23 06:43:19 rillig Exp $");
#include <sys/param.h>
#include <err.h>
@@ -366,6 +366,8 @@ update_ps_decl_ptr(lexer_symbol lsym)
if (lsym == lsym_lparen_or_lbracket
&& ps.prev_token == lsym_for)
ps.decl_ptr = dp_start;
+ if (lsym == lsym_comma && ps.in_decl)
+ ps.decl_ptr = dp_start;
break;
}
}
Home |
Main Index |
Thread Index |
Old Index