diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-08-14 17:25:25 +0200 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2008-08-22 20:52:58 +0200 |
commit | ffe11cfb0a808ae514193438616dfabc512b4cf6 (patch) | |
tree | 94452dba2c1a49d6e6a0782c6513acb36823cefc /bgpd/bgp_ecommunity.c | |
parent | [ospfd] Default route needs to be refreshed after neighbour state change (diff) | |
download | frr-ffe11cfb0a808ae514193438616dfabc512b4cf6.tar.xz frr-ffe11cfb0a808ae514193438616dfabc512b4cf6.zip |
[lib] hash compare function arguments ought to be const qualified
2008-08-14 Stephen Hemminger <stephen.hemminger@vyatta.com>
* 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 <paul@quagga.net>
Diffstat (limited to 'bgpd/bgp_ecommunity.c')
-rw-r--r-- | bgpd/bgp_ecommunity.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index 9e7ae1b3e..c08673ceb 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -247,15 +247,13 @@ ecommunity_hash_make (void *arg) /* Compare two Extended Communities Attribute structure. */ int -ecommunity_cmp (void *arg1, void *arg2) +ecommunity_cmp (const void *arg1, const void *arg2) { const struct ecommunity *ecom1 = arg1; const struct ecommunity *ecom2 = arg2; - if (ecom1->size == ecom2->size - && memcmp (ecom1->val, ecom2->val, ecom1->size * ECOMMUNITY_SIZE) == 0) - return 1; - return 0; + return (ecom1->size == ecom2->size + && memcmp (ecom1->val, ecom2->val, ecom1->size * ECOMMUNITY_SIZE) == 0); } /* Initialize Extended Comminities related hash. */ |