Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: ironhead on September 11, 2009, 06:50:01 pm

Title: AStyle issue with SVN 5755
Post by: ironhead on September 11, 2009, 06:50:01 pm
I've built 5755 using MinGW (GCC 4.4.0), running on Windows XP Pro SP3.  When I use the AStyle plugin, it seems to be defaulting to Stroustrup formating despite the fact that I have GNU selected.

The AStyle plugin worked as expected with the previous nightly (5731).
Title: Re: AStyle issue with SVN 5755
Post by: ironhead on September 13, 2009, 04:54:26 am
The source of the problem is in:

Code
void FormatterSettings::ApplyTo(astyle::ASFormatter& formatter)

If I hardcode:

Code
formatter.setFormattingStyle(astyle::STYLE_GNU);

Then I get the desired behaviour.  As a result, I suspect:

Code
int style = cfg->ReadInt(_T("/style"), 0);

is failing and returning '0'.
Title: Re: AStyle issue with SVN 5755
Post by: ironhead on September 13, 2009, 05:43:33 am
It turns out that the Linux and GNU styles were swapped in some of the files.  I've uploaded a patch (#2825) that corrects the issue:

http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2825&group_id=5358 (http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2825&group_id=5358)

Cheers!

Chris
Title: Re: AStyle issue with SVN 5755
Post by: Jenna on September 13, 2009, 10:03:35 am
It turns out that the Linux and GNU styles were swapped in some of the files.  I've uploaded a patch (#2825) that corrects the issue:

http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2825&group_id=5358 (http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2825&group_id=5358)

Cheers!

Chris
Hi Chris,

I'm working on this (in fact I have fixed it in my working copy).
I also added The Horstmann formatting-style.
I will commit the changes soon (hopefully today).
Title: Re: AStyle issue with SVN 5755
Post by: MortenMacFly on September 13, 2009, 02:10:11 pm
I'm working on this (in fact I have fixed it in my working copy).
It's all my fault. :oops:

I tried to be very careful when updating astyle but it seems I missed some points. Changes were quite big... Thanks for the help!
Title: Re: AStyle issue with SVN 5755
Post by: Jenna on September 14, 2009, 07:25:41 am
Should be fixed in trunk now.
Title: Re: AStyle issue with SVN 5755
Post by: ironhead on September 14, 2009, 04:25:52 pm
I can confirm it's fixed.

Thank you!

Chris