diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-08-14 16:25:25 +0100 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2008-08-22 19:52:58 +0100 |
commit | ffe11cfb0a808ae514193438616dfabc512b4cf6 (patch) | |
tree | 94452dba2c1a49d6e6a0782c6513acb36823cefc /lib/hash.c | |
parent | 9fd4958a4eef88c536e4a5aeefce302e10ee8ee6 (diff) | |
download | quagga-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/hash.c')
-rw-r--r-- | lib/hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -27,7 +27,7 @@ /* Allocate a new hash. */ struct hash * hash_create_size (unsigned int size, unsigned int (*hash_key) (void *), - int (*hash_cmp) (void *, void *)) + int (*hash_cmp) (const void *, const void *)) { struct hash *hash; @@ -46,7 +46,7 @@ hash_create_size (unsigned int size, unsigned int (*hash_key) (void *), /* Allocate a new hash with default hash size. */ struct hash * hash_create (unsigned int (*hash_key) (void *), - int (*hash_cmp) (void *, void *)) + int (*hash_cmp) (const void *, const void *)) { return hash_create_size (HASHTABSIZE, hash_key, hash_cmp); } |