Robert Hak | 40bafc5 | 2002-08-21 10:19:23 +0000 | [diff] [blame] | 1 | $Id$ |
| 2 | |
Robert Hak | 465ba3e | 2002-08-21 10:29:58 +0000 | [diff] [blame] | 3 | __________ __ ___. |
| 4 | Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 5 | Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 6 | Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 7 | Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 8 | \/ \/ \/ \/ \/ |
| 9 | Contribution Policies |
| 10 | |
| 11 | |
Robert Hak | 40bafc5 | 2002-08-21 10:19:23 +0000 | [diff] [blame] | 12 | In order for the project to run as smoothly as possible, it's best if all |
| 13 | contributors adhere to a few simple conventions: |
| 14 | |
| 15 | Language |
| 16 | -------- |
| 17 | Write all code in C. Sometimes assembly is faster, but C is always more |
| 18 | readable and maintainable. |
| 19 | |
| 20 | Language features |
| 21 | ----------------- |
| 22 | Write normal C code. Don't redefine the language. No new types (structs are |
Björn Stenberg | 83b8ede | 2004-11-11 09:40:48 +0000 | [diff] [blame] | 23 | structs, not typedefs), no C++isms or Javaisms. |
Robert Hak | 40bafc5 | 2002-08-21 10:19:23 +0000 | [diff] [blame] | 24 | |
| 25 | Names |
| 26 | ----- |
| 27 | Variables and function names should be all lower case. |
| 28 | Preprocessor symbols should be all uppercase. |
| 29 | |
Daniel Stenberg | 071898e | 2003-03-04 15:06:53 +0000 | [diff] [blame] | 30 | Comments |
| 31 | -------- |
| 32 | We only use plain old /* C standard comments */. |
Tomas Salfischberger | abf975d | 2006-02-27 15:01:34 +0000 | [diff] [blame^] | 33 | If you want to comment out large blocks containing other comments, use #if 0. |
Daniel Stenberg | 071898e | 2003-03-04 15:06:53 +0000 | [diff] [blame] | 34 | |
Robert Hak | 40bafc5 | 2002-08-21 10:19:23 +0000 | [diff] [blame] | 35 | Style |
| 36 | ----- |
| 37 | When changing code, follow the code style of the file you are editing. |
| 38 | |
| 39 | When writing new files, you may use the brace placement style of your choice. |
| 40 | |
| 41 | Always indent your code with four spaces. Don't use TAB characters, as that |
| 42 | will mess up code display in CVS, printing, and a zillion other places. |
| 43 | |
| 44 | Keep lines below 80 columns length. Use whitespace and newlines to make the |
| 45 | code easy to browse/read. |
| 46 | |
| 47 | Text format |
| 48 | ----------- |
| 49 | Use "unix style" line feeds: "LF" only. Do not use "CR+LF". |
| 50 | |
Daniel Stenberg | 95cde0b | 2005-10-28 10:44:50 +0000 | [diff] [blame] | 51 | Use ISO-8859-1 character set, but try to refrain from using any non-ascii |
| 52 | letters as they will only appear weird in some camps no matter what. |
| 53 | |
Robert Hak | 40bafc5 | 2002-08-21 10:19:23 +0000 | [diff] [blame] | 54 | Patches |
| 55 | ------- |
| 56 | Create a patch using 'cvs diff -ub'. |
| 57 | Trim your patches so they only contain relevant changes. |
Robert Hak | 40bafc5 | 2002-08-21 10:19:23 +0000 | [diff] [blame] | 58 | |
Daniel Stenberg | 55da279 | 2006-02-26 23:28:15 +0000 | [diff] [blame] | 59 | Submit your patch to the project via our patch tracker: |
| 60 | http://www.rockbox.org/bugs/index.php?type=4 |