Module Name:    src
Committed By:   rillig
Date:           Tue Oct  5 18:50:42 UTC 2021

Modified Files:
        src/usr.bin/indent: indent.c indent_globs.h io.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/indent/indent_globs.h
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/indent/io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.107 src/usr.bin/indent/indent.c:1.108
--- src/usr.bin/indent/indent.c:1.107	Tue Oct  5 17:14:45 2021
+++ src/usr.bin/indent/indent.c	Tue Oct  5 18:50:42 2021
@@ -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 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #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 *bp_save;
 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 @@ process_preprocessing(void)
     }
     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;

Index: src/usr.bin/indent/indent_globs.h
diff -u src/usr.bin/indent/indent_globs.h:1.41 src/usr.bin/indent/indent_globs.h:1.42
--- src/usr.bin/indent/indent_globs.h:1.41	Mon Sep 27 16:56:35 2021
+++ src/usr.bin/indent/indent_globs.h	Tue Oct  5 18:50:42 2021
@@ -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 @@ enum keyword_kind {
 
 
 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

Index: src/usr.bin/indent/io.c
diff -u src/usr.bin/indent/io.c:1.71 src/usr.bin/indent/io.c:1.72
--- src/usr.bin/indent/io.c:1.71	Tue Oct  5 06:24:06 2021
+++ src/usr.bin/indent/io.c	Tue Oct  5 18:50:42 2021
@@ -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 @@ static char sccsid[] = "@(#)io.c	8.1 (Be
 
 #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 @@ dump_line(void)
 	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 @@ parse_indent_comment(void)
 	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;

Reply via email to