opt_v.c revision 1.1
1/* $NetBSD: opt_v.c,v 1.1 2021/10/16 03:20:13 rillig Exp $ */
2/* $FreeBSD$ */
3
4#indent input
5/*
6 * A long comment.
7 */
8void
9example(void)
10{
11	printf("A very long message template with %d arguments: %s, %s, %s", 3, "first", "second", "third");
12}
13
14/* $ This comment is neither counted nor formatted. */
15#define macro1 /* prefix */ suffix
16
17/* $ This comment is formatted and counted. */
18#define macro2 prefix /* suffix */
19#indent end
20
21#indent run -v
22/*
23 * A long comment.
24 */
25void
26example(void)
27{
28	printf("A very long message template with %d arguments: %s, %s, %s", 3, "first", "second", "third");
29}
30
31#define macro1 /* prefix */ suffix
32
33#define macro2 prefix		/* suffix */
34There were 10 output lines and 2 comments
35(Lines with comments)/(Lines with code):  0.571
36#indent end
37
38#indent input
39void
40example(void)
41{
42	int sum1 = 1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21;
43	int sum2 = (1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21);
44}
45#indent end
46
47#indent run -nv
48void
49example(void)
50{
51/* $ XXX: The following lines are too long and should thus be broken. */
52/* $ XXX: If they are broken, -nv does NOT output 'Line broken'. */
53	int		sum1 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21;
54	int		sum2 = (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21);
55}
56#indent end
57