--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../aros.css' --->
This guide applies to all .c and .h files. If there is a conflict between local style and this guide, this guide wins.
Example:
if (cond) {
do_work();
}
Examples:
a = b + c; mask = (x << 2) | y; ptr = base + offset;
Examples:
i++; --j; p = &obj; q = *p;
Examples:
if (a == b) /* not: if ( a == b ) */ func(x, y); /* not: func( x, y ) */
Example:
static int foo(int x)
{
if (x > 0) {
return x;
}
return 0;
}
Example:
if (ok) {
do_a();
} else {
do_b();
}
Example:
do {
work();
} while (cond);
Examples:
char *p; const struct Foo *foo; struct Node *node; void (*fn)(int x);
Example:
char *a, *b;
Conditions:
if (really_long_condition &&
another_condition &&
final_condition) {
...
}
Function calls:
rc = some_function(arg1, arg2, arg3,
arg4, arg5);
Logging and long format strings:
bug("%s: dev=%u ep=%u state=%lu\n",
__func__, dev, ep, state);
Guidance:
Preferred:
if (error) {
return FAIL;
}