mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 06:03:52 +03:00
Convert 'int i' to 'size_t i' in tests/ files
Convert the type of loop iterators named 'i', 'j', k', 'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or 'unsigned int', also santizing 'ii', 'jj', 'kk' to use the normal 'i', 'j', 'k' naming Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
f8b42f3224
commit
7a1e691711
@ -57,7 +57,7 @@ static int envsort(const void *a, const void *b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
int i, n;
|
size_t i, n;
|
||||||
char **origenv;
|
char **origenv;
|
||||||
char **newenv;
|
char **newenv;
|
||||||
char *cwd;
|
char *cwd;
|
||||||
@ -104,7 +104,7 @@ int main(int argc, char **argv) {
|
|||||||
closed = fcntl(i, F_GETFD, &f) == -1 &&
|
closed = fcntl(i, F_GETFD, &f) == -1 &&
|
||||||
errno == EBADF;
|
errno == EBADF;
|
||||||
if (!closed)
|
if (!closed)
|
||||||
fprintf(log, "FD:%d\n", i);
|
fprintf(log, "FD:%zu\n", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(log, "DAEMON:%s\n", getpgrp() == getsid(0) ? "yes" : "no");
|
fprintf(log, "DAEMON:%s\n", getpgrp() == getsid(0) ? "yes" : "no");
|
||||||
|
@ -114,7 +114,7 @@ cpuTestLoadMultiXML(const char *arch,
|
|||||||
xmlNodePtr *nodes = NULL;
|
xmlNodePtr *nodes = NULL;
|
||||||
virCPUDefPtr *cpus = NULL;
|
virCPUDefPtr *cpus = NULL;
|
||||||
int n;
|
int n;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (virAsprintf(&xml, "%s/cputestdata/%s-%s.xml", abs_srcdir, arch, name) < 0)
|
if (virAsprintf(&xml, "%s/cputestdata/%s-%s.xml", abs_srcdir, arch, name) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -326,7 +326,7 @@ cpuTestBaseline(const void *arg)
|
|||||||
virCPUDefPtr baseline = NULL;
|
virCPUDefPtr baseline = NULL;
|
||||||
unsigned int ncpus = 0;
|
unsigned int ncpus = 0;
|
||||||
char *result = NULL;
|
char *result = NULL;
|
||||||
unsigned int i;
|
size_t i;
|
||||||
|
|
||||||
if (!(cpus = cpuTestLoadMultiXML(data->arch, data->name, &ncpus)))
|
if (!(cpus = cpuTestLoadMultiXML(data->arch, data->name, &ncpus)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -359,7 +359,7 @@ cpuTestBaseline(const void *arg)
|
|||||||
cmp != VIR_CPU_COMPARE_IDENTICAL) {
|
cmp != VIR_CPU_COMPARE_IDENTICAL) {
|
||||||
if (virTestGetVerbose()) {
|
if (virTestGetVerbose()) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"\nbaseline CPU is incompatible with CPU %u\n", i);
|
"\nbaseline CPU is incompatible with CPU %zu\n", i);
|
||||||
fprintf(stderr, "%74s", "... ");
|
fprintf(stderr, "%74s", "... ");
|
||||||
}
|
}
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
@ -47,7 +47,8 @@ static struct testPath paths[] = {
|
|||||||
static int
|
static int
|
||||||
testParseDatastorePath(const void *data ATTRIBUTE_UNUSED)
|
testParseDatastorePath(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int i, result = 0;
|
int result = 0;
|
||||||
|
size_t i;
|
||||||
char *datastoreName = NULL;
|
char *datastoreName = NULL;
|
||||||
char *directoryName = NULL;
|
char *directoryName = NULL;
|
||||||
char *directoryAndFileName = NULL;
|
char *directoryAndFileName = NULL;
|
||||||
@ -135,7 +136,7 @@ static struct testDateTime times[] = {
|
|||||||
static int
|
static int
|
||||||
testConvertDateTimeToCalendarTime(const void *data ATTRIBUTE_UNUSED)
|
testConvertDateTimeToCalendarTime(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
esxVI_DateTime dateTime;
|
esxVI_DateTime dateTime;
|
||||||
long long calendarTime;
|
long long calendarTime;
|
||||||
|
|
||||||
@ -187,7 +188,7 @@ static struct testDatastoreItem datastoreItems[] = {
|
|||||||
static int
|
static int
|
||||||
testEscapeDatastoreItem(const void *data ATTRIBUTE_UNUSED)
|
testEscapeDatastoreItem(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
char *escaped = NULL;
|
char *escaped = NULL;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_CARDINALITY(datastoreItems); ++i) {
|
for (i = 0; i < ARRAY_CARDINALITY(datastoreItems); ++i) {
|
||||||
@ -228,7 +229,7 @@ static struct testWindows1252ToUTF8 windows1252ToUTF8[] = {
|
|||||||
static int
|
static int
|
||||||
testConvertWindows1252ToUTF8(const void *data ATTRIBUTE_UNUSED)
|
testConvertWindows1252ToUTF8(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
char *utf8 = NULL;
|
char *utf8 = NULL;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_CARDINALITY(windows1252ToUTF8); ++i) {
|
for (i = 0; i < ARRAY_CARDINALITY(windows1252ToUTF8); ++i) {
|
||||||
|
@ -143,18 +143,18 @@ verifyFired(const char *name, int handle, int timer)
|
|||||||
{
|
{
|
||||||
int handleFired = 0;
|
int handleFired = 0;
|
||||||
int timerFired = 0;
|
int timerFired = 0;
|
||||||
int i;
|
size_t i;
|
||||||
for (i = 0; i < NUM_FDS; i++) {
|
for (i = 0; i < NUM_FDS; i++) {
|
||||||
if (handles[i].fired) {
|
if (handles[i].fired) {
|
||||||
if (i != handle) {
|
if (i != handle) {
|
||||||
virtTestResult(name, 1,
|
virtTestResult(name, 1,
|
||||||
"Handle %d fired, but expected %d\n", i,
|
"Handle %zu fired, but expected %d\n", i,
|
||||||
handle);
|
handle);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
} else {
|
} else {
|
||||||
if (handles[i].error != EV_ERROR_NONE) {
|
if (handles[i].error != EV_ERROR_NONE) {
|
||||||
virtTestResult(name, 1,
|
virtTestResult(name, 1,
|
||||||
"Handle %d fired, but had error %d\n", i,
|
"Handle %zu fired, but had error %d\n", i,
|
||||||
handles[i].error);
|
handles[i].error);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
@ -181,12 +181,12 @@ verifyFired(const char *name, int handle, int timer)
|
|||||||
if (timers[i].fired) {
|
if (timers[i].fired) {
|
||||||
if (i != timer) {
|
if (i != timer) {
|
||||||
virtTestResult(name, 1,
|
virtTestResult(name, 1,
|
||||||
"Timer %d fired, but expected %d\n", i, timer);
|
"Timer %zu fired, but expected %d\n", i, timer);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
} else {
|
} else {
|
||||||
if (timers[i].error != EV_ERROR_NONE) {
|
if (timers[i].error != EV_ERROR_NONE) {
|
||||||
virtTestResult(name, 1,
|
virtTestResult(name, 1,
|
||||||
"Timer %d fired, but had error %d\n", i,
|
"Timer %zu fired, but had error %d\n", i,
|
||||||
timers[i].error);
|
timers[i].error);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
@ -247,7 +247,7 @@ finishJob(const char *name, int handle, int timer)
|
|||||||
static void
|
static void
|
||||||
resetAll(void)
|
resetAll(void)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
for (i = 0; i < NUM_FDS; i++) {
|
for (i = 0; i < NUM_FDS; i++) {
|
||||||
handles[i].fired = 0;
|
handles[i].fired = 0;
|
||||||
handles[i].error = EV_ERROR_NONE;
|
handles[i].error = EV_ERROR_NONE;
|
||||||
@ -261,7 +261,7 @@ resetAll(void)
|
|||||||
static int
|
static int
|
||||||
mymain(void)
|
mymain(void)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
pthread_t eventThread;
|
pthread_t eventThread;
|
||||||
char one = '1';
|
char one = '1';
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ static int
|
|||||||
mymain(void)
|
mymain(void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int i;
|
size_t i;
|
||||||
const char *nodeData[] = {
|
const char *nodeData[] = {
|
||||||
"test1",
|
"test1",
|
||||||
# if !(defined(__powerpc__) || \
|
# if !(defined(__powerpc__) || \
|
||||||
|
@ -38,7 +38,7 @@ static int
|
|||||||
testReadConfigParam(const void *data ATTRIBUTE_UNUSED)
|
testReadConfigParam(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int result = -1;
|
int result = -1;
|
||||||
int i;
|
size_t i;
|
||||||
char *conf = NULL;
|
char *conf = NULL;
|
||||||
char *value = NULL;
|
char *value = NULL;
|
||||||
|
|
||||||
|
@ -24,15 +24,15 @@ struct testInfo {
|
|||||||
static void printMismatchedFlags(virQEMUCapsPtr got,
|
static void printMismatchedFlags(virQEMUCapsPtr got,
|
||||||
virQEMUCapsPtr expect)
|
virQEMUCapsPtr expect)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < QEMU_CAPS_LAST; i++) {
|
for (i = 0; i < QEMU_CAPS_LAST; i++) {
|
||||||
bool gotFlag = virQEMUCapsGet(got, i);
|
bool gotFlag = virQEMUCapsGet(got, i);
|
||||||
bool expectFlag = virQEMUCapsGet(expect, i);
|
bool expectFlag = virQEMUCapsGet(expect, i);
|
||||||
if (gotFlag && !expectFlag)
|
if (gotFlag && !expectFlag)
|
||||||
fprintf(stderr, "Extra flag %i\n", i);
|
fprintf(stderr, "Extra flag %zu\n", i);
|
||||||
if (!gotFlag && expectFlag)
|
if (!gotFlag && expectFlag)
|
||||||
fprintf(stderr, "Missing flag %i\n", i);
|
fprintf(stderr, "Missing flag %zu\n", i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ testQemuMonitorJSONGetMachines(const void *data)
|
|||||||
qemuMonitorMachineInfoPtr *info;
|
qemuMonitorMachineInfoPtr *info;
|
||||||
int ninfo = 0;
|
int ninfo = 0;
|
||||||
const char *null = NULL;
|
const char *null = NULL;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (!test)
|
if (!test)
|
||||||
return -1;
|
return -1;
|
||||||
@ -317,7 +317,7 @@ testQemuMonitorJSONGetCPUDefinitions(const void *data)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
char **cpus = NULL;
|
char **cpus = NULL;
|
||||||
int ncpus = 0;
|
int ncpus = 0;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (!test)
|
if (!test)
|
||||||
return -1;
|
return -1;
|
||||||
@ -383,7 +383,7 @@ testQemuMonitorJSONGetCommands(const void *data)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
char **commands = NULL;
|
char **commands = NULL;
|
||||||
int ncommands = 0;
|
int ncommands = 0;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (!test)
|
if (!test)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -34,7 +34,7 @@ static struct testEscapeString escapeStrings[] = {
|
|||||||
|
|
||||||
static int testEscapeArg(const void *data ATTRIBUTE_UNUSED)
|
static int testEscapeArg(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
char *escaped = NULL;
|
char *escaped = NULL;
|
||||||
for (i = 0; i < ARRAY_CARDINALITY(escapeStrings); ++i) {
|
for (i = 0; i < ARRAY_CARDINALITY(escapeStrings); ++i) {
|
||||||
escaped = qemuMonitorEscapeArg(escapeStrings[i].unescaped);
|
escaped = qemuMonitorEscapeArg(escapeStrings[i].unescaped);
|
||||||
@ -61,7 +61,7 @@ static int testEscapeArg(const void *data ATTRIBUTE_UNUSED)
|
|||||||
|
|
||||||
static int testUnescapeArg(const void *data ATTRIBUTE_UNUSED)
|
static int testUnescapeArg(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
char *unescaped = NULL;
|
char *unescaped = NULL;
|
||||||
for (i = 0; i < ARRAY_CARDINALITY(escapeStrings); ++i) {
|
for (i = 0; i < ARRAY_CARDINALITY(escapeStrings); ++i) {
|
||||||
unescaped = qemuMonitorUnescapeArg(escapeStrings[i].escaped);
|
unescaped = qemuMonitorUnescapeArg(escapeStrings[i].escaped);
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
bool failConnect = false; /* Exit -1, with no data on stdout, msg on stderr */
|
bool failConnect = false; /* Exit -1, with no data on stdout, msg on stderr */
|
||||||
bool dieEarly = false; /* Exit -1, with partial data on stdout, msg on stderr */
|
bool dieEarly = false; /* Exit -1, with partial data on stdout, msg on stderr */
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ double
|
|||||||
virtTestCountAverage(double *items, int nitems)
|
virtTestCountAverage(double *items, int nitems)
|
||||||
{
|
{
|
||||||
long double sum = 0;
|
long double sum = 0;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i=1; i < nitems; i++)
|
for (i=1; i < nitems; i++)
|
||||||
sum += items[i];
|
sum += items[i];
|
||||||
@ -132,7 +132,8 @@ void virtTestResult(const char *name, int ret, const char *msg, ...)
|
|||||||
int
|
int
|
||||||
virtTestRun(const char *title, int nloops, int (*body)(const void *data), const void *data)
|
virtTestRun(const char *title, int nloops, int (*body)(const void *data), const void *data)
|
||||||
{
|
{
|
||||||
int i, ret = 0;
|
int ret = 0;
|
||||||
|
size_t i;
|
||||||
double *ts = NULL;
|
double *ts = NULL;
|
||||||
|
|
||||||
if (testCounter == 0 && !virTestGetVerbose())
|
if (testCounter == 0 && !virTestGetVerbose())
|
||||||
@ -265,7 +266,7 @@ virtTestLoadFile(const char *file, char **buf)
|
|||||||
static
|
static
|
||||||
void virtTestCaptureProgramExecChild(const char *const argv[],
|
void virtTestCaptureProgramExecChild(const char *const argv[],
|
||||||
int pipefd) {
|
int pipefd) {
|
||||||
int i;
|
size_t i;
|
||||||
int open_max;
|
int open_max;
|
||||||
int stdinfd = -1;
|
int stdinfd = -1;
|
||||||
const char *const env[] = {
|
const char *const env[] = {
|
||||||
@ -283,7 +284,8 @@ void virtTestCaptureProgramExecChild(const char *const argv[],
|
|||||||
for (i = 0; i < open_max; i++) {
|
for (i = 0; i < open_max; i++) {
|
||||||
if (i != stdinfd &&
|
if (i != stdinfd &&
|
||||||
i != pipefd) {
|
i != pipefd) {
|
||||||
int tmpfd = i;
|
int tmpfd;
|
||||||
|
tmpfd = i;
|
||||||
VIR_FORCE_CLOSE(tmpfd);
|
VIR_FORCE_CLOSE(tmpfd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -523,7 +525,7 @@ virtTestErrorHook(int n, void *data ATTRIBUTE_UNUSED)
|
|||||||
{
|
{
|
||||||
void *trace[30];
|
void *trace[30];
|
||||||
int ntrace = ARRAY_CARDINALITY(trace);
|
int ntrace = ARRAY_CARDINALITY(trace);
|
||||||
int i;
|
size_t i;
|
||||||
char **symbols = NULL;
|
char **symbols = NULL;
|
||||||
|
|
||||||
ntrace = backtrace(trace, ntrace);
|
ntrace = backtrace(trace, ntrace);
|
||||||
@ -665,7 +667,7 @@ int virtTestMain(int argc,
|
|||||||
fprintf(stderr, "%d) OOM of %d allocs ", testCounter, approxAlloc);
|
fprintf(stderr, "%d) OOM of %d allocs ", testCounter, approxAlloc);
|
||||||
|
|
||||||
if (mp) {
|
if (mp) {
|
||||||
int i;
|
size_t i;
|
||||||
for (i = 0; i < mp; i++) {
|
for (i = 0; i < mp; i++) {
|
||||||
workers[i] = fork();
|
workers[i] = fork();
|
||||||
if (workers[i] == 0) {
|
if (workers[i] == 0) {
|
||||||
@ -700,7 +702,7 @@ int virtTestMain(int argc,
|
|||||||
if (worker) {
|
if (worker) {
|
||||||
_exit(ret);
|
_exit(ret);
|
||||||
} else {
|
} else {
|
||||||
int i;
|
size_t i;
|
||||||
for (i = 0; i < mp; i++) {
|
for (i = 0; i < mp; i++) {
|
||||||
if (virProcessWait(workers[i], NULL) < 0)
|
if (virProcessWait(workers[i], NULL) < 0)
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
|
@ -36,7 +36,7 @@ static const char* diskNames[] = {
|
|||||||
static int
|
static int
|
||||||
testIndexToDiskName(const void *data ATTRIBUTE_UNUSED)
|
testIndexToDiskName(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
char *diskName = NULL;
|
char *diskName = NULL;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_CARDINALITY(diskNames); ++i) {
|
for (i = 0; i < ARRAY_CARDINALITY(diskNames); ++i) {
|
||||||
@ -62,19 +62,20 @@ testIndexToDiskName(const void *data ATTRIBUTE_UNUSED)
|
|||||||
static int
|
static int
|
||||||
testDiskNameToIndex(const void *data ATTRIBUTE_UNUSED)
|
testDiskNameToIndex(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int i, k;
|
size_t i;
|
||||||
|
int idx;
|
||||||
char *diskName = NULL;
|
char *diskName = NULL;
|
||||||
|
|
||||||
for (i = 0; i < 100000; ++i) {
|
for (i = 0; i < 100000; ++i) {
|
||||||
VIR_FREE(diskName);
|
VIR_FREE(diskName);
|
||||||
|
|
||||||
diskName = virIndexToDiskName(i, "sd");
|
diskName = virIndexToDiskName(i, "sd");
|
||||||
k = virDiskNameToIndex(diskName);
|
idx = virDiskNameToIndex(diskName);
|
||||||
|
|
||||||
if (k != i) {
|
if (idx < 0 || idx != i) {
|
||||||
if (virTestGetDebug() > 0) {
|
if (virTestGetDebug() > 0) {
|
||||||
fprintf(stderr, "\nExpect [%d]\n", i);
|
fprintf(stderr, "\nExpect [%zu]\n", i);
|
||||||
fprintf(stderr, "Actual [%d]\n", k);
|
fprintf(stderr, "Actual [%d]\n", idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_FREE(diskName);
|
VIR_FREE(diskName);
|
||||||
@ -115,7 +116,8 @@ static struct testVersionString versions[] = {
|
|||||||
static int
|
static int
|
||||||
testParseVersionString(const void *data ATTRIBUTE_UNUSED)
|
testParseVersionString(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int i, result;
|
int result;
|
||||||
|
size_t i;
|
||||||
unsigned long version;
|
unsigned long version;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_CARDINALITY(versions); ++i) {
|
for (i = 0; i < ARRAY_CARDINALITY(versions); ++i) {
|
||||||
|
@ -115,7 +115,7 @@ static void
|
|||||||
thread_func(void *data)
|
thread_func(void *data)
|
||||||
{
|
{
|
||||||
int idx = (intptr_t)data;
|
int idx = (intptr_t)data;
|
||||||
int i;
|
size_t i;
|
||||||
int d;
|
int d;
|
||||||
|
|
||||||
for (i = 0; i < ROUNDS; i++) {
|
for (i = 0; i < ROUNDS; i++) {
|
||||||
@ -134,7 +134,7 @@ static int
|
|||||||
testThreads(const void *data ATTRIBUTE_UNUSED)
|
testThreads(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int sum;
|
int sum;
|
||||||
int i;
|
size_t i;
|
||||||
virThread threads[THREADS];
|
virThread threads[THREADS];
|
||||||
|
|
||||||
atomic = 0;
|
atomic = 0;
|
||||||
|
@ -65,7 +65,7 @@ testBit(virBitmapPtr bitmap,
|
|||||||
unsigned int end,
|
unsigned int end,
|
||||||
bool expected)
|
bool expected)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
for (i = start; i <= end; i++) {
|
for (i = start; i <= end; i++) {
|
||||||
@ -145,7 +145,7 @@ static int test3(const void *data ATTRIBUTE_UNUSED)
|
|||||||
virBitmapPtr bitmap = NULL;
|
virBitmapPtr bitmap = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
int size = 5;
|
int size = 5;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if ((bitmap = virBitmapNew(size)) == NULL)
|
if ((bitmap = virBitmapNew(size)) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
@ -180,7 +180,7 @@ static int test4(const void *data ATTRIBUTE_UNUSED)
|
|||||||
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39
|
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39
|
||||||
};
|
};
|
||||||
virBitmapPtr bitmap = NULL;
|
virBitmapPtr bitmap = NULL;
|
||||||
int i, j;
|
ssize_t i, j;
|
||||||
|
|
||||||
if (ARRAY_CARDINALITY(bitsPos) + ARRAY_CARDINALITY(bitsPosInv) != size)
|
if (ARRAY_CARDINALITY(bitsPos) + ARRAY_CARDINALITY(bitsPosInv) != size)
|
||||||
goto error;
|
goto error;
|
||||||
@ -268,7 +268,8 @@ static int test5(const void *v ATTRIBUTE_UNUSED)
|
|||||||
int len2;
|
int len2;
|
||||||
int bits[] = {0, 9, 34};
|
int bits[] = {0, 9, 34};
|
||||||
virBitmapPtr bitmap;
|
virBitmapPtr bitmap;
|
||||||
int i, j;
|
size_t i;
|
||||||
|
ssize_t j;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
bitmap = virBitmapNewData(data, sizeof(data));
|
bitmap = virBitmapNewData(data, sizeof(data));
|
||||||
|
@ -41,7 +41,7 @@ static int validateCgroup(virCgroupPtr cgroup,
|
|||||||
const char **expectLinkPoint,
|
const char **expectLinkPoint,
|
||||||
const char **expectPlacement)
|
const char **expectPlacement)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (STRNEQ(cgroup->path, expectPath)) {
|
if (STRNEQ(cgroup->path, expectPath)) {
|
||||||
fprintf(stderr, "Wrong path '%s', expected '%s'\n",
|
fprintf(stderr, "Wrong path '%s', expected '%s'\n",
|
||||||
|
@ -130,7 +130,7 @@ testHashUpdate(const void *data ATTRIBUTE_UNUSED)
|
|||||||
{
|
{
|
||||||
int count = ARRAY_CARDINALITY(uuids) + ARRAY_CARDINALITY(uuids_new);
|
int count = ARRAY_CARDINALITY(uuids) + ARRAY_CARDINALITY(uuids_new);
|
||||||
virHashTablePtr hash;
|
virHashTablePtr hash;
|
||||||
int i;
|
size_t i;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!(hash = testHashInit(0)))
|
if (!(hash = testHashInit(0)))
|
||||||
@ -172,7 +172,7 @@ testHashRemove(const void *data ATTRIBUTE_UNUSED)
|
|||||||
{
|
{
|
||||||
int count = ARRAY_CARDINALITY(uuids) - ARRAY_CARDINALITY(uuids_subset);
|
int count = ARRAY_CARDINALITY(uuids) - ARRAY_CARDINALITY(uuids_subset);
|
||||||
virHashTablePtr hash;
|
virHashTablePtr hash;
|
||||||
int i;
|
size_t i;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!(hash = testHashInit(0)))
|
if (!(hash = testHashInit(0)))
|
||||||
@ -208,7 +208,7 @@ testHashRemoveForEachSome(void *payload ATTRIBUTE_UNUSED,
|
|||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
virHashTablePtr hash = data;
|
virHashTablePtr hash = data;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_CARDINALITY(uuids_subset); i++) {
|
for (i = 0; i < ARRAY_CARDINALITY(uuids_subset); i++) {
|
||||||
if (STREQ(uuids_subset[i], name)) {
|
if (STREQ(uuids_subset[i], name)) {
|
||||||
@ -243,7 +243,7 @@ testHashRemoveForEachForbidden(void *payload ATTRIBUTE_UNUSED,
|
|||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
virHashTablePtr hash = data;
|
virHashTablePtr hash = data;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_CARDINALITY(uuids_subset); i++) {
|
for (i = 0; i < ARRAY_CARDINALITY(uuids_subset); i++) {
|
||||||
if (STREQ(uuids_subset[i], name)) {
|
if (STREQ(uuids_subset[i], name)) {
|
||||||
@ -299,7 +299,7 @@ testHashSteal(const void *data ATTRIBUTE_UNUSED)
|
|||||||
{
|
{
|
||||||
int count = ARRAY_CARDINALITY(uuids) - ARRAY_CARDINALITY(uuids_subset);
|
int count = ARRAY_CARDINALITY(uuids) - ARRAY_CARDINALITY(uuids_subset);
|
||||||
virHashTablePtr hash;
|
virHashTablePtr hash;
|
||||||
int i;
|
size_t i;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!(hash = testHashInit(0)))
|
if (!(hash = testHashInit(0)))
|
||||||
@ -404,7 +404,7 @@ testHashRemoveSetIter(const void *payload ATTRIBUTE_UNUSED,
|
|||||||
{
|
{
|
||||||
int *count = (int *) data;
|
int *count = (int *) data;
|
||||||
bool rem = false;
|
bool rem = false;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_CARDINALITY(uuids_subset); i++) {
|
for (i = 0; i < ARRAY_CARDINALITY(uuids_subset); i++) {
|
||||||
if (STREQ(uuids_subset[i], name)) {
|
if (STREQ(uuids_subset[i], name)) {
|
||||||
|
@ -52,7 +52,7 @@ checkProtocols(bool *hasIPv4, bool *hasIPv6,
|
|||||||
struct sockaddr_in in4;
|
struct sockaddr_in in4;
|
||||||
struct sockaddr_in6 in6;
|
struct sockaddr_in6 in6;
|
||||||
int s4 = -1, s6 = -1;
|
int s4 = -1, s6 = -1;
|
||||||
int i;
|
size_t i;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
@ -218,7 +218,7 @@ testStorageChain(const void *args)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
virStorageFileMetadataPtr meta;
|
virStorageFileMetadataPtr meta;
|
||||||
virStorageFileMetadataPtr elt;
|
virStorageFileMetadataPtr elt;
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
meta = virStorageFileGetMetadata(data->start, data->format, -1, -1,
|
meta = virStorageFileGetMetadata(data->start, data->format, -1, -1,
|
||||||
(data->flags & ALLOW_PROBE) != 0);
|
(data->flags & ALLOW_PROBE) != 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user