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: unexport add_typedefs_from_file



details:   https://anonhg.NetBSD.org/src/rev/52cebaa4521f
branches:  trunk
changeset: 988650:52cebaa4521f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Oct 08 19:27:20 2021 +0000

description:
indent: unexport add_typedefs_from_file

No functional change.

diffstat:

 usr.bin/indent/args.c |  42 ++++++++++++++++++++----------------------
 1 files changed, 20 insertions(+), 22 deletions(-)

diffs (74 lines):

diff -r aa1653ef0473 -r 52cebaa4521f usr.bin/indent/args.c
--- a/usr.bin/indent/args.c     Fri Oct 08 19:22:19 2021 +0000
+++ b/usr.bin/indent/args.c     Fri Oct 08 19:27:20 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: args.c,v 1.52 2021/10/08 19:03:34 rillig Exp $ */
+/*     $NetBSD: args.c,v 1.53 2021/10/08 19:27:20 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.52 2021/10/08 19:03:34 rillig Exp $");
+__RCSID("$NetBSD: args.c,v 1.53 2021/10/08 19:27:20 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/args.c 336318 2018-07-15 21:04:21Z pstef $");
 #endif
@@ -61,8 +61,6 @@
 
 #define INDENT_VERSION "2.0"
 
-void add_typedefs_from_file(const char *);
-
 #if __STDC_VERSION__ >= 201112L
 #define assert_type(expr, type) _Generic((expr), type : (expr))
 #else
@@ -203,6 +201,24 @@
     return s;
 }
 
+static void
+add_typedefs_from_file(const char *fname)
+{
+    FILE *file;
+    char line[BUFSIZ];
+
+    if ((file = fopen(fname, "r")) == NULL) {
+       fprintf(stderr, "indent: cannot open file %s\n", fname);
+       exit(1);
+    }
+    while ((fgets(line, BUFSIZ, file)) != NULL) {
+       /* Remove trailing whitespace */
+       line[strcspn(line, " \t\n\r")] = '\0';
+       add_typename(line);
+    }
+    (void)fclose(file);
+}
+
 static bool
 set_special_option(const char *arg, const char *option_source)
 {
@@ -285,21 +301,3 @@
        *(int *)p->p_var = atoi(param_start);
     }
 }
-
-void
-add_typedefs_from_file(const char *fname)
-{
-    FILE *file;
-    char line[BUFSIZ];
-
-    if ((file = fopen(fname, "r")) == NULL) {
-       fprintf(stderr, "indent: cannot open file %s\n", fname);
-       exit(1);
-    }
-    while ((fgets(line, BUFSIZ, file)) != NULL) {
-       /* Remove trailing whitespace */
-       line[strcspn(line, " \t\n\r")] = '\0';
-       add_typename(line);
-    }
-    fclose(file);
-}



Home | Main Index | Thread Index | Old Index