Difference between revisions of "Kernel Normal Form"

From Embedded Xinu
Jump to navigation Jump to search
(New page: == Tabs == * Use tabs to indent code. * Use spaces to position comments that appear to the right of code. == Braces == * For functions and control blocks, the brace goes on its own line. ...)
 
Line 18: Line 18:
 
== Global Variables ==
 
== Global Variables ==
 
* Global tables are named after the related structure with the suffix "tab", such as <code>devicetab</code>, <code>processtab</code>, etc.
 
* Global tables are named after the related structure with the suffix "tab", such as <code>devicetab</code>, <code>processtab</code>, etc.
 +
 +
== Comments ==

Revision as of 21:38, 26 June 2007

Tabs

  • Use tabs to indent code.
  • Use spaces to position comments that appear to the right of code.

Braces

  • For functions and control blocks, the brace goes on its own line.
  • Control blocks can be compressed to

Spaces

  • Spaces around operators are recommended, around = are required.
  • The parenthesis following a keyword is always prefixed by a space.
  • Following a function call or declaration, there is no space between the name and the opening parenthesis.

Function Naming

  • Function names use Java style lowerCamelCase, following Java conventions on capitalization edge cases.
  • Avoid unnecessary abbreviation in function names as reasonable.

Global Variables

  • Global tables are named after the related structure with the suffix "tab", such as devicetab, processtab, etc.

Comments