mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 21:15:20 +00:00
Convert 'int i' to 'size_t i' in src/ 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
c220aa917f
commit
563818bc99
@ -522,7 +522,7 @@ int virFDStreamConnectUNIX(virStreamPtr st,
|
|||||||
bool abstract)
|
bool abstract)
|
||||||
{
|
{
|
||||||
struct sockaddr_un sa;
|
struct sockaddr_un sa;
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
int timeout = 3;
|
int timeout = 3;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ virDomainLxcEnterNamespace(virDomainPtr domain,
|
|||||||
int **oldfdlist,
|
int **oldfdlist,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
virCheckFlagsGoto(0, error);
|
virCheckFlagsGoto(0, error);
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ cleanup:
|
|||||||
static int virConnectAuthCallbackDefault(virConnectCredentialPtr cred,
|
static int virConnectAuthCallbackDefault(virConnectCredentialPtr cred,
|
||||||
unsigned int ncred,
|
unsigned int ncred,
|
||||||
void *cbdata ATTRIBUTE_UNUSED) {
|
void *cbdata ATTRIBUTE_UNUSED) {
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < ncred; i++) {
|
for (i = 0; i < ncred; i++) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
@ -816,7 +816,7 @@ int virStateInitialize(bool privileged,
|
|||||||
virStateInhibitCallback callback,
|
virStateInhibitCallback callback,
|
||||||
void *opaque)
|
void *opaque)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (virInitialize() < 0)
|
if (virInitialize() < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -847,7 +847,8 @@ int virStateInitialize(bool privileged,
|
|||||||
* Returns 0 if all succeed, -1 upon any failure.
|
* Returns 0 if all succeed, -1 upon any failure.
|
||||||
*/
|
*/
|
||||||
int virStateCleanup(void) {
|
int virStateCleanup(void) {
|
||||||
int i, ret = 0;
|
size_t i;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
for (i = 0; i < virStateDriverTabCount; i++) {
|
for (i = 0; i < virStateDriverTabCount; i++) {
|
||||||
if (virStateDriverTab[i]->stateCleanup &&
|
if (virStateDriverTab[i]->stateCleanup &&
|
||||||
@ -865,7 +866,8 @@ int virStateCleanup(void) {
|
|||||||
* Returns 0 if all succeed, -1 upon any failure.
|
* Returns 0 if all succeed, -1 upon any failure.
|
||||||
*/
|
*/
|
||||||
int virStateReload(void) {
|
int virStateReload(void) {
|
||||||
int i, ret = 0;
|
size_t i;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
for (i = 0; i < virStateDriverTabCount; i++) {
|
for (i = 0; i < virStateDriverTabCount; i++) {
|
||||||
if (virStateDriverTab[i]->stateReload &&
|
if (virStateDriverTab[i]->stateReload &&
|
||||||
@ -883,7 +885,8 @@ int virStateReload(void) {
|
|||||||
* Returns 0 if successful, -1 on failure
|
* Returns 0 if successful, -1 on failure
|
||||||
*/
|
*/
|
||||||
int virStateStop(void) {
|
int virStateStop(void) {
|
||||||
int i, ret = 0;
|
size_t i;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
for (i = 0; i < virStateDriverTabCount; i++) {
|
for (i = 0; i < virStateDriverTabCount; i++) {
|
||||||
if (virStateDriverTab[i]->stateStop &&
|
if (virStateDriverTab[i]->stateStop &&
|
||||||
@ -1095,7 +1098,8 @@ do_open(const char *name,
|
|||||||
virConnectAuthPtr auth,
|
virConnectAuthPtr auth,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
int i, res;
|
size_t i;
|
||||||
|
int res;
|
||||||
virConnectPtr ret;
|
virConnectPtr ret;
|
||||||
virConfPtr conf = NULL;
|
virConfPtr conf = NULL;
|
||||||
|
|
||||||
@ -1196,10 +1200,10 @@ do_open(const char *name,
|
|||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("trying driver %d (%s) ...", i, virDriverTab[i]->name);
|
VIR_DEBUG("trying driver %zu (%s) ...", i, virDriverTab[i]->name);
|
||||||
ret->driver = virDriverTab[i];
|
ret->driver = virDriverTab[i];
|
||||||
res = virDriverTab[i]->connectOpen(ret, auth, flags);
|
res = virDriverTab[i]->connectOpen(ret, auth, flags);
|
||||||
VIR_DEBUG("driver %d %s returned %s",
|
VIR_DEBUG("driver %zu %s returned %s",
|
||||||
i, virDriverTab[i]->name,
|
i, virDriverTab[i]->name,
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
||||||
@ -1225,7 +1229,7 @@ do_open(const char *name,
|
|||||||
|
|
||||||
for (i = 0; i < virNetworkDriverTabCount; i++) {
|
for (i = 0; i < virNetworkDriverTabCount; i++) {
|
||||||
res = virNetworkDriverTab[i]->networkOpen(ret, auth, flags);
|
res = virNetworkDriverTab[i]->networkOpen(ret, auth, flags);
|
||||||
VIR_DEBUG("network driver %d %s returned %s",
|
VIR_DEBUG("network driver %zu %s returned %s",
|
||||||
i, virNetworkDriverTab[i]->name,
|
i, virNetworkDriverTab[i]->name,
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
||||||
@ -1241,7 +1245,7 @@ do_open(const char *name,
|
|||||||
|
|
||||||
for (i = 0; i < virInterfaceDriverTabCount; i++) {
|
for (i = 0; i < virInterfaceDriverTabCount; i++) {
|
||||||
res = virInterfaceDriverTab[i]->interfaceOpen(ret, auth, flags);
|
res = virInterfaceDriverTab[i]->interfaceOpen(ret, auth, flags);
|
||||||
VIR_DEBUG("interface driver %d %s returned %s",
|
VIR_DEBUG("interface driver %zu %s returned %s",
|
||||||
i, virInterfaceDriverTab[i]->name,
|
i, virInterfaceDriverTab[i]->name,
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
||||||
@ -1258,7 +1262,7 @@ do_open(const char *name,
|
|||||||
/* Secondary driver for storage. Optional */
|
/* Secondary driver for storage. Optional */
|
||||||
for (i = 0; i < virStorageDriverTabCount; i++) {
|
for (i = 0; i < virStorageDriverTabCount; i++) {
|
||||||
res = virStorageDriverTab[i]->storageOpen(ret, auth, flags);
|
res = virStorageDriverTab[i]->storageOpen(ret, auth, flags);
|
||||||
VIR_DEBUG("storage driver %d %s returned %s",
|
VIR_DEBUG("storage driver %zu %s returned %s",
|
||||||
i, virStorageDriverTab[i]->name,
|
i, virStorageDriverTab[i]->name,
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
||||||
@ -1275,7 +1279,7 @@ do_open(const char *name,
|
|||||||
/* Node driver (optional) */
|
/* Node driver (optional) */
|
||||||
for (i = 0; i < virNodeDeviceDriverTabCount; i++) {
|
for (i = 0; i < virNodeDeviceDriverTabCount; i++) {
|
||||||
res = virNodeDeviceDriverTab[i]->nodeDeviceOpen(ret, auth, flags);
|
res = virNodeDeviceDriverTab[i]->nodeDeviceOpen(ret, auth, flags);
|
||||||
VIR_DEBUG("node driver %d %s returned %s",
|
VIR_DEBUG("node driver %zu %s returned %s",
|
||||||
i, virNodeDeviceDriverTab[i]->name,
|
i, virNodeDeviceDriverTab[i]->name,
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
||||||
@ -1292,7 +1296,7 @@ do_open(const char *name,
|
|||||||
/* Secret manipulation driver. Optional */
|
/* Secret manipulation driver. Optional */
|
||||||
for (i = 0; i < virSecretDriverTabCount; i++) {
|
for (i = 0; i < virSecretDriverTabCount; i++) {
|
||||||
res = virSecretDriverTab[i]->secretOpen(ret, auth, flags);
|
res = virSecretDriverTab[i]->secretOpen(ret, auth, flags);
|
||||||
VIR_DEBUG("secret driver %d %s returned %s",
|
VIR_DEBUG("secret driver %zu %s returned %s",
|
||||||
i, virSecretDriverTab[i]->name,
|
i, virSecretDriverTab[i]->name,
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
||||||
@ -1309,7 +1313,7 @@ do_open(const char *name,
|
|||||||
/* Network filter driver. Optional */
|
/* Network filter driver. Optional */
|
||||||
for (i = 0; i < virNWFilterDriverTabCount; i++) {
|
for (i = 0; i < virNWFilterDriverTabCount; i++) {
|
||||||
res = virNWFilterDriverTab[i]->nwfilterOpen(ret, auth, flags);
|
res = virNWFilterDriverTab[i]->nwfilterOpen(ret, auth, flags);
|
||||||
VIR_DEBUG("nwfilter driver %d %s returned %s",
|
VIR_DEBUG("nwfilter driver %zu %s returned %s",
|
||||||
i, virNWFilterDriverTab[i]->name,
|
i, virNWFilterDriverTab[i]->name,
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
||||||
@ -3785,7 +3789,7 @@ virTypedParameterValidateSet(virConnectPtr conn,
|
|||||||
int nparams)
|
int nparams)
|
||||||
{
|
{
|
||||||
bool string_okay;
|
bool string_okay;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
string_okay = VIR_DRV_SUPPORTS_FEATURE(conn->driver,
|
string_okay = VIR_DRV_SUPPORTS_FEATURE(conn->driver,
|
||||||
conn,
|
conn,
|
||||||
@ -9193,7 +9197,7 @@ error:
|
|||||||
*
|
*
|
||||||
* Example of usage:
|
* Example of usage:
|
||||||
* virDomainPtr *domains;
|
* virDomainPtr *domains;
|
||||||
* int i;
|
* size_t i;
|
||||||
* int ret;
|
* int ret;
|
||||||
* unsigned int flags = VIR_CONNECT_LIST_DOMAINS_RUNNING |
|
* unsigned int flags = VIR_CONNECT_LIST_DOMAINS_RUNNING |
|
||||||
* VIR_CONNECT_LIST_DOMAINS_PERSISTENT;
|
* VIR_CONNECT_LIST_DOMAINS_PERSISTENT;
|
||||||
@ -18285,13 +18289,13 @@ virConnectBaselineCPU(virConnectPtr conn,
|
|||||||
unsigned int ncpus,
|
unsigned int ncpus,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
size_t i;
|
||||||
|
|
||||||
VIR_DEBUG("conn=%p, xmlCPUs=%p, ncpus=%u, flags=%x",
|
VIR_DEBUG("conn=%p, xmlCPUs=%p, ncpus=%u, flags=%x",
|
||||||
conn, xmlCPUs, ncpus, flags);
|
conn, xmlCPUs, ncpus, flags);
|
||||||
if (xmlCPUs) {
|
if (xmlCPUs) {
|
||||||
for (i = 0; i < ncpus; i++)
|
for (i = 0; i < ncpus; i++)
|
||||||
VIR_DEBUG("xmlCPUs[%u]=%s", i, NULLSTR(xmlCPUs[i]));
|
VIR_DEBUG("xmlCPUs[%zu]=%s", i, NULLSTR(xmlCPUs[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user