Remove code that delete braces around single statements.
This commit is contained in:
parent
abc98dcc15
commit
47402a9b00
@ -1742,33 +1742,6 @@ do
|
||||
sed 's;\([^ ]\)\(/\*.*\*/\)$;\1 \2;' |
|
||||
# move trailing * in function return type
|
||||
sed 's;^\([A-Za-z_][^ ]*\)[ ][ ]*\*$;\1 *;' |
|
||||
# remove un-needed braces around single statements
|
||||
awk '
|
||||
{
|
||||
line3 = $0;
|
||||
if (skips > 0)
|
||||
skips--;
|
||||
if (line1 ~ " *{$" &&
|
||||
line2 ~ " *[^;{}]*;$" &&
|
||||
line3 ~ " *}$")
|
||||
{
|
||||
print line2;
|
||||
line2 = "";
|
||||
line3 = "";
|
||||
skips = 3;
|
||||
}
|
||||
else
|
||||
if (skips == 0 && NR >= 3)
|
||||
print line1;
|
||||
line1 = line2;
|
||||
line2 = line3;
|
||||
}
|
||||
END {
|
||||
if (NR >= 2 && skips <= 1)
|
||||
print line1;
|
||||
if (NR >= 1 && skips <= 2)
|
||||
print line2;
|
||||
}' |
|
||||
# remove blank line between opening brace and block comment
|
||||
awk '
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user