From 527ae7092d98ff11c10ec92831e1297e33e946cf Mon Sep 17 00:00:00 2001 From: Barbu Paul - Gheorghe Date: Tue, 31 Jul 2012 21:24:31 +0300 Subject: added coding standard Signed-off-by: Barbu Paul - Gheorghe --- HACKING | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/HACKING b/HACKING index 8a59344e..e859bd86 100644 --- a/HACKING +++ b/HACKING @@ -101,6 +101,50 @@ alpm_list_t *alpm_list_add(alpm_list_t *list, void *data) NOT for(a=0;a0;a++,n--) {} +9. Declare all variables at the start of the block. +[source,C] +------------------------------------------- +int SYMEXPORT alpm_db_remove_server(alpm_db_t *db, const char *url) +{ + char *newurl, *vdata = NULL; + + newurl = url; + if(!newurl) { + return -1; + } + + ... + + if(vdata) { + ... + } + + return 1; +} +------------------------------------------- + + NOT + +[source,C] +------------------------------------------- +int SYMEXPORT alpm_db_remove_server(alpm_db_t *db, const char *url) +{ + char *newurl = url; + + if(!newurl) { + return -1; + } + + char *vdata = NULL; + + if(vdata) { + ... + } + + return 1; +} +------------------------------------------- + Other Concerns -------------- -- cgit v1.2.3-70-g09d2