Changes between Version 3 and Version 4 of CodingStyle
- Timestamp:
- Dec 16, 2011, 2:36:11 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CodingStyle
v3 v4 3 3 In 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: 4 4 5 Indentation:: Spaces5 Indentation:: Four spaces 6 6 Spaces:: Spaces around keywords but not in inner parenthesis. 7 7 Brace placement:: '{' at end of line except for function definition and '}' on its own line except in do-while-loops. 8 8 Naming:: Descriptive for global functions and usually lower case with underscores. 9 9 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. 11 11 12 12 I would add the following: … … 19 19 There are still some open questions: 20 20 21 * Number of whitelines to separate functions?21 * Number of newlines to separate functions? 22 22 * Comments: C vs. C++ style, usage of '*'? 23 23 * Alignment of multiple assignments? … … 56 56 }}} 57 57 58 59 58 == Astyle Formatter == 60 59
![(please configure the [header_logo] section in trac.ini)](/ufo/chrome/site/your_project_logo.png)