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: format own source code



details:   https://anonhg.NetBSD.org/src/rev/5d2e31b81724
branches:  trunk
changeset: 376233:5d2e31b81724
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jun 05 12:05:01 2023 +0000

description:
indent: format own source code

diffstat:

 usr.bin/indent/indent.c |   8 ++++----
 usr.bin/indent/indent.h |  22 +++++++++++-----------
 2 files changed, 15 insertions(+), 15 deletions(-)

diffs (86 lines):

diff -r f39ddaaa8fd5 -r 5d2e31b81724 usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c   Mon Jun 05 12:01:33 2023 +0000
+++ b/usr.bin/indent/indent.c   Mon Jun 05 12:05:01 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.c,v 1.334 2023/06/05 12:01:33 rillig Exp $      */
+/*     $NetBSD: indent.c,v 1.335 2023/06/05 12:05:01 rillig Exp $      */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: indent.c,v 1.334 2023/06/05 12:01:33 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.335 2023/06/05 12:05:01 rillig Exp $");
 
 #include <sys/param.h>
 #include <err.h>
@@ -413,7 +413,7 @@ process_newline(void)
        if (ps.prev_lsym == lsym_comma
            && ps.nparen == 0 && !ps.block_init
            && !opt.break_after_comma && ps.break_after_comma
-           && lab.len == 0 /* for preprocessing lines */
+           && lab.len == 0     /* for preprocessing lines */
            && com.len == 0)
                goto stay_in_line;
        if (ps.s_sym[ps.tos] == psym_switch_expr && opt.brace_same_line) {
@@ -1167,7 +1167,7 @@ process_lsym(lexer_symbol lsym)
        case lsym_funcname:
        case lsym_return:
                process_ident(lsym);
-       copy_token:
+copy_token:
                if (ps.want_blank)
                        buf_add_char(&code, ' ');
                buf_add_buf(&code, &token);
diff -r f39ddaaa8fd5 -r 5d2e31b81724 usr.bin/indent/indent.h
--- a/usr.bin/indent/indent.h   Mon Jun 05 12:01:33 2023 +0000
+++ b/usr.bin/indent/indent.h   Mon Jun 05 12:05:01 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.h,v 1.173 2023/06/05 10:12:21 rillig Exp $      */
+/*     $NetBSD: indent.h,v 1.174 2023/06/05 12:05:01 rillig Exp $      */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -89,7 +89,7 @@ typedef enum lexer_symbol {
        lsym_colon_other,       /* bit-fields, generic-association (C11),
                                 * enum-type-specifier (C23),
                                 * attribute-prefixed-token (C23),
-                                * pp-prefixed-parameter (C23 6.10)*/
+                                * pp-prefixed-parameter (C23 6.10) */
        lsym_comma,
        lsym_semicolon,
        lsym_typedef,
@@ -320,8 +320,8 @@ extern struct parser_state {
                                 * processing of braces is then slightly
                                 * different */
        bool in_func_def_params;
-       bool seen_case;         /* whether there was a 'case' or 'default',
-                                * to properly space the following ':' */
+       bool seen_case;         /* whether there was a 'case' or 'default', to
+                                * properly space the following ':' */
        parser_symbol spaced_expr_psym; /* the parser symbol to be shifted
                                         * after the parenthesized expression
                                         * from a 'for', 'if', 'switch' or
@@ -374,13 +374,13 @@ extern struct parser_state {
                                 * remaining lines of the statement,
                                 * initializer or declaration */
        enum {
-           dp_start,           /* the beginning of a declaration */
-           dp_word,            /* seen a type name */
-           dp_word_asterisk,   /* seen a type name and some '*' */
-           dp_other,
-       } decl_ptr;             /* detects declarations like 'typename *x',
-                                * to prevent the '*' from being interpreted as
-                                * a binary operator */
+               dp_start,       /* the beginning of a declaration */
+               dp_word,        /* seen a type name */
+               dp_word_asterisk,       /* seen a type name and some '*' */
+               dp_other,
+       } decl_ptr;             /* detects declarations like 'typename *x', to
+                                * prevent the '*' from being interpreted as a
+                                * binary operator */
        paren_level_props paren[20];
 
        /* Horizontal spacing for comments */



Home | Main Index | Thread Index | Old Index