diff options
author | Andreas Schneider <asn@samba.org> | 2016-02-15 15:51:26 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2016-02-15 17:42:13 +0100 |
commit | dae1a9fdb5f85ebb1c72f7990959ffaa3003c769 (patch) | |
tree | 4538410d857b2a291fe6b6e03f01126aa18be8e2 /README.Coding | |
parent | 19fdc7fd5785498044223874460f0ef13e88f576 (diff) | |
download | samba-dae1a9fdb5f85ebb1c72f7990959ffaa3003c769.tar.gz |
README.Coding: Add a boolean example we use very often
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'README.Coding')
-rw-r--r-- | README.Coding | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/README.Coding b/README.Coding index 29bad1b1ffc..c4e9dfebf98 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 -------- |