Skip to content

Commit

Permalink
Update STYLE.
Browse files Browse the repository at this point in the history
  • Loading branch information
0mp committed Feb 23, 2017
1 parent bc4d2bf commit 5cc8edf
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions contrib/openbsm/bin/bsmconv/STYLE
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,33 @@ The if statements
Use a little bit more strict rules in terms of using brackets around the if
statements. Here an example of the desired style:

if (!fun_returning_bool) {
f();
} else {
g();
h();
}

if (!fun_returning_bool) {
f();
} else if (fun_returning_bool2) {
this_is_a_really_long_function_name(withsolongparameters,
thatthelinehastobebroken);
} else {
g();
}

if (f() == 0)
return (1);
else
return (2);

/* It is better to break on "&&" and "||" than on the function's "(". */
if (!very_long_fun(aaa, bbb, ccc) &&
another_very_long_fun(xxx, yyy, zzz)
f();
else if (this_breaking_style_is_not_that_good(xxx, yyy, zzz) && fun(
aaa, bbb, ccc)
f();
```c
if (!fun_returning_bool) {
f();
} else {
g();
h();
}

if (!fun_returning_bool) {
f();
} else if (fun_returning_bool2) {
this_is_a_really_long_function_name(withsolongparameters,
thatthelinehastobebroken);
} else {
g();
}

if (f() == 0)
return (1);
else
return (2);

/* It is better to break on "&&" and "||" than on the function's "(". */
if (!very_long_fun(aaa, bbb, ccc) &&
another_very_long_fun(xxx, yyy, zzz)
f();
else if (this_breaking_style_is_not_that_good(xxx, yyy, zzz) && fun(
aaa, bbb, ccc)
f();
```

0 comments on commit 5cc8edf

Please sign in to comment.