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: fix wrong or outdated comments



details:   https://anonhg.NetBSD.org/src/rev/00be88e3c82b
branches:  trunk
changeset: 1024019:00be88e3c82b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Oct 07 21:41:59 2021 +0000

description:
indent: fix wrong or outdated comments

No functional change.

diffstat:

 usr.bin/indent/args.c         |   9 +++------
 usr.bin/indent/indent.c       |  14 ++++++--------
 usr.bin/indent/indent_globs.h |   4 ++--
 usr.bin/indent/lexi.c         |  10 +++++-----
 4 files changed, 16 insertions(+), 21 deletions(-)

diffs (145 lines):

diff -r 3939ff42c5fb -r 00be88e3c82b usr.bin/indent/args.c
--- a/usr.bin/indent/args.c     Thu Oct 07 21:38:25 2021 +0000
+++ b/usr.bin/indent/args.c     Thu Oct 07 21:41:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: args.c,v 1.49 2021/10/07 19:42:41 rillig Exp $ */
+/*     $NetBSD: args.c,v 1.50 2021/10/07 21:41:59 rillig Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,15 +43,12 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: args.c,v 1.49 2021/10/07 19:42:41 rillig Exp $");
+__RCSID("$NetBSD: args.c,v 1.50 2021/10/07 21:41:59 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/args.c 336318 2018-07-15 21:04:21Z pstef $");
 #endif
 
-/*
- * Argument scanning and profile reading code.  Default parameters are set
- * here as well.
- */
+/* Read options from profile files and from the command line. */
 
 #include <ctype.h>
 #include <err.h>
diff -r 3939ff42c5fb -r 00be88e3c82b usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c   Thu Oct 07 21:38:25 2021 +0000
+++ b/usr.bin/indent/indent.c   Thu Oct 07 21:41:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.c,v 1.116 2021/10/07 21:38:25 rillig Exp $      */
+/*     $NetBSD: indent.c,v 1.117 2021/10/07 21:41:59 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.116 2021/10/07 21:38:25 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.117 2021/10/07 21:41:59 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -204,8 +204,7 @@
 {
     /*
      * Put KNF-style lbraces before the buffered up tokens and jump out of
-     * this loop in order to avoid copying the token again under the default
-     * case of the switch below.
+     * this loop in order to avoid copying the token again.
      */
     if (sc_end != NULL && opt.btype_2) {
        save_com[0] = '{';
@@ -254,15 +253,14 @@
            sc_end--;
        }
     }
-    if (*force_nl) {   /* if we should insert a nl here, put it into
+    if (*force_nl) {           /* if we should insert a nl here, put it into
                                 * the buffer */
        *force_nl = false;
        --line_no;              /* this will be re-increased when the newline
                                 * is read from the buffer */
        *sc_end++ = '\n';
        *sc_end++ = ' ';
-       if (opt.verbose)        /* print error msg if the line was not already
-                                * broken */
+       if (opt.verbose)        /* warn if the line was not already broken */
            diag(0, "Line broken");
     }
     for (const char *t_ptr = token.s; *t_ptr != '\0'; ++t_ptr)
@@ -1359,7 +1357,7 @@
            goto copy_token;
 
        case funcname:
-       case ident:             /* got an identifier or constant */
+       case ident:             /* an identifier, constant or string */
            process_ident(ttype, decl_ind, tabs_to_var, &sp_sw, &force_nl,
                hd_type);
     copy_token:
diff -r 3939ff42c5fb -r 00be88e3c82b usr.bin/indent/indent_globs.h
--- a/usr.bin/indent/indent_globs.h     Thu Oct 07 21:38:25 2021 +0000
+++ b/usr.bin/indent/indent_globs.h     Thu Oct 07 21:41:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent_globs.h,v 1.43 2021/10/07 19:35:50 rillig Exp $ */
+/*     $NetBSD: indent_globs.h,v 1.44 2021/10/07 21:41:59 rillig Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -188,7 +188,7 @@
 
 extern struct parser_state {
     token_type  last_token;
-    token_type p_stack[STACKSIZE];     /* this is the parsers stack */
+    token_type p_stack[STACKSIZE];     /* this is the parser's stack */
     int         il[STACKSIZE]; /* this stack stores indentation levels */
     float       cstk[STACKSIZE];/* used to store case stmt indentation levels */
     bool       box_com;        /* whether we are in a "boxed" comment. In
diff -r 3939ff42c5fb -r 00be88e3c82b usr.bin/indent/lexi.c
--- a/usr.bin/indent/lexi.c     Thu Oct 07 21:38:25 2021 +0000
+++ b/usr.bin/indent/lexi.c     Thu Oct 07 21:41:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lexi.c,v 1.73 2021/10/07 18:32:09 rillig Exp $ */
+/*     $NetBSD: lexi.c,v 1.74 2021/10/07 21:41:59 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.73 2021/10/07 18:32:09 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.74 2021/10/07 21:41:59 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -275,7 +275,7 @@
        if (num_lex_state[row][s - 'A'] == ' ') {
            /*-
             * num_lex_state[0][s - 'A'] now indicates the type:
-            * f = floating, ch = integer, u = unknown
+            * f = floating, i = integer, u = unknown
             */
            break;
        }
@@ -484,7 +484,7 @@
                                         * then following sign is unary */
            state->last_u_d = true;     /* will make "int a -1" work */
        return lexi_end(ident); /* the ident is not in the list */
-    }                          /* end of procesing for alpanum character */
+    }                          /* end of processing for alphanum character */
 
     /* Scan a non-alphanumeric token */
 
@@ -550,7 +550,7 @@
 
     case '\f':
        unary_delim = state->last_u_d;
-       state->last_nl = true;  /* remember this so we can set 'state->col_1'
+       state->last_nl = true;  /* remember this, so we can set 'state->col_1'
                                 * right */
        ttype = form_feed;
        break;



Home | Main Index | Thread Index | Old Index