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

[libvirt] [PATCH 17/32] Convert 'int i' to 'size_t i' in src/phyp/ 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/phyp/phyp_driver.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index cae3b59..1c41360 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -425,7 +425,7 @@ phypUUIDTable_WriteFile(virConnectPtr conn)
 {
     phyp_driverPtr phyp_driver = conn->privateData;
     uuid_tablePtr uuid_table = phyp_driver->uuid_table;
-    unsigned int i = 0;
+    size_t i = 0;
     int fd = -1;
     char local_file[] = "./uuid_table";
 
@@ -549,7 +549,7 @@ phypUUIDTable_RemLpar(virConnectPtr conn, int id)
 {
     phyp_driverPtr phyp_driver = conn->privateData;
     uuid_tablePtr uuid_table = phyp_driver->uuid_table;
-    unsigned int i = 0;
+    size_t i = 0;
 
     for (i = 0; i <= uuid_table->nlpars; i++) {
         if (uuid_table->lpars[i]->id == id) {
@@ -577,7 +577,7 @@ phypUUIDTable_AddLpar(virConnectPtr conn, unsigned char *uuid, int id)
     uuid_tablePtr uuid_table = phyp_driver->uuid_table;
 
     uuid_table->nlpars++;
-    unsigned int i = uuid_table->nlpars;
+    size_t i = uuid_table->nlpars;
     i--;
 
     if (VIR_REALLOC_N(uuid_table->lpars, uuid_table->nlpars) < 0) {
@@ -610,7 +610,7 @@ phypUUIDTable_ReadFile(virConnectPtr conn)
 {
     phyp_driverPtr phyp_driver = conn->privateData;
     uuid_tablePtr uuid_table = phyp_driver->uuid_table;
-    unsigned int i = 0;
+    size_t i = 0;
     int fd = -1;
     char local_file[] = "./uuid_table";
     int rc = 0;
@@ -764,7 +764,7 @@ phypUUIDTable_Init(virConnectPtr conn)
     int nids_numdomains = 0;
     int nids_listdomains = 0;
     int *ids = NULL;
-    unsigned int i = 0;
+    size_t i = 0;
     int ret = -1;
     bool table_created = false;
 
@@ -841,7 +841,7 @@ cleanup:
 static void
 phypUUIDTable_Free(uuid_tablePtr uuid_table)
 {
-    int i;
+    size_t i;
 
     if (uuid_table == NULL)
         return;
@@ -1319,7 +1319,7 @@ phypGetLparUUID(unsigned char *uuid, int lpar_id, virConnectPtr conn)
     phyp_driverPtr phyp_driver = conn->privateData;
     uuid_tablePtr uuid_table = phyp_driver->uuid_table;
     lparPtr *lpars = uuid_table->lpars;
-    unsigned int i = 0;
+    size_t i = 0;
 
     for (i = 0; i < uuid_table->nlpars; i++) {
         if (lpars[i]->id == lpar_id) {
@@ -2336,7 +2336,7 @@ phypStoragePoolListVolumes(virStoragePoolPtr pool, char **const volumes,
     int vios_id = phyp_driver->vios_id;
     int exit_status = 0;
     int got = 0;
-    int i;
+    size_t i;
     char *ret = NULL;
     char *volumes_list = NULL;
     char *char_ptr = NULL;
@@ -2537,7 +2537,7 @@ phypConnectListStoragePools(virConnectPtr conn, char **const pools, int npools)
     int vios_id = phyp_driver->vios_id;
     int exit_status = 0;
     int got = 0;
-    int i;
+    size_t i;
     char *ret = NULL;
     char *storage_pools = NULL;
     char *char_ptr = NULL;
@@ -2594,7 +2594,7 @@ phypStoragePoolLookupByUUID(virConnectPtr conn,
     int npools = 0;
     int gotpools = 0;
     char **pools = NULL;
-    unsigned int i = 0;
+    size_t i = 0;
     unsigned char *local_uuid = NULL;
 
     if (VIR_ALLOC_N(local_uuid, VIR_UUID_BUFLEN) < 0) {
@@ -3002,7 +3002,7 @@ phypConnectListInterfaces(virConnectPtr conn, char **const names, int nnames)
     int vios_id = phyp_driver->vios_id;
     int exit_status = 0;
     int got = 0;
-    int i;
+    size_t i;
     char *ret = NULL;
     char *networks = NULL;
     char *char_ptr = NULL;
@@ -3170,7 +3170,7 @@ phypConnectListDefinedDomains(virConnectPtr conn, char **const names, int nnames
     char *managed_system = phyp_driver->managed_system;
     int exit_status = 0;
     int got = 0;
-    int i;
+    size_t i;
     char *ret = NULL;
     char *domains = NULL;
     char *char_ptr = NULL;
@@ -3581,7 +3581,7 @@ phypDomainCreateXML(virConnectPtr conn,
     phyp_driverPtr phyp_driver = conn->privateData;
     uuid_tablePtr uuid_table = phyp_driver->uuid_table;
     lparPtr *lpars = uuid_table->lpars;
-    unsigned int i = 0;
+    size_t i = 0;
     char *managed_system = phyp_driver->managed_system;
 
     virCheckFlags(0, NULL);
-- 
1.8.1.4


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