Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Format typedefs correctly
Format typedefs correctly [message #908736] Wed, 05 September 2012 19:14 Go to next message
Jonas Nyrup is currently offline Jonas Nyrup
Messages: 2
Registered: September 2012
Junior Member
In my C code I have this code
#define Color int_fast16_t
Color var1;
Color var2;

/* Returns the vertex of maximal degree */
Color getColor();



When I use the formatter in Eclipse for some reason it removes some linebreaks that it shouldn't.
#define Color int_fast16_t
Color var1;Color var2;

/* Returns the vertex of maximal degree */Color getColor();

How do I get Eclipse to recognize my typedef and format correctly?

[Updated on: Thu, 06 September 2012 07:30]

Report message to a moderator

Re: Format typedefs correctly [message #909023 is a reply to message #908736] Thu, 06 September 2012 08:37 Go to previous messageGo to next message
Sunil Matta is currently offline Sunil Matta
Messages: 8
Registered: April 2012
Junior Member
Two points.
I have typedefs all over and I dont get bad formatting in Juno. Does this only happen after you do your defines ?
You really want to use typedef instead of textual substitution. That is the preferred method for defining types.
Re: Format typedefs correctly [message #909051 is a reply to message #909023] Thu, 06 September 2012 09:11 Go to previous message
Jonas Nyrup is currently offline Jonas Nyrup
Messages: 2
Registered: September 2012
Junior Member
I normally uses Indigo as it is in the default repositories for my Linux distribution, but I've just tried to download the newest Juno CDT release and the problem consists.

When I manually substitutes "Color" with "int_fast16_t" the problem disappears. But as you mention, typedefs are preferred.
Previous Topic:Access to GNU-Tools
Next Topic:Bad user interface design
Goto Forum:
  


Current Time: Fri Jul 25 16:41:05 EDT 2014

Powered by FUDForum. Page generated in 0.12375 seconds