Changes between Version 3 and Version 4 of CodingStyle


Ignore:
Timestamp:
Dec 16, 2011, 2:36:11 PM (14 years ago)
Author:
Matthias Vogelgesang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CodingStyle

    v3 v4  
    33In general, the [http://kerneltrap.org/files/Jeremy/CodingStyle.txt coding standards] used in the Linux kernel are versatile, comprehensive and quite good looking. They are boiling down to the following guide lines:
    44
    5  Indentation:: Spaces
     5 Indentation:: Four spaces
    66 Spaces:: Spaces around keywords but not in inner parenthesis.
    77 Brace placement:: '{' at end of line except for function definition and '}' on its own line except in do-while-loops.
    88 Naming:: Descriptive for global functions and usually lower case with underscores.
    99 Macros:: Upper case for constants, lower case with underscores for macros resembling functions.
    10  Structures:: No typedefs, although this is debatable. For shared data structures reference counting should be implemented.
     10 Structures:: Consistency when using typedefs or not. For shared data structures reference counting should be implemented.
    1111
    1212I would add the following:
     
    1919There are still some open questions:
    2020
    21 * Number of white lines to separate functions?
     21* Number of newlines to separate functions?
    2222* Comments: C vs. C++ style, usage of '*'?
    2323* Alignment of multiple assignments?
     
    5656}}}
    5757
    58 
    5958== Astyle Formatter ==
    6059