Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » wrapping logical operators(Code Style - Wrapping Logical Operators)
wrapping logical operators [message #828357] Sat, 24 March 2012 13:22 Go to next message
Bobby Missing name is currently offline Bobby Missing name
Messages: 11
Registered: November 2010
Junior Member
Is there a way for me to configure my code style, so that Eclipse does not place the && on the next line?

This is what it's doing:

if ((tkcmdpr_msg[next_source].unit != tkcmdpr_unit_id)
&& (tkcmdpr_msg[next_source].unit != TKCMDPR_FIXED_UNIT_ID)) {
ecode = TKCMDPR_INVALID_UNIT_ID_ERR;
}

Where this is what I want:

if ((tkcmdpr_msg[next_source].unit != tkcmdpr_unit_id) &&
(tkcmdpr_msg[next_source].unit != TKCMDPR_FIXED_UNIT_ID)){
ecode = TKCMDPR_INVALID_UNIT_ID_ERR;
}

Honestly, I've been working for years in embedded C code now, and I don't think I've ever seen someone prefer to put the && on the next line. Is this really so common that it should be the default code style? At any rate, I'd love to just be able to change it.

I am using this version if the info is helpful:
Eclipse C/C++ Development Tools
Version: 8.0.0.201106081058
Build id: 201106081058

Thanks,
Bobby
Re: wrapping logical operators [message #844218 is a reply to message #828357] Fri, 13 April 2012 16:33 Go to previous messageGo to next message
Bobby Missing name is currently offline Bobby Missing name
Messages: 11
Registered: November 2010
Junior Member
Bumping this up.

Does anyone see how to change this behavior? It's preventing me from cleaning up some code that really needs cleaning up.

Honestly...I would like to know if anyone actually does like their operators on the next line...is there *anybody* who does it this way?
Re: wrapping logical operators [message #846594 is a reply to message #844218] Mon, 16 April 2012 03:46 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
Bobby Mising name wrote on Fri, 13 April 2012 22:33
Bumping this up.

Does anyone see how to change this behavior? It's preventing me from cleaning up some code that really needs cleaning up.

Honestly...I would like to know if anyone actually does like their operators on the next line...is there *anybody* who does it this way?

There is an open bugzilla request about this feature https://bugs.eclipse.org/bugs/show_bug.cgi?id=360107


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: wrapping logical operators [message #871315 is a reply to message #846594] Fri, 11 May 2012 17:43 Go to previous message
Bobby Missing name is currently offline Bobby Missing name
Messages: 11
Registered: November 2010
Junior Member
Hello!

I think that I'm actually going to give a try this weekend, at getting the CDT project and figuring out how to fix this bug myself.

I must admit that I'm going to have a learning curve here. If I manage to get the code and build it this weekend I'll be happy. I design circuit boards and write embedded software for a living so I'm not a total idiot. I've never built a Windows program of considerable size, however: simple C# apps, python scripts...that's the extent of my experience in Windows...I don't even know Java.

It looks like this link is the best place to start if I really want to do this in this link: wiki.eclipse.org/Getting_started_with_CDT_development

Please let me know if I'm being unrealistic thinking that I might be able to add this formatting option myself.

Thanks,
Bobby
Previous Topic:Problems w/ Debug Configs, Attach to Application
Next Topic:Kernel Header Issues
Goto Forum:
  


Current Time: Wed Aug 27 09:17:32 EDT 2014

Powered by FUDForum. Page generated in 0.03757 seconds