Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/conf/cpu_conf.c | 6 +--
src/conf/device_conf.c | 2 +-
src/conf/domain_audit.c | 4 +-
src/conf/domain_conf.c | 88 ++++++++++++++++++-------------------
src/conf/interface_conf.c | 4 +-
src/conf/network_conf.c | 4 +-
src/conf/nwfilter_params.c | 4 +-
src/conf/storage_conf.c | 48 ++++++++++----------
src/conf/virchrdev.c | 4 +-
src/conf/virnodedeviceobj.c | 4 +-
src/conf/virsecretobj.c | 2 +-
src/conf/virstorageobj.c | 4 +-
12 files changed, 87 insertions(+), 87 deletions(-)
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 43a3ab5dcdfa..ca42760c38ba 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -448,21 +448,21 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
_("Missing 'sockets' attribute in CPU
topology"));
goto cleanup;
}
- def->sockets = (unsigned int) ul;
+ def->sockets = (unsigned int)ul;
if (virXPathULong("string(./topology[1]/@cores)", ctxt, &ul) <
0) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("Missing 'cores' attribute in CPU
topology"));
goto cleanup;
}
- def->cores = (unsigned int) ul;
+ def->cores = (unsigned int)ul;
if (virXPathULong("string(./topology[1]/@threads)", ctxt, &ul) <
0) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("Missing 'threads' attribute in CPU
topology"));
goto cleanup;
}
- def->threads = (unsigned int) ul;
+ def->threads = (unsigned int)ul;
if (!def->sockets || !def->cores || !def->threads) {
virReportError(VIR_ERR_XML_ERROR, "%s",
diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c
index d69f94fadf14..c408dee9541a 100644
--- a/src/conf/device_conf.c
+++ b/src/conf/device_conf.c
@@ -81,7 +81,7 @@ virDomainDeviceInfoAddressIsEqual(const virDomainDeviceInfo *a,
if (a->type != b->type)
return false;
- switch ((virDomainDeviceAddressType) a->type) {
+ switch ((virDomainDeviceAddressType)a->type) {
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE:
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST:
/* address types below don't have any specific data */
diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index 82868bca76b0..b5fd1cafbcb8 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -162,7 +162,7 @@ virDomainAuditSmartcard(virDomainObjPtr vm,
size_t i;
if (def) {
- switch ((virDomainSmartcardType) def->type) {
+ switch ((virDomainSmartcardType)def->type) {
case VIR_DOMAIN_SMARTCARD_TYPE_HOST:
virDomainAuditGenericDev(vm, "smartcard",
NULL, "nss-smartcard-device",
@@ -1004,7 +1004,7 @@ virDomainAuditInput(virDomainObjPtr vm,
if (!(vmname = virAuditEncode("vm", vm->def->name)))
goto no_memory;
- switch ((virDomainInputType) input->type) {
+ switch ((virDomainInputType)input->type) {
case VIR_DOMAIN_INPUT_TYPE_MOUSE:
case VIR_DOMAIN_INPUT_TYPE_TABLET:
case VIR_DOMAIN_INPUT_TYPE_KBD:
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b0257068dabb..9c4a6b7f968e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1421,7 +1421,7 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def)
const char *virDomainInputDefGetPath(virDomainInputDefPtr input)
{
- switch ((virDomainInputType) input->type) {
+ switch ((virDomainInputType)input->type) {
case VIR_DOMAIN_INPUT_TYPE_MOUSE:
case VIR_DOMAIN_INPUT_TYPE_TABLET:
case VIR_DOMAIN_INPUT_TYPE_KBD:
@@ -1896,7 +1896,7 @@ virDomainControllerDefNew(virDomainControllerType type)
def->model = -1;
def->idx = -1;
- switch ((virDomainControllerType) def->type) {
+ switch ((virDomainControllerType)def->type) {
case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL:
def->opts.vioserial.ports = -1;
def->opts.vioserial.vectors = -1;
@@ -2117,7 +2117,7 @@ virDomainChrSourceDefGetPath(virDomainChrSourceDefPtr chr)
if (!chr)
return NULL;
- switch ((virDomainChrType) chr->type) {
+ switch ((virDomainChrType)chr->type) {
case VIR_DOMAIN_CHR_TYPE_PTY:
case VIR_DOMAIN_CHR_TYPE_DEV:
case VIR_DOMAIN_CHR_TYPE_FILE:
@@ -2558,7 +2558,7 @@ void virDomainHostdevDefClear(virDomainHostdevDefPtr def)
switch (def->mode) {
case VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES:
- switch ((virDomainHostdevCapsType) def->source.caps.type) {
+ switch ((virDomainHostdevCapsType)def->source.caps.type) {
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE:
VIR_FREE(def->source.caps.u.storage.block);
break;
@@ -2574,7 +2574,7 @@ void virDomainHostdevDefClear(virDomainHostdevDefPtr def)
}
break;
case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS:
- switch ((virDomainHostdevSubsysType) def->source.subsys.type) {
+ switch ((virDomainHostdevSubsysType)def->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
virDomainHostdevSubsysSCSIClear(&def->source.subsys.u.scsi);
break;
@@ -2673,7 +2673,7 @@ void virDomainDeviceDefFree(virDomainDeviceDefPtr def)
if (!def)
return;
- switch ((virDomainDeviceType) def->type) {
+ switch ((virDomainDeviceType)def->type) {
case VIR_DOMAIN_DEVICE_DISK:
virDomainDiskDefFree(def->data.disk);
break;
@@ -3566,7 +3566,7 @@ int virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info,
virDomainDeviceInfoPtr
virDomainDeviceGetInfo(virDomainDeviceDefPtr device)
{
- switch ((virDomainDeviceType) device->type) {
+ switch ((virDomainDeviceType)device->type) {
case VIR_DOMAIN_DEVICE_DISK:
return &device->data.disk->info;
case VIR_DOMAIN_DEVICE_FS:
@@ -3812,7 +3812,7 @@ virDomainDeviceInfoIterateInternal(virDomainDefPtr def,
* statement has no real function here and should be optimized out by the
* compiler. */
i = VIR_DOMAIN_DEVICE_LAST;
- switch ((virDomainDeviceType) i) {
+ switch ((virDomainDeviceType)i) {
case VIR_DOMAIN_DEVICE_DISK:
case VIR_DOMAIN_DEVICE_LEASE:
case VIR_DOMAIN_DEVICE_FS:
@@ -4086,7 +4086,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def)
} else if (def->os.type == VIR_DOMAIN_OSTYPE_HVM && def->nserials >
0 &&
def->serials[0]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) {
- switch ((virDomainChrSerialTargetType) def->serials[0]->targetType) {
+ switch ((virDomainChrSerialTargetType)def->serials[0]->targetType) {
case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO:
case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM:
@@ -5252,7 +5252,7 @@ static int
virDomainChrSourceDefValidate(const virDomainChrSourceDef *def,
const virDomainChrDef *chr_def)
{
- switch ((virDomainChrType) def->type) {
+ switch ((virDomainChrType)def->type) {
case VIR_DOMAIN_CHR_TYPE_NULL:
case VIR_DOMAIN_CHR_TYPE_PTY:
case VIR_DOMAIN_CHR_TYPE_VC:
@@ -5451,7 +5451,7 @@ static int
virDomainHostdevDefValidate(const virDomainHostdevDef *hostdev)
{
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
- switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) {
+ switch ((virDomainHostdevSubsysType)hostdev->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
if (hostdev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE
&&
hostdev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
@@ -5512,7 +5512,7 @@ static int
virDomainDeviceDefValidateInternal(const virDomainDeviceDef *dev,
const virDomainDef *def)
{
- switch ((virDomainDeviceType) dev->type) {
+ switch ((virDomainDeviceType)dev->type) {
case VIR_DOMAIN_DEVICE_DISK:
return virDomainDiskDefValidate(dev->data.disk);
@@ -5602,7 +5602,7 @@ virDomainDeviceDefValidateAliasesIterator(virDomainDefPtr def,
return -1;
}
- if (virHashAddEntry(data->aliases, alias, (void *) 1) < 0) {
+ if (virHashAddEntry(data->aliases, alias, (void *)1) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to construct table of device aliases"));
return -1;
@@ -6124,7 +6124,7 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
virBufferAsprintf(buf, "<address type='%s'",
virDomainDeviceAddressTypeToString(info->type));
- switch ((virDomainDeviceAddressType) info->type) {
+ switch ((virDomainDeviceAddressType)info->type) {
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
if (!virPCIDeviceAddressIsEmpty(&info->addr.pci)) {
virBufferAsprintf(buf, " domain='0x%.4x' bus='0x%.2x'
"
@@ -6534,7 +6534,7 @@ virDomainDeviceBootParseXML(xmlNodePtr node,
goto cleanup;
}
- if (virHashAddEntry(bootHash, order, (void *) 1) < 0)
+ if (virHashAddEntry(bootHash, order, (void *)1) < 0)
goto cleanup;
}
@@ -6650,7 +6650,7 @@ virDomainDeviceAddressParseXML(xmlNodePtr address,
goto cleanup;
}
- switch ((virDomainDeviceAddressType) info->type) {
+ switch ((virDomainDeviceAddressType)info->type) {
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
if (virPCIDeviceAddressParseXML(address, &info->addr.pci) < 0)
goto cleanup;
@@ -7384,7 +7384,7 @@ virDomainHostdevSubsysSCSIVHostDefParseXML(xmlNodePtr sourcenode,
goto cleanup;
}
- switch ((virDomainHostdevSubsysSCSIHostProtocolType) hostsrc->protocol) {
+ switch ((virDomainHostdevSubsysSCSIHostProtocolType)hostsrc->protocol) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_VHOST:
if (!(wwpn = virXMLPropString(sourcenode, "wwpn"))) {
virReportError(VIR_ERR_XML_ERROR, "%s",
@@ -11692,7 +11692,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
static int
virDomainChrDefaultTargetType(int devtype)
{
- switch ((virDomainChrDeviceType) devtype) {
+ switch ((virDomainChrDeviceType)devtype) {
case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
virReportError(VIR_ERR_XML_ERROR,
_("target type must be specified for %s device"),
@@ -11723,7 +11723,7 @@ virDomainChrTargetTypeFromString(int devtype,
if (!targetType)
return virDomainChrDefaultTargetType(devtype);
- switch ((virDomainChrDeviceType) devtype) {
+ switch ((virDomainChrDeviceType)devtype) {
case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
ret = virDomainChrChannelTargetTypeFromString(targetType);
break;
@@ -11755,7 +11755,7 @@ virDomainChrTargetModelFromString(int devtype,
if (!targetModel)
return 0;
- switch ((virDomainChrDeviceType) devtype) {
+ switch ((virDomainChrDeviceType)devtype) {
case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL:
ret = virDomainChrSerialTargetModelTypeFromString(targetModel);
break;
@@ -12148,7 +12148,7 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
}
sourceParsed++;
- switch ((virDomainChrType) def->type) {
+ switch ((virDomainChrType)def->type) {
case VIR_DOMAIN_CHR_TYPE_FILE:
if (virDomainChrSourceDefParseFile(def, cur) < 0)
goto error;
@@ -12370,7 +12370,7 @@ virDomainChrDefParseXML(virDomainXMLOptionPtr xmlopt,
goto error;
}
- nodeName = (const char *) node->name;
+ nodeName = (const char *)node->name;
if ((def->deviceType = virDomainChrDeviceTypeFromString(nodeName)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown character device type: %s"),
@@ -15103,7 +15103,7 @@ virDomainHostdevDefParseXML(virDomainXMLOptionPtr xmlopt,
goto error;
}
if (def->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
- switch ((virDomainHostdevSubsysType) def->source.subsys.type) {
+ switch ((virDomainHostdevSubsysType)def->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
if (virXPathBoolean("boolean(./readonly)", ctxt))
def->readonly = true;
@@ -15763,7 +15763,7 @@ virDomainDeviceDefParse(const char *xmlStr,
if (VIR_ALLOC(dev) < 0)
goto error;
- if ((dev->type = virDomainDeviceTypeFromString((const char *) node->name)) <
0) {
+ if ((dev->type = virDomainDeviceTypeFromString((const char *)node->name)) <
0) {
/* Some crazy mapping of serial, parallel, console and channel to
* VIR_DOMAIN_DEVICE_CHR. */
if (virXMLNodeNameEqual(node, "channel") ||
@@ -15779,7 +15779,7 @@ virDomainDeviceDefParse(const char *xmlStr,
}
}
- switch ((virDomainDeviceType) dev->type) {
+ switch ((virDomainDeviceType)dev->type) {
case VIR_DOMAIN_DEVICE_DISK:
if (!(dev->data.disk = virDomainDiskDefParseXML(xmlopt, node, ctxt,
NULL, def->seclabels,
@@ -16087,7 +16087,7 @@ virDomainHostdevMatchSubsys(virDomainHostdevDefPtr a,
if (a->source.subsys.type != b->source.subsys.type)
return 0;
- switch ((virDomainHostdevSubsysType) a->source.subsys.type) {
+ switch ((virDomainHostdevSubsysType)a->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
return virDomainHostdevMatchSubsysPCI(a, b);
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
@@ -16785,11 +16785,11 @@ virDomainChrEquals(virDomainChrDefPtr src,
!virDomainChrSourceDefIsEqual(src->source, tgt->source))
return false;
- switch ((virDomainChrDeviceType) src->deviceType) {
+ switch ((virDomainChrDeviceType)src->deviceType) {
case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
if (src->targetType != tgt->targetType)
return false;
- switch ((virDomainChrChannelTargetType) src->targetType) {
+ switch ((virDomainChrChannelTargetType)src->targetType) {
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN:
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO:
return STREQ_NULLABLE(src->target.name, tgt->target.name);
@@ -16901,7 +16901,7 @@ virDomainChrGetDomainPtrs(const virDomainDef *vmdef,
*arrPtr = NULL;
*cntPtr = 0;
} else {
- *arrPtr = (const virDomainChrDef **) *arrVar;
+ *arrPtr = (const virDomainChrDef **)*arrVar;
*cntPtr = *cntVar;
}
}
@@ -17994,7 +17994,7 @@ virDomainLoaderDefParseXML(xmlNodePtr node,
readonly_str = virXMLPropString(node, "readonly");
secure_str = virXMLPropString(node, "secure");
type_str = virXMLPropString(node, "type");
- loader->path = (char *) xmlNodeGetContent(node);
+ loader->path = (char *)xmlNodeGetContent(node);
if (readonly_str &&
(loader->readonly = virTristateBoolTypeFromString(readonly_str)) <= 0) {
@@ -20668,7 +20668,7 @@ virDomainDeviceInfoCheckABIStability(virDomainDeviceInfoPtr src,
return false;
}
- switch ((virDomainDeviceAddressType) src->type) {
+ switch ((virDomainDeviceAddressType)src->type) {
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
if (src->addr.pci.domain != dst->addr.pci.domain ||
src->addr.pci.bus != dst->addr.pci.bus ||
@@ -22313,7 +22313,7 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src,
* also have to add an check above. Otherwise the switch statement has no
* real function here and should be optimized out by the compiler. */
i = VIR_DOMAIN_DEVICE_LAST;
- switch ((virDomainDeviceType) i) {
+ switch ((virDomainDeviceType)i) {
case VIR_DOMAIN_DEVICE_DISK:
case VIR_DOMAIN_DEVICE_LEASE:
case VIR_DOMAIN_DEVICE_FS:
@@ -22463,7 +22463,7 @@ virDomainDefMaybeAddSmartcardController(virDomainDefPtr def)
virDomainDeviceInfoPtr info = &def->smartcards[j]->info;
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID &&
info->addr.ccid.controller == 0 &&
- (int) info->addr.ccid.slot > max)
+ (int)info->addr.ccid.slot > max)
max = info->addr.ccid.slot;
}
smartcard->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID;
@@ -24575,7 +24575,7 @@ virDomainChrTargetDefFormat(virBufferPtr buf,
const char *targetType = virDomainChrTargetTypeToString(def->deviceType,
def->targetType);
- switch ((virDomainChrDeviceType) def->deviceType) {
+ switch ((virDomainChrDeviceType)def->deviceType) {
case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: {
if (!targetType) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -26587,7 +26587,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
xmlIndentTreeOutput = oldIndentTreeOutput;
goto error;
}
- virBufferAsprintf(buf, "%s\n", (char *) xmlBufferContent(xmlbuf));
+ virBufferAsprintf(buf, "%s\n", (char *)xmlBufferContent(xmlbuf));
xmlBufferFree(xmlbuf);
xmlIndentTreeOutput = oldIndentTreeOutput;
}
@@ -28357,7 +28357,7 @@ virDomainDeviceDefCopy(virDomainDeviceDefPtr src,
int rc = -1;
char *netprefix;
- switch ((virDomainDeviceType) src->type) {
+ switch ((virDomainDeviceType)src->type) {
case VIR_DOMAIN_DEVICE_DISK:
rc = virDomainDiskDefFormat(&buf, src->data.disk, flags, xmlopt);
break;
@@ -28548,7 +28548,7 @@ virDomainObjGetMetadata(virDomainObjPtr vm,
if (!(def = virDomainObjGetOneDef(vm, flags)))
goto cleanup;
- switch ((virDomainMetadataType) type) {
+ switch ((virDomainMetadataType)type) {
case VIR_DOMAIN_METADATA_DESCRIPTION:
if (VIR_STRDUP(ret, def->description) < 0)
goto cleanup;
@@ -28600,7 +28600,7 @@ virDomainDefSetMetadata(virDomainDefPtr def,
goto cleanup;
}
- switch ((virDomainMetadataType) type) {
+ switch ((virDomainMetadataType)type) {
case VIR_DOMAIN_METADATA_DESCRIPTION:
if (VIR_STRDUP(tmp, metadata) < 0)
goto cleanup;
@@ -28776,21 +28776,21 @@ virDomainDefGetShortName(const virDomainDef *def)
* characters. The same applies for illegal sequences as they can occur
* with incompatible locales. */
len = mbstowcs(NULL, def->name, 0);
- if ((len == (size_t) -1 && errno == EILSEQ) ||
+ if ((len == (size_t)-1 && errno == EILSEQ) ||
len == strlen(def->name)) {
ignore_value(virAsprintf(&ret, "%d-%.*s", def->id,
VIR_DOMAIN_SHORT_NAME_MAX, def->name));
return ret;
}
- if (len == (size_t) -1) {
+ if (len == (size_t)-1) {
virReportSystemError(errno, "%s",
_("Cannot convert domain name to "
"wide character string"));
return NULL;
}
- if (mbstowcs(wshortname, def->name, VIR_DOMAIN_SHORT_NAME_MAX) == (size_t) -1) {
+ if (mbstowcs(wshortname, def->name, VIR_DOMAIN_SHORT_NAME_MAX) == (size_t)-1) {
virReportSystemError(errno, "%s",
_("Cannot convert domain name to "
"wide character string"));
@@ -28798,7 +28798,7 @@ virDomainDefGetShortName(const virDomainDef *def)
}
len = wcstombs(NULL, wshortname, 0);
- if (len == (size_t) -1) {
+ if (len == (size_t)-1) {
virReportSystemError(errno, "%s",
_("Cannot convert wide character string "
"back to multi-byte domain name"));
@@ -28808,7 +28808,7 @@ virDomainDefGetShortName(const virDomainDef *def)
if (VIR_ALLOC_N(shortname, len + 1) < 0)
return NULL;
- if (wcstombs(shortname, wshortname, len) == (size_t) -1) {
+ if (wcstombs(shortname, wshortname, len) == (size_t)-1) {
virReportSystemError(errno, "%s",
_("Cannot convert wide character string "
"back to multi-byte domain name"));
@@ -29305,7 +29305,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
virStorageAuthDefFree(def->src->auth);
def->src->auth = NULL;
- switch ((virStoragePoolType) pooldef->type) {
+ switch ((virStoragePoolType)pooldef->type) {
case VIR_STORAGE_POOL_DIR:
case VIR_STORAGE_POOL_FS:
case VIR_STORAGE_POOL_NETFS:
diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c
index 0a4b28f489fa..aec756e083ef 100644
--- a/src/conf/interface_conf.c
+++ b/src/conf/interface_conf.c
@@ -146,7 +146,7 @@ virInterfaceDefParseMtu(virInterfaceDefPtr def,
"%s", _("interface mtu value is improper"));
return -1;
} else if (ret == 0) {
- def->mtu = (unsigned int) mtu;
+ def->mtu = (unsigned int)mtu;
}
return 0;
}
@@ -305,7 +305,7 @@ virInterfaceDefParseIP(virInterfaceIPDefPtr def,
if (tmp != NULL) {
ret = virXPathLong("string(./@prefix)", ctxt, &l);
if (ret == 0) {
- def->prefix = (int) l;
+ def->prefix = (int)l;
} else if (ret == -2) {
virReportError(VIR_ERR_XML_ERROR,
"%s", _("Invalid ip address prefix
value"));
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 630a87fc07f7..96c31d6184cd 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -611,7 +611,7 @@ virNetworkDNSHostDefParseXML(const char *networkName,
if (cur->type == XML_ELEMENT_NODE &&
virXMLNodeNameEqual(cur, "hostname")) {
if (cur->children != NULL) {
- char *name = (char *) xmlNodeGetContent(cur);
+ char *name = (char *)xmlNodeGetContent(cur);
if (!name) {
virReportError(VIR_ERR_XML_DETAIL,
@@ -2384,7 +2384,7 @@ virNetworkDefFormatBuf(virBufferPtr buf,
xmlIndentTreeOutput = oldIndentTreeOutput;
goto error;
}
- virBufferAsprintf(buf, "%s\n", (char *) xmlBufferContent(xmlbuf));
+ virBufferAsprintf(buf, "%s\n", (char *)xmlBufferContent(xmlbuf));
xmlBufferFree(xmlbuf);
xmlIndentTreeOutput = oldIndentTreeOutput;
}
diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c
index 3a010491826a..8a3fd075388c 100644
--- a/src/conf/nwfilter_params.c
+++ b/src/conf/nwfilter_params.c
@@ -762,8 +762,8 @@ virNWFilterHashTablePutAll(virNWFilterHashTablePtr src,
static int
virNWFilterVarValueCompare(const void *a, const void *b)
{
- return virNWFilterVarValueEqual((const virNWFilterVarValue *) a,
- (const virNWFilterVarValue *) b) ? 0 : 1;
+ return virNWFilterVarValueEqual((const virNWFilterVarValue *)a,
+ (const virNWFilterVarValue *)b) ? 0 : 1;
}
bool
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 5036ab9ef8a0..8b3c25344bec 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -606,9 +606,9 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt,
node = virXPathNode(permxpath, ctxt);
if (node == NULL) {
/* Set default values if there is not <permissions> element */
- perms->mode = (mode_t) -1;
- perms->uid = (uid_t) -1;
- perms->gid = (gid_t) -1;
+ perms->mode = (mode_t)-1;
+ perms->uid = (uid_t)-1;
+ perms->gid = (gid_t)-1;
perms->label = NULL;
return 0;
}
@@ -628,11 +628,11 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt,
perms->mode = tmp;
VIR_FREE(mode);
} else {
- perms->mode = (mode_t) -1;
+ perms->mode = (mode_t)-1;
}
if (virXPathNode("./owner", ctxt) == NULL) {
- perms->uid = (uid_t) -1;
+ perms->uid = (uid_t)-1;
} else {
/* We previously could output -1, so continue to parse it */
if (virXPathLongLong("number(./owner)", ctxt, &val) < 0 ||
@@ -647,11 +647,11 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt,
}
if (virXPathNode("./group", ctxt) == NULL) {
- perms->gid = (gid_t) -1;
+ perms->gid = (gid_t)-1;
} else {
/* We previously could output -1, so continue to parse it */
if (virXPathLongLong("number(./group)", ctxt, &val) < 0 ||
- ((gid_t) val != val &&
+ ((gid_t)val != val &&
val != -1)) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("malformed group element"));
@@ -1010,21 +1010,21 @@ virStoragePoolDefFormatBuf(virBufferPtr buf,
virBufferEscapeString(buf, "<path>%s</path>\n",
def->target.path);
- if (def->target.perms.mode != (mode_t) -1 ||
- def->target.perms.uid != (uid_t) -1 ||
- def->target.perms.gid != (gid_t) -1 ||
+ if (def->target.perms.mode != (mode_t)-1 ||
+ def->target.perms.uid != (uid_t)-1 ||
+ def->target.perms.gid != (gid_t)-1 ||
def->target.perms.label) {
virBufferAddLit(buf, "<permissions>\n");
virBufferAdjustIndent(buf, 2);
- if (def->target.perms.mode != (mode_t) -1)
+ if (def->target.perms.mode != (mode_t)-1)
virBufferAsprintf(buf, "<mode>0%o</mode>\n",
def->target.perms.mode);
- if (def->target.perms.uid != (uid_t) -1)
+ if (def->target.perms.uid != (uid_t)-1)
virBufferAsprintf(buf, "<owner>%d</owner>\n",
- (int) def->target.perms.uid);
- if (def->target.perms.gid != (gid_t) -1)
+ (int)def->target.perms.uid);
+ if (def->target.perms.gid != (gid_t)-1)
virBufferAsprintf(buf, "<group>%d</group>\n",
- (int) def->target.perms.gid);
+ (int)def->target.perms.gid);
virBufferEscapeString(buf, "<label>%s</label>\n",
def->target.perms.label);
@@ -1334,7 +1334,7 @@ virStorageVolTimestampFormat(virBufferPtr buf, const char *name,
if (ts->tv_nsec < 0)
return;
virBufferAsprintf(buf, "<%s>%llu", name,
- (unsigned long long) ts->tv_sec);
+ (unsigned long long)ts->tv_sec);
if (ts->tv_nsec)
virBufferAsprintf(buf, ".%09ld", ts->tv_nsec);
virBufferAsprintf(buf, "</%s>\n", name);
@@ -1364,22 +1364,22 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
}
if (def->perms &&
- (def->perms->mode != (mode_t) -1 ||
- def->perms->uid != (uid_t) -1 ||
- def->perms->gid != (gid_t) -1 ||
+ (def->perms->mode != (mode_t)-1 ||
+ def->perms->uid != (uid_t)-1 ||
+ def->perms->gid != (gid_t)-1 ||
def->perms->label)) {
virBufferAddLit(buf, "<permissions>\n");
virBufferAdjustIndent(buf, 2);
- if (def->perms->mode != (mode_t) -1)
+ if (def->perms->mode != (mode_t)-1)
virBufferAsprintf(buf, "<mode>0%o</mode>\n",
def->perms->mode);
- if (def->perms->uid != (uid_t) -1)
+ if (def->perms->uid != (uid_t)-1)
virBufferAsprintf(buf, "<owner>%d</owner>\n",
- (int) def->perms->uid);
- if (def->perms->gid != (gid_t) -1)
+ (int)def->perms->uid);
+ if (def->perms->gid != (gid_t)-1)
virBufferAsprintf(buf, "<group>%d</group>\n",
- (int) def->perms->gid);
+ (int)def->perms->gid);
virBufferEscapeString(buf, "<label>%s</label>\n",
def->perms->label);
diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c
index 416a7a129c78..afdcd97e567f 100644
--- a/src/conf/virchrdev.c
+++ b/src/conf/virchrdev.c
@@ -128,7 +128,7 @@ static int virChrdevLockFileCreate(const char *dev)
virReportError(VIR_ERR_OPERATION_FAILED,
_("Requested device '%s' is locked by "
"lock file '%s' held by process %lld"),
- dev, path, (long long) pid);
+ dev, path, (long long)pid);
goto cleanup;
} else {
/* clean up the stale/corrupted/nonexistent lockfile */
@@ -138,7 +138,7 @@ static int virChrdevLockFileCreate(const char *dev)
/* ensure correct format according to filesystem hierarchy standard */
/*
http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES */
- if (virAsprintf(&pidStr, "%10lld\n", (long long) getpid()) < 0)
+ if (virAsprintf(&pidStr, "%10lld\n", (long long)getpid()) < 0)
goto cleanup;
/* create the lock file */
diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index 13e9a1751851..d894093dbb7d 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -258,7 +258,7 @@ virNodeDeviceObjListFindByWWNsCallback(const void *payload,
{
virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload;
struct virNodeDeviceObjListFindByWWNsData *data =
- (struct virNodeDeviceObjListFindByWWNsData *) opaque;
+ (struct virNodeDeviceObjListFindByWWNsData *)opaque;
virNodeDevCapsDefPtr cap;
int want = 0;
@@ -356,7 +356,7 @@ virNodeDeviceObjListFindSCSIHostByWWNsCallback(const void *payload,
{
virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload;
struct virNodeDeviceObjListFindSCSIHostByWWNsData *data =
- (struct virNodeDeviceObjListFindSCSIHostByWWNsData *) opaque;
+ (struct virNodeDeviceObjListFindSCSIHostByWWNsData *)opaque;
virNodeDevCapsDefPtr cap;
int want = 0;
diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c
index 48ce3c814178..7ad6196a3add 100644
--- a/src/conf/virsecretobj.c
+++ b/src/conf/virsecretobj.c
@@ -203,7 +203,7 @@ virSecretObjSearchName(const void *payload,
{
virSecretObjPtr obj = (virSecretObjPtr) payload;
virSecretDefPtr def;
- struct virSecretSearchData *data = (struct virSecretSearchData *) opaque;
+ struct virSecretSearchData *data = (struct virSecretSearchData *)opaque;
int found = 0;
virObjectLock(obj);
diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
index 6c937f105ca9..54535a799fe3 100644
--- a/src/conf/virstorageobj.c
+++ b/src/conf/virstorageobj.c
@@ -754,7 +754,7 @@ virStoragePoolObjSearchVolumeCb(const void *payload,
{
virStorageVolObjPtr volobj = (virStorageVolObjPtr) payload;
struct _virStoragePoolObjSearchVolData *data =
- (struct _virStoragePoolObjSearchVolData *) opaque;
+ (struct _virStoragePoolObjSearchVolData *)opaque;
int found = 0;
virObjectLock(volobj);
@@ -1812,7 +1812,7 @@ virStoragePoolObjSourceFindDuplicateCb(const void *payload,
{
virStoragePoolObjPtr obj = (virStoragePoolObjPtr) payload;
struct _virStoragePoolObjFindDuplicateData *data =
- (struct _virStoragePoolObjFindDuplicateData *) opaque;
+ (struct _virStoragePoolObjFindDuplicateData *)opaque;
/* Don't match against ourself if re-defining existing pool ! */
if (STREQ(obj->def->name, data->def->name))
--
2.17.0