blob: d36e359719474ac8a999d692d2db244e055ec6bb [file] [log] [blame]
Robert Hak40bafc52002-08-21 10:19:23 +00001$Id$
2
Robert Hak465ba3e2002-08-21 10:29:58 +00003 __________ __ ___.
4 Open \______ \ ____ ____ | | _\_ |__ _______ ___
5 Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
6 Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
7 Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 \/ \/ \/ \/ \/
9 Contribution Policies
10
11
Robert Hak40bafc52002-08-21 10:19:23 +000012In order for the project to run as smoothly as possible, it's best if all
Daniel Stenberge248eac2006-03-03 07:31:54 +000013contributors adhere to a few simple source code conventions:
14
15Exceptions
16----------
17This project borrows and imports quite a lot of code from other free software
18projects. We do not change style of such code unless we really have to, even
19though they might be using style very different from others.
Robert Hak40bafc52002-08-21 10:19:23 +000020
21Language
22--------
23Write all code in C. Sometimes assembly is faster, but C is always more
24readable and maintainable.
25
26Language features
27-----------------
28Write normal C code. Don't redefine the language. No new types (structs are
Björn Stenberg83b8ede2004-11-11 09:40:48 +000029structs, not typedefs), no C++isms or Javaisms.
Robert Hak40bafc52002-08-21 10:19:23 +000030
31Names
32-----
33Variables and function names should be all lower case.
34Preprocessor symbols should be all uppercase.
35
Daniel Stenberg071898e2003-03-04 15:06:53 +000036Comments
37--------
38We only use plain old /* C standard comments */.
Tomas Salfischbergerabf975d2006-02-27 15:01:34 +000039If you want to comment out large blocks containing other comments, use #if 0.
Daniel Stenberg071898e2003-03-04 15:06:53 +000040
Robert Hak40bafc52002-08-21 10:19:23 +000041Style
42-----
43When changing code, follow the code style of the file you are editing.
44
45When writing new files, you may use the brace placement style of your choice.
46
Daniel Stenberg8e757342007-09-06 11:08:23 +000047Braces for function declarations are put in a new line under the name, as in:
48
49 int foo(char *name)
50 {
51 return FOO_NAME:
52 }
53
Robert Hak40bafc52002-08-21 10:19:23 +000054Always indent your code with four spaces. Don't use TAB characters, as that
55will mess up code display in CVS, printing, and a zillion other places.
56
57Keep lines below 80 columns length. Use whitespace and newlines to make the
58code easy to browse/read.
59
60Text format
61-----------
62Use "unix style" line feeds: "LF" only. Do not use "CR+LF".
63
Daniel Stenberg95cde0b2005-10-28 10:44:50 +000064Use ISO-8859-1 character set, but try to refrain from using any non-ascii
65letters as they will only appear weird in some camps no matter what.
66
Robert Hak40bafc52002-08-21 10:19:23 +000067Patches
68-------
Peter D'Hoye9ae05c32007-01-10 21:25:59 +000069Create a patch using 'svn diff > mychanges.patch
Robert Hak40bafc52002-08-21 10:19:23 +000070Trim your patches so they only contain relevant changes.
Robert Hak40bafc52002-08-21 10:19:23 +000071
Daniel Stenberg55da2792006-02-26 23:28:15 +000072Submit your patch to the project via our patch tracker:
Dave Chapman2c3fd0c2006-08-11 00:21:42 +000073http://www.rockbox.org/tracker/index.php?type=4
Björn Stenberg4a67c872006-03-09 14:58:15 +000074
75Credits
76-------
77We believe in crediting all contributors by name. Before committing a patch to
Nicolas Pennequin77bdacc2007-05-24 18:56:09 +000078SVN, we ask that you give us your full real name (no pseudonyms or nicknames)
Björn Stenberg4a67c872006-03-09 14:58:15 +000079for adding to the credits list.