summaryrefslogtreecommitdiff
path: root/HACKING
diff options
context:
space:
mode:
authorSimon Howard2015-02-26 00:21:25 -0500
committerSimon Howard2015-02-26 00:21:25 -0500
commit622653dde922a486a056b63d37dc6d7d6f26f3a4 (patch)
tree716e9adbd7e7bc0830afbf4e8b47a7715d222f71 /HACKING
parent074026b37ee26e78ae1c25907d2b7211b3e5fe91 (diff)
downloadchocolate-doom-622653dde922a486a056b63d37dc6d7d6f26f3a4.tar.gz
chocolate-doom-622653dde922a486a056b63d37dc6d7d6f26f3a4.tar.bz2
chocolate-doom-622653dde922a486a056b63d37dc6d7d6f26f3a4.zip
Tweak HACKING style guide.
There was no example for how to write function calls. Do this to make clear that there should be no space between the function name and the open paren. Give examples of assignments and if() conditions as well, and tweak the for() style - there's no reason to omit spaces around operators for the looping conditions.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING13
1 files changed, 9 insertions, 4 deletions
diff --git a/HACKING b/HACKING
index 3bbe23d0..db20f963 100644
--- a/HACKING
+++ b/HACKING
@@ -64,11 +64,15 @@ typedef struct
void FunctionName(int argument, int arg2, int arg3, int arg4, int arg5,
int arg6, int arg7)
{
- if (condition)
+ int assign_var;
+
+ assign_var = arg2 + arg3 * arg4 * (arg5 + arg6);
+
+ if (foo && !bar || baz && qux || !(foo && bar && baz))
{
body;
}
- else if (condition)
+ else if (xyz + 4 < abc * 4 + 3)
{
body;
}
@@ -97,9 +101,10 @@ void FunctionName(int argument, int arg2, int arg3, int arg4, int arg5,
break;
}
- for (a=0; a<10; ++a)
+ for (a = 0; a < 10; ++a)
{
- loop_body;
+ FunctionCall(arg1, arg2, arg3, arg4,
+ arg_split_onto_second_line);
}
while (a < 10)