[libvirt] [PATCH 21/32] Convert 'int i' to 'size_t i' in src/node_device/ files

Ján Tomko jtomko at redhat.com
Tue Jul 9 12:35:24 UTC 2013


On 07/08/2013 04: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/node_device/node_device_driver.c |  6 +++---
>  src/node_device/node_device_hal.c    |  9 ++++++---
>  src/nodeinfo.c                       | 24 ++++++++++++------------
>  3 files changed, 21 insertions(+), 18 deletions(-)
> 

> diff --git a/src/nodeinfo.c b/src/nodeinfo.c
> index a50f892..d48c7ed 100644
> --- a/src/nodeinfo.c
> +++ b/src/nodeinfo.c
> @@ -1041,7 +1041,7 @@ nodeGetCPUCount(void)
>       * will be consecutive.
>       */
>      char *cpupath = NULL;
> -    int i = 0;
> +    size_t i = 0;
>  
>      if (virFileExists(SYSFS_SYSTEM_PATH "/cpu/present")) {
>          i = linuxParseCPUmax(SYSFS_SYSTEM_PATH "/cpu/present");

linuxParseCPUmax can return -1.

ACK

Jan




More information about the libvir-list mailing list