summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-02-11 16:48:29 +0100
committerwm4 <wm4@nowhere>2017-02-11 16:48:29 +0100
commit8432514c5fd0be05a8d76ce536610c547658af89 (patch)
tree43779c67564c96d9264fe5760c49b1a4d045a5af
parent8bc335e3db2434ef594e49e8ddff3d6c89a6a009 (diff)
downloadmpv-8432514c5fd0be05a8d76ce536610c547658af89.tar.bz2
mpv-8432514c5fd0be05a8d76ce536610c547658af89.tar.xz
DOCS/contribute.md: adjust coding style for if/else bracing
-rw-r--r--DOCS/contribute.md10
1 files changed, 4 insertions, 6 deletions
diff --git a/DOCS/contribute.md b/DOCS/contribute.md
index 9fc9d8d8bc..994e2040c1 100644
--- a/DOCS/contribute.md
+++ b/DOCS/contribute.md
@@ -101,18 +101,16 @@ mpv uses C99 with K&R formatting, with some exceptions.
do_something();
}
```
-- If the body of an if statement uses braces, the else branch should also
- use braces (and reverse).
+- If the if has an else branch, both branches should use braces, even if they're
+ technically redundant.
Example:
```C
if (a) {
- // do something
- something();
- something_else();
- } else {
one_line();
+ } else {
+ one_other_line();
}
```
- If an if condition spans multiple physical lines, then put the opening brace