[Libvir] [PATCH] qemu_conf.h: Avoid dubious signed one-bit bitfield

Jim Paris jim at jtan.com
Thu Nov 15 08:32:21 UTC 2007


Signed one-bit bitfields are odd (values are 0 and -1?).  The code
doesn't test for == 1, so it's not currently broken, but it's fragile.
(Noticed by Sparse).
---
 src/qemu_conf.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu_conf.h b/src/qemu_conf.h
index 72e582d..6a59744 100644
--- a/src/qemu_conf.h
+++ b/src/qemu_conf.h
@@ -305,8 +305,8 @@ struct qemud_driver {
     char *networkConfigDir;
     char *networkAutostartDir;
     char logDir[PATH_MAX];
-    int vncTLS : 1;
-    int vncTLSx509verify : 1;
+    unsigned int vncTLS : 1;
+    unsigned int vncTLSx509verify : 1;
     char *vncTLSx509certdir;
     char vncListen[BR_INET_ADDR_MAXLEN];
 };
-- 
1.5.3.4




More information about the libvir-list mailing list