From nobody Wed May 14 13:37:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524487579506519.5963769016619; Mon, 23 Apr 2018 05:46:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC6913162520; Mon, 23 Apr 2018 12:46:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7BAD15FC26; Mon, 23 Apr 2018 12:46:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 272C05BBE5; Mon, 23 Apr 2018 12:46:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3NCjC9g011968 for ; Mon, 23 Apr 2018 08:45:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id A57A2215CDC8; Mon, 23 Apr 2018 12:45:12 +0000 (UTC) Received: from caroline.localdomain (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 49287215CDCB for ; Mon, 23 Apr 2018 12:45:12 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline.localdomain (Postfix) with ESMTP id B5CF6120094 for ; Mon, 23 Apr 2018 14:45:08 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 23 Apr 2018 14:44:55 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 27/29] tools: Add spaces after casts X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 23 Apr 2018 12:46:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander --- tools/nss/libvirt_nss.c | 4 ++-- tools/virsh-domain-monitor.c | 4 ++-- tools/virsh-domain.c | 36 ++++++++++++++-------------- tools/virsh-host.c | 4 ++-- tools/virsh-secret.c | 2 +- tools/virsh-volume.c | 2 +- tools/virt-host-validate-qemu.c | 2 +- tools/vsh.c | 4 ++-- tools/wireshark/src/packet-libvirt.c | 8 +++---- 9 files changed, 33 insertions(+), 33 deletions(-) diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c index 62fe589bed7e..afabaf20fc05 100644 --- a/tools/nss/libvirt_nss.c +++ b/tools/nss/libvirt_nss.c @@ -681,7 +681,7 @@ _nss_compat_getaddrinfo(void *retval, void *mdata ATTRI= BUTE_UNUSED, va_list ap) h_errno =3D HOST_NOT_FOUND; return NS_NOTFOUND; } - *((struct addrinfo **)retval) =3D sentinel.ai_next; + *((struct addrinfo **) retval) =3D sentinel.ai_next; =20 return NS_SUCCESS; } @@ -708,7 +708,7 @@ _nss_compat_gethostbyname2_r(void *retval, void *mdata = ATTRIBUTE_UNUSED, va_list herrnop =3D va_arg(ap, int *); =20 ret =3D NSS_NAME(gethostbyname2)(name, af, result, buffer, buflen, err= nop, herrnop); - *(struct hostent **)retval =3D (ret =3D=3D NS_SUCCESS) ? result : NULL; + *(struct hostent **) retval =3D (ret =3D=3D NS_SUCCESS) ? result : NUL= L; =20 return ret; } diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 8e071779b4ef..15133def92a6 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -1150,7 +1150,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) return false; =20 id =3D virDomainGetID(dom); - if (id =3D=3D ((unsigned int)-1)) + if (id =3D=3D ((unsigned int) -1)) vshPrint(ctl, "%-15s %s\n", _("Id:"), "-"); else vshPrint(ctl, "%-15s %d\n", _("Id:"), id); @@ -1795,7 +1795,7 @@ cmdList(vshControl *ctl, const vshCmd *cmd) bool ret =3D false; virshDomainListPtr list =3D NULL; virDomainPtr dom; - char id_buf[INT_BUFSIZE_BOUND(unsigned int)]; + char id_buf[INT_BUFSIZE_BOUND(unsigned int) ]; unsigned int id; unsigned int flags =3D VIR_CONNECT_LIST_DOMAINS_ACTIVE; =20 diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 2b775fc4cca6..7ebe4dc30cac 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -370,7 +370,7 @@ static int str2PCIAddress(const char *str, struct PCIAd= dress *pciAddr) if (!str) return -1; =20 - domain =3D (char *)str; + domain =3D (char *) str; =20 if (virStrToLong_uip(domain, &bus, 16, &pciAddr->domain) !=3D 0) return -1; @@ -399,7 +399,7 @@ static int str2SCSIAddress(const char *str, struct SCSI= Address *scsiAddr) if (!str) return -1; =20 - controller =3D (char *)str; + controller =3D (char *) str; =20 if (virStrToLong_uip(controller, &bus, 10, &scsiAddr->controller) !=3D= 0) return -1; @@ -424,7 +424,7 @@ static int str2IDEAddress(const char *str, struct IDEAd= dress *ideAddr) if (!str) return -1; =20 - controller =3D (char *)str; + controller =3D (char *) str; =20 if (virStrToLong_uip(controller, &bus, 10, &ideAddr->controller) !=3D = 0) return -1; @@ -449,7 +449,7 @@ static int str2CCWAddress(const char *str, struct CCWAd= dress *ccwAddr) if (!str) return -1; =20 - cssid =3D (char *)str; + cssid =3D (char *) str; =20 if (virStrToLong_uip(cssid, &ssid, 16, &ccwAddr->cssid) !=3D 0) return -1; @@ -480,7 +480,7 @@ static int str2DiskAddress(const char *str, struct Disk= Address *diskAddr) if (!str) return -1; =20 - type =3D (char *)str; + type =3D (char *) str; addr =3D strchr(type, ':'); if (!addr) return -1; @@ -625,7 +625,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) goto cleanup; } =20 - if (STRPREFIX((const char *)target, "vd")) { + if (STRPREFIX((const char *) target, "vd")) { if (diskAddr.type =3D=3D DISK_ADDR_TYPE_PCI) { virBufferAsprintf(&buf, "
=3D 100) { /* migration has not completed, do not print [100 %] */ progress =3D 99; @@ -4021,7 +4021,7 @@ cmdStart(vshControl *ctl, const vshCmd *cmd) VIRSH_BYNAME | VIRSH_BYUUID))) return false; =20 - if (virDomainGetID(dom) !=3D (unsigned int)-1) { + if (virDomainGetID(dom) !=3D (unsigned int) -1) { vshError(ctl, "%s", _("Domain is already active")); goto cleanup; } @@ -4226,7 +4226,7 @@ virshWatchJob(vshControl *ctl, =20 GETTIMEOFDAY(&start); while (1) { - ret =3D poll((struct pollfd *)&pollfd, npollfd, 500); + ret =3D poll((struct pollfd *) &pollfd, npollfd, 500); if (ret > 0) { if (pollfd[1].revents & POLLIN && saferead(STDIN_FILENO, &retchar, sizeof(retchar)) > 0) { @@ -4259,8 +4259,8 @@ virshWatchJob(vshControl *ctl, } =20 GETTIMEOFDAY(&curr); - if (timeout_ms && (((int)(curr.tv_sec - start.tv_sec) * 1000 + - (int)(curr.tv_usec - start.tv_usec) / 1000) > + if (timeout_ms && (((int) (curr.tv_sec - start.tv_sec) * 1000 + + (int) (curr.tv_usec - start.tv_usec) / 1000) > timeout_ms)) { /* suspend the domain when migration timeouts. */ vshDebug(ctl, VSH_ERR_DEBUG, "%s timeout", label); @@ -7859,7 +7859,7 @@ cmdCPUBaseline(vshControl *ctl, const vshCmd *cmd) } =20 result =3D virConnectBaselineCPU(priv->conn, - (const char **)list, count, flags); + (const char **) list, count, flags); =20 if (result) { vshPrint(ctl, "%s", result); @@ -10326,7 +10326,7 @@ cmdDomid(vshControl *ctl, const vshCmd *cmd) return false; =20 id =3D virDomainGetID(dom); - if (id =3D=3D ((unsigned int)-1)) + if (id =3D=3D ((unsigned int) -1)) vshPrint(ctl, "%s\n", "-"); else vshPrint(ctl, "%d\n", id); @@ -10626,7 +10626,7 @@ doMigrate(void *opaque) &nparams, &maxparams, VIR_MIGRATE_PARAM_MIGRATE_DISKS, - (const char **)val) < 0) { + (const char **) val) < 0) { VIR_FREE(val); goto save_error; } @@ -10643,7 +10643,7 @@ doMigrate(void *opaque) &nparams, &maxparams, VIR_MIGRATE_PARAM_COMPRESSION, - (const char **)val) < 0) { + (const char **) val) < 0) { VIR_FREE(val); goto save_error; } diff --git a/tools/virsh-host.c b/tools/virsh-host.c index ecaf830e350d..91c0e57272c9 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -290,8 +290,8 @@ static const vshCmdOptDef opts_freepages[] =3D { static int vshPageSizeSorter(const void *a, const void *b) { - unsigned int pa =3D *(unsigned int *)a; - unsigned int pb =3D *(unsigned int *)b; + unsigned int pa =3D *(unsigned int *) a; + unsigned int pb =3D *(unsigned int *) b; =20 return pa - pb; } diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index 9e4ec61a8807..e2b097e3f733 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -214,7 +214,7 @@ cmdSecretSetValue(vshControl *ctl, const vshCmd *cmd) goto cleanup; } =20 - res =3D virSecretSetValue(secret, (unsigned char *)value, value_size, = 0); + res =3D virSecretSetValue(secret, (unsigned char *) value, value_size,= 0); memset(value, 0, value_size); VIR_FREE(value); =20 diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 9d6ebd2325a5..2a590d7dd826 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -536,7 +536,7 @@ virshMakeCloneXML(const char *origxml, const char *newn= ame) obj->nodesetval->nodeTab =3D=3D NULL) goto cleanup; =20 - xmlNodeSetContent(obj->nodesetval->nodeTab[0], (const xmlChar *)newnam= e); + xmlNodeSetContent(obj->nodesetval->nodeTab[0], (const xmlChar *) newna= me); xmlDocDumpMemory(doc, &newxml, &size); =20 cleanup: diff --git a/tools/virt-host-validate-qemu.c b/tools/virt-host-validate-qem= u.c index d7573ea8b3dd..22b92a5d1d19 100644 --- a/tools/virt-host-validate-qemu.c +++ b/tools/virt-host-validate-qemu.c @@ -40,7 +40,7 @@ int virHostValidateQEMU(void) if (!(flags =3D virHostValidateGetCPUFlags())) return -1; =20 - switch ((int)arch) { + switch ((int) arch) { case VIR_ARCH_I686: case VIR_ARCH_X86_64: hasVirtFlag =3D true; diff --git a/tools/vsh.c b/tools/vsh.c index 73ec007e5622..babdbb542e45 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -162,7 +162,7 @@ _vshStrdup(vshControl *ctl, const char *s, const char *= filename, int line) if (VIR_STRDUP(x, s) >=3D 0) return x; vshError(ctl, _("%s: %d: failed to allocate %lu bytes"), - filename, line, (unsigned long)strlen(s)); + filename, line, (unsigned long) strlen(s)); exit(EXIT_FAILURE); } =20 @@ -373,7 +373,7 @@ vshCmddefCheckInternals(const vshCmdDef *cmd) =20 case VSH_OT_ALIAS: { size_t j; - char *name =3D (char *)opt->help; /* cast away const */ + char *name =3D (char *) opt->help; /* cast away const */ char *p; =20 if (opt->flags || !opt->help) diff --git a/tools/wireshark/src/packet-libvirt.c b/tools/wireshark/src/pac= ket-libvirt.c index 71f0f6114a68..421f116f77e3 100644 --- a/tools/wireshark/src/packet-libvirt.c +++ b/tools/wireshark/src/packet-libvirt.c @@ -95,7 +95,7 @@ dissect_xdr_string(tvbuff_t *tvb, proto_tree *tree, XDR *= xdrs, int hf, start =3D xdr_getpos(xdrs); if (xdr_string(xdrs, &val, maxlen)) { proto_tree_add_string(tree, hf, tvb, start, xdr_getpos(xdrs) - sta= rt, val); - xdr_free((xdrproc_t)xdr_string, (char *)&val); + xdr_free((xdrproc_t)xdr_string, (char *) &val); return TRUE; } else { proto_tree_add_item(tree, hf_libvirt_unknown, tvb, start, -1, ENC_= NA); @@ -151,7 +151,7 @@ dissect_xdr_bytes(tvbuff_t *tvb, proto_tree *tree, XDR = *xdrs, int hf, guint32 length; =20 start =3D xdr_getpos(xdrs); - if (xdr_bytes(xdrs, (char **)&val, &length, maxlen)) { + if (xdr_bytes(xdrs, (char **) &val, &length, maxlen)) { proto_tree_add_bytes_format_value(tree, hf, tvb, start, xdr_getpos= (xdrs) - start, NULL, "%s", format_xdr_bytes(val= , length)); /* Seems I can't call xdr_free() for this case. @@ -374,7 +374,7 @@ dissect_libvirt_payload(tvbuff_t *tvb, proto_tree *tree, =20 if (status =3D=3D VIR_NET_OK) { vir_xdr_dissector_t xd =3D find_payload_dissector(proc, type, get_= program_data(prog, VIR_PROGRAM_DISSECTORS), - *(gsize *)get_prog= ram_data(prog, VIR_PROGRAM_DISSECTORS_LEN)); + *(gsize *) get_pro= gram_data(prog, VIR_PROGRAM_DISSECTORS_LEN)); if (xd =3D=3D NULL) goto unknown; dissect_libvirt_payload_xdr_data(tvb, tree, payload_length, status= , xd); @@ -445,7 +445,7 @@ dissect_libvirt_message(tvbuff_t *tvb, packet_info *pin= fo, proto_tree *tree, proto_tree_add_item(libvirt_tree, hf_libvirt_program, tvb, offset,= 4, ENC_NA); offset +=3D 4; proto_tree_add_item(libvirt_tree, hf_libvirt_version, tvb, offset,= 4, ENC_NA); offset +=3D 4; =20 - hf_proc =3D (int *)get_program_data(prog, VIR_PROGRAM_PROCHFVAR); + hf_proc =3D (int *) get_program_data(prog, VIR_PROGRAM_PROCHFVAR); if (hf_proc !=3D NULL && *hf_proc !=3D -1) { proto_tree_add_item(libvirt_tree, *hf_proc, tvb, offset, 4, EN= C_NA); } else { --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list