I would like to use KR style with astyle tool, but I find this in astyle of plugin's settings of settings:
namespace foospace {
int Foo() {
if (isBar) {
bar();
return 1;
}
else --------------------????? It's very stranger. It is not KR style
return 0;
}
}
KR style should be :
namespace foospace {
int Foo() {
if (isBar) {
bar();
return 1;
} else ---- this
return 0;
}
}
Same problem as with Linux style; it's not right. In the astyle document shows:
http://cvs.sourceforge.net/viewcvs.py/*checkout*/astyle/astyle_1.x/astyle.html?rev=1.28
namespace foospace
{
int Foo()
{
if (isBar) {
bar();
return 1;
} else /* difference */
return 0;
}
}
But in C::B 1.0r2 has this:
namespace foospace
{
int Foo()
{
if (isBar) {
bar();
return 1;
}
else /* difference */
return 0;
}
}
K&R style problem still exist in C::B 1.0r2. I have no idea if it's arleady fixed in SVN, so just a FYI.
I have tried now with C::B SVN rev1578 (from Therion), but it seems that there is another issue with K&R:
namespace foospace
{ <-- This is false
int Foo() {
if (isBar) {
bar();
return 1;
}
else /* difference */ <-- This is false
return 0;
}
}
With linux style same difference between code and linux style example in plugin settings.
Java style has the same problem as described in my previous post.
Michael
This:
namespace foospace
{
int Foo()
{
if (isBar) {
bar();
return 1;
} else
return 0;
}
}
is K&R - i.e. functions use the C bracket convention, while expressions use the java bracket convention.