From nobody Sun Feb 8 23:42:12 2026 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 1524662821450463.137000616107; Wed, 25 Apr 2018 06:27:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 882963002F89; Wed, 25 Apr 2018 13:26:59 +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 1C77D2010CA1; Wed, 25 Apr 2018 13:26:59 +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 4B4F14CA9F; Wed, 25 Apr 2018 13:26:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3PDPEQu002276 for ; Wed, 25 Apr 2018 09:25:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0DBF410F1BF1; Wed, 25 Apr 2018 13:25:14 +0000 (UTC) Received: from caroline.localdomain (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A8C210F1BF2 for ; Wed, 25 Apr 2018 13:25:13 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline.localdomain (Postfix) with ESMTP id 0D904120094 for ; Wed, 25 Apr 2018 15:25:10 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Wed, 25 Apr 2018 15:25:04 +0200 Message-Id: <377d757633d8ee49739b377a2d99da11124764ee.1524661163.git.mkletzan@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 27/30] tests/: Remove 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 25 Apr 2018 13:27:00 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander --- tests/domaincapstest.c | 4 +- tests/qemuhotplugtest.c | 2 +- tests/qemumonitorjsontest.c | 42 +++++++++--------- tests/qemuxml2argvtest.c | 4 +- tests/testutils.c | 2 +- tests/testutils.h | 2 +- tests/testutilshostcpus.h | 88 ++++++++++++++++++------------------- tests/virbitmaptest.c | 4 +- tests/vircaps2xmltest.c | 2 +- tests/virfiletest.c | 18 ++++---- tests/virfilewrapper.c | 2 +- tests/virhashtest.c | 8 ++-- tests/virhostcputest.c | 2 +- tests/virhostdevtest.c | 2 +- tests/virpcimock.c | 2 +- tests/virpcitest.c | 2 +- tests/virresctrltest.c | 2 +- tests/virschematest.c | 2 +- tests/virstoragetest.c | 42 +++++++++--------- tests/virstringtest.c | 12 ++--- tests/virusbmock.c | 2 +- 21 files changed, 123 insertions(+), 123 deletions(-) diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 06e77fd5861a..94c466c42ca6 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -68,8 +68,8 @@ fillAllCaps(virDomainCapsPtr domCaps) virCPUDef host =3D { .type =3D VIR_CPU_TYPE_HOST, .arch =3D VIR_ARCH_X86_64, - .model =3D (char *) "host", - .vendor =3D (char *) "CPU Vendorrr", + .model =3D (char *)"host", + .vendor =3D (char *)"CPU Vendorrr", }; =20 domCaps->maxvcpus =3D 255; diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 85e53653e1bd..77dcc39fadc4 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -227,7 +227,7 @@ static int testQemuHotplug(const void *data) { int ret =3D -1; - struct qemuHotplugTestData *test =3D (struct qemuHotplugTestData *) da= ta; + struct qemuHotplugTestData *test =3D (struct qemuHotplugTestData *)dat= a; char *domain_filename =3D NULL; char *device_filename =3D NULL; char *result_filename =3D NULL; diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index f8d39c35abda..b9a0de49c587 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -853,20 +853,20 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPt= r xmlopt) =20 memset(&chr, 0, sizeof(chr)); chr.type =3D VIR_DOMAIN_CHR_TYPE_FILE; - chr.data.file.path =3D (char *) "/test/path"; + chr.data.file.path =3D (char *)"/test/path"; CHECK("file", false, "{'id':'alias','backend':{'type':'file','data':{'out':'/test/pat= h'}}}"); =20 memset(&chr, 0, sizeof(chr)); chr.type =3D VIR_DOMAIN_CHR_TYPE_DEV; - chr.data.file.path =3D (char *) "/test/path"; + chr.data.file.path =3D (char *)"/test/path"; CHECK("device", false, "{'id':'alias','backend':{'type':'serial','data':{'device':'/tes= t/path'}}}"); =20 memset(&chr, 0, sizeof(chr)); chr.type =3D VIR_DOMAIN_CHR_TYPE_TCP; - chr.data.tcp.host =3D (char *) "example.com"; - chr.data.tcp.service =3D (char *) "1234"; + chr.data.tcp.host =3D (char *)"example.com"; + chr.data.tcp.service =3D (char *)"1234"; CHECK("tcp", false, "{'id':'alias'," "'backend':{'type':'socket'," @@ -879,8 +879,8 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr = xmlopt) =20 memset(&chr, 0, sizeof(chr)); chr.type =3D VIR_DOMAIN_CHR_TYPE_UDP; - chr.data.udp.connectHost =3D (char *) "example.com"; - chr.data.udp.connectService =3D (char *) "1234"; + chr.data.udp.connectHost =3D (char *)"example.com"; + chr.data.udp.connectService =3D (char *)"1234"; CHECK("udp", false, "{'id':'alias'," "'backend':{'type':'udp'," @@ -888,8 +888,8 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr = xmlopt) "'data':{'host':'example.com'," "'port':'1234'}}}}}"); =20 - chr.data.udp.bindHost =3D (char *) "localhost"; - chr.data.udp.bindService =3D (char *) "4321"; + chr.data.udp.bindHost =3D (char *)"localhost"; + chr.data.udp.bindService =3D (char *)"4321"; CHECK("udp", false, "{'id':'alias'," "'backend':{'type':'udp'," @@ -901,7 +901,7 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr = xmlopt) "'port':'4321'}}}}}"); =20 chr.data.udp.bindHost =3D NULL; - chr.data.udp.bindService =3D (char *) "4321"; + chr.data.udp.bindService =3D (char *)"4321"; CHECK("udp", false, "{'id':'alias'," "'backend':{'type':'udp'," @@ -913,7 +913,7 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr = xmlopt) "'port':'4321'}}}}}"); memset(&chr, 0, sizeof(chr)); chr.type =3D VIR_DOMAIN_CHR_TYPE_UNIX; - chr.data.nix.path =3D (char *) "/path/to/socket"; + chr.data.nix.path =3D (char *)"/path/to/socket"; CHECK("unix", false, "{'id':'alias'," "'backend':{'type':'socket'," @@ -1185,14 +1185,14 @@ testQemuMonitorJSONGetDeviceAliases(const void *dat= a) } =20 ret =3D 0; - for (alias =3D (const char **) aliases; *alias; alias++) { + for (alias =3D (const char **)aliases; *alias; alias++) { if (!virStringListHasString(expected, *alias)) { fprintf(stderr, "got unexpected device alias '%s'\n", *alias); ret =3D -1; } } for (alias =3D expected; *alias; alias++) { - if (!virStringListHasString((const char **) aliases, *alias)) { + if (!virStringListHasString((const char **)aliases, *alias)) { fprintf(stderr, "missing expected alias '%s'\n", *alias); ret =3D -1; } @@ -1411,14 +1411,14 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const v= oid *data) qemuMonitorTestPtr test =3D qemuMonitorTestNewSimple(true, xmlopt); int ret =3D -1; struct qemuMonitorQueryCpusEntry expect_slow[] =3D { - {0, 17622, (char *) "/machine/unattached/device[0]", true}, - {1, 17624, (char *) "/machine/unattached/device[1]", true}, - {2, 17626, (char *) "/machine/unattached/device[2]", true}, + {0, 17622, (char *)"/machine/unattached/device[0]", true}, + {1, 17624, (char *)"/machine/unattached/device[1]", true}, + {2, 17626, (char *)"/machine/unattached/device[2]", true}, {3, 17628, NULL, true}, }; struct qemuMonitorQueryCpusEntry expect_fast[] =3D { - {0, 17629, (char *) "/machine/unattached/device[0]", false}, - {1, 17630, (char *) "/machine/unattached/device[1]", false}, + {0, 17629, (char *)"/machine/unattached/device[0]", false}, + {1, 17630, (char *)"/machine/unattached/device[1]", false}, }; =20 if (!test) @@ -1976,8 +1976,8 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(cons= t void *data) int ret =3D -1; virHashTablePtr info =3D NULL, expectedInfo =3D NULL; qemuMonitorChardevInfo info0 =3D { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_D= EFAULT }; - qemuMonitorChardevInfo info1 =3D { (char *) "/dev/pts/21", VIR_DOMAIN_= CHR_DEVICE_STATE_CONNECTED }; - qemuMonitorChardevInfo info2 =3D { (char *) "/dev/pts/20", VIR_DOMAIN_= CHR_DEVICE_STATE_DEFAULT }; + qemuMonitorChardevInfo info1 =3D { (char *)"/dev/pts/21", VIR_DOMAIN_C= HR_DEVICE_STATE_CONNECTED }; + qemuMonitorChardevInfo info2 =3D { (char *)"/dev/pts/20", VIR_DOMAIN_C= HR_DEVICE_STATE_DEFAULT }; qemuMonitorChardevInfo info3 =3D { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_D= ISCONNECTED }; =20 if (!test) @@ -2215,7 +2215,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabil= ities(const void *data) goto cleanup; =20 cap =3D qemuMigrationCapabilityTypeToString(QEMU_MIGRATION_CAP_XBZRLE); - if (!virStringListHasString((const char **) caps, cap)) { + if (!virStringListHasString((const char **)caps, cap)) { virReportError(VIR_ERR_INTERNAL_ERROR, "Expected capability %s is missing", cap); goto cleanup; @@ -2601,7 +2601,7 @@ testQemuMonitorCPUInfoFormat(qemuMonitorCPUInfoPtr vc= pus, =20 if (vcpu->tid) virBufferAsprintf(&buf, "thread-id=3D'%llu'\n", - (unsigned long long) vcpu->tid); + (unsigned long long)vcpu->tid); =20 if (vcpu->id !=3D 0) virBufferAsprintf(&buf, "enable-id=3D'%d'\n", vcpu->id); diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5b3bd4a99649..3ace44e99422 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -48,7 +48,7 @@ fakeSecretGetValue(virSecretPtr obj ATTRIBUTE_UNUSED, if (VIR_STRDUP(secret, "AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A") < 0) return NULL; *value_size =3D strlen(secret); - return (unsigned char *) secret; + return (unsigned char *)secret; } =20 static virSecretPtr @@ -438,7 +438,7 @@ testCompareXMLToStartupXML(const void *data) static int testCompareXMLToArgv(const void *data) { - struct testInfo *info =3D (void *) data; + struct testInfo *info =3D (void *)data; char *xml =3D NULL; char *args =3D NULL; char *migrateURI =3D NULL; diff --git a/tests/testutils.c b/tests/testutils.c index 4b13d112788a..8b0e61859634 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -626,7 +626,7 @@ virTestDifferenceFullInternal(FILE *stream, /* Show the trimmed differences */ if (expectName) fprintf(stream, "\nIn '%s':", expectName); - fprintf(stream, "\nOffset %d\nExpect [", (int) (expectStart - expect)); + fprintf(stream, "\nOffset %d\nExpect [", (int)(expectStart - expect)); if ((expectEnd - expectStart + 1) && fwrite(expectStart, (expectEnd-expectStart+1), 1, stream) !=3D 1) return -1; diff --git a/tests/testutils.h b/tests/testutils.h index 3bd7bf16034f..474907541741 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -131,7 +131,7 @@ int virTestMain(int argc, return EXIT_FAILURE; \ } \ if (!preload) { \ - newenv =3D (char *) lib; \ + newenv =3D (char *)lib; \ } else if (virAsprintf(&newenv, "%s:%s", lib, preload) < 0) { \ perror("virAsprintf"); \ return EXIT_FAILURE; \ diff --git a/tests/testutilshostcpus.h b/tests/testutilshostcpus.h index f0ab23b96226..e18bdd78b33e 100644 --- a/tests/testutilshostcpus.h +++ b/tests/testutilshostcpus.h @@ -3,25 +3,25 @@ #include "util/virarch.h" =20 static virCPUFeatureDef cpuDefaultFeatures[] =3D { - { (char *) "ds", -1 }, - { (char *) "acpi", -1 }, - { (char *) "ss", -1 }, - { (char *) "ht", -1 }, - { (char *) "tm", -1 }, - { (char *) "pbe", -1 }, - { (char *) "ds_cpl", -1 }, - { (char *) "vmx", -1 }, - { (char *) "est", -1 }, - { (char *) "tm2", -1 }, - { (char *) "cx16", -1 }, - { (char *) "xtpr", -1 }, - { (char *) "lahf_lm", -1 }, + { (char *)"ds", -1 }, + { (char *)"acpi", -1 }, + { (char *)"ss", -1 }, + { (char *)"ht", -1 }, + { (char *)"tm", -1 }, + { (char *)"pbe", -1 }, + { (char *)"ds_cpl", -1 }, + { (char *)"vmx", -1 }, + { (char *)"est", -1 }, + { (char *)"tm2", -1 }, + { (char *)"cx16", -1 }, + { (char *)"xtpr", -1 }, + { (char *)"lahf_lm", -1 }, }; static virCPUDef cpuDefaultData =3D { .type =3D VIR_CPU_TYPE_HOST, .arch =3D VIR_ARCH_X86_64, - .model =3D (char *) "core2duo", - .vendor =3D (char *) "Intel", + .model =3D (char *)"core2duo", + .vendor =3D (char *)"Intel", .sockets =3D 1, .cores =3D 2, .threads =3D 1, @@ -31,36 +31,36 @@ static virCPUDef cpuDefaultData =3D { }; =20 static virCPUFeatureDef cpuHaswellFeatures[] =3D { - { (char *) "vme", -1 }, - { (char *) "ds", -1 }, - { (char *) "acpi", -1 }, - { (char *) "ss", -1 }, - { (char *) "ht", -1 }, - { (char *) "tm", -1 }, - { (char *) "pbe", -1 }, - { (char *) "dtes64", -1 }, - { (char *) "monitor", -1 }, - { (char *) "ds_cpl", -1 }, - { (char *) "vmx", -1 }, - { (char *) "smx", -1 }, - { (char *) "est", -1 }, - { (char *) "tm2", -1 }, - { (char *) "xtpr", -1 }, - { (char *) "pdcm", -1 }, - { (char *) "osxsave", -1 }, - { (char *) "f16c", -1 }, - { (char *) "rdrand", -1 }, - { (char *) "cmt", -1 }, - { (char *) "pdpe1gb", -1 }, - { (char *) "abm", -1 }, - { (char *) "invtsc", -1 }, - { (char *) "lahf_lm", -1 }, + { (char *)"vme", -1 }, + { (char *)"ds", -1 }, + { (char *)"acpi", -1 }, + { (char *)"ss", -1 }, + { (char *)"ht", -1 }, + { (char *)"tm", -1 }, + { (char *)"pbe", -1 }, + { (char *)"dtes64", -1 }, + { (char *)"monitor", -1 }, + { (char *)"ds_cpl", -1 }, + { (char *)"vmx", -1 }, + { (char *)"smx", -1 }, + { (char *)"est", -1 }, + { (char *)"tm2", -1 }, + { (char *)"xtpr", -1 }, + { (char *)"pdcm", -1 }, + { (char *)"osxsave", -1 }, + { (char *)"f16c", -1 }, + { (char *)"rdrand", -1 }, + { (char *)"cmt", -1 }, + { (char *)"pdpe1gb", -1 }, + { (char *)"abm", -1 }, + { (char *)"invtsc", -1 }, + { (char *)"lahf_lm", -1 }, }; static virCPUDef cpuHaswellData =3D { .type =3D VIR_CPU_TYPE_HOST, .arch =3D VIR_ARCH_X86_64, - .model =3D (char *) "Haswell", - .vendor =3D (char *) "Intel", + .model =3D (char *)"Haswell", + .vendor =3D (char *)"Intel", .sockets =3D 1, .cores =3D 2, .threads =3D 2, @@ -72,7 +72,7 @@ static virCPUDef cpuHaswellData =3D { static virCPUDef cpuBroadwellData =3D { .type =3D VIR_CPU_TYPE_HOST, .arch =3D VIR_ARCH_X86_64, - .model =3D (char *) "Broadwell", + .model =3D (char *)"Broadwell", .sockets =3D 1, .cores =3D 2, .threads =3D 2, @@ -81,7 +81,7 @@ static virCPUDef cpuBroadwellData =3D { static virCPUDef cpuPower8Data =3D { .type =3D VIR_CPU_TYPE_HOST, .arch =3D VIR_ARCH_PPC64, - .model =3D (char *) "POWER8", + .model =3D (char *)"POWER8", .sockets =3D 1, .cores =3D 8, .threads =3D 8, @@ -90,7 +90,7 @@ static virCPUDef cpuPower8Data =3D { static virCPUDef cpuPower9Data =3D { .type =3D VIR_CPU_TYPE_HOST, .arch =3D VIR_ARCH_PPC64, - .model =3D (char *) "POWER9", + .model =3D (char *)"POWER9", .sockets =3D 1, .cores =3D 16, .threads =3D 1, diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c index 2fbafc0a7632..f5f84fb8a241 100644 --- a/tests/virbitmaptest.c +++ b/tests/virbitmaptest.c @@ -252,7 +252,7 @@ test4(const void *data ATTRIBUTE_UNUSED) if (virBitmapNextSetBit(bitmap, i) !=3D -1) goto error; =20 - j =3D sizeof(bitsPos)/sizeof(int) - 1; + j =3D sizeof(bitsPos)/sizeof(int)- 1; =20 if (virBitmapLastSetBit(bitmap) !=3D bitsPos[j]) goto error; @@ -314,7 +314,7 @@ test5(const void *v ATTRIBUTE_UNUSED) =20 i =3D 0; j =3D -1; - while (i < sizeof(bits)/sizeof(int) && + while (i < sizeof(bits)/sizeof(int)&& (j =3D virBitmapNextSetBit(bitmap, j)) >=3D 0) { if (j !=3D bits[i++]) goto error; diff --git a/tests/vircaps2xmltest.c b/tests/vircaps2xmltest.c index ede546825edc..f0db6dacfa88 100644 --- a/tests/vircaps2xmltest.c +++ b/tests/vircaps2xmltest.c @@ -41,7 +41,7 @@ struct virCapabilitiesData { static int test_virCapabilities(const void *opaque) { - struct virCapabilitiesData *data =3D (struct virCapabilitiesData *) op= aque; + struct virCapabilitiesData *data =3D (struct virCapabilitiesData *)opa= que; const char *archStr =3D virArchToString(data->arch); virCapsPtr caps =3D NULL; char *capsXML =3D NULL; diff --git a/tests/virfiletest.c b/tests/virfiletest.c index a15495e9e8cd..1934d18c7bea 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -141,7 +141,7 @@ makeSparseFile(const off_t offsets[], if (unlink(path) < 0) goto error; =20 - for (i =3D 0; offsets[i] !=3D (off_t) -1; i++) + for (i =3D 0; offsets[i] !=3D (off_t)-1; i++) len +=3D offsets[i] * 1024; =20 while (len) { @@ -160,7 +160,7 @@ makeSparseFile(const off_t offsets[], } =20 len =3D 0; - for (i =3D 0; offsets[i] !=3D (off_t) -1; i++) { + for (i =3D 0; offsets[i] !=3D (off_t)-1; i++) { bool inData =3D startData; =20 if (i % 2) @@ -171,14 +171,14 @@ makeSparseFile(const off_t offsets[], FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, len, offsets[i] * 1024) < 0) { fprintf(stderr, "unable to punch a hole at offset %lld length = %lld\n", - (long long) len, (long long) offsets[i]); + (long long)len, (long long)offsets[i]); goto error; } =20 len +=3D offsets[i] * 1024; } =20 - if (lseek(fd, 0, SEEK_SET) =3D=3D (off_t) -1) { + if (lseek(fd, 0, SEEK_SET) =3D=3D (off_t)-1) { fprintf(stderr, "unable to lseek (errno=3D%d)\n", errno); goto error; } @@ -205,25 +205,25 @@ holesSupported(void) /* The way this works is: there are 4K of data followed by 4K hole fol= lowed * by 4K hole again. Check if the filesystem we are running the test s= uite * on supports holes. */ - if ((tmp =3D lseek(fd, 0, SEEK_DATA)) =3D=3D (off_t) -1) + if ((tmp =3D lseek(fd, 0, SEEK_DATA)) =3D=3D (off_t)-1) goto cleanup; =20 if (tmp !=3D 0) goto cleanup; =20 - if ((tmp =3D lseek(fd, tmp, SEEK_HOLE)) =3D=3D (off_t) -1) + if ((tmp =3D lseek(fd, tmp, SEEK_HOLE)) =3D=3D (off_t)-1) goto cleanup; =20 if (tmp !=3D EXTENT * 1024) goto cleanup; =20 - if ((tmp =3D lseek(fd, tmp, SEEK_DATA)) =3D=3D (off_t) -1) + if ((tmp =3D lseek(fd, tmp, SEEK_DATA)) =3D=3D (off_t)-1) goto cleanup; =20 if (tmp !=3D 2 * EXTENT * 1024) goto cleanup; =20 - if ((tmp =3D lseek(fd, tmp, SEEK_HOLE)) =3D=3D (off_t) -1) + if ((tmp =3D lseek(fd, tmp, SEEK_HOLE)) =3D=3D (off_t)-1) goto cleanup; =20 if (tmp !=3D 3 * EXTENT * 1024) @@ -270,7 +270,7 @@ testFileInData(const void *opaque) if ((fd =3D makeSparseFile(data->offsets, data->startData)) < 0) goto cleanup; =20 - for (i =3D 0; data->offsets[i] !=3D (off_t) -1; i++) { + for (i =3D 0; data->offsets[i] !=3D (off_t)-1; i++) { bool shouldInData =3D data->startData; int realInData; long long shouldLen; diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c index 062ae63a4909..5f6ebd9d6daf 100644 --- a/tests/virfilewrapper.c +++ b/tests/virfilewrapper.c @@ -267,7 +267,7 @@ int open(const char *path, int flags, ...) */ if (flags & O_CREAT) { va_start(ap, flags); - mode =3D (mode_t) va_arg(ap, int); + mode =3D (mode_t)va_arg(ap, int); va_end(ap); } =20 diff --git a/tests/virhashtest.c b/tests/virhashtest.c index e9c03c1afbbc..997b29bf9a7a 100644 --- a/tests/virhashtest.c +++ b/tests/virhashtest.c @@ -31,7 +31,7 @@ testHashInit(int size) */ for (i =3D ARRAY_CARDINALITY(uuids) - 1; i >=3D 0; i--) { ssize_t oldsize =3D virHashTableSize(hash); - if (virHashAddEntry(hash, uuids[i], (void *) uuids[i]) < 0) { + if (virHashAddEntry(hash, uuids[i], (void *)uuids[i]) < 0) { virHashFree(hash); return NULL; } @@ -127,7 +127,7 @@ testHashUpdate(const void *data ATTRIBUTE_UNUSED) return -1; =20 for (i =3D 0; i < ARRAY_CARDINALITY(uuids_subset); i++) { - if (virHashUpdateEntry(hash, uuids_subset[i], (void *) 1) < 0) { + if (virHashUpdateEntry(hash, uuids_subset[i], (void *)1) < 0) { VIR_TEST_VERBOSE("\nentry \"%s\" could not be updated\n", uuids_subset[i]); goto cleanup; @@ -135,7 +135,7 @@ testHashUpdate(const void *data ATTRIBUTE_UNUSED) } =20 for (i =3D 0; i < ARRAY_CARDINALITY(uuids_new); i++) { - if (virHashUpdateEntry(hash, uuids_new[i], (void *) 1) < 0) { + if (virHashUpdateEntry(hash, uuids_new[i], (void *)1) < 0) { VIR_TEST_VERBOSE("\nnew entry \"%s\" could not be updated\n", uuids_new[i]); goto cleanup; @@ -282,7 +282,7 @@ testHashRemoveSetIter(const void *payload ATTRIBUTE_UNU= SED, const void *name, const void *data) { - int *count =3D (int *) data; + int *count =3D (int *)data; bool rem =3D false; size_t i; =20 diff --git a/tests/virhostcputest.c b/tests/virhostcputest.c index cb318df6e1bb..e739aa3d0d6c 100644 --- a/tests/virhostcputest.c +++ b/tests/virhostcputest.c @@ -168,7 +168,7 @@ linuxTestHostCPU(const void *opaque) char *cpuinfo =3D NULL; char *sysfs_prefix =3D NULL; char *output =3D NULL; - struct linuxTestHostCPUData *data =3D (struct linuxTestHostCPUData *) = opaque; + struct linuxTestHostCPUData *data =3D (struct linuxTestHostCPUData *)o= paque; const char *archStr =3D virArchToString(data->arch); =20 if (virAsprintf(&sysfs_prefix, "%s/virhostcpudata/linux-%s", diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index 5b03cb6aee5e..b103470ebd8f 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -44,7 +44,7 @@ VIR_LOG_INIT("tests.hostdevtest"); if ((actualCount =3D virPCIDeviceListCount(list)) !=3D cnt) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ "Unexpected count of items in " #list ": %zu, "= \ - "expecting %zu", actualCount, (size_t) cnt); \ + "expecting %zu", actualCount, (size_t)cnt); \ goto cleanup; \ } \ } while (0) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 176c64d65435..fb2ad723e244 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -54,7 +54,7 @@ char *fakesysfspcidir; # define SYSFS_PCI_PREFIX "/sys/bus/pci/" =20 # define STDERR(...) \ - fprintf(stderr, "%s %zu: ", __FUNCTION__, (size_t) __LINE__); \ + fprintf(stderr, "%s %zu: ", __FUNCTION__, (size_t)__LINE__); \ fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, "\n"); \ =20 diff --git a/tests/virpcitest.c b/tests/virpcitest.c index 80e994ae52c5..077e99d86478 100644 --- a/tests/virpcitest.c +++ b/tests/virpcitest.c @@ -86,7 +86,7 @@ testVirPCIDeviceNew(const void *opaque ATTRIBUTE_UNUSED) if ((count =3D virPCIDeviceListCount(list)) !=3D cnt) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ "Unexpected count of items in " #list ": %d, " \ - "expecting %zu", count, (size_t) cnt); \ + "expecting %zu", count, (size_t)cnt); \ goto cleanup; \ } =20 diff --git a/tests/virresctrltest.c b/tests/virresctrltest.c index 99e20d5dec99..111782dca9e9 100644 --- a/tests/virresctrltest.c +++ b/tests/virresctrltest.c @@ -17,7 +17,7 @@ struct virResctrlData { static int test_virResctrlGetUnused(const void *opaque) { - struct virResctrlData *data =3D (struct virResctrlData *) opaque; + struct virResctrlData *data =3D (struct virResctrlData *)opaque; char *system_dir =3D NULL; char *resctrl_dir =3D NULL; int ret =3D -1; diff --git a/tests/virschematest.c b/tests/virschematest.c index 2d3583391943..f9f624afc048 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -144,7 +144,7 @@ testSchemaDirs(const char *schema, virXMLValidatorPtr v= alidator, ...) static int testSchemaGrammar(const void *opaque) { - struct testSchemaData *data =3D (struct testSchemaData *) opaque; + struct testSchemaData *data =3D (struct testSchemaData *)opaque; char *schema_path; int ret =3D -1; =20 diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index b032d8b93fd9..fabd0efbd078 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -586,40 +586,40 @@ testPathRelativePrepare(void) } =20 /* normal relative backing chain */ - backingchain[0].path =3D (char *) "/path/to/some/img"; + backingchain[0].path =3D (char *)"/path/to/some/img"; =20 - backingchain[1].path =3D (char *) "/path/to/some/asdf"; - backingchain[1].relPath =3D (char *) "asdf"; + backingchain[1].path =3D (char *)"/path/to/some/asdf"; + backingchain[1].relPath =3D (char *)"asdf"; =20 - backingchain[2].path =3D (char *) "/path/to/some/test"; - backingchain[2].relPath =3D (char *) "test"; + backingchain[2].path =3D (char *)"/path/to/some/test"; + backingchain[2].relPath =3D (char *)"test"; =20 - backingchain[3].path =3D (char *) "/path/to/some/blah"; - backingchain[3].relPath =3D (char *) "blah"; + backingchain[3].path =3D (char *)"/path/to/some/blah"; + backingchain[3].relPath =3D (char *)"blah"; =20 /* ovirt's backing chain */ - backingchain[4].path =3D (char *) "/path/to/volume/image1"; + backingchain[4].path =3D (char *)"/path/to/volume/image1"; =20 - backingchain[5].path =3D (char *) "/path/to/volume/image2"; - backingchain[5].relPath =3D (char *) "../volume/image2"; + backingchain[5].path =3D (char *)"/path/to/volume/image2"; + backingchain[5].relPath =3D (char *)"../volume/image2"; =20 - backingchain[6].path =3D (char *) "/path/to/volume/image3"; - backingchain[6].relPath =3D (char *) "../volume/image3"; + backingchain[6].path =3D (char *)"/path/to/volume/image3"; + backingchain[6].relPath =3D (char *)"../volume/image3"; =20 - backingchain[7].path =3D (char *) "/path/to/volume/image4"; - backingchain[7].relPath =3D (char *) "../volume/image4"; + backingchain[7].path =3D (char *)"/path/to/volume/image4"; + backingchain[7].relPath =3D (char *)"../volume/image4"; =20 /* some arbitrarily crazy backing chains */ - backingchain[8].path =3D (char *) "/crazy/base/image"; + backingchain[8].path =3D (char *)"/crazy/base/image"; =20 - backingchain[9].path =3D (char *) "/crazy/base/directory/stuff/volumes= /garbage/image2"; - backingchain[9].relPath =3D (char *) "directory/stuff/volumes/garbage/= image2"; + backingchain[9].path =3D (char *)"/crazy/base/directory/stuff/volumes/= garbage/image2"; + backingchain[9].relPath =3D (char *)"directory/stuff/volumes/garbage/i= mage2"; =20 - backingchain[10].path =3D (char *) "/crazy/base/directory/image3"; - backingchain[10].relPath =3D (char *) "../../../image3"; + backingchain[10].path =3D (char *)"/crazy/base/directory/image3"; + backingchain[10].relPath =3D (char *)"../../../image3"; =20 - backingchain[11].path =3D (char *) "/crazy/base/blah/image4"; - backingchain[11].relPath =3D (char *) "../blah/image4"; + backingchain[11].path =3D (char *)"/crazy/base/blah/image4"; + backingchain[11].relPath =3D (char *)"../blah/image4"; } =20 =20 diff --git a/tests/virstringtest.c b/tests/virstringtest.c index 1230aba5b7a3..a521bcff8065 100644 --- a/tests/virstringtest.c +++ b/tests/virstringtest.c @@ -47,7 +47,7 @@ static int testStreq(const void *args) bool streq_rv, strneq_rv; size_t i; =20 - if ((size_t) data->a ^ (size_t) data->b) + if ((size_t)data->a ^ (size_t)data->b) equal =3D false; if (data->a && data->b) { for (i =3D 0; data->a[i] !=3D '\0'; i++) { @@ -65,14 +65,14 @@ static int testStreq(const void *args) if (streq_rv !=3D equal) { virFilePrintf(stderr, "STREQ not working correctly. Expected %d got %d", - (int) equal, (int) streq_rv); + (int)equal, (int)streq_rv); goto cleanup; } =20 if (strneq_rv =3D=3D equal) { virFilePrintf(stderr, "STRNEQ not working correctly. Expected %d got %d", - (int) equal, (int) strneq_rv); + (int)equal, (int)strneq_rv); goto cleanup; } =20 @@ -225,7 +225,7 @@ static int testRemove(const void *args) =20 for (i =3D 0; data->tokens[i]; i++) { virStringListRemove(&list, data->tokens[i]); - if (virStringListHasString((const char **) list, data->tokens[i]))= { + if (virStringListHasString((const char **)list, data->tokens[i])) { virFilePrintf(stderr, "Not removed %s", data->tokens[i]); goto cleanup; } @@ -564,7 +564,7 @@ struct stringToLongData { * to try and port libvirt to a platform with 16-bit int. Gnulib * already assumes that signed integers are two's complement. */ verify(sizeof(int) =3D=3D 4); -verify(sizeof(long) =3D=3D sizeof(int) || sizeof(long) =3D=3D sizeof(long = long)); +verify(sizeof(long) =3D=3D sizeof(int)|| sizeof(long) =3D=3D sizeof(long l= ong)); verify(sizeof(long long) =3D=3D 8); =20 static int @@ -587,7 +587,7 @@ testStringToLong(const void *opaque) do { \ Type value =3D 5; \ int result; \ - end =3D (char *) "oops"; \ + end =3D (char *)"oops"; \ result =3D virStrToLong_ ## Fn(Str, Suff ? &end : NULL, \ 0, &value); \ /* On failure, end is modified, value is unchanged */ \ diff --git a/tests/virusbmock.c b/tests/virusbmock.c index 12083e236206..e55d051d859b 100644 --- a/tests/virusbmock.c +++ b/tests/virusbmock.c @@ -101,7 +101,7 @@ int open(const char *pathname, int flags, ...) */ if (flags & O_CREAT) { va_start(ap, flags); - mode =3D (mode_t) va_arg(ap, int); + mode =3D (mode_t)va_arg(ap, int); va_end(ap); } =20 --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list