style was Re: [PATCH 33.0 1/5] LEON: updated AMBA PnP API

Joel Sherrill joel.sherrill at OARcorp.com
Mon Apr 16 14:18:53 UTC 2012


On 04/16/2012 07:33 AM, Sebastian Huber wrote:
> On 04/16/2012 10:23 AM, Daniel Hellstrom wrote:
>>> Second is the indentation. We usually use 2 spaces per indent level
>>> while this code uses 6 or so.
>> Yes, it have hard TAB = 8 spaces. I believe I have asked before about
>> indentation, and I've got the impression that it doesn't really matter as it is
>> consistent within the file. At least it is easier to go from hw-tab to soft,
>> and of course I agree that all files should aim to have the same coding-style.
>> I will update the patches and come back.
> Maybe it makes sense to define a set of astyle
>
> http://astyle.sourceforge.net/
>
> options that specify the RTEMS style (it is impossible to deduce this style
> from the sources).
>
The style is pretty straight-forward to deduce if you look
at the core of RTEMS. If you look at BSPs, you will see
all sorts of oddities.

Looking at astyle options, I think this list covers most of it

+ two space indent
+ no tabs
+ no spaces at end of line
+ brace style: From astyle, we are probably more like K&R
    in general but I could easily go with "one true brace style"
    I like single statements to be enclosed in braces.
+ padding around operators (--pad-oper)
+ padding inside parentheses (--pad-paren-in)
+ space after if, while, for (--pad-header)
+ align pointer with name (--align-pointer=name)
+ UNIX CR/LF (--lineend=linux)

There are other options we would have to examine
but that covers a core set.

I didn't see an option to enforce or warn on a line
being too long.

-- 
Joel Sherrill, Ph.D.             Director of Research&   Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
     Support Available             (256) 722-9985





More information about the devel mailing list