[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



On 07/08/2013 04:21 PM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange 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 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]