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: rename n_real_blanklines



details:   https://anonhg.NetBSD.org/src/rev/1a2111329f2c
branches:  trunk
changeset: 988256:1a2111329f2c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Oct 05 18:50:42 2021 +0000

description:
indent: rename n_real_blanklines

The word 'n' was not as helpful as possible, the word 'real' did not
give any clue at all about the variable's purpose.

No functional change.

diffstat:

 usr.bin/indent/indent.c       |   8 ++++----
 usr.bin/indent/indent_globs.h |   4 ++--
 usr.bin/indent/io.c           |  20 ++++++++++----------
 3 files changed, 16 insertions(+), 16 deletions(-)

diffs (110 lines):

diff -r bd63cc763dce -r 1a2111329f2c usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c   Tue Oct 05 18:21:03 2021 +0000
+++ b/usr.bin/indent/indent.c   Tue Oct 05 18:50:42 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.c,v 1.107 2021/10/05 17:14:45 rillig Exp $      */
+/*     $NetBSD: indent.c,v 1.108 2021/10/05 18:50:42 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.107 2021/10/05 17:14:45 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.108 2021/10/05 18:50:42 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -105,7 +105,7 @@
 char *be_save;
 
 bool found_err;
-int n_real_blanklines;
+int next_blank_lines;
 bool prefix_blankline_requested;
 bool postfix_blankline_requested;
 bool break_comma;
@@ -1203,7 +1203,7 @@
     }
     if (opt.blanklines_around_conditional_compilation) {
        postfix_blankline_requested = true;
-       n_real_blanklines = 0;
+       next_blank_lines = 0;
     } else {
        postfix_blankline_requested = false;
        prefix_blankline_requested = false;
diff -r bd63cc763dce -r 1a2111329f2c usr.bin/indent/indent_globs.h
--- a/usr.bin/indent/indent_globs.h     Tue Oct 05 18:21:03 2021 +0000
+++ b/usr.bin/indent/indent_globs.h     Tue Oct 05 18:50:42 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent_globs.h,v 1.41 2021/09/27 16:56:35 rillig Exp $ */
+/*     $NetBSD: indent_globs.h,v 1.42 2021/10/05 18:50:42 rillig Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -173,7 +173,7 @@
 
 
 extern bool        found_err;
-extern int         n_real_blanklines;
+extern int         next_blank_lines;
 extern bool        prefix_blankline_requested;
 extern bool        postfix_blankline_requested;
 extern bool        break_comma;        /* when true and not in parens, break after a
diff -r bd63cc763dce -r 1a2111329f2c usr.bin/indent/io.c
--- a/usr.bin/indent/io.c       Tue Oct 05 18:21:03 2021 +0000
+++ b/usr.bin/indent/io.c       Tue Oct 05 18:50:42 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: io.c,v 1.71 2021/10/05 06:24:06 rillig Exp $   */
+/*     $NetBSD: io.c,v 1.72 2021/10/05 18:50:42 rillig Exp $   */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: io.c,v 1.71 2021/10/05 06:24:06 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.72 2021/10/05 18:50:42 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -122,21 +122,21 @@
        if (suppress_blanklines > 0)
            suppress_blanklines--;
        else
-           n_real_blanklines++;
+           next_blank_lines++;
     } else if (!inhibit_formatting) {
        suppress_blanklines = 0;
        if (prefix_blankline_requested && not_first_line) {
            if (opt.swallow_optional_blanklines) {
-               if (n_real_blanklines == 1)
-                   n_real_blanklines = 0;
+               if (next_blank_lines == 1)
+                   next_blank_lines = 0;
            } else {
-               if (n_real_blanklines == 0)
-                   n_real_blanklines = 1;
+               if (next_blank_lines == 0)
+                   next_blank_lines = 1;
            }
        }
-       while (--n_real_blanklines >= 0)
+       while (--next_blank_lines >= 0)
            output_char('\n');
-       n_real_blanklines = 0;
+       next_blank_lines = 0;
        if (ps.ind_level == 0)
            ps.ind_stmt = false;        /* this is a class A kludge. don't do
                                         * additional statement indentation if
@@ -374,7 +374,7 @@
        dump_line();
 
     if (!(inhibit_formatting = (on_off == 2))) {
-       n_real_blanklines = 0;
+       next_blank_lines = 0;
        postfix_blankline_requested = false;
        prefix_blankline_requested = false;
        suppress_blanklines = 1;



Home | Main Index | Thread Index | Old Index