summaryrefslogtreecommitdiff
path: root/lib/hash.h
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/hash.h
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/hash.h')
-rw-r--r--lib/hash.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/hash.h b/lib/hash.h
index a6e3d59a..f4b1c23e 100644
--- a/lib/hash.h
+++ b/lib/hash.h
@@ -48,16 +48,16 @@ struct hash
unsigned int (*hash_key) (void *);
/* Data compare function. */
- int (*hash_cmp) (void *, void *);
+ int (*hash_cmp) (const void *, const void *);
/* Backet alloc. */
unsigned long count;
};
extern struct hash *hash_create (unsigned int (*) (void *),
- int (*) (void *, void *));
+ int (*) (const void *, const void *));
extern struct hash *hash_create_size (unsigned int, unsigned int (*) (void *),
- int (*) (void *, void *));
+ int (*) (const void *, const void *));
extern void *hash_get (struct hash *, void *, void * (*) (void *));
extern void *hash_alloc_intern (void *);