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: align comments in indent's own code



details:   https://anonhg.NetBSD.org/src/rev/fe41c22b118b
branches:  trunk
changeset: 960275:fe41c22b118b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Mar 13 18:24:56 2021 +0000

description:
indent: align comments in indent's own code

No functional change.

diffstat:

 usr.bin/indent/io.c |  22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diffs (57 lines):

diff -r 4a0e1f096528 -r fe41c22b118b usr.bin/indent/io.c
--- a/usr.bin/indent/io.c       Sat Mar 13 18:11:31 2021 +0000
+++ b/usr.bin/indent/io.c       Sat Mar 13 18:24:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: io.c,v 1.45 2021/03/13 13:55:42 rillig Exp $   */
+/*     $NetBSD: io.c,v 1.46 2021/03/13 18:24:56 rillig Exp $   */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -46,7 +46,7 @@
 #include <sys/cdefs.h>
 #ifndef lint
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: io.c,v 1.45 2021/03/13 13:55:42 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.46 2021/03/13 18:24:56 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -223,7 +223,7 @@
 
            target_col += ps.comment_delta;
            while (*com_st == '\t')     /* consider original indentation in
-                                    * case this is a box comment */
+                                * case this is a box comment */
                com_st++, target_col += opt.tabsize;
            while (target_col <= 0)
                if (*com_st == ' ')
@@ -234,7 +234,7 @@
                } else
                    target_col = 1;
            if (cur_col > target_col) { /* if comment can't fit on this line,
-                                    * put it on next line */
+                                * put it on next line */
                output_char('\n');
                cur_col = 1;
                ++ps.out_lines;
@@ -263,14 +263,12 @@
     if (e_com - s_com > 1 && s_com[1] == '/')
        output_range(s_token, e_token);
 
-    ps.decl_on_line = ps.in_decl;      /* if we are in the middle of a
-                                        * declaration, remember that fact for
-                                        * proper comment indentation */
-    ps.ind_stmt = ps.in_stmt & ~ps.in_decl;    /* next line should be
-                                                * indented if we have not
-                                                * completed this stmt and if
-                                                * we are not in the middle of
-                                                * a declaration */
+    ps.decl_on_line = ps.in_decl; /* if we are in the middle of a declaration,
+                                * remember that fact for proper comment
+                                * indentation */
+    ps.ind_stmt = ps.in_stmt & ~ps.in_decl; /* next line should be indented if
+                                * we have not completed this stmt and if we
+                                * are not in the middle of a declaration */
     ps.use_ff = false;
     ps.dumped_decl_indent = 0;
     *(e_lab = s_lab) = '\0';   /* reset buffers */



Home | Main Index | Thread Index | Old Index