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 ps.ind_stmt to in_stmt_cont



details:   https://anonhg.NetBSD.org/src/rev/d00af71b33db
branches:  trunk
changeset: 1026443:d00af71b33db
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Nov 25 07:41:13 2021 +0000

description:
indent: rename ps.ind_stmt to in_stmt_cont

This makes a comment redundant.

No functional change.

diffstat:

 usr.bin/indent/indent.c |  10 +++++-----
 usr.bin/indent/indent.h |   4 ++--
 usr.bin/indent/io.c     |  12 +++++-------
 usr.bin/indent/lexi.c   |   6 +++---
 4 files changed, 15 insertions(+), 17 deletions(-)

diffs (137 lines):

diff -r f9ff54392870 -r d00af71b33db usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c   Thu Nov 25 07:30:54 2021 +0000
+++ b/usr.bin/indent/indent.c   Thu Nov 25 07:41:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.c,v 1.229 2021/11/25 07:30:54 rillig Exp $      */
+/*     $NetBSD: indent.c,v 1.230 2021/11/25 07:41:13 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.229 2021/11/25 07:30:54 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.230 2021/11/25 07:41:13 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -917,7 +917,7 @@
     }
 
     if (code.s == code.e)
-       ps.ind_stmt = false;    /* don't indent the '{' itself */
+       ps.in_stmt_cont = false;        /* don't indent the '{' itself */
     if (ps.in_decl && ps.init_or_struct) {
        di_stack[ps.decl_level] = *decl_ind;
        if (++ps.decl_level == di_stack_cap) {
@@ -970,7 +970,7 @@
     *code.e++ = '}';
     ps.want_blank = true;
     ps.in_stmt = false;
-    ps.ind_stmt = false;
+    ps.in_stmt_cont = false;
 
     if (ps.decl_level > 0) { /* we are in multi-level structure declaration */
        *decl_ind = di_stack[--ps.decl_level];
@@ -1041,7 +1041,7 @@
     if (ps.in_parameter_declaration && opt.indent_parameters &&
            ps.decl_level == 0) {
        ps.ind_level = ps.ind_level_follow = 1;
-       ps.ind_stmt = false;
+       ps.in_stmt_cont = false;
     }
 
     ps.init_or_struct = /* maybe */ true;
diff -r f9ff54392870 -r d00af71b33db usr.bin/indent/indent.h
--- a/usr.bin/indent/indent.h   Thu Nov 25 07:30:54 2021 +0000
+++ b/usr.bin/indent/indent.h   Thu Nov 25 07:41:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.h,v 1.98 2021/11/19 20:23:17 rillig Exp $       */
+/*     $NetBSD: indent.h,v 1.99 2021/11/25 07:41:13 rillig Exp $       */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -316,7 +316,7 @@
     bool in_stmt;              /* TODO: rename to something appropriate; this
                                 * is set to true in struct declarations as
                                 * well, so 'stmt' isn't accurate */
-    bool ind_stmt;             /* whether the next line should have an extra
+    bool in_stmt_cont;         /* whether the next line should have an extra
                                 * indentation level because we are in the
                                 * middle of a statement */
     bool is_case_label;                /* 'case' and 'default' labels are indented
diff -r f9ff54392870 -r d00af71b33db usr.bin/indent/io.c
--- a/usr.bin/indent/io.c       Thu Nov 25 07:30:54 2021 +0000
+++ b/usr.bin/indent/io.c       Thu Nov 25 07:41:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: io.c,v 1.129 2021/11/19 20:23:17 rillig Exp $  */
+/*     $NetBSD: io.c,v 1.130 2021/11/25 07:41:13 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.129 2021/11/19 20:23:17 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.130 2021/11/25 07:41:13 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -471,9 +471,7 @@
            output_char('\n');
 
        if (ps.ind_level == 0)
-           ps.ind_stmt = false;        /* this is a class A kludge. don't do
-                                        * additional statement indentation if
-                                        * we are at bracket level 0 */
+           ps.in_stmt_cont = false;    /* this is a class A kludge */
 
        if (lab.e != lab.s || code.e != code.s)
            ps.stats.code_lines++;
@@ -498,7 +496,7 @@
     }
 
     ps.decl_on_line = ps.in_decl;      /* for proper comment indentation */
-    ps.ind_stmt = ps.in_stmt && !ps.in_decl;
+    ps.in_stmt_cont = ps.in_stmt && !ps.in_decl;
     ps.decl_indent_done = false;
 
     *(lab.e = lab.s) = '\0';   /* reset buffers */
@@ -553,7 +551,7 @@
     int base_ind = ps.ind_level * opt.indent_size;
 
     if (ps.paren_level == 0) {
-       if (ps.ind_stmt)
+       if (ps.in_stmt_cont)
            return base_ind + opt.continuation_indent;
        return base_ind;
     }
diff -r f9ff54392870 -r d00af71b33db usr.bin/indent/lexi.c
--- a/usr.bin/indent/lexi.c     Thu Nov 25 07:30:54 2021 +0000
+++ b/usr.bin/indent/lexi.c     Thu Nov 25 07:41:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lexi.c,v 1.150 2021/11/20 09:59:53 rillig Exp $        */
+/*     $NetBSD: lexi.c,v 1.151 2021/11/25 07:41:13 rillig Exp $        */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.150 2021/11/20 09:59:53 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.151 2021/11/25 07:41:13 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -305,7 +305,7 @@
     debug_ps_bool(decl_indent_done);
 
     debug_ps_bool(in_stmt);
-    debug_ps_bool(ind_stmt);
+    debug_ps_bool(in_stmt_cont);
     debug_ps_bool(is_case_label);
 
     debug_ps_bool(search_stmt);



Home | Main Index | Thread Index | Old Index