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: consistently use nparen for indexing ...



details:   https://anonhg.NetBSD.org/src/rev/7ff14d01827b
branches:  trunk
changeset: 361537:7ff14d01827b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Feb 13 12:48:12 2022 +0000

description:
indent: consistently use nparen for indexing parser_state.paren

No binary change.

diffstat:

 usr.bin/indent/io.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 9c06a36ca80f -r 7ff14d01827b usr.bin/indent/io.c
--- a/usr.bin/indent/io.c       Sun Feb 13 12:43:26 2022 +0000
+++ b/usr.bin/indent/io.c       Sun Feb 13 12:48:12 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: io.c,v 1.146 2022/02/13 12:43:26 rillig Exp $  */
+/*     $NetBSD: io.c,v 1.147 2022/02/13 12:48:12 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.146 2022/02/13 12:43:26 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.147 2022/02/13 12:48:12 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -573,9 +573,9 @@
     ps.ind_level = ps.ind_level_follow;
     ps.line_start_nparen = ps.nparen;
 
-    if (ps.line_start_nparen > 0) {
+    if (ps.nparen > 0) {
        /* TODO: explain what negative indentation means */
-       paren_indent = -1 - ps.paren[ps.line_start_nparen - 1].indent;
+       paren_indent = -1 - ps.paren[ps.nparen - 1].indent;
        debug_println("paren_indent is now %d", paren_indent);
     }
 



Home | Main Index | Thread Index | Old Index