wrapping logical operators [message #828357] |
Sat, 24 March 2012 13:22  |
Eclipse User |
|
|
|
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 #871315 is a reply to message #846594] |
Fri, 11 May 2012 17:43  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04227 seconds