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: misc cleanup



details:   https://anonhg.NetBSD.org/src/rev/3a4e44bc8d47
branches:  trunk
changeset: 1023772:3a4e44bc8d47
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Sep 25 22:57:04 2021 +0000

description:
indent: misc cleanup

No functional change.

diffstat:

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

diffs (112 lines):

diff -r 32e2f309414a -r 3a4e44bc8d47 usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c   Sat Sep 25 22:54:32 2021 +0000
+++ b/usr.bin/indent/indent.c   Sat Sep 25 22:57:04 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.c,v 1.83 2021/09/25 22:54:32 rillig Exp $       */
+/*     $NetBSD: indent.c,v 1.84 2021/09/25 22:57:04 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.83 2021/09/25 22:54:32 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.84 2021/09/25 22:57:04 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -529,7 +529,7 @@
     }
 
     ps.in_stmt = true;         /* turn on flag which causes an extra level of
-                                * indentation. this is turned off by a ; or
+                                * indentation. this is turned off by a ';' or
                                 * '}' */
     if (com.s != com.e) {      /* the turkey has embedded a comment
                                 * in a line. fix it */
@@ -1210,7 +1210,7 @@
     int squest;                        /* when this is positive, we have seen a '?'
                                 * without the matching ':' in a <c>?<s>:<s>
                                 * construct */
-    bool scase;                        /* set to true when we see a case, so we will
+    bool scase;                        /* set to true when we see a 'case', so we
                                 * know what to do with the following colon */
 
     sp_sw = force_nl = false;
diff -r 32e2f309414a -r 3a4e44bc8d47 usr.bin/indent/indent_globs.h
--- a/usr.bin/indent/indent_globs.h     Sat Sep 25 22:54:32 2021 +0000
+++ b/usr.bin/indent/indent_globs.h     Sat Sep 25 22:57:04 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent_globs.h,v 1.36 2021/09/25 22:54:32 rillig Exp $ */
+/*     $NetBSD: indent_globs.h,v 1.37 2021/09/25 22:57:04 rillig Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -137,7 +137,7 @@
                                 * will be lined up to the open paren */
     bool       proc_calls_space; /* whether procedure calls look like:
                                 * foo (bar) rather than foo(bar) */
-    bool       procnames_start_line; /* whether, the names of procedures
+    bool       procnames_start_line; /* whether the names of procedures
                                 * being defined get placed in column 1 (i.e.
                                 * a newline is placed between the type of
                                 * the procedure and its name) */
@@ -208,11 +208,11 @@
     int         not_cast_mask; /* indicates which close parens definitely
                                 * close off something else than casts */
     bool       block_init;     /* whether inside a block initialization */
-    int         block_init_level;      /* The level of brace nesting in an
-                                        * initialization */
-    bool       last_nl;        /* this is true if the last thing scanned was
+    int         block_init_level; /* The level of brace nesting in an
+                                * initialization */
+    bool       last_nl;        /* whether the last thing scanned was
                                 * a newline */
-    bool       in_or_st;       /* Will be true iff there has been a
+    bool       in_or_st;       /* true iff there has been a
                                 * declarator (e.g. int or char) and no left
                                 * paren since the last semicolon. When true,
                                 * a '{' is starting a structure definition or
@@ -229,7 +229,7 @@
     bool       in_decl;        /* whether we are in a declaration stmt.
                                 * The processing of braces is then slightly
                                 * different */
-    bool       in_stmt;        /* whether in a stmt */
+    bool       in_stmt;
     int         ind_level;     /* the current indentation level */
     bool       ind_stmt;       /* whether the next line should have an extra
                                 * indentation level because we are in the
diff -r 32e2f309414a -r 3a4e44bc8d47 usr.bin/indent/io.c
--- a/usr.bin/indent/io.c       Sat Sep 25 22:54:32 2021 +0000
+++ b/usr.bin/indent/io.c       Sat Sep 25 22:57:04 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: io.c,v 1.65 2021/09/25 22:54:32 rillig Exp $   */
+/*     $NetBSD: io.c,v 1.66 2021/09/25 22:57:04 rillig Exp $   */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,21 +43,19 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: io.c,v 1.65 2021/09/25 22:54:32 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.66 2021/09/25 22:57:04 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
 
 #include <ctype.h>
-#include <err.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
 
 #include "indent.h"
 
-bool comment_open;
+static bool comment_open;
 static int  paren_indent;
 
 static void



Home | Main Index | Thread Index | Old Index