diff options
author | Richard Levitte <levitte@openssl.org> | 2000-12-13 17:15:03 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-12-13 17:15:03 +0000 |
commit | 8d28d5f81b81f68a69db1c67e24bcfc092614346 (patch) | |
tree | 3391f9ea36d1b9655ffd8e9065de14a5284c5556 /crypto/mem_dbg.c | |
parent | 53b407da84909dffb54c44dc8a1106723a23a546 (diff) | |
download | openssl-8d28d5f81b81f68a69db1c67e24bcfc092614346.tar.gz |
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...
Diffstat (limited to 'crypto/mem_dbg.c')
-rw-r--r-- | crypto/mem_dbg.c | 18 |
1 files changed, 10 insertions, 8 deletions
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); |