From d3c0ce3c86f1fe89c36e97b1e7aad964fa10d03e Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 8 Jul 2013 15:09:33 +0100 Subject: [PATCH] Convert 'int i' to 'size_t i' in src/parallels/ 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 --- src/parallels/parallels_driver.c | 15 ++++++++------- src/parallels/parallels_network.c | 15 ++++++++++----- src/parallels/parallels_storage.c | 8 ++++---- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index dd4b13f7a3..33260ef799 100644 --- a/src/parallels/parallels_driver.c +++ b/src/parallels/parallels_driver.c @@ -412,7 +412,7 @@ static inline unsigned char hex2int(char c) static int parallelsMacAddrParse(const char *str, virMacAddrPtr addr) { - int i; + size_t i; if (strlen(str) != 12) goto error; @@ -837,7 +837,8 @@ parallelsLoadDomain(parallelsConnPtr privconn, virJSONValuePtr jobj) static int parallelsLoadDomains(parallelsConnPtr privconn, const char *domain_name) { - int count, i; + int count; + size_t i; virJSONValuePtr jobj; virJSONValuePtr jobj2; virDomainObjPtr dom = NULL; @@ -1504,7 +1505,7 @@ static int parallelsApplySerialParams(virDomainChrDefPtr *oldserials, int nold, virDomainChrDefPtr *newserials, int nnew) { - int i, j; + size_t i, j; if (nold != nnew) goto error; @@ -1704,7 +1705,7 @@ parallelsApplyDisksParams(virConnectPtr conn, parallelsDomObjPtr pdom, virDomainDiskDefPtr *olddisks, int nold, virDomainDiskDefPtr *newdisks, int nnew) { - int i, j; + size_t i, j; for (i = 0; i < nold; i++) { virDomainDiskDefPtr newdisk = NULL; @@ -1780,7 +1781,7 @@ static int parallelsApplyIfaceParams(parallelsDomObjPtr pdom, bool is_changed = false; virCommandPtr cmd = NULL; char strmac[VIR_MAC_STRING_BUFLEN]; - int i; + size_t i; int ret = -1; if (!oldnet) { @@ -1908,7 +1909,7 @@ parallelsApplyIfacesParams(parallelsDomObjPtr pdom, virDomainNetDefPtr *oldnets, int nold, virDomainNetDefPtr *newnets, int nnew) { - int i, j; + size_t i, j; virDomainNetDefPtr newnet; virDomainNetDefPtr oldnet; bool found; @@ -2200,7 +2201,7 @@ static int parallelsCreateVm(virConnectPtr conn, virDomainDefPtr def) { parallelsConnPtr privconn = conn->privateData; - int i; + size_t i; virStorageVolDefPtr privvol = NULL; virStoragePoolObjPtr pool = NULL; virStorageVolPtr vol = NULL; diff --git a/src/parallels/parallels_network.c b/src/parallels/parallels_network.c index 6edd0f8c6b..63daf53dc3 100644 --- a/src/parallels/parallels_network.c +++ b/src/parallels/parallels_network.c @@ -283,7 +283,8 @@ static int parallelsLoadNetworks(parallelsConnPtr privconn) virJSONValuePtr jobj, jobj2; virNetworkObjPtr net; int ret = -1; - int count, i; + int count; + size_t i; jobj = parallelsParseOutput("prlsrvctl", "net", "list", "-j", NULL); @@ -350,7 +351,8 @@ static int parallelsNetworkClose(virConnectPtr conn) static int parallelsConnectNumOfNetworks(virConnectPtr conn) { - int nactive = 0, i; + int nactive = 0; + size_t i; parallelsConnPtr privconn = conn->privateData; parallelsDriverLock(privconn); @@ -370,7 +372,8 @@ static int parallelsConnectListNetworks(virConnectPtr conn, int nnames) { parallelsConnPtr privconn = conn->privateData; - int got = 0, i; + int got = 0; + size_t i; parallelsDriverLock(privconn); for (i = 0; i < privconn->networks.count && got < nnames; i++) { @@ -397,7 +400,8 @@ static int parallelsConnectListNetworks(virConnectPtr conn, static int parallelsConnectNumOfDefinedNetworks(virConnectPtr conn) { - int ninactive = 0, i; + int ninactive = 0; + size_t i; parallelsConnPtr privconn = conn->privateData; parallelsDriverLock(privconn); @@ -417,7 +421,8 @@ static int parallelsConnectListDefinedNetworks(virConnectPtr conn, int nnames) { parallelsConnPtr privconn = conn->privateData; - int got = 0, i; + int got = 0; + size_t i; parallelsDriverLock(privconn); for (i = 0; i < privconn->networks.count && got < nnames; i++) { diff --git a/src/parallels/parallels_storage.c b/src/parallels/parallels_storage.c index 2d52d9245f..3e254ce8eb 100644 --- a/src/parallels/parallels_storage.c +++ b/src/parallels/parallels_storage.c @@ -129,14 +129,14 @@ static char *parallelsMakePoolName(virConnectPtr conn, const char *path) { parallelsConnPtr privconn = conn->privateData; char *name; - unsigned int i; + size_t i; for (i = 0; i < UINT_MAX; i++) { bool found = false; - int j; + size_t j; if ((!i && VIR_STRDUP(name, path) < 0) || - (i && virAsprintf(&name, "%s-%u", path, i) < 0)) + (i && virAsprintf(&name, "%s-%zu", path, i) < 0)) return NULL; for (j = 0; j < strlen(name); j++) @@ -216,7 +216,7 @@ parallelsPoolAddByDomain(virConnectPtr conn, virDomainObjPtr dom) virStoragePoolObjListPtr pools = &privconn->pools; char *poolPath; virStoragePoolObjPtr pool = NULL; - int j; + size_t j; poolPath = mdir_name(pdom->home); if (!poolPath) {