[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Suggestion add missing braces to single statement IF, FOR and WHILE etc.
From: |
Alec Davis |
Subject: |
Suggestion add missing braces to single statement IF, FOR and WHILE etc. |
Date: |
Thu, 16 Oct 2008 00:14:19 +1300 |
The Open Source PABX guidelines
http://svn.digium.com/view/asterisk/trunk/doc/CODING-GUIDELINES?view=markup
call for braces to be everywhere. The existing codebase has nearly everywhere
previously not required this. Creating a dilemma for modifying code.
- No nested statements without braces, e.g.:
for (x = 0; x < 5; x++)
if (foo)
if (bar)
baz();
instead do:
for (x = 0; x < 5; x++) {
if (foo) {
if (bar) {
baz();
}
}
}
Currently, 'indent -br' only moves an existing { to the same line as the IF,
any chnace of adding a parameter to insert missing braces?
Regards Alec Davis
- Suggestion add missing braces to single statement IF, FOR and WHILE etc.,
Alec Davis <=