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

Dmitry V. Levin ldv at altlinux.org
Thu Aug 24 14:45:07 PDT 2006


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);
 }
 
-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/devel/attachments/20060825/37f889db/attachment-0001.sig>


More information about the Devel mailing list