}
int main(int argc, char **argv) {
- int i, n;
+ size_t i, n;
char **origenv;
char **newenv;
char *cwd;
closed = fcntl(i, F_GETFD, &f) == -1 &&
errno == EBADF;
if (!closed)
- fprintf(log, "FD:%d\n", i);
+ fprintf(log, "FD:%zu\n", i);
}
fprintf(log, "DAEMON:%s\n", getpgrp() == getsid(0) ? "yes" : "no");
xmlNodePtr *nodes = NULL;
virCPUDefPtr *cpus = NULL;
int n;
- int i;
+ size_t i;
if (virAsprintf(&xml, "%s/cputestdata/%s-%s.xml", abs_srcdir, arch, name) < 0)
goto cleanup;
virCPUDefPtr baseline = NULL;
unsigned int ncpus = 0;
char *result = NULL;
- unsigned int i;
+ size_t i;
if (!(cpus = cpuTestLoadMultiXML(data->arch, data->name, &ncpus)))
goto cleanup;
cmp != VIR_CPU_COMPARE_IDENTICAL) {
if (virTestGetVerbose()) {
fprintf(stderr,
- "\nbaseline CPU is incompatible with CPU %u\n", i);
+ "\nbaseline CPU is incompatible with CPU %zu\n", i);
fprintf(stderr, "%74s", "... ");
}
ret = -1;
static int
testParseDatastorePath(const void *data ATTRIBUTE_UNUSED)
{
- int i, result = 0;
+ int result = 0;
+ size_t i;
char *datastoreName = NULL;
char *directoryName = NULL;
char *directoryAndFileName = NULL;
static int
testConvertDateTimeToCalendarTime(const void *data ATTRIBUTE_UNUSED)
{
- int i;
+ size_t i;
esxVI_DateTime dateTime;
long long calendarTime;
static int
testEscapeDatastoreItem(const void *data ATTRIBUTE_UNUSED)
{
- int i;
+ size_t i;
char *escaped = NULL;
for (i = 0; i < ARRAY_CARDINALITY(datastoreItems); ++i) {
static int
testConvertWindows1252ToUTF8(const void *data ATTRIBUTE_UNUSED)
{
- int i;
+ size_t i;
char *utf8 = NULL;
for (i = 0; i < ARRAY_CARDINALITY(windows1252ToUTF8); ++i) {
{
int handleFired = 0;
int timerFired = 0;
- int i;
+ size_t i;
for (i = 0; i < NUM_FDS; i++) {
if (handles[i].fired) {
if (i != handle) {
virtTestResult(name, 1,
- "Handle %d fired, but expected %d\n", i,
+ "Handle %zu fired, but expected %d\n", i,
handle);
return EXIT_FAILURE;
} else {
if (handles[i].error != EV_ERROR_NONE) {
virtTestResult(name, 1,
- "Handle %d fired, but had error %d\n", i,
+ "Handle %zu fired, but had error %d\n", i,
handles[i].error);
return EXIT_FAILURE;
}
if (timers[i].fired) {
if (i != timer) {
virtTestResult(name, 1,
- "Timer %d fired, but expected %d\n", i, timer);
+ "Timer %zu fired, but expected %d\n", i, timer);
return EXIT_FAILURE;
} else {
if (timers[i].error != EV_ERROR_NONE) {
virtTestResult(name, 1,
- "Timer %d fired, but had error %d\n", i,
+ "Timer %zu fired, but had error %d\n", i,
timers[i].error);
return EXIT_FAILURE;
}
static void
resetAll(void)
{
- int i;
+ size_t i;
for (i = 0; i < NUM_FDS; i++) {
handles[i].fired = 0;
handles[i].error = EV_ERROR_NONE;
static int
mymain(void)
{
- int i;
+ size_t i;
pthread_t eventThread;
char one = '1';
mymain(void)
{
int ret = 0;
- int i;
+ size_t i;
const char *nodeData[] = {
"test1",
# if !(defined(__powerpc__) || \
testReadConfigParam(const void *data ATTRIBUTE_UNUSED)
{
int result = -1;
- int i;
+ size_t i;
char *conf = NULL;
char *value = NULL;
static void printMismatchedFlags(virQEMUCapsPtr got,
virQEMUCapsPtr expect)
{
- int i;
+ size_t i;
for (i = 0; i < QEMU_CAPS_LAST; i++) {
bool gotFlag = virQEMUCapsGet(got, i);
bool expectFlag = virQEMUCapsGet(expect, i);
if (gotFlag && !expectFlag)
- fprintf(stderr, "Extra flag %i\n", i);
+ fprintf(stderr, "Extra flag %zu\n", i);
if (!gotFlag && expectFlag)
- fprintf(stderr, "Missing flag %i\n", i);
+ fprintf(stderr, "Missing flag %zu\n", i);
}
}
qemuMonitorMachineInfoPtr *info;
int ninfo = 0;
const char *null = NULL;
- int i;
+ size_t i;
if (!test)
return -1;
int ret = -1;
char **cpus = NULL;
int ncpus = 0;
- int i;
+ size_t i;
if (!test)
return -1;
int ret = -1;
char **commands = NULL;
int ncommands = 0;
- int i;
+ size_t i;
if (!test)
return -1;
static int testEscapeArg(const void *data ATTRIBUTE_UNUSED)
{
- int i;
+ size_t i;
char *escaped = NULL;
for (i = 0; i < ARRAY_CARDINALITY(escapeStrings); ++i) {
escaped = qemuMonitorEscapeArg(escapeStrings[i].unescaped);
static int testUnescapeArg(const void *data ATTRIBUTE_UNUSED)
{
- int i;
+ size_t i;
char *unescaped = NULL;
for (i = 0; i < ARRAY_CARDINALITY(escapeStrings); ++i) {
unescaped = qemuMonitorUnescapeArg(escapeStrings[i].escaped);
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 dieEarly = false; /* Exit -1, with partial data on stdout, msg on stderr */
virtTestCountAverage(double *items, int nitems)
{
long double sum = 0;
- int i;
+ size_t i;
for (i=1; i < nitems; i++)
sum += items[i];
int
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;
if (testCounter == 0 && !virTestGetVerbose())
static
void virtTestCaptureProgramExecChild(const char *const argv[],
int pipefd) {
- int i;
+ size_t i;
int open_max;
int stdinfd = -1;
const char *const env[] = {
for (i = 0; i < open_max; i++) {
if (i != stdinfd &&
i != pipefd) {
- int tmpfd = i;
+ int tmpfd;
+ tmpfd = i;
VIR_FORCE_CLOSE(tmpfd);
}
}
{
void *trace[30];
int ntrace = ARRAY_CARDINALITY(trace);
- int i;
+ size_t i;
char **symbols = NULL;
ntrace = backtrace(trace, ntrace);
fprintf(stderr, "%d) OOM of %d allocs ", testCounter, approxAlloc);
if (mp) {
- int i;
+ size_t i;
for (i = 0; i < mp; i++) {
workers[i] = fork();
if (workers[i] == 0) {
if (worker) {
_exit(ret);
} else {
- int i;
+ size_t i;
for (i = 0; i < mp; i++) {
if (virProcessWait(workers[i], NULL) < 0)
ret = EXIT_FAILURE;
static int
testIndexToDiskName(const void *data ATTRIBUTE_UNUSED)
{
- int i;
+ size_t i;
char *diskName = NULL;
for (i = 0; i < ARRAY_CARDINALITY(diskNames); ++i) {
static int
testDiskNameToIndex(const void *data ATTRIBUTE_UNUSED)
{
- int i, k;
+ size_t i;
+ int idx;
char *diskName = NULL;
for (i = 0; i < 100000; ++i) {
VIR_FREE(diskName);
diskName = virIndexToDiskName(i, "sd");
- k = virDiskNameToIndex(diskName);
+ idx = virDiskNameToIndex(diskName);
- if (k != i) {
+ if (idx < 0 || idx != i) {
if (virTestGetDebug() > 0) {
- fprintf(stderr, "\nExpect [%d]\n", i);
- fprintf(stderr, "Actual [%d]\n", k);
+ fprintf(stderr, "\nExpect [%zu]\n", i);
+ fprintf(stderr, "Actual [%d]\n", idx);
}
VIR_FREE(diskName);
static int
testParseVersionString(const void *data ATTRIBUTE_UNUSED)
{
- int i, result;
+ int result;
+ size_t i;
unsigned long version;
for (i = 0; i < ARRAY_CARDINALITY(versions); ++i) {
thread_func(void *data)
{
int idx = (intptr_t)data;
- int i;
+ size_t i;
int d;
for (i = 0; i < ROUNDS; i++) {
testThreads(const void *data ATTRIBUTE_UNUSED)
{
int sum;
- int i;
+ size_t i;
virThread threads[THREADS];
atomic = 0;
unsigned int end,
bool expected)
{
- int i;
+ size_t i;
bool result;
for (i = start; i <= end; i++) {
virBitmapPtr bitmap = NULL;
int ret = -1;
int size = 5;
- int i;
+ size_t i;
if ((bitmap = virBitmapNew(size)) == NULL)
goto error;
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39
};
virBitmapPtr bitmap = NULL;
- int i, j;
+ ssize_t i, j;
if (ARRAY_CARDINALITY(bitsPos) + ARRAY_CARDINALITY(bitsPosInv) != size)
goto error;
int len2;
int bits[] = {0, 9, 34};
virBitmapPtr bitmap;
- int i, j;
+ size_t i;
+ ssize_t j;
int ret = -1;
bitmap = virBitmapNewData(data, sizeof(data));
const char **expectLinkPoint,
const char **expectPlacement)
{
- int i;
+ size_t i;
if (STRNEQ(cgroup->path, expectPath)) {
fprintf(stderr, "Wrong path '%s', expected '%s'\n",
{
int count = ARRAY_CARDINALITY(uuids) + ARRAY_CARDINALITY(uuids_new);
virHashTablePtr hash;
- int i;
+ size_t i;
int ret = -1;
if (!(hash = testHashInit(0)))
{
int count = ARRAY_CARDINALITY(uuids) - ARRAY_CARDINALITY(uuids_subset);
virHashTablePtr hash;
- int i;
+ size_t i;
int ret = -1;
if (!(hash = testHashInit(0)))
void *data)
{
virHashTablePtr hash = data;
- int i;
+ size_t i;
for (i = 0; i < ARRAY_CARDINALITY(uuids_subset); i++) {
if (STREQ(uuids_subset[i], name)) {
void *data)
{
virHashTablePtr hash = data;
- int i;
+ size_t i;
for (i = 0; i < ARRAY_CARDINALITY(uuids_subset); i++) {
if (STREQ(uuids_subset[i], name)) {
{
int count = ARRAY_CARDINALITY(uuids) - ARRAY_CARDINALITY(uuids_subset);
virHashTablePtr hash;
- int i;
+ size_t i;
int ret = -1;
if (!(hash = testHashInit(0)))
{
int *count = (int *) data;
bool rem = false;
- int i;
+ size_t i;
for (i = 0; i < ARRAY_CARDINALITY(uuids_subset); i++) {
if (STREQ(uuids_subset[i], name)) {
struct sockaddr_in in4;
struct sockaddr_in6 in6;
int s4 = -1, s6 = -1;
- int i;
+ size_t i;
int ret = -1;
memset(&hints, 0, sizeof(hints));
int ret = -1;
virStorageFileMetadataPtr meta;
virStorageFileMetadataPtr elt;
- int i = 0;
+ size_t i = 0;
meta = virStorageFileGetMetadata(data->start, data->format, -1, -1,
(data->flags & ALLOW_PROBE) != 0);