[libvirt] [PATCH 02/32] Convert 'int i' to 'size_t i' in src/conf/ files

Guannan Ren gren at redhat.com
Tue Jul 9 09:11:38 UTC 2013


On 07/08/2013 10:21 PM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at 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 at redhat.com>
> ---
>   src/conf/capabilities.c            |  32 ++--
>   src/conf/cpu_conf.c                |  18 +--
>   src/conf/domain_audit.c            |   4 +-
>   src/conf/domain_conf.c             | 266 ++++++++++++++++---------------
>   src/conf/domain_conf.h             |  12 +-
>   src/conf/domain_event.c            |  24 +--
>   src/conf/domain_nwfilter.c         |   2 +-
>   src/conf/interface_conf.c          |  73 +++++----
>   src/conf/netdev_vlan_conf.c        |  19 +--
>   src/conf/network_conf.c            | 319 +++++++++++++++++++------------------
>   src/conf/node_device_conf.c        |  27 ++--
>   src/conf/nwfilter_conf.c           |  43 ++---
>   src/conf/nwfilter_params.c         |  26 +--
>   src/conf/snapshot_conf.c           |  21 +--
>   src/conf/storage_conf.c            |  42 ++---
>   src/conf/storage_encryption_conf.c |   3 +-
>   16 files changed, 482 insertions(+), 449 deletions(-)

> diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
> index b2be99a..068b09d 100644
> --- a/src/conf/nwfilter_conf.c
> +++ b/src/conf/nwfilter_conf.c
>
> @@ -2361,7 +2362,7 @@ virNWFilterRuleParse(xmlNodePtr node)
>   
>       while (cur != NULL) {
>           if (cur->type == XML_ELEMENT_NODE) {
> -            int i = 0;
> +            size_t i = 0;
>               while (1) {
>                   if (found)
>                       i = found_i;

      If we should also convert int found_i = 0 to size_t found_i = 0 in 
virNWFilterRuleParse()


> diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c
> index 48b89b7..a20b7b0 100644
> --- a/src/conf/nwfilter_params.c
> +++ b/src/conf/nwfilter_params.c

     In nwfilter_params.c,  missed i in virNWFilterVarValueFree() and 
virNWFilterVarValueCopy()

     Guannan




More information about the libvir-list mailing list