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

[libvirt] [PATCH 10/32] Convert 'int i' to 'size_t i' in src/uml/ files



From: "Daniel P. Berrange" <berrange redhat com>

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>
---
 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


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