summaryrefslogtreecommitdiff
path: root/lib/if_rmap.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/if_rmap.c
parent9fd4958a4eef88c536e4a5aeefce302e10ee8ee6 (diff)
[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/if_rmap.c')
-rw-r--r--lib/if_rmap.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/if_rmap.c b/lib/if_rmap.c
index e6f753c2..ddc62fd5 100644
--- a/lib/if_rmap.c
+++ b/lib/if_rmap.c
@@ -120,13 +120,12 @@ if_rmap_hash_make (void *data)
}
static int
-if_rmap_hash_cmp (void *arg1, void* arg2)
+if_rmap_hash_cmp (const void *arg1, const void* arg2)
{
- struct if_rmap *if_rmap1 = arg1;
- struct if_rmap *if_rmap2 = arg2;
- if (strcmp (if_rmap1->ifname, if_rmap2->ifname) == 0)
- return 1;
- return 0;
+ const struct if_rmap *if_rmap1 = arg1;
+ const struct if_rmap *if_rmap2 = arg2;
+
+ return strcmp (if_rmap1->ifname, if_rmap2->ifname) == 0;
}
static struct if_rmap *