All sources should be written with Allman style.
The Allman style is named after Eric Allman. It is sometimes referred to as “ANSI style” for its use in the documents describing the ANSI C standard. Proponents of this style often cite its use by ANSI and in other standards as justification for its adoption.
The style puts the brace associated with a control statement on the next line, indented to the same level as the control statement. Statements within the braces are indented to the next level. In this text, due to some html strange behaviors, I have replaced brackets by parenthesis.
while(x == y)
This style is similar to the standard indentation used by the Pascal programming language and Transact-SQL, where the braces are equivalent to the “begin” and “end” keywords.
Advantages of this style are that the indented code is clearly set apart from the containing statement by lines that are almost completely whitespace, improving readability and the ending brace lines up in the same column as the beginning brace, making it easy to find the matching brace. Additionally, the blocking style delineates the actual block of code associated from the control statement itself. Commenting out the control statement, removing the control statement entirely, refactoring, or removing of the block of code is less apt to introduce syntax errors because of dangling or missing brackets.
Maximum length of a line is 80 characters and there is only one instruction by line. FreeVMS is written in pure functional C++ without any object.
Tabulations are set to four characters and replaced by spaces with make convert. if an instruction does not fit on one line, the extra indentation added on following line is exactly eight spaces.
Parameters are sent to function by copy or by pointer, never by reference.
Function has to be declared as:
inline unsigned char *
All parenthesis should be written to prevent the compiler to do faulty or strange optimizations.
There is always a space between inlined operator and its arguments.
There is no space between function and its parenthesis except for if. We write
if (test == 0)