summaryrefslogtreecommitdiffstats
path: root/lib/distribute.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-08-14 16:25:25 +0100
committerPaul Jakma <paul@quagga.net>2008-08-22 19:52:58 +0100
commitffe11cfb0a808ae514193438616dfabc512b4cf6 (patch)
tree94452dba2c1a49d6e6a0782c6513acb36823cefc /lib/distribute.c
parent9fd4958a4eef88c536e4a5aeefce302e10ee8ee6 (diff)
downloadquagga-ffe11cfb0a808ae514193438616dfabc512b4cf6.tar.bz2
quagga-ffe11cfb0a808ae514193438616dfabc512b4cf6.tar.xz
[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 'lib/distribute.c')
-rw-r--r--lib/distribute.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/distribute.c b/lib/distribute.c
index 3d616211..906e3f6d 100644
--- a/lib/distribute.c
+++ b/lib/distribute.c
@@ -134,7 +134,7 @@ distribute_hash_make (struct distribute *dist)
/* If two distribute-list have same value then return 1 else return
0. This function is used by hash package. */
static int
-distribute_cmp (struct distribute *dist1, struct distribute *dist2)
+distribute_cmp (const struct distribute *dist1, const struct distribute *dist2)
{
if (dist1->ifname && dist2->ifname)
if (strcmp (dist1->ifname, dist2->ifname) == 0)
@@ -769,7 +769,7 @@ void
distribute_list_init (int node)
{
disthash = hash_create ((unsigned int (*) (void *)) distribute_hash_make,
- (int (*) (void *, void *)) distribute_cmp);
+ (int (*) (const void *, const void *)) distribute_cmp);
if(node==RIP_NODE) {
install_element (RIP_NODE, &distribute_list_all_cmd);