From 8d28d5f81b81f68a69db1c67e24bcfc092614346 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 13 Dec 2000 17:15:03 +0000 Subject: Constification of the data of a hash table. This means the callback functions need to be constified, and therefore meant a number of easy changes a little everywhere. Now, if someone could explain to me why OBJ_dup() cheats... --- crypto/mem_dbg.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'crypto/mem_dbg.c') diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c index 8e48e25fbd..9ed8184e45 100644 --- a/crypto/mem_dbg.c +++ b/crypto/mem_dbg.c @@ -220,34 +220,36 @@ long CRYPTO_dbg_get_options(void) } /* static int mem_cmp(MEM *a, MEM *b) */ -static int mem_cmp(void *a_void, void *b_void) +static int mem_cmp(const void *a_void, const void *b_void) { - return((char *)((MEM *)a_void)->addr - (char *)((MEM *)b_void)->addr); + return((const char *)((MEM *)a_void)->addr + - (const char *)((MEM *)b_void)->addr); } /* static unsigned long mem_hash(MEM *a) */ -static unsigned long mem_hash(void *a_void) +static unsigned long mem_hash(const void *a_void) { unsigned long ret; - ret=(unsigned long)((MEM *)a_void)->addr; + ret=(unsigned long)((const MEM *)a_void)->addr; ret=ret*17851+(ret>>14)*7+(ret>>4)*251; return(ret); } /* static int app_info_cmp(APP_INFO *a, APP_INFO *b) */ -static int app_info_cmp(void *a_void, void *b_void) +static int app_info_cmp(const void *a_void, const void *b_void) { - return(((APP_INFO *)a_void)->thread != ((APP_INFO *)b_void)->thread); + return(((const APP_INFO *)a_void)->thread + != ((const APP_INFO *)b_void)->thread); } /* static unsigned long app_info_hash(APP_INFO *a) */ -static unsigned long app_info_hash(void *a_void) +static unsigned long app_info_hash(const void *a_void) { unsigned long ret; - ret=(unsigned long)((APP_INFO *)a_void)->thread; + ret=(unsigned long)((const APP_INFO *)a_void)->thread; ret=ret*17851+(ret>>14)*7+(ret>>4)*251; return(ret); -- cgit v1.2.3