[PATCH 20/32] Convert 'int i' to 'size_t i' in src/nwfilter/ 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/nwfilter/nwfilter_driver.c            |  5 +++--
 src/nwfilter/nwfilter_ebiptables_driver.c |  4 ++--
 src/nwfilter/nwfilter_gentech_driver.c    | 21 +++++++++++----------
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index 0fbc940..57f1f54 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -441,7 +441,8 @@ nwfilterClose(virConnectPtr conn) {
 static int
 nwfilterConnectNumOfNWFilters(virConnectPtr conn) {
     virNWFilterDriverStatePtr driver = conn->nwfilterPrivateData;
-    int i, n;
+    size_t i;
+    int n;
 
     if (virConnectNumOfNWFiltersEnsureACL(conn) < 0)
         return -1;
@@ -503,7 +504,7 @@ nwfilterConnectListAllNWFilters(virConnectPtr conn,
     int nfilters = 0;
     virNWFilterPtr filter = NULL;
     virNWFilterObjPtr obj = NULL;
-    int i;
+    size_t i;
     int ret = -1;
 
     virCheckFlags(0, -1);
diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c
index 9a54de4..ee676b7 100644
--- a/src/nwfilter/nwfilter_ebiptables_driver.c
+++ b/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -3705,7 +3705,7 @@ ebiptablesApplyNewRules(const char *ifname,
                         int nruleInstances,
                         void **_inst)
 {
-    int i, j;
+    size_t i, j;
     int cli_status;
     ebiptablesRuleInstPtr *inst = (ebiptablesRuleInstPtr *)_inst;
     virBuffer buf = VIR_BUFFER_INITIALIZER;
@@ -4078,7 +4078,7 @@ ebiptablesRemoveRules(const char *ifname ATTRIBUTE_UNUSED,
 {
     int rc = 0;
     int cli_status;
-    int i;
+    size_t i;
     virBuffer buf = VIR_BUFFER_INITIALIZER;
     ebiptablesRuleInstPtr *inst = (ebiptablesRuleInstPtr *)_inst;
 
diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
index 4180505..9dc48ef 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -57,7 +57,7 @@ static virNWFilterTechDriverPtr filter_tech_drivers[] = {
 
 
 void virNWFilterTechDriversInit(bool privileged) {
-    int i = 0;
+    size_t i = 0;
     VIR_DEBUG("Initializing NWFilter technology drivers");
     while (filter_tech_drivers[i]) {
         if (!(filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
@@ -68,7 +68,7 @@ void virNWFilterTechDriversInit(bool privileged) {
 
 
 void virNWFilterTechDriversShutdown(void) {
-    int i = 0;
+    size_t i = 0;
     while (filter_tech_drivers[i]) {
         if ((filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
             filter_tech_drivers[i]->shutdown();
@@ -79,7 +79,7 @@ void virNWFilterTechDriversShutdown(void) {
 
 virNWFilterTechDriverPtr
 virNWFilterTechDriverForName(const char *name) {
-    int i = 0;
+    size_t i = 0;
     while (filter_tech_drivers[i]) {
        if (STREQ(filter_tech_drivers[i]->name, name)) {
            if ((filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED) == 0)
@@ -122,7 +122,7 @@ virNWFilterRuleInstAddData(virNWFilterRuleInstPtr res,
 static void
 virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst)
 {
-    int i;
+    size_t i;
     if (!inst)
         return;
 
@@ -300,7 +300,7 @@ virNWFilterRuleInstantiate(virNWFilterTechDriverPtr techdriver,
                            virNWFilterHashTablePtr vars)
 {
     int rc;
-    int i;
+    size_t i;
     virNWFilterRuleInstPtr ret;
 
     if (VIR_ALLOC(ret) < 0) {
@@ -395,7 +395,7 @@ _virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
 {
     virNWFilterObjPtr obj;
     int rc = 0;
-    int i;
+    size_t i;
     virNWFilterRuleInstPtr inst;
     virNWFilterDefPtr next_filter;
 
@@ -497,7 +497,7 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
 {
     virNWFilterObjPtr obj;
     int rc = 0;
-    int i, j;
+    size_t i, j;
     virNWFilterDefPtr next_filter;
     virNWFilterVarValuePtr val;
 
@@ -601,7 +601,7 @@ virNWFilterRuleInstancesToArray(int nEntries,
                                 void ***ptrs,
                                 int *nptrs)
 {
-    int i,j;
+    size_t i,j;
 
     *nptrs = 0;
 
@@ -662,7 +662,8 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
                        bool forceWithPendingReq)
 {
     int rc;
-    int j, nptrs;
+    size_t j;
+    int nptrs;
     int nEntries = 0;
     virNWFilterRuleInstPtr *insts = NULL;
     void **ptrs = NULL;
@@ -1155,7 +1156,7 @@ virNWFilterDomainFWUpdateCB(virDomainObjPtr obj,
 {
     virDomainDefPtr vm = obj->def;
     struct domUpdateCBStruct *cb = data;
-    int i;
+    size_t i;
     bool skipIface;
     int ret = 0;
 
-- 
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]