-
Notifications
You must be signed in to change notification settings - Fork 0
/
HACKING
22 lines (20 loc) · 1.19 KB
/
HACKING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Dear contributor,
Please follow these style guidelines for new all new C/C++/Objective C code:
* Follow the C++ 2003 (TR1) standard. The <Gosu/TR1.hpp> header facilitates this.
* Use JavaClassNames, javaVariables.javaMethods(), AND_JAVA_CONSTANTS.
For enums, follow the Delphi style: enum AlphaMode { amDefault, amAdditive }
* Don't worry too much about trailing space or Windows/UNIX newlines. But please
ensure that your commit does not change lines or files that you otherwise
haven't touched.
* Indent in multiples of four spaces (not tabs). Don't use formatting that will
break when using a proportional font.
* Place { on its own line in C and C++, but on the same line within Objective C
classes.
* Align the pointer star to the left in C and C++ (char* str), but to the right
within Objective C classes (NSString *string).
* You don't have to break up lines of code at all, Xcode and MSVC can do by
themselves that to adjust to netbook screen sizes and split-screen coding.
* Place spaces only around infix operators: ((-4 + 6) * --a[76])
Do not use spaces after function names: f(foo, bar)
But put a space after flow control keywords: return 5, if (cond), switch (x).
Thanks. --Julian