summaryrefslogtreecommitdiffstats
path: root/crypto/conf
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/conf
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/conf')
-rw-r--r--crypto/conf/cnf_save.c2
-rw-r--r--crypto/conf/conf_api.c9
-rw-r--r--crypto/conf/conf_def.c2
3 files changed, 8 insertions, 5 deletions
diff --git a/crypto/conf/cnf_save.c b/crypto/conf/cnf_save.c
index e907cc2242..efbb61373e 100644
--- a/crypto/conf/cnf_save.c
+++ b/crypto/conf/cnf_save.c
@@ -73,7 +73,7 @@ main()
exit(1);
}
- lh_doall(conf,print_conf);
+ lh_doall(conf,(LHASH_DOALL_FN_TYPE)print_conf);
}
diff --git a/crypto/conf/conf_api.c b/crypto/conf/conf_api.c
index 7abeeced07..4d30c6835c 100644
--- a/crypto/conf/conf_api.c
+++ b/crypto/conf/conf_api.c
@@ -181,7 +181,8 @@ int _CONF_new_data(CONF *conf)
return 0;
}
if (conf->data == NULL)
- if ((conf->data = lh_new(hash,cmp_conf)) == NULL)
+ if ((conf->data = lh_new((LHASH_HASH_FN_TYPE)hash,
+ (LHASH_COMP_FN_TYPE)cmp_conf)) == NULL)
{
return 0;
}
@@ -194,12 +195,14 @@ void _CONF_free_data(CONF *conf)
conf->data->down_load=0; /* evil thing to make sure the 'OPENSSL_free()'
* works as expected */
- lh_doall_arg(conf->data,(void (*)())value_free_hash,conf->data);
+ lh_doall_arg(conf->data, (LHASH_DOALL_ARG_FN_TYPE)value_free_hash,
+ conf->data);
/* We now have only 'section' entries in the hash table.
* Due to problems with */
- lh_doall_arg(conf->data,(void (*)())value_free_stack,conf->data);
+ lh_doall_arg(conf->data, (LHASH_DOALL_ARG_FN_TYPE)value_free_stack,
+ conf->data);
lh_free(conf->data);
}
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c
index 6825d96455..1d30f6f771 100644
--- a/crypto/conf/conf_def.c
+++ b/crypto/conf/conf_def.c
@@ -712,7 +712,7 @@ static void dump_value(CONF_VALUE *a, BIO *out)
static int def_dump(CONF *conf, BIO *out)
{
- lh_doall_arg(conf->data, (void (*)())dump_value, out);
+ lh_doall_arg(conf->data, (LHASH_DOALL_ARG_FN_TYPE)dump_value, out);
return 1;
}