diff --git a/src/util/virarch.c b/src/util/virarch.c index 8585a78177..81558e528d 100644 --- a/src/util/virarch.c +++ b/src/util/virarch.c @@ -128,7 +128,7 @@ const char *virArchToString(virArch arch) virArch virArchFromString(const char *archstr) { size_t i; - for (i = 1 ; i < VIR_ARCH_LAST ; i++) { + for (i = 1; i < VIR_ARCH_LAST; i++) { if (STREQ(virArchData[i].name, archstr)) return i; } diff --git a/src/util/virauth.c b/src/util/virauth.c index fdcefe1a06..fd53097d90 100644 --- a/src/util/virauth.c +++ b/src/util/virauth.c @@ -57,7 +57,7 @@ int virAuthGetConfigFilePath(virConnectPtr conn, } if (conn && conn->uri) { - for (i = 0 ; i < conn->uri->paramsCount ; i++) { + for (i = 0; i < conn->uri->paramsCount; i++) { if (STREQ_NULLABLE(conn->uri->params[i].name, "authfile") && conn->uri->params[i].value) { VIR_DEBUG("Using path from URI '%s'", diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 07ea2c30ef..329d84b318 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -79,7 +79,7 @@ void virCgroupFree(virCgroupPtr *group) if (*group == NULL) return; - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { VIR_FREE((*group)->controllers[i].mountPoint); VIR_FREE((*group)->controllers[i].linkPoint); VIR_FREE((*group)->controllers[i].placement); @@ -112,7 +112,7 @@ static int virCgroupCopyMounts(virCgroupPtr group, virCgroupPtr parent) { int i; - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { if (!parent->controllers[i].mountPoint) continue; @@ -154,7 +154,7 @@ static int virCgroupDetectMounts(virCgroupPtr group) if (STRNEQ(entry.mnt_type, "cgroup")) continue; - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { const char *typestr = virCgroupControllerTypeToString(i); int typelen = strlen(typestr); char *tmp = entry.mnt_opts; @@ -234,7 +234,7 @@ static int virCgroupCopyPlacement(virCgroupPtr group, virCgroupPtr parent) { int i; - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { if (!group->controllers[i].mountPoint) continue; @@ -311,7 +311,7 @@ static int virCgroupDetectPlacement(virCgroupPtr group, controllers++; selfpath++; - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { const char *typestr = virCgroupControllerTypeToString(i); int typelen = strlen(typestr); char *tmp = controllers; @@ -376,7 +376,7 @@ static int virCgroupDetect(virCgroupPtr group, if (controllers >= 0) { VIR_DEBUG("Validating controllers %d", controllers); - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { VIR_DEBUG("Controller '%s' wanted=%s, mount='%s'", virCgroupControllerTypeToString(i), (1 << i) & controllers ? "yes" : "no", @@ -391,7 +391,7 @@ static int virCgroupDetect(virCgroupPtr group, } else { /* Check whether a request to disable a controller * clashes with co-mounting of controllers */ - for (j = 0 ; j < VIR_CGROUP_CONTROLLER_LAST ; j++) { + for (j = 0; j < VIR_CGROUP_CONTROLLER_LAST; j++) { if (j == i) continue; if (!((1 << j) & controllers)) @@ -411,7 +411,7 @@ static int virCgroupDetect(virCgroupPtr group, } else { VIR_DEBUG("Auto-detecting controllers"); controllers = 0; - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { VIR_DEBUG("Controller '%s' present=%s", virCgroupControllerTypeToString(i), group->controllers[i].mountPoint ? "yes" : "no"); @@ -434,7 +434,7 @@ static int virCgroupDetect(virCgroupPtr group, if (rc == 0) { /* Check that for every mounted controller, we found our placement */ - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { if (!group->controllers[i].mountPoint) continue; @@ -467,7 +467,7 @@ int virCgroupPathOfController(virCgroupPtr group, { if (controller == -1) { int i; - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { if (group->controllers[i].mountPoint && group->controllers[i].placement) { controller = i; @@ -645,7 +645,7 @@ static int virCgroupCpuSetInherit(virCgroupPtr parent, virCgroupPtr group) }; VIR_DEBUG("Setting up inheritance %s -> %s", parent->path, group->path); - for (i = 0; i < ARRAY_CARDINALITY(inherit_values) ; i++) { + for (i = 0; i < ARRAY_CARDINALITY(inherit_values); i++) { char *value; rc = virCgroupGetValueStr(parent, @@ -713,7 +713,7 @@ static int virCgroupMakeGroup(virCgroupPtr parent, int rc = 0; VIR_DEBUG("Make group %s", group->path); - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { char *path = NULL; /* Skip over controllers that aren't mounted */ @@ -949,7 +949,7 @@ int virCgroupRemove(virCgroupPtr group) char *grppath = NULL; VIR_DEBUG("Removing cgroup %s", group->path); - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { /* Skip over controllers not mounted */ if (!group->controllers[i].mountPoint) continue; @@ -983,7 +983,7 @@ int virCgroupAddTask(virCgroupPtr group, pid_t pid) int rc = 0; int i; - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { /* Skip over controllers not mounted */ if (!group->controllers[i].mountPoint) continue; @@ -1069,7 +1069,7 @@ int virCgroupMoveTask(virCgroupPtr src_group, virCgroupPtr dest_group) char *content = NULL; int i; - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { if (!src_group->controllers[i].mountPoint || !dest_group->controllers[i].mountPoint) continue; @@ -1182,7 +1182,7 @@ static int virCgroupSetPartitionSuffix(const char *path, char **res) if (!tokens) return ret; - for (i = 0 ; tokens[i] != NULL ; i++) { + for (i = 0; tokens[i] != NULL; i++) { /* Whitelist the 3 top level fixed dirs * NB i == 0 is "", since we have leading '/' */ @@ -2499,7 +2499,7 @@ int virCgroupKillPainfully(virCgroupPtr group) int i; int rc; VIR_DEBUG("cgroup=%p path=%s", group, group->path); - for (i = 0 ; i < 15 ; i++) { + for (i = 0; i < 15; i++) { int signum; if (i == 0) signum = SIGTERM; @@ -2544,7 +2544,7 @@ static char *virCgroupIdentifyRoot(virCgroupPtr group) char *ret = NULL; size_t i; - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { char *tmp; if (!group->controllers[i].mountPoint) continue; @@ -2604,7 +2604,7 @@ int virCgroupIsolateMount(virCgroupPtr group, const char *oldroot, goto cleanup; } - for (i = 0 ; i < VIR_CGROUP_CONTROLLER_LAST ; i++) { + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { if (!group->controllers[i].mountPoint) continue; diff --git a/src/util/vircommand.c b/src/util/vircommand.c index f6f27d9e71..665f549b7c 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -890,7 +890,7 @@ virCommandKeepFD(virCommandPtr cmd, int fd, bool transfer) (transfer && (ret = virCommandFDSet(fd, &cmd->transfer, &cmd->transfer_size)))) { if (!cmd->has_error) - cmd->has_error = ret ? ret : -1 ; + cmd->has_error = ret ? ret : -1; VIR_DEBUG("cannot preserve %d", fd); return fd > STDERR_FILENO; } @@ -1739,13 +1739,13 @@ virCommandWriteArgLog(virCommandPtr cmd, int logfd) if (!cmd || cmd->has_error) return; - for (i = 0 ; i < cmd->nenv ; i++) { + for (i = 0; i < cmd->nenv; i++) { if (safewrite(logfd, cmd->env[i], strlen(cmd->env[i])) < 0) ioError = errno; if (safewrite(logfd, " ", 1) < 0) ioError = errno; } - for (i = 0 ; i < cmd->nargs ; i++) { + for (i = 0; i < cmd->nargs; i++) { if (safewrite(logfd, cmd->args[i], strlen(cmd->args[i])) < 0) ioError = errno; if (safewrite(logfd, i == cmd->nargs - 1 ? "\n" : " ", 1) < 0) @@ -1894,7 +1894,7 @@ virCommandProcessIO(virCommandPtr cmd) goto cleanup; } - for (i = 0; i < nfds ; i++) { + for (i = 0; i < nfds; i++) { if (fds[i].revents & (POLLIN | POLLHUP | POLLERR) && (fds[i].fd == errfd || fds[i].fd == outfd)) { char data[1024]; @@ -2564,11 +2564,11 @@ virCommandFree(virCommandPtr cmd) VIR_FORCE_CLOSE(cmd->outfd); VIR_FORCE_CLOSE(cmd->errfd); - for (i = 0 ; i < cmd->nargs ; i++) + for (i = 0; i < cmd->nargs; i++) VIR_FREE(cmd->args[i]); VIR_FREE(cmd->args); - for (i = 0 ; i < cmd->nenv ; i++) + for (i = 0; i < cmd->nenv; i++) VIR_FREE(cmd->env[i]); VIR_FREE(cmd->env); diff --git a/src/util/vireventpoll.c b/src/util/vireventpoll.c index 1f0e5b61ca..cc29dcbb88 100644 --- a/src/util/vireventpoll.c +++ b/src/util/vireventpoll.c @@ -152,7 +152,7 @@ void virEventPollUpdateHandle(int watch, int events) { } virMutexLock(&eventLoop.lock); - for (i = 0 ; i < eventLoop.handlesCount ; i++) { + for (i = 0; i < eventLoop.handlesCount; i++) { if (eventLoop.handles[i].watch == watch) { eventLoop.handles[i].events = virEventPollToNativeEvents(events); @@ -185,7 +185,7 @@ int virEventPollRemoveHandle(int watch) { } virMutexLock(&eventLoop.lock); - for (i = 0 ; i < eventLoop.handlesCount ; i++) { + for (i = 0; i < eventLoop.handlesCount; i++) { if (eventLoop.handles[i].deleted) continue; @@ -269,7 +269,7 @@ void virEventPollUpdateTimeout(int timer, int frequency) } virMutexLock(&eventLoop.lock); - for (i = 0 ; i < eventLoop.timeoutsCount ; i++) { + for (i = 0; i < eventLoop.timeoutsCount; i++) { if (eventLoop.timeouts[i].timer == timer) { eventLoop.timeouts[i].frequency = frequency; eventLoop.timeouts[i].expiresAt = @@ -305,7 +305,7 @@ int virEventPollRemoveTimeout(int timer) { } virMutexLock(&eventLoop.lock); - for (i = 0 ; i < eventLoop.timeoutsCount ; i++) { + for (i = 0; i < eventLoop.timeoutsCount; i++) { if (eventLoop.timeouts[i].deleted) continue; @@ -331,7 +331,7 @@ static int virEventPollCalculateTimeout(int *timeout) { int i; EVENT_DEBUG("Calculate expiry of %zu timers", eventLoop.timeoutsCount); /* Figure out if we need a timeout */ - for (i = 0 ; i < eventLoop.timeoutsCount ; i++) { + for (i = 0; i < eventLoop.timeoutsCount; i++) { if (eventLoop.timeouts[i].deleted) continue; if (eventLoop.timeouts[i].frequency < 0) @@ -373,7 +373,7 @@ static struct pollfd *virEventPollMakePollFDs(int *nfds) { int i; *nfds = 0; - for (i = 0 ; i < eventLoop.handlesCount ; i++) { + for (i = 0; i < eventLoop.handlesCount; i++) { if (eventLoop.handles[i].events && !eventLoop.handles[i].deleted) (*nfds)++; } @@ -385,7 +385,7 @@ static struct pollfd *virEventPollMakePollFDs(int *nfds) { } *nfds = 0; - for (i = 0 ; i < eventLoop.handlesCount ; i++) { + for (i = 0; i < eventLoop.handlesCount; i++) { EVENT_DEBUG("Prepare n=%d w=%d, f=%d e=%d d=%d", i, eventLoop.handles[i].watch, eventLoop.handles[i].fd, @@ -427,7 +427,7 @@ static int virEventPollDispatchTimeouts(void) if (virTimeMillisNow(&now) < 0) return -1; - for (i = 0 ; i < ntimeouts ; i++) { + for (i = 0; i < ntimeouts; i++) { if (eventLoop.timeouts[i].deleted || eventLoop.timeouts[i].frequency < 0) continue; @@ -472,7 +472,7 @@ static int virEventPollDispatchHandles(int nfds, struct pollfd *fds) { /* NB, use nfds not eventLoop.handlesCount, because new * fds might be added on end of list, and they're not * in the fds array we've got */ - for (i = 0, n = 0 ; n < nfds && i < eventLoop.handlesCount ; n++) { + for (i = 0, n = 0; n < nfds && i < eventLoop.handlesCount; n++) { while ((eventLoop.handles[i].fd != fds[n].fd || eventLoop.handles[i].events == 0) && i < eventLoop.handlesCount) { @@ -518,7 +518,7 @@ static void virEventPollCleanupTimeouts(void) { /* Remove deleted entries, shuffling down remaining * entries as needed to form contiguous series */ - for (i = 0 ; i < eventLoop.timeoutsCount ;) { + for (i = 0; i < eventLoop.timeoutsCount;) { if (!eventLoop.timeouts[i].deleted) { i++; continue; @@ -566,7 +566,7 @@ static void virEventPollCleanupHandles(void) { /* Remove deleted entries, shuffling down remaining * entries as needed to form contiguous series */ - for (i = 0 ; i < eventLoop.handlesCount ;) { + for (i = 0; i < eventLoop.handlesCount;) { if (!eventLoop.handles[i].deleted) { i++; continue; diff --git a/src/util/virhash.c b/src/util/virhash.c index 2fe8751dcd..db9ce6be8c 100644 --- a/src/util/virhash.c +++ b/src/util/virhash.c @@ -505,7 +505,7 @@ virHashForEach(virHashTablePtr table, virHashIterator iter, void *data) table->iterating = true; table->current = NULL; - for (i = 0 ; i < table->size ; i++) { + for (i = 0; i < table->size; i++) { virHashEntryPtr entry = table->table[i]; while (entry) { virHashEntryPtr next = entry->next; @@ -551,7 +551,7 @@ virHashRemoveSet(virHashTablePtr table, table->iterating = true; table->current = NULL; - for (i = 0 ; i < table->size ; i++) { + for (i = 0; i < table->size; i++) { virHashEntryPtr *nextptr = table->table + i; while (*nextptr) { @@ -625,7 +625,7 @@ void *virHashSearch(virHashTablePtr table, table->iterating = true; table->current = NULL; - for (i = 0 ; i < table->size ; i++) { + for (i = 0; i < table->size; i++) { virHashEntryPtr entry; for (entry = table->table[i]; entry; entry = entry->next) { if (iter(entry->payload, entry->name, data)) { diff --git a/src/util/viridentity.c b/src/util/viridentity.c index 840485af94..0af7c8c136 100644 --- a/src/util/viridentity.c +++ b/src/util/viridentity.c @@ -217,7 +217,7 @@ static void virIdentityDispose(void *object) virIdentityPtr ident = object; size_t i; - for (i = 0 ; i < VIR_IDENTITY_ATTR_LAST ; i++) + for (i = 0; i < VIR_IDENTITY_ATTR_LAST; i++) VIR_FREE(ident->attrs[i]); } @@ -300,7 +300,7 @@ bool virIdentityIsEqual(virIdentityPtr identA, size_t i; VIR_DEBUG("identA=%p identB=%p", identA, identB); - for (i = 0 ; i < VIR_IDENTITY_ATTR_LAST ; i++) { + for (i = 0; i < VIR_IDENTITY_ATTR_LAST; i++) { if (STRNEQ_NULLABLE(identA->attrs[i], identB->attrs[i])) goto cleanup; diff --git a/src/util/virjson.c b/src/util/virjson.c index 9410b664db..ce4d933d7e 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -70,14 +70,14 @@ void virJSONValueFree(virJSONValuePtr value) switch ((virJSONType) value->type) { case VIR_JSON_TYPE_OBJECT: - for (i = 0 ; i < value->data.object.npairs; i++) { + for (i = 0; i < value->data.object.npairs; i++) { VIR_FREE(value->data.object.pairs[i].key); virJSONValueFree(value->data.object.pairs[i].value); } VIR_FREE(value->data.object.pairs); break; case VIR_JSON_TYPE_ARRAY: - for (i = 0 ; i < value->data.array.nvalues ; i++) + for (i = 0; i < value->data.array.nvalues; i++) virJSONValueFree(value->data.array.values[i]); VIR_FREE(value->data.array.values); break; @@ -406,7 +406,7 @@ int virJSONValueObjectHasKey(virJSONValuePtr object, const char *key) if (object->type != VIR_JSON_TYPE_OBJECT) return -1; - for (i = 0 ; i < object->data.object.npairs ; i++) { + for (i = 0; i < object->data.object.npairs; i++) { if (STREQ(object->data.object.pairs[i].key, key)) return 1; } @@ -421,7 +421,7 @@ virJSONValuePtr virJSONValueObjectGet(virJSONValuePtr object, const char *key) if (object->type != VIR_JSON_TYPE_OBJECT) return NULL; - for (i = 0 ; i < object->data.object.npairs ; i++) { + for (i = 0; i < object->data.object.npairs; i++) { if (STREQ(object->data.object.pairs[i].key, key)) return object->data.object.pairs[i].value; } @@ -463,7 +463,7 @@ virJSONValueObjectRemoveKey(virJSONValuePtr object, const char *key, if (object->type != VIR_JSON_TYPE_OBJECT) return -1; - for (i = 0 ; i < object->data.object.npairs ; i++) { + for (i = 0; i < object->data.object.npairs; i++) { if (STREQ(object->data.object.pairs[i].key, key)) { if (value) { *value = object->data.object.pairs[i].value; @@ -1013,7 +1013,7 @@ cleanup: if (parser.nstate) { int i; - for (i = 0 ; i < parser.nstate ; i++) { + for (i = 0; i < parser.nstate; i++) { VIR_FREE(parser.state[i].key); } } @@ -1035,7 +1035,7 @@ static int virJSONValueToStringOne(virJSONValuePtr object, case VIR_JSON_TYPE_OBJECT: if (yajl_gen_map_open(g) != yajl_gen_status_ok) return -1; - for (i = 0; i < object->data.object.npairs ; i++) { + for (i = 0; i < object->data.object.npairs; i++) { if (yajl_gen_string(g, (unsigned char *)object->data.object.pairs[i].key, strlen(object->data.object.pairs[i].key)) @@ -1050,7 +1050,7 @@ static int virJSONValueToStringOne(virJSONValuePtr object, case VIR_JSON_TYPE_ARRAY: if (yajl_gen_array_open(g) != yajl_gen_status_ok) return -1; - for (i = 0; i < object->data.array.nvalues ; i++) { + for (i = 0; i < object->data.array.nvalues; i++) { if (virJSONValueToStringOne(object->data.array.values[i], g) < 0) return -1; } diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c index 620a460ee2..01790edbe8 100644 --- a/src/util/virlockspace.c +++ b/src/util/virlockspace.c @@ -342,7 +342,7 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object) goto error; } - for (i = 0 ; i < n ; i++) { + for (i = 0; i < n; i++) { virJSONValuePtr child = virJSONValueArrayGet(resources, i); virLockSpaceResourcePtr res; const char *tmp; @@ -426,7 +426,7 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object) goto error; } - for (j = 0 ; j < res->nOwners ; j++) { + for (j = 0; j < res->nOwners; j++) { unsigned long long int owner; virJSONValuePtr ownerval = virJSONValueArrayGet(owners, j); @@ -517,7 +517,7 @@ virJSONValuePtr virLockSpacePreExecRestart(virLockSpacePtr lockspace) goto error; } - for (i = 0 ; i < res->nOwners ; i++) { + for (i = 0; i < res->nOwners; i++) { virJSONValuePtr owner = virJSONValueNewNumberUlong(res->owners[i]); if (!owner) goto error; @@ -701,7 +701,7 @@ int virLockSpaceReleaseResource(virLockSpacePtr lockspace, goto cleanup; } - for (i = 0 ; i < res->nOwners ; i++) { + for (i = 0; i < res->nOwners; i++) { if (res->owners[i] == owner) { break; } @@ -749,7 +749,7 @@ virLockSpaceRemoveResourcesForOwner(const void *payload, VIR_DEBUG("res %s owner %lld", res->name, (unsigned long long)data->owner); - for (i = 0 ; i < res->nOwners ; i++) { + for (i = 0; i < res->nOwners; i++) { if (res->owners[i] == data->owner) { break; } diff --git a/src/util/virportallocator.c b/src/util/virportallocator.c index 590bb570f6..c7be10fe0c 100644 --- a/src/util/virportallocator.c +++ b/src/util/virportallocator.c @@ -104,7 +104,7 @@ int virPortAllocatorAcquire(virPortAllocatorPtr pa, *port = 0; virObjectLock(pa); - for (i = pa->start ; i <= pa->end && !*port; i++) { + for (i = pa->start; i <= pa->end && !*port; i++) { int reuse = 1; struct sockaddr_in addr; bool used = false; diff --git a/src/util/virprocess.c b/src/util/virprocess.c index a569406aea..bc028d7081 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -276,7 +276,7 @@ virProcessKillPainfully(pid_t pid, bool force) * * Note that setting @force could result in dataloss for the process. */ - for (i = 0 ; i < 75; i++) { + for (i = 0; i < 75; i++) { int signum; if (i == 0) { signum = SIGTERM; /* kindly suggest it should exit */ @@ -348,7 +348,7 @@ realloc: } CPU_ZERO_S(masklen, mask); - for (i = 0 ; i < virBitmapSize(map); i++) { + for (i = 0; i < virBitmapSize(map); i++) { if (virBitmapGetBit(map, i, &set) < 0) return -1; if (set) @@ -372,7 +372,7 @@ realloc: cpu_set_t mask; CPU_ZERO(&mask); - for (i = 0 ; i < virBitmapSize(map); i++) { + for (i = 0; i < virBitmapSize(map); i++) { if (virBitmapGetBit(map, i, &set) < 0) return -1; if (set) @@ -435,7 +435,7 @@ realloc: return -1; } - for (i = 0 ; i < maxcpu ; i++) + for (i = 0; i < maxcpu; i++) if (CPU_ISSET_S(i, masklen, mask)) ignore_value(virBitmapSetBit(*map, i)); CPU_FREE(mask); @@ -450,7 +450,7 @@ realloc: return -1; } - for (i = 0 ; i < maxcpu ; i++) + for (i = 0; i < maxcpu; i++) if (CPU_ISSET(i, &mask)) ignore_value(virBitmapSetBit(*map, i)); # endif @@ -570,7 +570,7 @@ cleanup: VIR_FREE(nsdir); VIR_FREE(nsfile); if (ret < 0) { - for (i = 0 ; i < *nfdlist ; i++) { + for (i = 0; i < *nfdlist; i++) { VIR_FORCE_CLOSE((*fdlist)[i]); } VIR_FREE(*fdlist); @@ -589,7 +589,7 @@ int virProcessSetNamespaces(size_t nfdlist, _("Expected at least one file descriptor")); return -1; } - for (i = 0 ; i < nfdlist ; i++) { + for (i = 0; i < nfdlist; i++) { if (setns(fdlist[i], 0) < 0) { virReportSystemError(errno, "%s", _("Unable to join domain namespace")); diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 0c433978a7..9bc88856f7 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -641,7 +641,7 @@ virStorageFileProbeFormatFromBuf(const char *path, VIR_DEBUG("path=%s", path); /* First check file magic */ - for (i = 0 ; i < VIR_STORAGE_FILE_LAST ; i++) { + for (i = 0; i < VIR_STORAGE_FILE_LAST; i++) { if (virStorageFileMatchesMagic(i, buf, buflen)) { if (!virStorageFileMatchesVersion(i, buf, buflen)) { possibleFormat = i; @@ -658,7 +658,7 @@ virStorageFileProbeFormatFromBuf(const char *path, path, virStorageFileFormatTypeToString(possibleFormat)); /* No magic, so check file extension */ - for (i = 0 ; i < VIR_STORAGE_FILE_LAST ; i++) { + for (i = 0; i < VIR_STORAGE_FILE_LAST; i++) { if (virStorageFileMatchesExtension(i, path)) { format = i; goto cleanup; diff --git a/src/util/virstring.c b/src/util/virstring.c index 1640d8c02a..82f1c2ed8b 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -109,7 +109,7 @@ char **virStringSplit(const char *string, no_memory: virReportOOMError(); - for (i = 0 ; i < ntokens ; i++) + for (i = 0; i < ntokens; i++) VIR_FREE(tokens[i]); VIR_FREE(tokens); return NULL; diff --git a/src/util/virthreadwin32.c b/src/util/virthreadwin32.c index bbe090f4c0..4feaae9bb9 100644 --- a/src/util/virthreadwin32.c +++ b/src/util/virthreadwin32.c @@ -56,7 +56,7 @@ void virThreadOnExit(void) { unsigned int i; virMutexLock(&virThreadLocalLock); - for (i = 0 ; i < virThreadLocalCount ; i++) { + for (i = 0; i < virThreadLocalCount; i++) { if (virThreadLocalList[i].cleanup) { void *data = TlsGetValue(virThreadLocalList[i].key); if (data) { @@ -220,7 +220,7 @@ void virCondBroadcast(virCondPtr c) if (c->nwaiters) { unsigned int i; - for (i = 0 ; i < c->nwaiters ; i++) { + for (i = 0; i < c->nwaiters; i++) { HANDLE event = c->waiters[i]; SetEvent(event); } diff --git a/src/util/viruri.c b/src/util/viruri.c index 2a75425d74..56d3ab1912 100644 --- a/src/util/viruri.c +++ b/src/util/viruri.c @@ -328,7 +328,7 @@ void virURIFree(virURIPtr uri) VIR_FREE(uri->query); VIR_FREE(uri->fragment); - for (i = 0 ; i < uri->paramsCount ; i++) { + for (i = 0; i < uri->paramsCount; i++) { VIR_FREE(uri->params[i].name); VIR_FREE(uri->params[i].value); } diff --git a/src/util/virutil.c b/src/util/virutil.c index 7f4ecd634d..239fba882d 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -386,7 +386,7 @@ int virEnumFromString(const char *const*types, if (!type) return -1; - for (i = 0 ; i < ntypes ; i++) + for (i = 0; i < ntypes; i++) if (STREQ(types[i], type)) return i;