Guidelines for developing & submitting patches

Discussion of development and patch submission.
User avatar
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Guidelines for developing & submitting patches

Post by SarahWalker »

Please submit patches as output from git diff.

When working on the emulator, please follow the coding style :

* 8 character tabs
* Braces should be on a new line
* Try to avoid multiple statements on a single line unless it actually improves readability
* Use spaces around keywords and operators other than prefix/postfix increment and decrement
* Do not use spaces around parenthesized expressions or when declaring pointers
* Function names should be lower case with underscores
* Global function names should include a sensible prefix (eg serial functions should start with serial_)
* Avoid creating new global variables unless absolutely required
* Prefer C89 "/* */" style comments. C99 "//" comments are generally used to comment out debug code
* Try to avoid magic numbers, ie use #define or enum where appropriate
* No hard limit on line lengths, but try to keep it sensible

Some of the older code does not yet follow this style (old code can be recognised by the lack of whitespace), but new code should.

If you're about to start working on something major, it might be worth posting that you are doing this. This may help avoid duplication of effort.