summaryrefslogtreecommitdiffstats
path: root/lib/thread.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-08-14 17:25:25 +0200
committerPaul Jakma <paul@quagga.net>2008-08-22 20:52:58 +0200
commitffe11cfb0a808ae514193438616dfabc512b4cf6 (patch)
tree94452dba2c1a49d6e6a0782c6513acb36823cefc /lib/thread.c
parent[ospfd] Default route needs to be refreshed after neighbour state change (diff)
downloadfrr-ffe11cfb0a808ae514193438616dfabc512b4cf6.tar.xz
frr-ffe11cfb0a808ae514193438616dfabc512b4cf6.zip
[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/thread.c')
-rw-r--r--lib/thread.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/thread.c b/lib/thread.c
index 095dff4e2..260e8c8e4 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -223,8 +223,8 @@ cpu_record_hash_key (struct cpu_thread_history *a)
}
static int
-cpu_record_hash_cmp (struct cpu_thread_history *a,
- struct cpu_thread_history *b)
+cpu_record_hash_cmp (const struct cpu_thread_history *a,
+ const struct cpu_thread_history *b)
{
return a->func == b->func;
}
@@ -410,7 +410,7 @@ thread_master_create ()
if (cpu_record == NULL)
cpu_record
= hash_create_size (1011, (unsigned int (*) (void *))cpu_record_hash_key,
- (int (*) (void *, void *))cpu_record_hash_cmp);
+ (int (*) (const void *, const void *))cpu_record_hash_cmp);
return (struct thread_master *) XCALLOC (MTYPE_THREAD_MASTER,
sizeof (struct thread_master));