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: reduce binary size



details:   https://anonhg.NetBSD.org/src/rev/0a6d69f88138
branches:  trunk
changeset: 1023765:0a6d69f88138
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Sep 25 21:20:59 2021 +0000

description:
indent: reduce binary size

No functional change.

diffstat:

 usr.bin/indent/args.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r b83415912610 -r 0a6d69f88138 usr.bin/indent/args.c
--- a/usr.bin/indent/args.c     Sat Sep 25 21:18:22 2021 +0000
+++ b/usr.bin/indent/args.c     Sat Sep 25 21:20:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: args.c,v 1.27 2021/09/25 18:49:03 rillig Exp $ */
+/*     $NetBSD: args.c,v 1.28 2021/09/25 21:20:59 rillig Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: args.c,v 1.27 2021/09/25 18:49:03 rillig Exp $");
+__RCSID("$NetBSD: args.c,v 1.28 2021/09/25 21:20:59 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/args.c 336318 2018-07-15 21:04:21Z pstef $");
 #endif
@@ -106,7 +106,7 @@
  * must be first.
  */
 const struct pro {
-    const char *p_name;                /* name, e.g. -bl, -cli */
+    const char  p_name[9];     /* name, e.g. "bl", "cli" */
     int         p_type;                /* type (int, bool, special) */
     int         p_special;     /* depends on type */
     void        *p_obj;                /* the associated variable */
@@ -182,7 +182,7 @@
     bool_option("ut", ON, opt.use_tabs),
     bool_option("v", ON, opt.verbose),
     /* whew! */
-    {0, 0, 0, 0}
+    {"", 0, 0, 0}
 };
 
 /*
@@ -262,7 +262,7 @@
     const char *param_start;
 
     arg++;                     /* ignore leading "-" */
-    for (p = pro; p->p_name != NULL; p++)
+    for (p = pro; p->p_name[0] != '\0'; p++)
        if (*p->p_name == *arg && (param_start = eqin(p->p_name, arg)) != NULL)
            goto found;
     errx(1, "%s: unknown parameter \"%s\"", option_source, arg - 1);



Home | Main Index | Thread Index | Old Index