[PATCH 10/32] Convert 'int i' to 'size_t i' in src/uml/ 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/uml/uml_conf.c   | 6 +++---
 src/uml/uml_driver.c | 9 +++++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 38dcfbb..6a22cc0 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -395,7 +395,7 @@ virCommandPtr umlBuildCommandLine(virConnectPtr conn,
                                   struct uml_driver *driver,
                                   virDomainObjPtr vm)
 {
-    int i, j;
+    size_t i, j;
     virCommandPtr cmd;
 
     cmd = virCommandNew(vm->def->os.kernel);
@@ -439,7 +439,7 @@ virCommandPtr umlBuildCommandLine(virConnectPtr conn,
         if (chr)
             ret = umlBuildCommandLineChr(chr, "con", cmd);
         if (!ret)
-            if (virAsprintf(&ret, "con%d=none", i) < 0)
+            if (virAsprintf(&ret, "con%zu=none", i) < 0)
                 goto no_memory;
         virCommandAddArg(cmd, ret);
         VIR_FREE(ret);
@@ -454,7 +454,7 @@ virCommandPtr umlBuildCommandLine(virConnectPtr conn,
         if (chr)
             ret = umlBuildCommandLineChr(chr, "ssl", cmd);
         if (!ret)
-            if (virAsprintf(&ret, "ssl%d=none", i) < 0)
+            if (virAsprintf(&ret, "ssl%zu=none", i) < 0)
                 goto no_memory;
 
         virCommandAddArg(cmd, ret);
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index df98eb8..a68fd93 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -275,7 +275,7 @@ static int
 umlIdentifyChrPTY(struct uml_driver *driver,
                   virDomainObjPtr dom)
 {
-    int i;
+    size_t i;
 
     for (i = 0; i < dom->def->nconsoles; i++)
         if (dom->def->consoles[i]->source.type == VIR_DOMAIN_CHR_TYPE_PTY)
@@ -1003,7 +1003,7 @@ error:
 
 
 static void umlCleanupTapDevices(virDomainObjPtr vm) {
-    int i;
+    size_t i;
 
     for (i = 0; i < vm->def->nnets; i++) {
         virDomainNetDefPtr def = vm->def->nets[i];
@@ -2127,7 +2127,7 @@ static int umlDomainAttachUmlDisk(struct uml_driver *driver,
                                   virDomainObjPtr vm,
                                   virDomainDiskDefPtr disk)
 {
-    int i;
+    size_t i;
     char *cmd = NULL;
     char *reply = NULL;
 
@@ -2255,7 +2255,8 @@ static int umlDomainDetachUmlDisk(struct uml_driver *driver,
                                   virDomainObjPtr vm,
                                   virDomainDeviceDefPtr dev)
 {
-    int i, ret = -1;
+    size_t i;
+    int ret = -1;
     virDomainDiskDefPtr detach = NULL;
     char *cmd;
     char *reply;
-- 
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]