aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-01-13 10:45:41 +0000
committerJim Meyering <meyering@redhat.com>2009-01-13 10:45:41 +0000
commit17bfd657b7bd0d2635d9be5757fb1e685c162c80 (patch)
treeede4211b1f874a6df819f847b56ae9144fca9ca4 /HACKING
parentfix the QEmu links (diff)
downloadlibvirt-17bfd657b7bd0d2635d9be5757fb1e685c162c80.tar.gz
libvirt-17bfd657b7bd0d2635d9be5757fb1e685c162c80.tar.bz2
libvirt-17bfd657b7bd0d2635d9be5757fb1e685c162c80.zip
* HACKING: Clarify "bool" vs. XDR/wire-format.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING5
1 files changed, 4 insertions, 1 deletions
diff --git a/HACKING b/HACKING
index ba036043e..ca39d61d8 100644
--- a/HACKING
+++ b/HACKING
@@ -115,7 +115,10 @@ standard type like int32_t, uint32_t, uint64_t, etc.
While using "bool" is good for readability, it comes with minor caveats:
- Don't use "bool" in places where the type size must be constant across
- all systems, like public interfaces and on-the-wire protocols.
+ all systems, like public interfaces and on-the-wire protocols. Note
+ that it would be possible (albeit wasteful) to use "bool" in libvirt's
+ logical wire protocol, since XDR maps that to its lower-level bool_t
+ type, which *is* fixed-size.
- Don't compare a bool variable against the literal, "true",
since a value with a logical non-false value need not be "1".
I.e., don't write "if (seen == true) ...". Rather, write "if (seen)...".