Module Name: src Committed By: rillig Date: Sat Nov 20 09:59:53 UTC 2021
Modified Files: src/tests/usr.bin/indent: fmt_decl.c opt_P.c opt_badp.c opt_bl_br.c t_misc.sh token_ident.c src/usr.bin/indent: lexi.c Log Message: indent: clean up lint annotation and tests To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/tests/usr.bin/indent/fmt_decl.c cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/opt_P.c cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/opt_badp.c cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/indent/opt_bl_br.c \ src/tests/usr.bin/indent/token_ident.c cvs rdiff -u -r1.16 -r1.17 src/tests/usr.bin/indent/t_misc.sh cvs rdiff -u -r1.149 -r1.150 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.19 src/tests/usr.bin/indent/fmt_decl.c:1.20 --- src/tests/usr.bin/indent/fmt_decl.c:1.19 Fri Nov 19 22:24:29 2021 +++ src/tests/usr.bin/indent/fmt_decl.c Sat Nov 20 09:59:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: fmt_decl.c,v 1.19 2021/11/19 22:24:29 rillig Exp $ */ +/* $NetBSD: fmt_decl.c,v 1.20 2021/11/20 09:59:53 rillig Exp $ */ /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */ /* @@ -470,11 +470,11 @@ int a - 1; /* - * Between 2019-04-04 and before lexi.c 1.146 from 2021-11-09, the indentation + * Between 2019-04-04 and before lexi.c 1.146 from 2021-11-19, the indentation * of the '*' depended on the function name, which did not make sense. For * function names that matched [A-Za-z]+, the '*' was placed correctly, for * all other function names (containing [$0-9_]) the '*' was right-aligned on - * declaration indentation, which defaults to 16. + * the declaration indentation, which defaults to 16. */ #indent input int * Index: src/tests/usr.bin/indent/opt_P.c diff -u src/tests/usr.bin/indent/opt_P.c:1.2 src/tests/usr.bin/indent/opt_P.c:1.3 --- src/tests/usr.bin/indent/opt_P.c:1.2 Fri Nov 19 22:24:29 2021 +++ src/tests/usr.bin/indent/opt_P.c Sat Nov 20 09:59:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: opt_P.c,v 1.2 2021/11/19 22:24:29 rillig Exp $ */ +/* $NetBSD: opt_P.c,v 1.3 2021/11/20 09:59:53 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -9,7 +9,7 @@ * arbitrary files, therefore this test is rather restricted. * * See also: - * t_misc for test with custom setup + * t_misc for tests with individual setup */ #indent input Index: src/tests/usr.bin/indent/opt_badp.c diff -u src/tests/usr.bin/indent/opt_badp.c:1.5 src/tests/usr.bin/indent/opt_badp.c:1.6 --- src/tests/usr.bin/indent/opt_badp.c:1.5 Fri Nov 19 22:24:29 2021 +++ src/tests/usr.bin/indent/opt_badp.c Sat Nov 20 09:59:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: opt_badp.c,v 1.5 2021/11/19 22:24:29 rillig Exp $ */ +/* $NetBSD: opt_badp.c,v 1.6 2021/11/20 09:59:53 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -10,7 +10,7 @@ #indent input void -empty_body(void) +empty(void) { } #indent end @@ -21,7 +21,7 @@ empty_body(void) #indent input void -empty_line(void) +blank(void) { } @@ -33,7 +33,7 @@ empty_line(void) #indent input void -only_declaration(void) +declaration(void) { int decl; } @@ -45,7 +45,7 @@ only_declaration(void) #indent input void -only_statement(void) +statement(void) { stmt(); } @@ -53,7 +53,7 @@ only_statement(void) #indent run -badp void -only_statement(void) +statement(void) { stmt(); @@ -64,7 +64,7 @@ only_statement(void) #indent input void -declaration_and_statement(void) +declaration_statement(void) { int decl; stmt(); @@ -73,7 +73,7 @@ declaration_and_statement(void) #indent run -badp void -declaration_and_statement(void) +declaration_statement(void) { int decl; /* $ FIXME: missing empty line */ Index: src/tests/usr.bin/indent/opt_bl_br.c diff -u src/tests/usr.bin/indent/opt_bl_br.c:1.3 src/tests/usr.bin/indent/opt_bl_br.c:1.4 --- src/tests/usr.bin/indent/opt_bl_br.c:1.3 Fri Nov 19 22:24:29 2021 +++ src/tests/usr.bin/indent/opt_bl_br.c Sat Nov 20 09:59:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: opt_bl_br.c,v 1.3 2021/11/19 22:24:29 rillig Exp $ */ +/* $NetBSD: opt_bl_br.c,v 1.4 2021/11/20 09:59:53 rillig Exp $ */ /* $FreeBSD$ */ #indent input @@ -13,8 +13,8 @@ example(int n) #indent end /* - * XXX: The '} else' looks strange in this style since the 'else' is - * not at the left margin of the code. + * XXX: The '} else' looks strange in this style since the '}' is not on a + * line of its own. */ #indent run -bl void @@ -109,7 +109,8 @@ function(void) /* - * + * The combination of the options '-br' and '-ei' (both active by default) + * remove extra newlines between the tokens '}', 'else' and 'if'. */ #indent input void Index: src/tests/usr.bin/indent/token_ident.c diff -u src/tests/usr.bin/indent/token_ident.c:1.3 src/tests/usr.bin/indent/token_ident.c:1.4 --- src/tests/usr.bin/indent/token_ident.c:1.3 Sun Nov 7 20:16:50 2021 +++ src/tests/usr.bin/indent/token_ident.c Sat Nov 20 09:59:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: token_ident.c,v 1.3 2021/11/07 20:16:50 rillig Exp $ */ +/* $NetBSD: token_ident.c,v 1.4 2021/11/20 09:59:53 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -80,7 +80,7 @@ const char SYS$LOGIN[] = "$HOME"; /* - * Text the tokenizer for number constants. + * Test the tokenizer for number constants. * * When the tokenizer reads a character that makes a token invalid (such as * '0x') but may later be extended to form a valid token (such as '0x123'), Index: src/tests/usr.bin/indent/t_misc.sh diff -u src/tests/usr.bin/indent/t_misc.sh:1.16 src/tests/usr.bin/indent/t_misc.sh:1.17 --- src/tests/usr.bin/indent/t_misc.sh:1.16 Fri Nov 19 22:24:29 2021 +++ src/tests/usr.bin/indent/t_misc.sh Sat Nov 20 09:59:53 2021 @@ -1,5 +1,5 @@ #! /bin/sh -# $NetBSD: t_misc.sh,v 1.16 2021/11/19 22:24:29 rillig Exp $ +# $NetBSD: t_misc.sh,v 1.17 2021/11/20 09:59:53 rillig Exp $ # # Copyright (c) 2021 The NetBSD Foundation, Inc. # All rights reserved. @@ -234,7 +234,7 @@ a type */custom_type /* For int options, trailing garbage would be an error. */ -i3 -/*For float options, trailing garbage would be an error. */ +/* For float options, trailing garbage would be an error. */ -cli3.5 -b/*/acc /* The comment is '/' '*' '/', making the option '-bacc'. */ Index: src/usr.bin/indent/lexi.c diff -u src/usr.bin/indent/lexi.c:1.149 src/usr.bin/indent/lexi.c:1.150 --- src/usr.bin/indent/lexi.c:1.149 Sat Nov 20 09:43:03 2021 +++ src/usr.bin/indent/lexi.c Sat Nov 20 09:59:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lexi.c,v 1.149 2021/11/20 09:43:03 rillig Exp $ */ +/* $NetBSD: lexi.c,v 1.150 2021/11/20 09:59:53 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.149 2021/11/20 09:43:03 rillig Exp $"); +__RCSID("$NetBSD: lexi.c,v 1.150 2021/11/20 09:59:53 rillig Exp $"); #elif defined(__FreeBSD__) __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $"); #endif @@ -314,7 +314,6 @@ debug_lexi(lexer_symbol lsym) } #endif -/* ARGSUSED */ static lexer_symbol lexi_end(lexer_symbol lsym) {