This commit is contained in:
Valery Febvre 2004-08-04 21:24:48 +00:00
parent 6f48cba5e8
commit 6483c9584b
1 changed files with 23 additions and 7 deletions

30
HACKING
View File

@ -8,13 +8,13 @@ Coding Style
Examples:
BAD:
``if(a)``
``if (a)``
BAD:
``if(a!=NULL)``
``if (a!=NULL)``
GOOD:
``if(a != NULL)``
``if (a != NULL)``
GOOD:
``if(a != 0)``
``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
@ -24,12 +24,29 @@ Coding Style
BAD:
.. line-block::
if(a != NULL)
if (a != NULL)
message(G_LOG_LEVEL_MESSAGE, "Ko");
GOOD:
.. line-block::
if(a != NULL) {
if (a != NULL) {
message(G_LOG_LEVEL_MESSAGE, "Ok");
}
- Put SPACES before the opening round bracket and after the closing round
bracket. One more time, it improves the readability of the code.
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");
}
@ -42,4 +59,3 @@ Coding Style
``return(0);``
- Check for memory leaks.