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.