mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 02:51:16 +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;
|
virNWFilterSnoopEthHdrPtr packet;
|
||||||
int ifindex = 0;
|
int ifindex = 0;
|
||||||
int errcount = 0;
|
int errcount = 0;
|
||||||
int tmp = -1, i, rv, n, pollTo;
|
int tmp = -1, rv, n, pollTo;
|
||||||
|
size_t i;
|
||||||
char *threadkey = NULL;
|
char *threadkey = NULL;
|
||||||
virThreadPoolPtr worker = NULL;
|
virThreadPoolPtr worker = NULL;
|
||||||
time_t last_displayed = 0, last_displayed_queue = 0;
|
time_t last_displayed = 0, last_displayed_queue = 0;
|
||||||
|
@ -436,7 +436,8 @@ nwfilterClose(virConnectPtr conn) {
|
|||||||
static int
|
static int
|
||||||
nwfilterConnectNumOfNWFilters(virConnectPtr conn) {
|
nwfilterConnectNumOfNWFilters(virConnectPtr conn) {
|
||||||
virNWFilterDriverStatePtr driver = conn->nwfilterPrivateData;
|
virNWFilterDriverStatePtr driver = conn->nwfilterPrivateData;
|
||||||
int i, n;
|
size_t i;
|
||||||
|
int n;
|
||||||
|
|
||||||
if (virConnectNumOfNWFiltersEnsureACL(conn) < 0)
|
if (virConnectNumOfNWFiltersEnsureACL(conn) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -459,7 +460,8 @@ nwfilterConnectListNWFilters(virConnectPtr conn,
|
|||||||
char **const names,
|
char **const names,
|
||||||
int nnames) {
|
int nnames) {
|
||||||
virNWFilterDriverStatePtr driver = conn->nwfilterPrivateData;
|
virNWFilterDriverStatePtr driver = conn->nwfilterPrivateData;
|
||||||
int got = 0, i;
|
int got = 0;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
if (virConnectListNWFiltersEnsureACL(conn) < 0)
|
if (virConnectListNWFiltersEnsureACL(conn) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -498,7 +500,7 @@ nwfilterConnectListAllNWFilters(virConnectPtr conn,
|
|||||||
int nfilters = 0;
|
int nfilters = 0;
|
||||||
virNWFilterPtr filter = NULL;
|
virNWFilterPtr filter = NULL;
|
||||||
virNWFilterObjPtr obj = NULL;
|
virNWFilterObjPtr obj = NULL;
|
||||||
int i;
|
size_t i;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
virCheckFlags(0, -1);
|
virCheckFlags(0, -1);
|
||||||
|
@ -3067,7 +3067,7 @@ _ebtablesRemoveSubChains(virBufferPtr buf,
|
|||||||
const char *chains)
|
const char *chains)
|
||||||
{
|
{
|
||||||
char rootchain[MAX_CHAINNAME_LENGTH];
|
char rootchain[MAX_CHAINNAME_LENGTH];
|
||||||
unsigned i;
|
size_t i;
|
||||||
|
|
||||||
NWFILTER_SET_EBTABLES_SHELLVAR(buf);
|
NWFILTER_SET_EBTABLES_SHELLVAR(buf);
|
||||||
|
|
||||||
@ -3159,7 +3159,7 @@ ebtablesRenameTmpSubAndRootChains(virBufferPtr buf,
|
|||||||
const char *ifname)
|
const char *ifname)
|
||||||
{
|
{
|
||||||
char rootchain[MAX_CHAINNAME_LENGTH];
|
char rootchain[MAX_CHAINNAME_LENGTH];
|
||||||
unsigned i;
|
size_t i;
|
||||||
char chains[3] = {
|
char chains[3] = {
|
||||||
CHAINPREFIX_HOST_IN_TEMP,
|
CHAINPREFIX_HOST_IN_TEMP,
|
||||||
CHAINPREFIX_HOST_OUT_TEMP,
|
CHAINPREFIX_HOST_OUT_TEMP,
|
||||||
@ -3664,7 +3664,8 @@ ebtablesCreateTmpRootAndSubChains(virBufferPtr buf,
|
|||||||
ebiptablesRuleInstPtr *inst,
|
ebiptablesRuleInstPtr *inst,
|
||||||
int *nRuleInstances)
|
int *nRuleInstances)
|
||||||
{
|
{
|
||||||
int rc = 0, i;
|
int rc = 0;
|
||||||
|
size_t i;
|
||||||
virHashKeyValuePairPtr filter_names;
|
virHashKeyValuePairPtr filter_names;
|
||||||
const virNWFilterChainPriority *priority;
|
const virNWFilterChainPriority *priority;
|
||||||
|
|
||||||
@ -3699,7 +3700,7 @@ ebiptablesApplyNewRules(const char *ifname,
|
|||||||
int nruleInstances,
|
int nruleInstances,
|
||||||
void **_inst)
|
void **_inst)
|
||||||
{
|
{
|
||||||
int i, j;
|
size_t i, j;
|
||||||
int cli_status;
|
int cli_status;
|
||||||
ebiptablesRuleInstPtr *inst = (ebiptablesRuleInstPtr *)_inst;
|
ebiptablesRuleInstPtr *inst = (ebiptablesRuleInstPtr *)_inst;
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
@ -4066,7 +4067,7 @@ ebiptablesRemoveRules(const char *ifname ATTRIBUTE_UNUSED,
|
|||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int cli_status;
|
int cli_status;
|
||||||
int i;
|
size_t i;
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
ebiptablesRuleInstPtr *inst = (ebiptablesRuleInstPtr *)_inst;
|
ebiptablesRuleInstPtr *inst = (ebiptablesRuleInstPtr *)_inst;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ static virNWFilterTechDriverPtr filter_tech_drivers[] = {
|
|||||||
|
|
||||||
|
|
||||||
void virNWFilterTechDriversInit(bool privileged) {
|
void virNWFilterTechDriversInit(bool privileged) {
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
VIR_DEBUG("Initializing NWFilter technology drivers");
|
VIR_DEBUG("Initializing NWFilter technology drivers");
|
||||||
while (filter_tech_drivers[i]) {
|
while (filter_tech_drivers[i]) {
|
||||||
if (!(filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
|
if (!(filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
|
||||||
@ -68,7 +68,7 @@ void virNWFilterTechDriversInit(bool privileged) {
|
|||||||
|
|
||||||
|
|
||||||
void virNWFilterTechDriversShutdown(void) {
|
void virNWFilterTechDriversShutdown(void) {
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
while (filter_tech_drivers[i]) {
|
while (filter_tech_drivers[i]) {
|
||||||
if ((filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
|
if ((filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
|
||||||
filter_tech_drivers[i]->shutdown();
|
filter_tech_drivers[i]->shutdown();
|
||||||
@ -79,7 +79,7 @@ void virNWFilterTechDriversShutdown(void) {
|
|||||||
|
|
||||||
virNWFilterTechDriverPtr
|
virNWFilterTechDriverPtr
|
||||||
virNWFilterTechDriverForName(const char *name) {
|
virNWFilterTechDriverForName(const char *name) {
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
while (filter_tech_drivers[i]) {
|
while (filter_tech_drivers[i]) {
|
||||||
if (STREQ(filter_tech_drivers[i]->name, name)) {
|
if (STREQ(filter_tech_drivers[i]->name, name)) {
|
||||||
if ((filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED) == 0)
|
if ((filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED) == 0)
|
||||||
@ -120,7 +120,7 @@ virNWFilterRuleInstAddData(virNWFilterRuleInstPtr res,
|
|||||||
static void
|
static void
|
||||||
virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst)
|
virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
if (!inst)
|
if (!inst)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ virNWFilterRuleInstantiate(virNWFilterTechDriverPtr techdriver,
|
|||||||
virNWFilterHashTablePtr vars)
|
virNWFilterHashTablePtr vars)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
int i;
|
size_t i;
|
||||||
virNWFilterRuleInstPtr ret;
|
virNWFilterRuleInstPtr ret;
|
||||||
|
|
||||||
if (VIR_ALLOC(ret) < 0)
|
if (VIR_ALLOC(ret) < 0)
|
||||||
@ -387,7 +387,7 @@ _virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
|
|||||||
{
|
{
|
||||||
virNWFilterObjPtr obj;
|
virNWFilterObjPtr obj;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int i;
|
size_t i;
|
||||||
virNWFilterRuleInstPtr inst;
|
virNWFilterRuleInstPtr inst;
|
||||||
virNWFilterDefPtr next_filter;
|
virNWFilterDefPtr next_filter;
|
||||||
|
|
||||||
@ -487,7 +487,7 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
|
|||||||
{
|
{
|
||||||
virNWFilterObjPtr obj;
|
virNWFilterObjPtr obj;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int i, j;
|
size_t i, j;
|
||||||
virNWFilterDefPtr next_filter;
|
virNWFilterDefPtr next_filter;
|
||||||
virNWFilterVarValuePtr val;
|
virNWFilterVarValuePtr val;
|
||||||
|
|
||||||
@ -590,7 +590,7 @@ virNWFilterRuleInstancesToArray(int nEntries,
|
|||||||
void ***ptrs,
|
void ***ptrs,
|
||||||
int *nptrs)
|
int *nptrs)
|
||||||
{
|
{
|
||||||
int i,j;
|
size_t i,j;
|
||||||
|
|
||||||
*nptrs = 0;
|
*nptrs = 0;
|
||||||
|
|
||||||
@ -649,7 +649,8 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
|
|||||||
bool forceWithPendingReq)
|
bool forceWithPendingReq)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
int j, nptrs;
|
size_t j;
|
||||||
|
int nptrs;
|
||||||
int nEntries = 0;
|
int nEntries = 0;
|
||||||
virNWFilterRuleInstPtr *insts = NULL;
|
virNWFilterRuleInstPtr *insts = NULL;
|
||||||
void **ptrs = NULL;
|
void **ptrs = NULL;
|
||||||
@ -1141,7 +1142,7 @@ virNWFilterDomainFWUpdateCB(virDomainObjPtr obj,
|
|||||||
{
|
{
|
||||||
virDomainDefPtr vm = obj->def;
|
virDomainDefPtr vm = obj->def;
|
||||||
struct domUpdateCBStruct *cb = data;
|
struct domUpdateCBStruct *cb = data;
|
||||||
int i;
|
size_t i;
|
||||||
bool skipIface;
|
bool skipIface;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user