From c9a2aaf516ece95878e039c05bb333bac52a3cd8 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 31 Jul 2008 16:17:42 -0700 Subject: Make hash compare functions take const args The hash compare function should not be modifiying its args --- lib/thread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/thread.c') diff --git a/lib/thread.c b/lib/thread.c index 095dff4e..260e8c8e 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)); -- cgit v1.2.3