mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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 <berrange@redhat.com>
This commit is contained in:
parent
c27e3651e6
commit
d3c0ce3c86
@ -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;
|
||||
|
@ -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++) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user