mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
Convert 'int i' to 'size_t i' in src/nwfilter/ files
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>
This commit is contained in:
parent
d70bdb14ff
commit
a1a1433ca0
@ -1335,7 +1335,8 @@ virNWFilterDHCPSnoopThread(void *req0)
|
||||
virNWFilterSnoopEthHdrPtr packet;
|
||||
int ifindex = 0;
|
||||
int errcount = 0;
|
||||
int tmp = -1, i, rv, n, pollTo;
|
||||
int tmp = -1, rv, n, pollTo;
|
||||
size_t i;
|
||||
char *threadkey = NULL;
|
||||
virThreadPoolPtr worker = NULL;
|
||||
time_t last_displayed = 0, last_displayed_queue = 0;
|
||||
|
@ -436,7 +436,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;
|
||||
@ -459,7 +460,8 @@ nwfilterConnectListNWFilters(virConnectPtr conn,
|
||||
char **const names,
|
||||
int nnames) {
|
||||
virNWFilterDriverStatePtr driver = conn->nwfilterPrivateData;
|
||||
int got = 0, i;
|
||||
int got = 0;
|
||||
size_t i;
|
||||
|
||||
if (virConnectListNWFiltersEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
@ -498,7 +500,7 @@ nwfilterConnectListAllNWFilters(virConnectPtr conn,
|
||||
int nfilters = 0;
|
||||
virNWFilterPtr filter = NULL;
|
||||
virNWFilterObjPtr obj = NULL;
|
||||
int i;
|
||||
size_t i;
|
||||
int ret = -1;
|
||||
|
||||
virCheckFlags(0, -1);
|
||||
|
@ -3067,7 +3067,7 @@ _ebtablesRemoveSubChains(virBufferPtr buf,
|
||||
const char *chains)
|
||||
{
|
||||
char rootchain[MAX_CHAINNAME_LENGTH];
|
||||
unsigned i;
|
||||
size_t i;
|
||||
|
||||
NWFILTER_SET_EBTABLES_SHELLVAR(buf);
|
||||
|
||||
@ -3159,7 +3159,7 @@ ebtablesRenameTmpSubAndRootChains(virBufferPtr buf,
|
||||
const char *ifname)
|
||||
{
|
||||
char rootchain[MAX_CHAINNAME_LENGTH];
|
||||
unsigned i;
|
||||
size_t i;
|
||||
char chains[3] = {
|
||||
CHAINPREFIX_HOST_IN_TEMP,
|
||||
CHAINPREFIX_HOST_OUT_TEMP,
|
||||
@ -3664,7 +3664,8 @@ ebtablesCreateTmpRootAndSubChains(virBufferPtr buf,
|
||||
ebiptablesRuleInstPtr *inst,
|
||||
int *nRuleInstances)
|
||||
{
|
||||
int rc = 0, i;
|
||||
int rc = 0;
|
||||
size_t i;
|
||||
virHashKeyValuePairPtr filter_names;
|
||||
const virNWFilterChainPriority *priority;
|
||||
|
||||
@ -3699,7 +3700,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;
|
||||
@ -4066,7 +4067,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;
|
||||
|
||||
|
@ -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)
|
||||
@ -120,7 +120,7 @@ virNWFilterRuleInstAddData(virNWFilterRuleInstPtr res,
|
||||
static void
|
||||
virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
if (!inst)
|
||||
return;
|
||||
|
||||
@ -296,7 +296,7 @@ virNWFilterRuleInstantiate(virNWFilterTechDriverPtr techdriver,
|
||||
virNWFilterHashTablePtr vars)
|
||||
{
|
||||
int rc;
|
||||
int i;
|
||||
size_t i;
|
||||
virNWFilterRuleInstPtr ret;
|
||||
|
||||
if (VIR_ALLOC(ret) < 0)
|
||||
@ -387,7 +387,7 @@ _virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
|
||||
{
|
||||
virNWFilterObjPtr obj;
|
||||
int rc = 0;
|
||||
int i;
|
||||
size_t i;
|
||||
virNWFilterRuleInstPtr inst;
|
||||
virNWFilterDefPtr next_filter;
|
||||
|
||||
@ -487,7 +487,7 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
|
||||
{
|
||||
virNWFilterObjPtr obj;
|
||||
int rc = 0;
|
||||
int i, j;
|
||||
size_t i, j;
|
||||
virNWFilterDefPtr next_filter;
|
||||
virNWFilterVarValuePtr val;
|
||||
|
||||
@ -590,7 +590,7 @@ virNWFilterRuleInstancesToArray(int nEntries,
|
||||
void ***ptrs,
|
||||
int *nptrs)
|
||||
{
|
||||
int i,j;
|
||||
size_t i,j;
|
||||
|
||||
*nptrs = 0;
|
||||
|
||||
@ -649,7 +649,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;
|
||||
@ -1141,7 +1142,7 @@ virNWFilterDomainFWUpdateCB(virDomainObjPtr obj,
|
||||
{
|
||||
virDomainDefPtr vm = obj->def;
|
||||
struct domUpdateCBStruct *cb = data;
|
||||
int i;
|
||||
size_t i;
|
||||
bool skipIface;
|
||||
int ret = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user