diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-07-31 16:17:42 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-07-31 16:17:42 -0700 |
commit | c9a2aaf516ece95878e039c05bb333bac52a3cd8 (patch) | |
tree | d0a8a21585c0a34d031d13666dc63a99f79c5380 /bgpd/bgp_ecommunity.c | |
parent | de451b80ce76bd339c85a39cd815d720bf562003 (diff) | |
download | quagga-c9a2aaf516ece95878e039c05bb333bac52a3cd8.tar.bz2 quagga-c9a2aaf516ece95878e039c05bb333bac52a3cd8.tar.xz |
Make hash compare functions take const args
The hash compare function should not be modifiying its args
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 9e7ae1b3..c08673ce 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. */ |