Kernel Normal Form

From Embedded Xinu
Revision as of 21:38, 26 June 2007 by Phinze (talk | contribs)
Jump to navigation Jump to search

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