Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx> --- 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 = { .type = VIR_CPU_TYPE_HOST, .arch = VIR_ARCH_X86_64, - .model = (char *) "host", - .vendor = (char *) "CPU Vendorrr", + .model = (char *)"host", + .vendor = (char *)"CPU Vendorrr", }; domCaps->maxvcpus = 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 = -1; - struct qemuHotplugTestData *test = (struct qemuHotplugTestData *) data; + struct qemuHotplugTestData *test = (struct qemuHotplugTestData *)data; char *domain_filename = NULL; char *device_filename = NULL; char *result_filename = 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(virDomainXMLOptionPtr xmlopt) memset(&chr, 0, sizeof(chr)); chr.type = VIR_DOMAIN_CHR_TYPE_FILE; - chr.data.file.path = (char *) "/test/path"; + chr.data.file.path = (char *)"/test/path"; CHECK("file", false, "{'id':'alias','backend':{'type':'file','data':{'out':'/test/path'}}}"); memset(&chr, 0, sizeof(chr)); chr.type = VIR_DOMAIN_CHR_TYPE_DEV; - chr.data.file.path = (char *) "/test/path"; + chr.data.file.path = (char *)"/test/path"; CHECK("device", false, "{'id':'alias','backend':{'type':'serial','data':{'device':'/test/path'}}}"); memset(&chr, 0, sizeof(chr)); chr.type = VIR_DOMAIN_CHR_TYPE_TCP; - chr.data.tcp.host = (char *) "example.com"; - chr.data.tcp.service = (char *) "1234"; + chr.data.tcp.host = (char *)"example.com"; + chr.data.tcp.service = (char *)"1234"; CHECK("tcp", false, "{'id':'alias'," "'backend':{'type':'socket'," @@ -879,8 +879,8 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt) memset(&chr, 0, sizeof(chr)); chr.type = VIR_DOMAIN_CHR_TYPE_UDP; - chr.data.udp.connectHost = (char *) "example.com"; - chr.data.udp.connectService = (char *) "1234"; + chr.data.udp.connectHost = (char *)"example.com"; + chr.data.udp.connectService = (char *)"1234"; CHECK("udp", false, "{'id':'alias'," "'backend':{'type':'udp'," @@ -888,8 +888,8 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt) "'data':{'host':'example.com'," "'port':'1234'}}}}}"); - chr.data.udp.bindHost = (char *) "localhost"; - chr.data.udp.bindService = (char *) "4321"; + chr.data.udp.bindHost = (char *)"localhost"; + chr.data.udp.bindService = (char *)"4321"; CHECK("udp", false, "{'id':'alias'," "'backend':{'type':'udp'," @@ -901,7 +901,7 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt) "'port':'4321'}}}}}"); chr.data.udp.bindHost = NULL; - chr.data.udp.bindService = (char *) "4321"; + chr.data.udp.bindService = (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 = VIR_DOMAIN_CHR_TYPE_UNIX; - chr.data.nix.path = (char *) "/path/to/socket"; + chr.data.nix.path = (char *)"/path/to/socket"; CHECK("unix", false, "{'id':'alias'," "'backend':{'type':'socket'," @@ -1185,14 +1185,14 @@ testQemuMonitorJSONGetDeviceAliases(const void *data) } ret = 0; - for (alias = (const char **) aliases; *alias; alias++) { + for (alias = (const char **)aliases; *alias; alias++) { if (!virStringListHasString(expected, *alias)) { fprintf(stderr, "got unexpected device alias '%s'\n", *alias); ret = -1; } } for (alias = expected; *alias; alias++) { - if (!virStringListHasString((const char **) aliases, *alias)) { + if (!virStringListHasString((const char **)aliases, *alias)) { fprintf(stderr, "missing expected alias '%s'\n", *alias); ret = -1; } @@ -1411,14 +1411,14 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *data) qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt); int ret = -1; struct qemuMonitorQueryCpusEntry expect_slow[] = { - {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[] = { - {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}, }; if (!test) @@ -1976,8 +1976,8 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *data) int ret = -1; virHashTablePtr info = NULL, expectedInfo = NULL; qemuMonitorChardevInfo info0 = { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT }; - qemuMonitorChardevInfo info1 = { (char *) "/dev/pts/21", VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED }; - qemuMonitorChardevInfo info2 = { (char *) "/dev/pts/20", VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT }; + qemuMonitorChardevInfo info1 = { (char *)"/dev/pts/21", VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED }; + qemuMonitorChardevInfo info2 = { (char *)"/dev/pts/20", VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT }; qemuMonitorChardevInfo info3 = { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_DISCONNECTED }; if (!test) @@ -2215,7 +2215,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabilities(const void *data) goto cleanup; cap = 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 vcpus, if (vcpu->tid) virBufferAsprintf(&buf, "thread-id='%llu'\n", - (unsigned long long) vcpu->tid); + (unsigned long long)vcpu->tid); if (vcpu->id != 0) virBufferAsprintf(&buf, "enable-id='%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 = strlen(secret); - return (unsigned char *) secret; + return (unsigned char *)secret; } static virSecretPtr @@ -438,7 +438,7 @@ testCompareXMLToStartupXML(const void *data) static int testCompareXMLToArgv(const void *data) { - struct testInfo *info = (void *) data; + struct testInfo *info = (void *)data; char *xml = NULL; char *args = NULL; char *migrateURI = 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) != 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 = (char *) lib; \ + newenv = (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" static virCPUFeatureDef cpuDefaultFeatures[] = { - { (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 = { .type = VIR_CPU_TYPE_HOST, .arch = VIR_ARCH_X86_64, - .model = (char *) "core2duo", - .vendor = (char *) "Intel", + .model = (char *)"core2duo", + .vendor = (char *)"Intel", .sockets = 1, .cores = 2, .threads = 1, @@ -31,36 +31,36 @@ static virCPUDef cpuDefaultData = { }; static virCPUFeatureDef cpuHaswellFeatures[] = { - { (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 = { .type = VIR_CPU_TYPE_HOST, .arch = VIR_ARCH_X86_64, - .model = (char *) "Haswell", - .vendor = (char *) "Intel", + .model = (char *)"Haswell", + .vendor = (char *)"Intel", .sockets = 1, .cores = 2, .threads = 2, @@ -72,7 +72,7 @@ static virCPUDef cpuHaswellData = { static virCPUDef cpuBroadwellData = { .type = VIR_CPU_TYPE_HOST, .arch = VIR_ARCH_X86_64, - .model = (char *) "Broadwell", + .model = (char *)"Broadwell", .sockets = 1, .cores = 2, .threads = 2, @@ -81,7 +81,7 @@ static virCPUDef cpuBroadwellData = { static virCPUDef cpuPower8Data = { .type = VIR_CPU_TYPE_HOST, .arch = VIR_ARCH_PPC64, - .model = (char *) "POWER8", + .model = (char *)"POWER8", .sockets = 1, .cores = 8, .threads = 8, @@ -90,7 +90,7 @@ static virCPUDef cpuPower8Data = { static virCPUDef cpuPower9Data = { .type = VIR_CPU_TYPE_HOST, .arch = VIR_ARCH_PPC64, - .model = (char *) "POWER9", + .model = (char *)"POWER9", .sockets = 1, .cores = 16, .threads = 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) != -1) goto error; - j = sizeof(bitsPos)/sizeof(int) - 1; + j = sizeof(bitsPos)/sizeof(int)- 1; if (virBitmapLastSetBit(bitmap) != bitsPos[j]) goto error; @@ -314,7 +314,7 @@ test5(const void *v ATTRIBUTE_UNUSED) i = 0; j = -1; - while (i < sizeof(bits)/sizeof(int) && + while (i < sizeof(bits)/sizeof(int)&& (j = virBitmapNextSetBit(bitmap, j)) >= 0) { if (j != 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 = (struct virCapabilitiesData *) opaque; + struct virCapabilitiesData *data = (struct virCapabilitiesData *)opaque; const char *archStr = virArchToString(data->arch); virCapsPtr caps = NULL; char *capsXML = 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; - for (i = 0; offsets[i] != (off_t) -1; i++) + for (i = 0; offsets[i] != (off_t)-1; i++) len += offsets[i] * 1024; while (len) { @@ -160,7 +160,7 @@ makeSparseFile(const off_t offsets[], } len = 0; - for (i = 0; offsets[i] != (off_t) -1; i++) { + for (i = 0; offsets[i] != (off_t)-1; i++) { bool inData = startData; 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; } len += offsets[i] * 1024; } - if (lseek(fd, 0, SEEK_SET) == (off_t) -1) { + if (lseek(fd, 0, SEEK_SET) == (off_t)-1) { fprintf(stderr, "unable to lseek (errno=%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 followed * by 4K hole again. Check if the filesystem we are running the test suite * on supports holes. */ - if ((tmp = lseek(fd, 0, SEEK_DATA)) == (off_t) -1) + if ((tmp = lseek(fd, 0, SEEK_DATA)) == (off_t)-1) goto cleanup; if (tmp != 0) goto cleanup; - if ((tmp = lseek(fd, tmp, SEEK_HOLE)) == (off_t) -1) + if ((tmp = lseek(fd, tmp, SEEK_HOLE)) == (off_t)-1) goto cleanup; if (tmp != EXTENT * 1024) goto cleanup; - if ((tmp = lseek(fd, tmp, SEEK_DATA)) == (off_t) -1) + if ((tmp = lseek(fd, tmp, SEEK_DATA)) == (off_t)-1) goto cleanup; if (tmp != 2 * EXTENT * 1024) goto cleanup; - if ((tmp = lseek(fd, tmp, SEEK_HOLE)) == (off_t) -1) + if ((tmp = lseek(fd, tmp, SEEK_HOLE)) == (off_t)-1) goto cleanup; if (tmp != 3 * EXTENT * 1024) @@ -270,7 +270,7 @@ testFileInData(const void *opaque) if ((fd = makeSparseFile(data->offsets, data->startData)) < 0) goto cleanup; - for (i = 0; data->offsets[i] != (off_t) -1; i++) { + for (i = 0; data->offsets[i] != (off_t)-1; i++) { bool shouldInData = 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 = (mode_t) va_arg(ap, int); + mode = (mode_t)va_arg(ap, int); va_end(ap); } 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 = ARRAY_CARDINALITY(uuids) - 1; i >= 0; i--) { ssize_t oldsize = 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; for (i = 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) } for (i = 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_UNUSED, const void *name, const void *data) { - int *count = (int *) data; + int *count = (int *)data; bool rem = false; size_t i; 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 = NULL; char *sysfs_prefix = NULL; char *output = NULL; - struct linuxTestHostCPUData *data = (struct linuxTestHostCPUData *) opaque; + struct linuxTestHostCPUData *data = (struct linuxTestHostCPUData *)opaque; const char *archStr = virArchToString(data->arch); 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 = virPCIDeviceListCount(list)) != 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/" # 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"); \ 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 = virPCIDeviceListCount(list)) != 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; \ } 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 = (struct virResctrlData *) opaque; + struct virResctrlData *data = (struct virResctrlData *)opaque; char *system_dir = NULL; char *resctrl_dir = NULL; int ret = -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 validator, ...) static int testSchemaGrammar(const void *opaque) { - struct testSchemaData *data = (struct testSchemaData *) opaque; + struct testSchemaData *data = (struct testSchemaData *)opaque; char *schema_path; int ret = -1; 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) } /* normal relative backing chain */ - backingchain[0].path = (char *) "/path/to/some/img"; + backingchain[0].path = (char *)"/path/to/some/img"; - backingchain[1].path = (char *) "/path/to/some/asdf"; - backingchain[1].relPath = (char *) "asdf"; + backingchain[1].path = (char *)"/path/to/some/asdf"; + backingchain[1].relPath = (char *)"asdf"; - backingchain[2].path = (char *) "/path/to/some/test"; - backingchain[2].relPath = (char *) "test"; + backingchain[2].path = (char *)"/path/to/some/test"; + backingchain[2].relPath = (char *)"test"; - backingchain[3].path = (char *) "/path/to/some/blah"; - backingchain[3].relPath = (char *) "blah"; + backingchain[3].path = (char *)"/path/to/some/blah"; + backingchain[3].relPath = (char *)"blah"; /* ovirt's backing chain */ - backingchain[4].path = (char *) "/path/to/volume/image1"; + backingchain[4].path = (char *)"/path/to/volume/image1"; - backingchain[5].path = (char *) "/path/to/volume/image2"; - backingchain[5].relPath = (char *) "../volume/image2"; + backingchain[5].path = (char *)"/path/to/volume/image2"; + backingchain[5].relPath = (char *)"../volume/image2"; - backingchain[6].path = (char *) "/path/to/volume/image3"; - backingchain[6].relPath = (char *) "../volume/image3"; + backingchain[6].path = (char *)"/path/to/volume/image3"; + backingchain[6].relPath = (char *)"../volume/image3"; - backingchain[7].path = (char *) "/path/to/volume/image4"; - backingchain[7].relPath = (char *) "../volume/image4"; + backingchain[7].path = (char *)"/path/to/volume/image4"; + backingchain[7].relPath = (char *)"../volume/image4"; /* some arbitrarily crazy backing chains */ - backingchain[8].path = (char *) "/crazy/base/image"; + backingchain[8].path = (char *)"/crazy/base/image"; - backingchain[9].path = (char *) "/crazy/base/directory/stuff/volumes/garbage/image2"; - backingchain[9].relPath = (char *) "directory/stuff/volumes/garbage/image2"; + backingchain[9].path = (char *)"/crazy/base/directory/stuff/volumes/garbage/image2"; + backingchain[9].relPath = (char *)"directory/stuff/volumes/garbage/image2"; - backingchain[10].path = (char *) "/crazy/base/directory/image3"; - backingchain[10].relPath = (char *) "../../../image3"; + backingchain[10].path = (char *)"/crazy/base/directory/image3"; + backingchain[10].relPath = (char *)"../../../image3"; - backingchain[11].path = (char *) "/crazy/base/blah/image4"; - backingchain[11].relPath = (char *) "../blah/image4"; + backingchain[11].path = (char *)"/crazy/base/blah/image4"; + backingchain[11].relPath = (char *)"../blah/image4"; } 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; - if ((size_t) data->a ^ (size_t) data->b) + if ((size_t)data->a ^ (size_t)data->b) equal = false; if (data->a && data->b) { for (i = 0; data->a[i] != '\0'; i++) { @@ -65,14 +65,14 @@ static int testStreq(const void *args) if (streq_rv != equal) { virFilePrintf(stderr, "STREQ not working correctly. Expected %d got %d", - (int) equal, (int) streq_rv); + (int)equal, (int)streq_rv); goto cleanup; } if (strneq_rv == equal) { virFilePrintf(stderr, "STRNEQ not working correctly. Expected %d got %d", - (int) equal, (int) strneq_rv); + (int)equal, (int)strneq_rv); goto cleanup; } @@ -225,7 +225,7 @@ static int testRemove(const void *args) for (i = 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) == 4); -verify(sizeof(long) == sizeof(int) || sizeof(long) == sizeof(long long)); +verify(sizeof(long) == sizeof(int)|| sizeof(long) == sizeof(long long)); verify(sizeof(long long) == 8); static int @@ -587,7 +587,7 @@ testStringToLong(const void *opaque) do { \ Type value = 5; \ int result; \ - end = (char *) "oops"; \ + end = (char *)"oops"; \ result = 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 = (mode_t) va_arg(ap, int); + mode = (mode_t)va_arg(ap, int); va_end(ap); } -- 2.17.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list