[Devel] [PATCH] vzlist: Fix "cast from pointer to integer of different size" warnings

Kirill Korotaev dev at sw.ru
Fri Aug 25 01:42:53 PDT 2006


Dmitry,

thanks a lot for your help!
all 4 patches are commited and can be found at git

Thanks,
Kirill

> vzlist:
> 	id_search_fn(): Take veid by reference like in veid_search_fn().
> 	find_ve(): Pass veid by reference like in check_veid_restr().
> 
> Signed-off-by: Dmitry V. Levin <ldv at altlinux.org>
> ---
>  src/vzlist.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/vzlist.c b/src/vzlist.c
> index 3e631ea..f211f11 100644
> --- a/src/vzlist.c
> +++ b/src/vzlist.c
> @@ -607,7 +607,7 @@ void usage()
>  
>  int id_search_fn(const void* val1, const void* val2)
>  {
> -	return ((int)val1 - ((struct Cveinfo*)val2)->veid);
> +	return (*(int *)val1 - ((struct Cveinfo*)val2)->veid);
>  }
>  
>  int veid_search_fn(const void* val1, const void* val2)
> @@ -708,7 +708,7 @@ void add_elem(struct Cveinfo *ve)
>  
>  inline struct Cveinfo *find_ve(int veid)
>  {
> -	return (struct Cveinfo *) bsearch((void*)veid, veinfo, n_veinfo,
> +	return (struct Cveinfo *) bsearch(&veid, veinfo, n_veinfo,
>  			sizeof(struct Cveinfo), id_search_fn);
>  }
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Devel mailing list
> Devel at openvz.org
> https://openvz.org/mailman/listinfo/devel




More information about the Devel mailing list