2002-08-21 10:29:58 +00:00
|
|
|
__________ __ ___.
|
|
|
|
Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
\/ \/ \/ \/ \/
|
|
|
|
Contribution Policies
|
|
|
|
|
|
|
|
|
2002-08-21 10:19:23 +00:00
|
|
|
In order for the project to run as smoothly as possible, it's best if all
|
2006-03-03 07:31:54 +00:00
|
|
|
contributors adhere to a few simple source code conventions:
|
|
|
|
|
|
|
|
Exceptions
|
|
|
|
----------
|
|
|
|
This project borrows and imports quite a lot of code from other free software
|
|
|
|
projects. We do not change style of such code unless we really have to, even
|
|
|
|
though they might be using style very different from others.
|
2002-08-21 10:19:23 +00:00
|
|
|
|
|
|
|
Language
|
|
|
|
--------
|
|
|
|
Write all code in C. Sometimes assembly is faster, but C is always more
|
|
|
|
readable and maintainable.
|
|
|
|
|
|
|
|
Language features
|
|
|
|
-----------------
|
2009-10-23 07:26:48 +00:00
|
|
|
Write normal C code. Keep it simple. Don't redefine the language. No new types
|
|
|
|
(structs are structs, not typedefs). No C++isms or Javaisms. No code in .h
|
|
|
|
files or #defines.
|
2002-08-21 10:19:23 +00:00
|
|
|
|
2007-10-24 13:08:00 +00:00
|
|
|
Identifiers
|
2009-02-12 20:49:53 +00:00
|
|
|
-----------
|
2007-10-24 13:08:00 +00:00
|
|
|
We do not want mixed case identifiers.
|
2002-08-21 10:19:23 +00:00
|
|
|
Variables and function names should be all lower case.
|
2007-10-24 13:08:00 +00:00
|
|
|
Struct and enum names should be all lower case.
|
|
|
|
Preprocessor symbols and enum constants should be all upper case.
|
2002-08-21 10:19:23 +00:00
|
|
|
|
2003-03-04 15:06:53 +00:00
|
|
|
Comments
|
|
|
|
--------
|
|
|
|
We only use plain old /* C standard comments */.
|
2006-02-27 15:01:34 +00:00
|
|
|
If you want to comment out large blocks containing other comments, use #if 0.
|
2003-03-04 15:06:53 +00:00
|
|
|
|
2002-08-21 10:19:23 +00:00
|
|
|
Style
|
|
|
|
-----
|
|
|
|
When changing code, follow the code style of the file you are editing.
|
|
|
|
|
|
|
|
When writing new files, you may use the brace placement style of your choice.
|
|
|
|
|
2007-09-06 11:08:23 +00:00
|
|
|
Braces for function declarations are put in a new line under the name, as in:
|
|
|
|
|
|
|
|
int foo(char *name)
|
|
|
|
{
|
|
|
|
return FOO_NAME:
|
|
|
|
}
|
|
|
|
|
2002-08-21 10:19:23 +00:00
|
|
|
Always indent your code with four spaces. Don't use TAB characters, as that
|
2012-01-24 12:05:25 +00:00
|
|
|
will mess up code display, printing, and a zillion other places.
|
2002-08-21 10:19:23 +00:00
|
|
|
|
|
|
|
Keep lines below 80 columns length. Use whitespace and newlines to make the
|
|
|
|
code easy to browse/read.
|
|
|
|
|
|
|
|
Text format
|
|
|
|
-----------
|
|
|
|
Use "unix style" line feeds: "LF" only. Do not use "CR+LF".
|
|
|
|
|
2008-05-05 10:32:46 +00:00
|
|
|
Use UTF-8 character set, but try to refrain from using any non-ascii
|
2005-10-28 10:44:50 +00:00
|
|
|
letters as they will only appear weird in some camps no matter what.
|
|
|
|
|
2012-01-24 12:05:25 +00:00
|
|
|
Contributing code
|
2002-08-21 10:19:23 +00:00
|
|
|
-------
|
2012-01-24 12:05:25 +00:00
|
|
|
We have a public code review system based on git, which is also how you can
|
|
|
|
check out the latest version of the Rockbox sources.
|
|
|
|
See http://www.rockbox.org/wiki/UsingGit for details on how to setup your
|
|
|
|
environment and how to upload a change you have made for review.
|
2002-08-21 10:19:23 +00:00
|
|
|
|
2012-01-24 12:05:25 +00:00
|
|
|
We'd prefer that you don't submit patches to the bug tracker any more,
|
|
|
|
as it's much harder to read and discuss them there.
|
2006-03-09 14:58:15 +00:00
|
|
|
|
|
|
|
Credits
|
|
|
|
-------
|
|
|
|
We believe in crediting all contributors by name. Before committing a patch to
|
2012-01-24 12:05:25 +00:00
|
|
|
Git, we ask that you give us your full real name (no pseudonyms or nicknames)
|
2006-03-09 14:58:15 +00:00
|
|
|
for adding to the credits list.
|