mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
maint: avoid comparisons to bool constants
HACKING already mentions that comparisons against literal 'true' are unsafe; for consistency, also shorten comparisons against 'false'. * src/conf/domain_conf.c (virDomainNetDefParseXML): Simplify. * src/nwfilter/nwfilter_gentech_driver.c (virNWFilterDomainFWUpdateCB): Likewise. * tools/virsh.c (cmdVolDownload, vshCommandRun, vshPrintExtra): Likewise.
This commit is contained in:
parent
5d09c31495
commit
f84fe150e1
@ -2602,7 +2602,7 @@ virDomainNetDefParseXML(virCapsPtr caps,
|
||||
xmlStrEqual(cur->name, BAD_CAST "source")) {
|
||||
dev = virXMLPropString(cur, "dev");
|
||||
mode = virXMLPropString(cur, "mode");
|
||||
} else if ((virtPortParsed == false) &&
|
||||
} else if (!virtPortParsed &&
|
||||
(def->type == VIR_DOMAIN_NET_TYPE_DIRECT) &&
|
||||
xmlStrEqual(cur->name, BAD_CAST "virtualport")) {
|
||||
if (virVirtualPortProfileParamsParseXML(cur, &virtPort))
|
||||
|
@ -1032,7 +1032,7 @@ virNWFilterDomainFWUpdateCB(void *payload,
|
||||
cb->err = virNWFilterUpdateInstantiateFilter(cb->conn,
|
||||
net,
|
||||
&skipIface);
|
||||
if (cb->err == 0 && skipIface == true) {
|
||||
if (cb->err == 0 && skipIface) {
|
||||
/* filter tree unchanged -- no update needed */
|
||||
cb->err = virHashAddEntry(cb->skipInterfaces,
|
||||
net->ifname,
|
||||
|
@ -7318,7 +7318,7 @@ cmdVolDownload (vshControl *ctl, const vshCmd *cmd)
|
||||
|
||||
cleanup:
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
if (ret == false && created)
|
||||
if (!ret && created)
|
||||
unlink(file);
|
||||
if (vol)
|
||||
virStorageVolFree(vol);
|
||||
@ -11697,11 +11697,11 @@ vshCommandRun(vshControl *ctl, const vshCmd *cmd)
|
||||
if (enable_timing)
|
||||
GETTIMEOFDAY(&after);
|
||||
|
||||
if (ret == false)
|
||||
if (!ret)
|
||||
virshReportError(ctl);
|
||||
|
||||
/* try to automatically catch disconnections */
|
||||
if ((ret == false) &&
|
||||
if (!ret &&
|
||||
((disconnected != 0) ||
|
||||
((last_error != NULL) &&
|
||||
(((last_error->code == VIR_ERR_SYSTEM_ERROR) &&
|
||||
@ -12105,7 +12105,7 @@ vshPrintExtra(vshControl *ctl, const char *format, ...)
|
||||
va_list ap;
|
||||
char *str;
|
||||
|
||||
if (ctl && ctl->quiet == true)
|
||||
if (ctl && ctl->quiet)
|
||||
return;
|
||||
|
||||
va_start(ap, format);
|
||||
|
Loading…
x
Reference in New Issue
Block a user