summaryrefslogtreecommitdiffstats
path: root/crypto/err
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2000-12-01 20:31:52 +0000
committerGeoff Thorpe <geoff@openssl.org>2000-12-01 20:31:52 +0000
commit385d81380cb8aa062b9d7e2c678419623c7db484 (patch)
treef866963b5b03410694d03a37d20695327a72a460 /crypto/err
parent862e973b50e56d9510cfebc220cf410d3d5e99bc (diff)
First step in tidying up the LHASH code. The callback prototypes (and
casts) used in the lhash code are about as horrible and evil as they can be. For starters, the callback prototypes contain empty parameter lists. Yuck. This first change defines clearer prototypes - including "typedef"'d function pointer types to use as "hash" and "compare" callbacks, as well as the callbacks passed to the lh_doall and lh_doall_arg iteration functions. Now at least more explicit (and clear) casting is required in all of the dependant code - and that should be included in this commit. The next step will be to hunt down and obliterate some of the function pointer casting being used when it's not necessary - a particularly evil variant exists in the implementation of lh_doall.
Diffstat (limited to 'crypto/err')
-rw-r--r--crypto/err/err.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c
index 99272e437c..34f4adaeb2 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -316,7 +316,8 @@ void ERR_load_strings(int lib, ERR_STRING_DATA *str)
if (error_hash == NULL)
{
CRYPTO_w_lock(CRYPTO_LOCK_ERR_HASH);
- error_hash=lh_new(err_hash,err_cmp);
+ error_hash=lh_new((LHASH_HASH_FN_TYPE)err_hash,
+ (LHASH_COMP_FN_TYPE)err_cmp);
if (error_hash == NULL)
{
CRYPTO_w_unlock(CRYPTO_LOCK_ERR_HASH);
@@ -706,7 +707,8 @@ ERR_STATE *ERR_get_state(void)
/* no entry yet in thread_hash for current thread -
* thus, it may have changed since we last looked at it */
if (thread_hash == NULL)
- thread_hash = lh_new(pid_hash, pid_cmp);
+ thread_hash = lh_new((LHASH_HASH_FN_TYPE)pid_hash,
+ (LHASH_COMP_FN_TYPE)pid_cmp);
if (thread_hash == NULL)
thread_state_exists = 0; /* allocation error */
else