-
Notifications
You must be signed in to change notification settings - Fork 284
/
CONTRIBUTING
60 lines (49 loc) · 1.63 KB
/
CONTRIBUTING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Here's some guidelines on contributing to the SoLoud project.
- SoLoud is extremely liberally licensed. All submitted code
must follow suit to keep it that way.
(public domain, CC0, wtfpl, zlib/libpng, unlicense, or similar
no-attribution and definitely no viral licenses).
- When submitting the first time, add your name in AUTHORS.
- Many small commits are better than few huge ones.
- Try to follow the coding convention of the surrounding code.
If stand alone (such as platform or output device specific),
this isn't as important.
- All optimized code (such as SSE or assembler) must be
accompanied by plain 'c' version, because:
a) optimizations come and go, porting 30 years from now
can be really painful.
b) plain 'c' version works as documentation of the
optimized code.
- When doing platform specific code or otherwise optionally
compiled code, it's often better to have some duplicate
code inside large ifdef block than to have tons of hard
to follow small ifdef blocks.
- Unless there's a really, really good reason, no templates,
including funkycast<foobar>. foo = (int)bar works fine.
- Unless performance critical, always try to write for readability.
Coding convention in brief:
- On naming:
aFunctionParameter
mMemberVariable
gGlobalVariable
localVariable
CONSTANT_VALUE
ClassName
functionName
int ExampleClass::example(int aFoo)
{
if (aFoo)
{
int i;
for (i = 0; i < mBarCycles; i++)
{
bar();
}
switch (gBah)
{
case BOO:
return HISS;
}
}
return 0;
}