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: improve names of option variables



details:   https://anonhg.NetBSD.org/src/rev/9a058d1b347e
branches:  trunk
changeset: 374825:9a058d1b347e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat May 13 13:48:54 2023 +0000

description:
indent: improve names of option variables

No functional change.

diffstat:

 usr.bin/indent/args.c   |  8 ++++----
 usr.bin/indent/indent.h |  8 ++++----
 usr.bin/indent/io.c     |  7 +++----
 3 files changed, 11 insertions(+), 12 deletions(-)

diffs (84 lines):

diff -r 1df7cf61766b -r 9a058d1b347e usr.bin/indent/args.c
--- a/usr.bin/indent/args.c     Sat May 13 13:45:24 2023 +0000
+++ b/usr.bin/indent/args.c     Sat May 13 13:48:54 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: args.c,v 1.74 2023/05/13 06:36:33 rillig Exp $ */
+/*     $NetBSD: args.c,v 1.75 2023/05/13 13:48:54 rillig Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)args.c    8.1 (
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: args.c,v 1.74 2023/05/13 06:36:33 rillig Exp $");
+__RCSID("$NetBSD: args.c,v 1.75 2023/05/13 13:48:54 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/args.c 336318 2018-07-15 21:04:21Z pstef $");
 #endif
@@ -82,8 +82,8 @@ static const struct pro {
     void *p_var;               /* the associated variable */
 } pro[] = {
     bool_options("bacc", blanklines_around_conditional_compilation),
-    bool_options("bad", blanklines_after_decl),
-    bool_options("badp", blanklines_after_decl_at_top),
+    bool_options("bad", blank_line_after_decl),
+    bool_options("badp", blank_line_after_decl_at_top),
     bool_options("bap", blanklines_after_procs),
     bool_options("bbb", blanklines_before_block_comments),
     bool_options("bc", break_after_comma),
diff -r 1df7cf61766b -r 9a058d1b347e usr.bin/indent/indent.h
--- a/usr.bin/indent/indent.h   Sat May 13 13:45:24 2023 +0000
+++ b/usr.bin/indent/indent.h   Sat May 13 13:48:54 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.h,v 1.125 2023/05/13 12:31:02 rillig Exp $      */
+/*     $NetBSD: indent.h,v 1.126 2023/05/13 13:48:54 rillig Exp $      */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -151,14 +151,14 @@ extern struct buffer com; /* the trailin
 
 extern struct options {
     bool blanklines_around_conditional_compilation;
-    bool blanklines_after_decl_at_top; /* this is vaguely similar to
-                                        * blanklines_after_decl except that
+    bool blank_line_after_decl_at_top; /* this is vaguely similar to
+                                        * blank_line_after_decl except that
                                         * it only applies to the first set of
                                         * declarations in a procedure (just
                                         * after the first '{') and it causes
                                         * a blank line to be generated even
                                         * if there are no declarations */
-    bool blanklines_after_decl;
+    bool blank_line_after_decl;
     bool blanklines_after_procs;
     bool blanklines_before_block_comments;
     bool break_after_comma;    /* whether to break declarations after commas */
diff -r 1df7cf61766b -r 9a058d1b347e usr.bin/indent/io.c
--- a/usr.bin/indent/io.c       Sat May 13 13:45:24 2023 +0000
+++ b/usr.bin/indent/io.c       Sat May 13 13:48:54 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: io.c,v 1.157 2023/05/13 12:31:02 rillig Exp $  */
+/*     $NetBSD: io.c,v 1.158 2023/05/13 13:48:54 rillig Exp $  */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)io.c      8.1 (Be
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: io.c,v 1.157 2023/05/13 12:31:02 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.158 2023/05/13 13:48:54 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -302,8 +302,7 @@ output_complete_line(char line_terminato
 
        output_char(line_terminator);
 
-       /* TODO: rename to blank_line_after_decl */
-       if (ps.just_saw_decl == 1 && opt.blanklines_after_decl)
+       if (ps.just_saw_decl == 1 && opt.blank_line_after_decl)
            ps.just_saw_decl = 0;
     }
 



Home | Main Index | Thread Index | Old Index