[giimote commit] r194 - wiki

1 view
Skip to first unread message

codesite...@google.com

unread,
Mar 7, 2009, 2:13:38 AM3/7/09
to gii...@googlegroups.com
Author: leif902
Date: Fri Mar 6 23:12:38 2009
New Revision: 194

Modified:
wiki/CodingStyles.wiki

Log:
Updated CodingStyles.wiki to reflect new policy on return statements.

Modified: wiki/CodingStyles.wiki
==============================================================================
--- wiki/CodingStyles.wiki (original)
+++ wiki/CodingStyles.wiki Fri Mar 6 23:12:38 2009
@@ -12,13 +12,22 @@
* Make sure your code does not throw warnings or errors.
* Ensure compatibility with 64-bit hardware.
* Use "interCaps" for symbols.
- * Use "const" instead of a macro
+ * Use "const" when defining constants
for example:
{{{
#define btnPlus 8 // This is wrong
const int btnPlus = 8; // This is right
}}}
* Do not create null pointers.
+ * Always include a return statement even in functions which do not
return data.
+ for example:
+ {{{
+ void saveA(int a*)
+ {
+ a* = 1 + 1;
+ return;
+ }
+ }}}

= Pointers =
* Cleanup the heap after yourself when declaring objects.

Reply all
Reply to author
Forward
0 new messages