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: inline macro label_offset



details:   https://anonhg.NetBSD.org/src/rev/f41909026187
branches:  trunk
changeset: 990571:f41909026187
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 30 11:49:38 2021 +0000

description:
indent: inline macro label_offset

No functional change.

diffstat:

 usr.bin/indent/indent.h |  4 +---
 usr.bin/indent/io.c     |  6 +++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diffs (45 lines):

diff -r 37bc37a55a21 -r f41909026187 usr.bin/indent/indent.h
--- a/usr.bin/indent/indent.h   Sat Oct 30 11:43:17 2021 +0000
+++ b/usr.bin/indent/indent.h   Sat Oct 30 11:49:38 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.h,v 1.63 2021/10/29 21:56:36 rillig Exp $       */
+/*     $NetBSD: indent.h,v 1.64 2021/10/30 11:49:38 rillig Exp $       */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -131,8 +131,6 @@
 } stmt_head;
 
 #define sc_size 5000           /* size of save_com buffer */
-#define label_offset 2         /* number of levels a label is placed to left
-                                * of code */
 
 
 /* A range of characters, in some cases null-terminated. */
diff -r 37bc37a55a21 -r f41909026187 usr.bin/indent/io.c
--- a/usr.bin/indent/io.c       Sat Oct 30 11:43:17 2021 +0000
+++ b/usr.bin/indent/io.c       Sat Oct 30 11:49:38 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: io.c,v 1.107 2021/10/29 20:27:42 rillig Exp $  */
+/*     $NetBSD: io.c,v 1.108 2021/10/30 11:49:38 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.107 2021/10/29 20:27:42 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.108 2021/10/30 11:49:38 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -340,7 +340,7 @@
        return (int)(case_ind * (float)opt.indent_size);
     if (lab.s[0] == '#')
        return 0;
-    return opt.indent_size * (ps.ind_level - label_offset);
+    return opt.indent_size * (ps.ind_level - 2);
 }
 
 static void



Home | Main Index | Thread Index | Old Index