blob: 44f0d3f8d3a6b8328b9c16a0e93c46822f0bd881 [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
47Always indent your code with four spaces. Don't use TAB characters, as that
48will mess up code display in CVS, printing, and a zillion other places.
49
50Keep lines below 80 columns length. Use whitespace and newlines to make the
51code easy to browse/read.
52
53Text format
54-----------
55Use "unix style" line feeds: "LF" only. Do not use "CR+LF".
56
Daniel Stenberg95cde0b2005-10-28 10:44:50 +000057Use ISO-8859-1 character set, but try to refrain from using any non-ascii
58letters as they will only appear weird in some camps no matter what.
59
Robert Hak40bafc52002-08-21 10:19:23 +000060Patches
61-------
62Create a patch using 'cvs diff -ub'.
63Trim your patches so they only contain relevant changes.
Robert Hak40bafc52002-08-21 10:19:23 +000064
Daniel Stenberg55da2792006-02-26 23:28:15 +000065Submit your patch to the project via our patch tracker:
66http://www.rockbox.org/bugs/index.php?type=4