summaryrefslogtreecommitdiff
blob: 86f6dd86ed93c812135246206506a01128bbb319 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Dmitry V. Levin <ldv@altlinux.org>
Date: Fri, 25 Aug 2006 08:03:34 +0000 (+0400)
Subject: vzlist: Fix cast from pointer to integer of different size warnings
X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff;h=3a772bf0e3145a1c255d823bca4f4cea6e035f7f

vzlist: Fix cast from pointer to integer of different size warnings
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@altlinux.org>
---

Index: vzctl-3.0.11/src/vzlist.c
===================================================================
--- vzctl-3.0.11.orig/src/vzlist.c
+++ vzctl-3.0.11/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);
 }