diff options
author | bde <bde@FreeBSD.org> | 2004-02-09 12:52:15 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2004-02-09 12:52:15 +0000 |
commit | 49286bb39a91c129be3fd1e7bfe591744a021056 (patch) | |
tree | 70f512c548614355061981f7989bb44dfabf6681 /usr.bin | |
parent | 5715cbfdf110ce90fb269508f2ba05cd1b1b55da (diff) | |
download | FreeBSD-src-49286bb39a91c129be3fd1e7bfe591744a021056.zip FreeBSD-src-49286bb39a91c129be3fd1e7bfe591744a021056.tar.gz |
Backed out rev.1.4 and 1.7 so they they can be implemented and committed
properly. Of the 3 changes mentioned in the log message for rev.1.4,
the first (implementing -[n]fcb) was correct but didn't touch this
file, the second (no-space-after-sizeof) was not actually done (it is
the default and is controlled by the undcoumented -[n]bs options), and
the third (no-space-after 'struct foo *') was very buggy and was reduced
to wrong comments and other style bugs by backing out the main part
of it in rev.1.6. Rev.1.4 had 2 changes which were not mentioned in
its commit log: expand specials[] so that more than -83 typedef-names
can be specified (this was the one working change in rev.1.4), and add
"const" and "volatile" to specials[] (this was buggy).
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/indent/lexi.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c index c716bc8..beceabd 100644 --- a/usr.bin/indent/lexi.c +++ b/usr.bin/indent/lexi.c @@ -64,7 +64,7 @@ struct templ { int rwcode; }; -struct templ specials[1000] = +struct templ specials[100] = { {"switch", 1}, {"case", 2}, @@ -94,8 +94,6 @@ struct templ specials[1000] = {"else", 6}, {"do", 6}, {"sizeof", 7}, - {"const", 9}, - {"volatile", 9}, {0, 0} }; @@ -274,28 +272,17 @@ lexi(void) case 3: /* a "struct" */ if (ps.p_l_follow) - break; /* inside parens: cast */ - /* - * Next time around, we may want to know that we have had a - * 'struct' - */ + break; /* inside parens: cast */ l_struct = true; /* - * Fall through to test for a cast, function prototype or - * sizeof(). + * Next time around, we will want to know that we have had a + * 'struct' */ case 4: /* one of the declaration keywords */ if (ps.p_l_follow) { ps.cast_mask |= 1 << ps.p_l_follow; - - /* - * Forget that we saw `struct' if we're in a sizeof(). - */ - if (ps.sizeof_mask) - l_struct = false; - - break; /* inside parens: cast, prototype or sizeof() */ + break; /* inside parens: cast */ } last_code = decl; return (decl); |