Skip to content

Commit 5cc8edf

Browse files
committed
Update STYLE.
1 parent bc4d2bf commit 5cc8edf

1 file changed

Lines changed: 30 additions & 28 deletions

File tree

  • contrib/openbsm/bin/bsmconv

contrib/openbsm/bin/bsmconv/STYLE

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,33 @@ The if statements
2929
Use a little bit more strict rules in terms of using brackets around the if
3030
statements. Here an example of the desired style:
3131

32-
if (!fun_returning_bool) {
33-
f();
34-
} else {
35-
g();
36-
h();
37-
}
38-
39-
if (!fun_returning_bool) {
40-
f();
41-
} else if (fun_returning_bool2) {
42-
this_is_a_really_long_function_name(withsolongparameters,
43-
thatthelinehastobebroken);
44-
} else {
45-
g();
46-
}
47-
48-
if (f() == 0)
49-
return (1);
50-
else
51-
return (2);
52-
53-
/* It is better to break on "&&" and "||" than on the function's "(". */
54-
if (!very_long_fun(aaa, bbb, ccc) &&
55-
another_very_long_fun(xxx, yyy, zzz)
56-
f();
57-
else if (this_breaking_style_is_not_that_good(xxx, yyy, zzz) && fun(
58-
aaa, bbb, ccc)
59-
f();
32+
```c
33+
if (!fun_returning_bool) {
34+
f();
35+
} else {
36+
g();
37+
h();
38+
}
39+
40+
if (!fun_returning_bool) {
41+
f();
42+
} else if (fun_returning_bool2) {
43+
this_is_a_really_long_function_name(withsolongparameters,
44+
thatthelinehastobebroken);
45+
} else {
46+
g();
47+
}
48+
49+
if (f() == 0)
50+
return (1);
51+
else
52+
return (2);
53+
54+
/* It is better to break on "&&" and "||" than on the function's "(". */
55+
if (!very_long_fun(aaa, bbb, ccc) &&
56+
another_very_long_fun(xxx, yyy, zzz)
57+
f();
58+
else if (this_breaking_style_is_not_that_good(xxx, yyy, zzz) && fun(
59+
aaa, bbb, ccc)
60+
f();
61+
```

0 commit comments

Comments
 (0)