[PATCH 18/32] Convert 'int i' to 'size_t i' in src/parallels/ files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 src/parallels/parallels_driver.c  | 15 ++++++++-------
 src/parallels/parallels_network.c |  3 ++-
 src/parallels/parallels_storage.c |  8 ++++----
 3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
index d5e0ea3..de8982a 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -419,7 +419,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;
@@ -850,7 +850,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;
@@ -1519,7 +1520,7 @@ static int
 parallelsApplySerialParams(virDomainChrDefPtr *oldserials, int nold,
                            virDomainChrDefPtr *newserials, int nnew)
 {
-    int i, j;
+    size_t i, j;
 
     if (nold != nnew)
         goto error;
@@ -1719,7 +1720,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;
@@ -1795,7 +1796,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) {
@@ -1925,7 +1926,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;
@@ -2217,7 +2218,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 26a3f13..b39338a 100644
--- a/src/parallels/parallels_network.c
+++ b/src/parallels/parallels_network.c
@@ -295,7 +295,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);
 
diff --git a/src/parallels/parallels_storage.c b/src/parallels/parallels_storage.c
index 3d55e82..63441e3 100644
--- a/src/parallels/parallels_storage.c
+++ b/src/parallels/parallels_storage.c
@@ -131,14 +131,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++)
@@ -220,7 +220,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) {
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]