From ffe11cfb0a808ae514193438616dfabc512b4cf6 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 14 Aug 2008 16:25:25 +0100 Subject: [lib] hash compare function arguments ought to be const qualified 2008-08-14 Stephen Hemminger * lib/hash.h: (struct hash) Hash comparator callback really ought to treat storage behind arguments as constant - a compare function with side-effects would be evil. * */*.c: Adjust comparator functions similarly, thus fixing at least a few compiler warnings about const qualifier being dropped. Signed-off-by: Paul Jakma --- bgpd/bgp_advertise.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bgpd/bgp_advertise.c') diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c index 870aab134..b9f4a85b2 100644 --- a/bgpd/bgp_advertise.c +++ b/bgpd/bgp_advertise.c @@ -72,10 +72,10 @@ baa_hash_key (void *p) } static int -baa_hash_cmp (void *p1, void *p2) +baa_hash_cmp (const void *p1, const void *p2) { - struct bgp_advertise_attr * baa1 = (struct bgp_advertise_attr *) p1; - struct bgp_advertise_attr * baa2 = (struct bgp_advertise_attr *) p2; + const struct bgp_advertise_attr * baa1 = p1; + const struct bgp_advertise_attr * baa2 = p2; return attrhash_cmp (baa1->attr, baa2->attr); } -- cgit v1.2.3