Module Name: src
Committed By: kamil
Date: Thu Apr 4 15:27:35 UTC 2019
Added Files:
src/tests/usr.bin/indent: Makefile binary.0 binary.0.stdout comments.0
comments.0.pro comments.0.stdout cs.0 cs.0.pro cs.0.stdout
declarations.0 declarations.0.stdout elsecomment.0
elsecomment.0.pro elsecomment.0.stdout f_decls.0 f_decls.0.stdout
float.0 float.0.stdout label.0 label.0.pro label.0.stdout
list_head.0 list_head.0.stdout ncs.0 ncs.0.pro ncs.0.stdout
offsetof.0 offsetof.0.stdout parens.0 parens.0.pro parens.0.stdout
pcs.0 pcs.0.pro pcs.0.stdout struct.0 struct.0.stdout surplusbad.0
surplusbad.0.pro surplusbad.0.stdout t_indent.sh types_from_file.0
types_from_file.0.list types_from_file.0.pro
types_from_file.0.stdout wchar.0 wchar.0.stdout
src/usr.bin/indent: indent.h
Log Message:
Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot
into our local copy.
FreeBSD actively maintains this program in their sources and their
repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute
minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names.
- Added option -P for loading user-provided files as profiles
- Added -tsn for setting tabsize
- Rename -nsac/-sac ("space after cast") to -ncs/-cs
- Added option -fbs Enables (disables) splitting the function declaration and
opening brace across two lines.
- Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1)
- Group global option variables into an options structure
- Use bsearch() for looking up type keywords.
- Don't produce unneeded space character in function declarators
- Don't unnecessarily add a blank before a comment ends.
- Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework.
All tests pass.
Upgrade prepared by Manikishan Ghantasala.
Final polishing by myself.
Part II, checkin new files.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/Makefile \
src/tests/usr.bin/indent/binary.0 \
src/tests/usr.bin/indent/binary.0.stdout \
src/tests/usr.bin/indent/comments.0 \
src/tests/usr.bin/indent/comments.0.pro \
src/tests/usr.bin/indent/comments.0.stdout src/tests/usr.bin/indent/cs.0 \
src/tests/usr.bin/indent/cs.0.pro src/tests/usr.bin/indent/cs.0.stdout \
src/tests/usr.bin/indent/declarations.0 \
src/tests/usr.bin/indent/declarations.0.stdout \
src/tests/usr.bin/indent/elsecomment.0 \
src/tests/usr.bin/indent/elsecomment.0.pro \
src/tests/usr.bin/indent/elsecomment.0.stdout \
src/tests/usr.bin/indent/f_decls.0 \
src/tests/usr.bin/indent/f_decls.0.stdout \
src/tests/usr.bin/indent/float.0 src/tests/usr.bin/indent/float.0.stdout \
src/tests/usr.bin/indent/label.0 src/tests/usr.bin/indent/label.0.pro \
src/tests/usr.bin/indent/label.0.stdout \
src/tests/usr.bin/indent/list_head.0 \
src/tests/usr.bin/indent/list_head.0.stdout \
src/tests/usr.bin/indent/ncs.0 src/tests/usr.bin/indent/ncs.0.pro \
src/tests/usr.bin/indent/ncs.0.stdout src/tests/usr.bin/indent/offsetof.0 \
src/tests/usr.bin/indent/offsetof.0.stdout \
src/tests/usr.bin/indent/parens.0 src/tests/usr.bin/indent/parens.0.pro \
src/tests/usr.bin/indent/parens.0.stdout src/tests/usr.bin/indent/pcs.0 \
src/tests/usr.bin/indent/pcs.0.pro src/tests/usr.bin/indent/pcs.0.stdout \
src/tests/usr.bin/indent/struct.0 \
src/tests/usr.bin/indent/struct.0.stdout \
src/tests/usr.bin/indent/surplusbad.0 \
src/tests/usr.bin/indent/surplusbad.0.pro \
src/tests/usr.bin/indent/surplusbad.0.stdout \
src/tests/usr.bin/indent/t_indent.sh \
src/tests/usr.bin/indent/types_from_file.0 \
src/tests/usr.bin/indent/types_from_file.0.list \
src/tests/usr.bin/indent/types_from_file.0.pro \
src/tests/usr.bin/indent/types_from_file.0.stdout \
src/tests/usr.bin/indent/wchar.0 src/tests/usr.bin/indent/wchar.0.stdout
cvs rdiff -u -r0 -r1.1 src/usr.bin/indent/indent.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: src/tests/usr.bin/indent/Makefile
diff -u /dev/null src/tests/usr.bin/indent/Makefile:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/Makefile Thu Apr 4 15:27:35 2019
@@ -0,0 +1,54 @@
+# $NetBSD: Makefile,v 1.1 2019/04/04 15:27:35 kamil Exp $
+
+.include <bsd.own.mk>
+
+TESTSDIR= ${TESTSBASE}/usr.bin/indent
+TESTS_SH= t_indent
+
+FILESDIR= ${TESTSDIR}
+FILES= binary.0
+FILES+= binary.0.stdout
+FILES+= comments.0
+FILES+= comments.0.pro
+FILES+= comments.0.stdout
+FILES+= declarations.0
+FILES+= declarations.0.stdout
+FILES+= elsecomment.0
+FILES+= elsecomment.0.stdout
+FILES+= elsecomment.0.pro
+FILES+= f_decls.0
+FILES+= f_decls.0.stdout
+FILES+= float.0
+FILES+= float.0.stdout
+FILES+= label.0
+FILES+= label.0.stdout
+FILES+= label.0.pro
+FILES+= list_head.0
+FILES+= list_head.0.stdout
+FILES+= ncs.0
+FILES+= ncs.0.stdout
+FILES+= ncs.0.pro
+FILES+= offsetof.0
+FILES+= offsetof.0.stdout
+FILES+= parens.0
+FILES+= parens.0.stdout
+FILES+= parens.0.pro
+FILES+= pcs.0
+FILES+= pcs.0.stdout
+FILES+= pcs.0.pro
+FILES+= cs.0
+FILES+= cs.0.stdout
+FILES+= cs.0.pro
+FILES+= struct.0
+FILES+= struct.0.stdout
+FILES+= surplusbad.0
+FILES+= surplusbad.0.stdout
+FILES+= surplusbad.0.pro
+FILES+= types_from_file.0
+FILES+= types_from_file.0.stdout
+FILES+= types_from_file.0.list
+FILES+= types_from_file.0.pro
+FILES+= wchar.0
+FILES+= wchar.0.stdout
+
+.include <bsd.test.mk>
Index: src/tests/usr.bin/indent/binary.0
diff -u /dev/null src/tests/usr.bin/indent/binary.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/binary.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,11 @@
+/* $NetBSD: binary.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/binary.0 318471 2017-05-18 17:15:58Z pstef $ */
+#define b00101010 -1
+void t(void) {
+ unsigned a[] = {0b00101010, 0x00005678, 02, 17U};
+ float x[] = {.7f, 0.7f};
+ unsigned long ul[] = {0b00001111UL, 0x01010101UL, 02UL, 17UL};
+
+ if (0 b00101010)
+ return;
+}
Index: src/tests/usr.bin/indent/binary.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/binary.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/binary.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,13 @@
+/* $NetBSD: binary.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/binary.0.stdout 321381 2017-07-23 14:04:45Z pstef $ */
+#define b00101010 -1
+void
+t(void)
+{
+ unsigned a[] = {0b00101010, 0x00005678, 02, 17U};
+ float x[] = {.7f, 0.7f};
+ unsigned long ul[] = {0b00001111UL, 0x01010101UL, 02UL, 17UL};
+
+ if (0 b00101010)
+ return;
+}
Index: src/tests/usr.bin/indent/comments.0
diff -u /dev/null src/tests/usr.bin/indent/comments.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/comments.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,53 @@
+/* $NetBSD: comments.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/comments.0 321383 2017-07-23 15:07:52Z pstef $ */
+typedef enum x {
+ aaaaaaaaaaaaaaaaaaaaaa = 1 << 0, /* test a */
+ bbbbbbbbbbbbbbbbb = 1 << 1, /* test b */
+ cccccccccccccc = 1 << 1, /* test c */
+ dddddddddddddddddddddddddddddd = 1 << 2 /* test d */
+} x;
+
+/* See r303597, r303598, r309219, and r309343 */
+void t(void) {
+ /*
+ * Old indent wrapped the URL near where this sentence ends.
+ *
+ * https://www.freebsd.org/cgi/man.cgi?query=indent&apropos=0&sektion=0&manpath=FreeBSD+12-current&arch=default&format=html
+ */
+
+ /*
+ * Old indent did not wrap to column 78
+ *
+ * aaaaaa bbbbbb cccccc dddddd eeeeee ffffff ggggg hhhhh iiiii jjjj kk
+ */
+
+ /*
+ * Old indent unnecessarily removed the star comment continuation on the next line.
+ *
+ * *test*
+ */
+
+ /* r309219 Go through linked list, freeing from the malloced (t[-1]) address. */
+
+ /* r309343 */
+}
+
+int c(void)
+{
+ if (1) { /*- a christmas tree *
+ ***
+ ***** */
+ /*- another one *
+ ***
+ ***** */
+ 7;
+ }
+
+ if (1) /*- a christmas tree *
+ ***
+ ***** */
+ /*- another one *
+ ***
+ ***** */
+ 1;
+}
Index: src/tests/usr.bin/indent/comments.0.pro
diff -u /dev/null src/tests/usr.bin/indent/comments.0.pro:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/comments.0.pro Thu Apr 4 15:27:35 2019
@@ -0,0 +1,3 @@
+/* $NetBSD: comments.0.pro,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/comments.0.pro 321383 2017-07-23 15:07:52Z pstef $ */
+-bbb
Index: src/tests/usr.bin/indent/comments.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/comments.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/comments.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,61 @@
+/* $NetBSD: comments.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/comments.0.stdout 334563 2018-06-03 15:28:55Z pstef $ */
+typedef enum x {
+ aaaaaaaaaaaaaaaaaaaaaa = 1 << 0, /* test a */
+ bbbbbbbbbbbbbbbbb = 1 << 1, /* test b */
+ cccccccccccccc = 1 << 1, /* test c */
+ dddddddddddddddddddddddddddddd = 1 << 2 /* test d */
+} x;
+
+/* See r303597, r303598, r309219, and r309343 */
+void
+t(void)
+{
+ /*
+ * Old indent wrapped the URL near where this sentence ends.
+ *
+ * https://www.freebsd.org/cgi/man.cgi?query=indent&apropos=0&sektion=0&manpath=FreeBSD+12-current&arch=default&format=html
+ */
+
+ /*
+ * Old indent did not wrap to column 78
+ *
+ * aaaaaa bbbbbb cccccc dddddd eeeeee ffffff ggggg hhhhh iiiii jjjj
+ * kk
+ */
+
+ /*
+ * Old indent unnecessarily removed the star comment continuation on
+ * the next line.
+ *
+ * *test*
+ */
+
+ /*
+ * r309219 Go through linked list, freeing from the malloced (t[-1])
+ * address.
+ */
+
+ /* r309343 */
+}
+
+int
+c(void)
+{
+ if (1) { /*- a christmas tree *
+ ***
+ ***** */
+ /*- another one *
+ ***
+ ***** */
+ 7;
+ }
+
+ if (1) /*- a christmas tree *
+ ***
+ ***** */
+ /*- another one *
+ ***
+ ***** */
+ 1;
+}
Index: src/tests/usr.bin/indent/cs.0
diff -u /dev/null src/tests/usr.bin/indent/cs.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/cs.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,5 @@
+/* $NetBSD: cs.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/cs.0 334944 2018-06-11 05:35:57Z pstef $ */
+void t(void) {
+ int a = (double) 8;
+}
Index: src/tests/usr.bin/indent/cs.0.pro
diff -u /dev/null src/tests/usr.bin/indent/cs.0.pro:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/cs.0.pro Thu Apr 4 15:27:35 2019
@@ -0,0 +1,3 @@
+/* $NetBSD: cs.0.pro,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/cs.0.pro 334944 2018-06-11 05:35:57Z pstef $ */
+-cs
Index: src/tests/usr.bin/indent/cs.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/cs.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/cs.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,7 @@
+/* $NetBSD: cs.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/cs.0.stdout 334944 2018-06-11 05:35:57Z pstef $ */
+void
+t(void)
+{
+ int a = (double) 8;
+}
Index: src/tests/usr.bin/indent/declarations.0
diff -u /dev/null src/tests/usr.bin/indent/declarations.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/declarations.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,80 @@
+/* $NetBSD: declarations.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
+/* See r303570 */
+
+typedef void (*voidptr) (int *);
+
+static const struct
+{
+ double x;
+ double y, z;
+} n[m + 1] =
+{
+ {
+ .0,
+ .9,
+ 5
+ }
+};
+
+typedef struct Complex
+{
+ double x;
+ double y;
+} Complex;
+
+void
+t1 (char *a, int b,
+ void (*fn)(void))
+{}
+
+void t2 (char *x, int y)
+{
+ int a,
+ b,
+ c;
+ int
+ *d,
+ *e,
+ *f;
+ int (*g)(),
+ (*h)(),
+ (*i)();
+ int j,
+ k,
+ l;
+ int m
+ ,n
+ ,o
+ ;
+ int chars[ /* push the comma beyond column 74 .... */ ], x;
+}
+
+const int int_minimum_size =
+MAXALIGN(offsetof(int, test)) + MAXIMUM_ALIGNOF;
+
+int *int_create(void)
+{
+
+}
+
+static
+_attribute_printf(1, 2)
+void
+print_error(const char *fmt,...)
+{
+
+}
+
+static LIST_HEAD(, alq) ald_active;
+static int ald_shutingdown = 0;
+struct thread *ald_thread;
+
+static int
+do_execve(td, args, mac_p)
+ struct thread *td;
+ struct image_args *args;
+ struct mac *mac_p;
+{
+
+}
Index: src/tests/usr.bin/indent/declarations.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/declarations.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/declarations.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,74 @@
+/* $NetBSD: declarations.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/declarations.0.stdout 334480 2018-06-01 09:58:44Z pstef $ */
+/* See r303570 */
+
+typedef void (*voidptr) (int *);
+
+static const struct {
+ double x;
+ double y, z;
+} n[m + 1] =
+{
+ {
+ .0,
+ .9,
+ 5
+ }
+};
+
+typedef struct Complex {
+ double x;
+ double y;
+} Complex;
+
+void
+t1(char *a, int b,
+ void (*fn) (void))
+{
+}
+
+void
+t2(char *x, int y)
+{
+ int a, b, c;
+ int
+ *d, *e, *f;
+ int (*g) (), (*h) (), (*i) ();
+ int j, k, l;
+ int m
+ ,n
+ ,o
+ ;
+ int chars[ /* push the comma beyond column 74 .... */ ],
+ x;
+}
+
+const int int_minimum_size =
+MAXALIGN(offsetof(int, test)) + MAXIMUM_ALIGNOF;
+
+int *
+int_create(void)
+{
+
+}
+
+static
+_attribute_printf(1, 2)
+void
+print_error(const char *fmt,...)
+{
+
+}
+
+static LIST_HEAD(, alq) ald_active;
+static int ald_shutingdown = 0;
+struct thread *ald_thread;
+
+static int
+do_execve(td, args, mac_p)
+ struct thread *td;
+ struct image_args *args;
+ struct mac *mac_p;
+{
+
+}
Index: src/tests/usr.bin/indent/elsecomment.0
diff -u /dev/null src/tests/usr.bin/indent/elsecomment.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/elsecomment.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,43 @@
+/* $NetBSD: elsecomment.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/elsecomment.0.pro 314613 2017-03-03 20:15:22Z ngie $ */
+/* See r303484 and r309342 */
+void t(void) {
+ /* The two if statements below excercise two different code paths. */
+
+ if (1) /* a */ int a; else /* b */ int b;
+
+ if (1) /* a */
+ int a;
+ else /* b */
+ int b;
+
+ if (1) {
+
+ }
+
+
+
+ /* Old indent would remove the 3 blank lines above, awaiting "else". */
+
+ if (1) {
+ int a;
+ }
+
+
+ else if (0) {
+ int b;
+ }
+ /* test */
+ else
+ ;
+
+ if (1)
+ ;
+ else /* Old indent would get very confused here */
+ /* We also mustn't assume that there's only one comment */
+ /* before the left brace. */
+ {
+
+
+ }
+}
Index: src/tests/usr.bin/indent/elsecomment.0.pro
diff -u /dev/null src/tests/usr.bin/indent/elsecomment.0.pro:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/elsecomment.0.pro Thu Apr 4 15:27:35 2019
@@ -0,0 +1,3 @@
+/* $NetBSD: elsecomment.0.pro,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/elsecomment.0.pro 314613 2017-03-03 20:15:22Z ngie $ */
+-bl
Index: src/tests/usr.bin/indent/elsecomment.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/elsecomment.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/elsecomment.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,48 @@
+/* $NetBSD: elsecomment.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/elsecomment.0.stdout 334559 2018-06-03 14:03:20Z pstef $ */
+/* See r303484 and r309342 */
+void
+t(void)
+{
+ /* The two if statements below excercise two different code paths. */
+
+ if (1) /* a */
+ int a;
+ else /* b */
+ int b;
+
+ if (1) /* a */
+ int a;
+ else /* b */
+ int b;
+
+ if (1)
+ {
+
+ }
+
+
+
+ /* Old indent would remove the 3 blank lines above, awaiting "else". */
+
+ if (1)
+ {
+ int a;
+ } else if (0)
+ {
+ int b;
+ }
+ /* test */
+ else
+ ;
+
+ if (1)
+ ;
+ else /* Old indent would get very confused here */
+ /* We also mustn't assume that there's only one comment */
+ /* before the left brace. */
+ {
+
+
+ }
+}
Index: src/tests/usr.bin/indent/f_decls.0
diff -u /dev/null src/tests/usr.bin/indent/f_decls.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/f_decls.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,30 @@
+/* $NetBSD: f_decls.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/f_decls.0 334566 2018-06-03 16:42:58Z pstef $ */
+
+char * x(void)
+{
+ type identifier;
+ type *pointer;
+ unused * value;
+ (void)unused * value;
+
+ dmax = (double)3 * 10.0;
+ dmin = (double)dmax * 10.0;
+ davg = (double)dmax * dmin;
+
+ return NULL;
+}
+
+int *
+y(void) {
+
+}
+
+int
+z(void) {
+
+}
+
+int x;
+int *y;
+int * * * * z;
Index: src/tests/usr.bin/indent/f_decls.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/f_decls.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/f_decls.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,33 @@
+/* $NetBSD: f_decls.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/f_decls.0.stdout 334566 2018-06-03 16:42:58Z pstef $ */
+
+char *
+x(void)
+{
+ type identifier;
+ type *pointer;
+ unused *value;
+ (void)unused * value;
+
+ dmax = (double)3 * 10.0;
+ dmin = (double)dmax * 10.0;
+ davg = (double)dmax * dmin;
+
+ return NULL;
+}
+
+int *
+y(void)
+{
+
+}
+
+int
+z(void)
+{
+
+}
+
+int x;
+int *y;
+int ****z;
Index: src/tests/usr.bin/indent/float.0
diff -u /dev/null src/tests/usr.bin/indent/float.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/float.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,9 @@
+/* $NetBSD: float.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/float.0 337862 2018-08-15 18:19:45Z pstef $ */
+void t(void) {
+ unsigned long x = 314UL;
+ double y[] = {0x1P+9F, 0.3, .1, 1.2f, 0xa.p01f, 3.14f, 2.L};
+ int z = 0b0101;
+ DO_NOTHING;
+ x._y = 5;
+}
Index: src/tests/usr.bin/indent/float.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/float.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/float.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,11 @@
+/* $NetBSD: float.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/float.0.stdout 337862 2018-08-15 18:19:45Z pstef $ */
+void
+t(void)
+{
+ unsigned long x = 314UL;
+ double y[] = {0x1P+9F, 0.3, .1, 1.2f, 0xa.p01f, 3.14f, 2.L};
+ int z = 0b0101;
+ DO_NOTHING;
+ x._y = 5;
+}
Index: src/tests/usr.bin/indent/label.0
diff -u /dev/null src/tests/usr.bin/indent/label.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/label.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,14 @@
+/* $NetBSD: label.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/label.0 313544 2017-02-10 09:31:39Z pstef $ */
+/* See r303489 */
+void t(void) {
+ switch (1)
+ {
+ case 1: /* test */
+ case 2: /* test */
+ }
+CLEANUP:
+ ;
+V: ;
+U: ;
+}
Index: src/tests/usr.bin/indent/label.0.pro
diff -u /dev/null src/tests/usr.bin/indent/label.0.pro:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/label.0.pro Thu Apr 4 15:27:35 2019
@@ -0,0 +1,3 @@
+/* $NetBSD: label.0.pro,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/label.0.pro 314613 2017-03-03 20:15:22Z ngie $ */
+-nut
Index: src/tests/usr.bin/indent/label.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/label.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/label.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,15 @@
+/* $NetBSD: label.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/label.0.stdout 321381 2017-07-23 14:04:45Z pstef $ */
+/* See r303489 */
+void
+t(void)
+{
+ switch (1) {
+ case 1: /* test */
+ case 2: /* test */
+ }
+CLEANUP:
+ ;
+V: ;
+U: ;
+}
Index: src/tests/usr.bin/indent/list_head.0
diff -u /dev/null src/tests/usr.bin/indent/list_head.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/list_head.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,17 @@
+/* $NetBSD: list_head.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/list_head.0 313544 2017-02-10 09:31:39Z pstef $ */
+/* See r309380 */
+static int
+do_execve(td, args, mac_p)
+ struct thread *td;
+ struct image_args *args;
+ struct mac *mac_p;
+{
+
+}
+
+static LIST_HEAD(, alq) ald_active;
+static int ald_shuttingdown = 0;
+struct thread *ald_thread;
+
+
Index: src/tests/usr.bin/indent/list_head.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/list_head.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/list_head.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,15 @@
+/* $NetBSD: list_head.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/list_head.0.stdout 313544 2017-02-10 09:31:39Z pstef $ */
+/* See r309380 */
+static int
+do_execve(td, args, mac_p)
+ struct thread *td;
+ struct image_args *args;
+ struct mac *mac_p;
+{
+
+}
+
+static LIST_HEAD(, alq) ald_active;
+static int ald_shuttingdown = 0;
+struct thread *ald_thread;
Index: src/tests/usr.bin/indent/ncs.0
diff -u /dev/null src/tests/usr.bin/indent/ncs.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/ncs.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,5 @@
+/* $NetBSD: ncs.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/ncs.0 334944 2018-06-11 05:35:57Z pstef $ */
+void t(void) {
+ int a = (double) 8;
+}
Index: src/tests/usr.bin/indent/ncs.0.pro
diff -u /dev/null src/tests/usr.bin/indent/ncs.0.pro:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/ncs.0.pro Thu Apr 4 15:27:35 2019
@@ -0,0 +1,3 @@
+/* $NetBSD: ncs.0.pro,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/ncs.0.pro 334944 2018-06-11 05:35:57Z pstef $ */
+-ncs
Index: src/tests/usr.bin/indent/ncs.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/ncs.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/ncs.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,7 @@
+/* $NetBSD: ncs.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/ncs.0.stdout 334944 2018-06-11 05:35:57Z pstef $ */
+void
+t(void)
+{
+ int a = (double)8;
+}
Index: src/tests/usr.bin/indent/offsetof.0
diff -u /dev/null src/tests/usr.bin/indent/offsetof.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/offsetof.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,6 @@
+/* $NetBSD: offsetof.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/offsetof.0 313544 2017-02-10 09:31:39Z pstef $ */
+/* See r303718 */
+void t(void) {
+ int n = malloc(offsetof(struct s, f) + 1);
+}
Index: src/tests/usr.bin/indent/offsetof.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/offsetof.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/offsetof.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,8 @@
+/* $NetBSD: offsetof.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/offsetof.0.stdout 321381 2017-07-23 14:04:45Z pstef $ */
+/* See r303718 */
+void
+t(void)
+{
+ int n = malloc(offsetof(struct s, f) + 1);
+}
Index: src/tests/usr.bin/indent/parens.0
diff -u /dev/null src/tests/usr.bin/indent/parens.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/parens.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,28 @@
+/* $NetBSD: parens.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/parens.0 334583 2018-06-03 19:05:20Z pstef $ */
+typedef void (*xxxxxxxxxxx) (int,
+ char);
+
+typedef char (*xxxxxxxxxxxxxxxxxxxxxxxxxxxx) (int *,
+ unsigned *,
+ char,
+ float *);
+
+void
+test(void)
+{
+ char chars[secondf(firstf(B),
+ *here)];
+
+ float xxx = yyyyyyyyyyyyyy(zzzzzzzzzzzzz(p1,
+ (p2),
+ p3));
+
+ if (1) {
+ char *xxx = firstf(secondf2(p1,
+ p2));
+ }
+
+ rb->allocfunc(1);
+ rb2.allocfunc(7);
+}
Index: src/tests/usr.bin/indent/parens.0.pro
diff -u /dev/null src/tests/usr.bin/indent/parens.0.pro:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/parens.0.pro Thu Apr 4 15:27:35 2019
@@ -0,0 +1,3 @@
+/* $NetBSD: parens.0.pro,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/parens.0.pro 334583 2018-06-03 19:05:20Z pstef $ */
+-ts4 -i4 -di12 -Tallocfunc
Index: src/tests/usr.bin/indent/parens.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/parens.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/parens.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,28 @@
+/* $NetBSD: parens.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/parens.0.stdout 334583 2018-06-03 19:05:20Z pstef $ */
+typedef void (*xxxxxxxxxxx) (int,
+ char);
+
+typedef char (*xxxxxxxxxxxxxxxxxxxxxxxxxxxx) (int *,
+ unsigned *,
+ char,
+ float *);
+
+void
+test(void)
+{
+ char chars[secondf(firstf(B),
+ *here)];
+
+ float xxx = yyyyyyyyyyyyyy(zzzzzzzzzzzzz(p1,
+ (p2),
+ p3));
+
+ if (1) {
+ char *xxx = firstf(secondf2(p1,
+ p2));
+ }
+
+ rb->allocfunc(1);
+ rb2.allocfunc(7);
+}
Index: src/tests/usr.bin/indent/pcs.0
diff -u /dev/null src/tests/usr.bin/indent/pcs.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/pcs.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,8 @@
+/* $NetBSD: pcs.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/pcs.0 334493 2018-06-01 19:56:41Z pstef $ */
+#include <stdio.h>
+
+int main(void) {
+ puts("Hello");
+ return 0;
+}
Index: src/tests/usr.bin/indent/pcs.0.pro
diff -u /dev/null src/tests/usr.bin/indent/pcs.0.pro:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/pcs.0.pro Thu Apr 4 15:27:35 2019
@@ -0,0 +1,3 @@
+/* $NetBSD: pcs.0.pro,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/pcs.0.pro 334493 2018-06-01 19:56:41Z pstef $ */
+-pcs
Index: src/tests/usr.bin/indent/pcs.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/pcs.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/pcs.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,10 @@
+/* $NetBSD: pcs.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/pcs.0.stdout 334493 2018-06-01 19:56:41Z pstef $ */
+#include <stdio.h>
+
+int
+main(void)
+{
+ puts ("Hello");
+ return 0;
+}
Index: src/tests/usr.bin/indent/struct.0
diff -u /dev/null src/tests/usr.bin/indent/struct.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/struct.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,22 @@
+/* $NetBSD: struct.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/struct.0 334564 2018-06-03 16:21:15Z pstef $ */
+
+int f(struct x *a);
+
+/* See r303485 */
+void
+t(void)
+{
+ static const struct {
+ int a;
+ int b;
+ } c[] = {
+ { D, E },
+ { F, G }
+ };
+}
+
+void u(struct x a) {
+ int b;
+ struct y c = (struct y *)&a;
+}
Index: src/tests/usr.bin/indent/struct.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/struct.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/struct.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,24 @@
+/* $NetBSD: struct.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/struct.0.stdout 334564 2018-06-03 16:21:15Z pstef $ */
+
+int f(struct x *a);
+
+/* See r303485 */
+void
+t(void)
+{
+ static const struct {
+ int a;
+ int b;
+ } c[] = {
+ {D, E},
+ {F, G}
+ };
+}
+
+void
+u(struct x a)
+{
+ int b;
+ struct y c = (struct y *)&a;
+}
Index: src/tests/usr.bin/indent/surplusbad.0
diff -u /dev/null src/tests/usr.bin/indent/surplusbad.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/surplusbad.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,10 @@
+/* $NetBSD: surplusbad.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/surplusbad.0 313544 2017-02-10 09:31:39Z pstef $ */
+/* See r303599 */
+#if defined(__i386__)
+int a;
+#elif defined(__amd64__)
+int b;
+#else
+#error "Port me"
+#endif
Index: src/tests/usr.bin/indent/surplusbad.0.pro
diff -u /dev/null src/tests/usr.bin/indent/surplusbad.0.pro:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/surplusbad.0.pro Thu Apr 4 15:27:35 2019
@@ -0,0 +1,3 @@
+/* $NetBSD: surplusbad.0.pro,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/surplusbad.0.pro 314613 2017-03-03 20:15:22Z ngie $ */
+-bad
Index: src/tests/usr.bin/indent/surplusbad.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/surplusbad.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/surplusbad.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,10 @@
+/* $NetBSD: surplusbad.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/surplusbad.0.stdout 313544 2017-02-10 09:31:39Z pstef $ */
+/* See r303599 */
+#if defined(__i386__)
+int a;
+#elif defined(__amd64__)
+int b;
+#else
+#error "Port me"
+#endif
Index: src/tests/usr.bin/indent/t_indent.sh
diff -u /dev/null src/tests/usr.bin/indent/t_indent.sh:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/t_indent.sh Thu Apr 4 15:27:35 2019
@@ -0,0 +1,91 @@
+#
+# Copyright 2016 Dell EMC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# $FreeBSD: head/usr.bin/indent/tests/functional_test.sh 314613 2017-03-03 20:15:22Z ngie $
+
+SRCDIR=$(atf_get_srcdir)
+
+check()
+{
+ local tc=${1}; shift
+
+ local indent=$(atf_config_get usr.bin.indent.test_indent /usr/bin/indent)
+
+ # All of the files need to be in the ATF sandbox in order for the tests
+ # to pass.
+ atf_check cp ${SRCDIR}/${tc}* .
+
+ # Remove $FreeBSD: head/usr.bin/indent/tests/functional_test.sh 314613 2017-03-03 20:15:22Z ngie $ RCS expansions because they get re-indented, which
+ # changes the output
+ local out_file="${tc}.stdout"
+ if [ -f "${out_file}" ]; then
+ parsed_file=output_file.parsed
+
+ atf_check -o save:$parsed_file sed -e '/\$NetBSD.*\$/,/\$FreeBSD.*\$/d' \
+ ${tc}.stdout
+ out_flag="-o file:$parsed_file"
+ fi
+ local profile_file="${tc}.pro"
+ if [ -f "${profile_file}" ]; then
+ profile_flag="-P${profile_file}"
+ else
+ # Make sure we don't implicitly use ~/.indent.pro from the test
+ # host, for determinism purposes.
+ profile_flag="-npro"
+ fi
+ sed -e '/\$NetBSD.*\$/,/\$FreeBSD.*\$/d' ${tc} > input_file.parsed
+
+ atf_check -s exit:${tc##*.} ${out_flag} ${indent} ${profile_flag} < input_file.parsed
+}
+
+add_testcase()
+{
+ local tc=${1}
+ local tc_escaped word
+
+ case "${tc%.*}" in
+ *-*)
+ local IFS="-"
+ for word in ${tc%.*}; do
+ tc_escaped="${tc_escaped:+${tc_escaped}_}${word}"
+ done
+ ;;
+ *)
+ tc_escaped=${tc%.*}
+ ;;
+ esac
+
+ atf_test_case ${tc_escaped}
+ eval "${tc_escaped}_body() { check ${tc}; }"
+ atf_add_test_case ${tc_escaped}
+}
+
+atf_init_test_cases()
+{
+ for path in $(find -Es "${SRCDIR}" -regex '.*\.[0-9]+$'); do
+ add_testcase ${path##*/}
+ done
+}
Index: src/tests/usr.bin/indent/types_from_file.0
diff -u /dev/null src/tests/usr.bin/indent/types_from_file.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/types_from_file.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,4 @@
+/* $NetBSD: types_from_file.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/types_from_file.0 313544 2017-02-10 09:31:39Z pstef $ */
+/* See r303735 */
+void t(a *x, b *y, c *z);
Index: src/tests/usr.bin/indent/types_from_file.0.list
diff -u /dev/null src/tests/usr.bin/indent/types_from_file.0.list:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/types_from_file.0.list Thu Apr 4 15:27:35 2019
@@ -0,0 +1,2 @@
+b
+a
\ No newline at end of file
Index: src/tests/usr.bin/indent/types_from_file.0.pro
diff -u /dev/null src/tests/usr.bin/indent/types_from_file.0.pro:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/types_from_file.0.pro Thu Apr 4 15:27:35 2019
@@ -0,0 +1,3 @@
+/* $NetBSD: types_from_file.0.pro,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/types_from_file.0.pro 314613 2017-03-03 20:15:22Z ngie $ */
+-Utypes_from_file.0.list
Index: src/tests/usr.bin/indent/types_from_file.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/types_from_file.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/types_from_file.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,4 @@
+/* $NetBSD: types_from_file.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/types_from_file.0.stdout 313544 2017-02-10 09:31:39Z pstef $ */
+/* See r303735 */
+void t(a *x, b *y, c * z);
Index: src/tests/usr.bin/indent/wchar.0
diff -u /dev/null src/tests/usr.bin/indent/wchar.0:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/wchar.0 Thu Apr 4 15:27:35 2019
@@ -0,0 +1,7 @@
+/* $NetBSD: wchar.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/wchar.0 313544 2017-02-10 09:31:39Z pstef $ */
+/* See r309220 */
+#include <wchar.h>
+
+wchar_t *x = L"test";
+wchar_t y = L't';
Index: src/tests/usr.bin/indent/wchar.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/wchar.0.stdout:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/tests/usr.bin/indent/wchar.0.stdout Thu Apr 4 15:27:35 2019
@@ -0,0 +1,7 @@
+/* $NetBSD: wchar.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+/* $FreeBSD: head/usr.bin/indent/tests/wchar.0.stdout 313544 2017-02-10 09:31:39Z pstef $ */
+/* See r309220 */
+#include <wchar.h>
+
+wchar_t *x = L"test";
+wchar_t y = L't';
Index: src/usr.bin/indent/indent.h
diff -u /dev/null src/usr.bin/indent/indent.h:1.1
--- /dev/null Thu Apr 4 15:27:35 2019
+++ src/usr.bin/indent/indent.h Thu Apr 4 15:27:35 2019
@@ -0,0 +1,60 @@
+/* $NetBSD: indent.h,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
+
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2001 Jens Schweikhardt
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if 0
+#if defined(__NetBSD__)
+__RCSID("$NetBSD: indent.h,v 1.1 2019/04/04 15:27:35 kamil Exp $");
+#elif defined(__FreeBSD__)
+__FBSDID("$FreeBSD: head/usr.bin/indent/indent.h 336333 2018-07-16 05:46:50Z pstef $");
+#endif
+#endif
+
+#ifndef nitems
+#define nitems(array) (sizeof (array) / sizeof (array[0]))
+#endif
+
+void add_typename(const char *);
+void alloc_typenames(void);
+int compute_code_target(void);
+int compute_label_target(void);
+int count_spaces(int, char *);
+int count_spaces_until(int, char *, char *);
+void init_constant_tt(void);
+int lexi(struct parser_state *);
+void diag2(int, const char *);
+void diag3(int, const char *, int);
+void diag4(int, const char *, int, int);
+void dump_line(void);
+void fill_buffer(void);
+void parse(int);
+void pr_comment(void);
+void set_defaults(void);
+void set_option(char *);
+void set_profile(const char *);