[Asterisk-cvs] asterisk/doc CODING-GUIDELINES,1.2,1.3
markster at lists.digium.com
markster at lists.digium.com
Tue May 18 01:40:48 CDT 2004
Update of /usr/cvsroot/asterisk/doc
In directory mongoose.digium.com:/tmp/cvs-serv14398/doc
Modified Files:
CODING-GUIDELINES
Log Message:
Update coding guidelines
Index: CODING-GUIDELINES
===================================================================
RCS file: /usr/cvsroot/asterisk/doc/CODING-GUIDELINES,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CODING-GUIDELINES 15 May 2004 15:34:31 -0000 1.2
+++ CODING-GUIDELINES 18 May 2004 05:52:52 -0000 1.3
@@ -49,10 +49,25 @@
Case statements:
switch (foo) {
- case BAR:
- blah();
- break;
- case OTHER:
- other();
- break;
+case BAR:
+ blah();
+ break;
+case OTHER:
+ other();
+ 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();
+ }
}
More information about the svn-commits
mailing list