I finally get to reformating the DBus code to match our coding guidelines.
When I was looking on the code I have found some more rules we might add to
the guidelines. This proposal uses the most frequent styles I've found in the
code.
* Control statements (if, else, while, for):
Keyword is followed by one space, then left parenthesis without space,
condition, right parenthesis, space, opening brace on same line. "else" and
"else if" are on same line with ending brace and opening brace, separated by
space.
if (condition1) {
statement1;
} else if (condition2) {
statement2;
} else {
statement3;
}
* Switch statement:
Cases have same indentation as switch. Body of cases is indented. Opening and
ending brace of switch are on separate lines.
switch (expression)
{
case 0:
command0;
break;
case 1:
command1;
break;
default:
command;
}
* Operators have spaces from both sides:
x = a + b * c;
* Classes:
Visibility modifiers have same indentation as the class, methods and
properties are indented. Name of the class should be Upper-CamelCase (first
letter of each word upper cased).
class TestClass : public ParentClass
{
private:
int x;
public:
void test();
};
If these (or some other) modification of the guidelines are accepted, I will
create the patch to adjust the code to match them.
Radek Novacek