summaryrefslogtreecommitdiffstats
path: root/HACKING
diff options
context:
space:
mode:
authorEmmanuel Raviart <eraviart@entrouvert.com>2004-07-30 17:02:49 +0000
committerEmmanuel Raviart <eraviart@entrouvert.com>2004-07-30 17:02:49 +0000
commit7f902ab5cbb35a05953487c7100e893d288ffe0f (patch)
treebdb531d419d948504f05ff48ec07e9a78fa9d048 /HACKING
parent386d690c3cc88977826ca2eb312532f5cb2eb44d (diff)
downloadlasso-7f902ab5cbb35a05953487c7100e893d288ffe0f.tar.gz
lasso-7f902ab5cbb35a05953487c7100e893d288ffe0f.tar.xz
lasso-7f902ab5cbb35a05953487c7100e893d288ffe0f.zip
Improved book. It also now includes HACKING.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING79
1 files changed, 45 insertions, 34 deletions
diff --git a/HACKING b/HACKING
index 190b04b8..c3dc10e4 100644
--- a/HACKING
+++ b/HACKING
@@ -1,34 +1,45 @@
-1) Coding style.
- - Use explicit "!= NULL", "!= 0", etc. This makes code easier to read and
- remove warnings on some platform. Don't forget SPACES before and after
- the comparison operator.
- Example:
- BAD:
- if(a)
- BAD:
- if(a!=NULL)
- GOOD:
- if(a != NULL)
- GOOD:
- if(a != 0)
-
- - Put figure brackets '{}' even if you have only one operator
- in "if", "for", etc. This also makes code easier to read and
- saves a lot of time when you need to quickly change something.
- Example:
- BAD:
- if(a != NULL)
- message(G_LOG_LEVEL_MESSAGE, "Ko");
- GOOD:
- if(a != NULL) {
- message(G_LOG_LEVEL_MESSAGE, "Ok");
- }
-
- - Use round brackets '()' for "return".
- Example:
- BAD:
- return 0;
- GOOD:
- return(0);
-
- - Check for memory leaks.
+============
+Coding Style
+============
+
+- Use explicit ``!= NULL``, ``!= 0``, etc. This makes code easier to read
+ and remove warnings on some platform. Don't forget SPACES before and
+ after the comparison operator.
+
+ Examples:
+ BAD:
+ ``if(a)``
+ BAD:
+ ``if(a!=NULL)``
+ GOOD:
+ ``if(a != NULL)``
+ GOOD:
+ ``if(a != 0)``
+
+- Put figure brackets ``{}`` even if you have only one operator
+ in ``if``, ``for``, etc. This also makes code easier to read and
+ saves a lot of time when you need to quickly change something.
+
+ Examples:
+ BAD:
+ .. line-block::
+
+ if(a != NULL)
+ message(G_LOG_LEVEL_MESSAGE, "Ko");
+ GOOD:
+ .. line-block::
+
+ if(a != NULL) {
+ message(G_LOG_LEVEL_MESSAGE, "Ok");
+ }
+
+- Use round brackets ``()`` for ``return``.
+
+ Examples:
+ BAD:
+ ``return 0;``
+ GOOD:
+ ``return(0);``
+
+- Check for memory leaks.
+