[libvirt] [PATCH] Get rid of shadowed booleans

There are still two places where we are using 1bit width unsigned integer to store a boolean. There's no real need for this and these occurrences can be replaced with 'bool'. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/conf/interface_conf.h | 4 ++-- src/rpc/virnetserver.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/conf/interface_conf.h b/src/conf/interface_conf.h index 4857822..0e22575 100644 --- a/src/conf/interface_conf.h +++ b/src/conf/interface_conf.h @@ -164,7 +164,7 @@ typedef virInterfaceObj *virInterfaceObjPtr; struct _virInterfaceObj { virMutex lock; - unsigned int active:1; /* 1 if interface is active (up) */ + bool active; /* true if interface is active (up) */ virInterfaceDefPtr def; /* The interface definition */ }; @@ -175,7 +175,7 @@ struct _virInterfaceObjList { virInterfaceObjPtr *objs; }; -static inline int +static inline bool virInterfaceObjIsActive(const virInterfaceObj *iface) { return iface->active; diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 2306e10..8907768 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -95,7 +95,7 @@ struct _virNetServer { unsigned int keepaliveCount; bool keepaliveRequired; - unsigned int quit :1; + bool quit; #ifdef WITH_GNUTLS virNetTLSContextPtr tls; @@ -1035,7 +1035,7 @@ static void virNetServerAutoShutdownTimer(int timerid ATTRIBUTE_UNUSED, if (!srv->autoShutdownInhibitions) { VIR_DEBUG("Automatic shutdown triggered"); - srv->quit = 1; + srv->quit = true; } virObjectUnlock(srv); @@ -1074,7 +1074,7 @@ void virNetServerRun(virNetServerPtr srv) virNetServerMDNSStart(srv->mdns) < 0) goto cleanup; - srv->quit = 0; + srv->quit = false; if (srv->autoShutdownTimeout && (timerid = virEventAddTimeout(-1, @@ -1162,7 +1162,7 @@ void virNetServerQuit(virNetServerPtr srv) virObjectLock(srv); VIR_DEBUG("Quit requested %p", srv); - srv->quit = 1; + srv->quit = true; virObjectUnlock(srv); } -- 1.8.1.5

On 10/22/2013 01:36 PM, Michal Privoznik wrote:
There are still two places where we are using 1bit width unsigned integer to store a boolean. There's no real need for this and these occurrences can be replaced with 'bool'.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/conf/interface_conf.h | 4 ++-- src/rpc/virnetserver.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Michal Privoznik