diff options
author | obrien <obrien@FreeBSD.org> | 2000-12-09 09:45:09 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2000-12-09 09:45:09 +0000 |
commit | ae466e022e32b4b72435351b39db7c596626315c (patch) | |
tree | 1b668963aef728cdd7b1a89fc512e215658ac433 /usr.bin/indent/indent.c | |
parent | b010dd915757f9b97f10d341fcb18ec6bacd1e56 (diff) | |
download | FreeBSD-src-ae466e022e32b4b72435351b39db7c596626315c.zip FreeBSD-src-ae466e022e32b4b72435351b39db7c596626315c.tar.gz |
"Implement -[n]fcb (formatting of block comments) and attempt to implement
no-space=after-sizeof (not optional) and no-space-after 'struct foo *'
(not optional). Without these, indent unKNFizes even more perfectly KNF code."
Submitted by: bde
Diffstat (limited to 'usr.bin/indent/indent.c')
-rw-r--r-- | usr.bin/indent/indent.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c index 08977bd..1a8675581 100644 --- a/usr.bin/indent/indent.c +++ b/usr.bin/indent/indent.c @@ -165,6 +165,7 @@ main(argc, argv) cuddle_else = 1; /* -ce */ ps.unindent_displace = 0; /* -d0 */ ps.case_indent = 0; /* -cli0 */ + format_block_comments = 1; /* -fcb */ format_col1_comments = 1; /* -fc1 */ procnames_start_line = 1; /* -psl */ proc_calls_space = 0; /* -npcs */ @@ -533,7 +534,9 @@ check_type: if (ps.cast_mask & (1 << ps.p_l_follow) & ~ps.sizeof_mask) { ps.last_u_d = true; ps.cast_mask &= (1 << ps.p_l_follow) - 1; - } + ps.want_blank = false; + } else + ps.want_blank = true; ps.sizeof_mask &= (1 << ps.p_l_follow) - 1; if (--ps.p_l_follow < 0) { ps.p_l_follow = 0; @@ -543,7 +546,6 @@ check_type: ps.paren_level = ps.p_l_follow; /* then indent it */ *e_code++ = token[0]; - ps.want_blank = true; if (sp_sw && (ps.p_l_follow == 0)) { /* check for end of if * (...), or some such */ |