[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Mon Feb 15 19:53:02 UTC 2016


The branch, master has been updated
       via  279d249 README.Coding: Improve pointer example
       via  dae1a9f README.Coding: Add a boolean example we use very often
      from  19fdc7f script/release.sh: generate announce.${tagname}.patch.txt in announcement_samba_rc()

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 279d2499763b5e56fd26faa4d04fe307d713944d
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Feb 15 15:53:50 2016 +0100

    README.Coding: Improve pointer example
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Mon Feb 15 20:52:24 CET 2016 on sn-devel-144

commit dae1a9fdb5f85ebb1c72f7990959ffaa3003c769
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Feb 15 15:51:26 2016 +0100

    README.Coding: Add a boolean example we use very often
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 README.Coding | 12 ++++++++++++
 1 file changed, 12 insertions(+)


Changeset truncated at 500 lines:

diff --git a/README.Coding b/README.Coding
index 29bad1b..2b011a6 100644
--- a/README.Coding
+++ b/README.Coding
@@ -312,6 +312,17 @@ lib/replace/, new code should adhere to the following conventions:
   * Boolean values are "true" and "false" (not True or False)
   * Exact width integers are of type [u]int[8|16|32|64]_t
 
+Most of the time a good name for a boolean variable is 'ok'. Here is an
+example we often use:
+
+	bool ok;
+
+	ok = foo();
+	if (!ok) {
+		/* do something */
+	}
+
+It makes the code more readable and is easy to debug.
 
 Typedefs
 --------
@@ -363,6 +374,7 @@ it's also easier to use the "step" command within gdb.
 Good Example:
 
 	char *name = NULL;
+	int ret;
 
 	name = get_some_name();
 	if (name == NULL) {


-- 
Samba Shared Repository



More information about the samba-cvs mailing list