Author Topic: AStyle issue with SVN 5755  (Read 5057 times)

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
AStyle issue with SVN 5755
« 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).
« Last Edit: September 12, 2009, 02:40:21 am by ironhead »

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: AStyle issue with SVN 5755
« Reply #1 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'.

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: AStyle issue with SVN 5755
« Reply #2 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

Cheers!

Chris

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: AStyle issue with SVN 5755
« Reply #3 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

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).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: AStyle issue with SVN 5755
« Reply #4 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!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: AStyle issue with SVN 5755
« Reply #5 on: September 14, 2009, 07:25:41 am »
Should be fixed in trunk now.

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: AStyle issue with SVN 5755
« Reply #6 on: September 14, 2009, 04:25:52 pm »
I can confirm it's fixed.

Thank you!

Chris