mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Update coding guidelines
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -49,10 +49,25 @@ if (foo) {
|
|||||||
|
|
||||||
Case statements:
|
Case statements:
|
||||||
switch (foo) {
|
switch (foo) {
|
||||||
case BAR:
|
case BAR:
|
||||||
blah();
|
blah();
|
||||||
break;
|
break;
|
||||||
case OTHER:
|
case OTHER:
|
||||||
other();
|
other();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
No nested statements without braces, e.g. no:
|
||||||
|
|
||||||
|
for (x=0;x<5;x++)
|
||||||
|
if (foo)
|
||||||
|
if (bar)
|
||||||
|
baz();
|
||||||
|
|
||||||
|
instead do:
|
||||||
|
for (x=0;x<5;x++) {
|
||||||
|
if (foo) {
|
||||||
|
if (bar)
|
||||||
|
baz();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user