astyle 2.05.1
Environment/.astylerc
--add-brackets
--align-pointer=name
--align-reference=name
--break-blocks
--convert-tabs
--indent-cases
--indent-switches
--indent=spaces=2
--pad-header
--pad-oper
--style=gnu
astyle source code
ASFormatter.cpp:1020
... && (isLegalNameChar(currentChar) && currentChar != '.')
This does not cover all valid statements.
The following ...
main
{
if (1) return 0; ptr='[';
if (1) return 1; ++ptr;
if (1) return 1; --ptr;
if (1) return 1; (int )ptr=1;
}
yields ...
main
{
if (1)
{
return 0;
} *ptr = '[';
if (1)
{
return 1;
} ++ptr;
if (1)
{
return 1;
} --ptr;
if (1)
{
return 1;
} (int *)ptr = 1;
}
rather than ...
main
{
if (1)
{
return 0;
}
*ptr = '[';
if (1)
{
return 1;
}
++ptr;
if (1)
{
return 1;
}
--ptr;
if (1)
{
return 1;
}
(int *)ptr = 1;
}
Diff:
Fixed.