aboutsummaryrefslogtreecommitdiffstats
path: root/apps
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 /apps
parent862e973b50e56d9510cfebc220cf410d3d5e99bc (diff)
downloadopenssl-385d81380cb8aa062b9d7e2c678419623c7db484.tar.gz
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 'apps')
-rw-r--r--apps/ca.c10
-rw-r--r--apps/openssl.c4
2 files changed, 9 insertions, 5 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 8184f2efca..2e00555880 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -753,15 +753,17 @@ bad:
BIO_printf(bio_err,"generating index\n");
}
- if (!TXT_DB_create_index(db,DB_serial,NULL,index_serial_hash,
- index_serial_cmp))
+ if (!TXT_DB_create_index(db, DB_serial, NULL,
+ (LHASH_HASH_FN_TYPE)index_serial_hash,
+ (LHASH_COMP_FN_TYPE)index_serial_cmp))
{
BIO_printf(bio_err,"error creating serial number index:(%ld,%ld,%ld)\n",db->error,db->arg1,db->arg2);
goto err;
}
- if (!TXT_DB_create_index(db,DB_name,index_name_qual,index_name_hash,
- index_name_cmp))
+ if (!TXT_DB_create_index(db, DB_name, index_name_qual,
+ (LHASH_HASH_FN_TYPE)index_name_hash,
+ (LHASH_COMP_FN_TYPE)index_name_cmp))
{
BIO_printf(bio_err,"error creating name index:(%ld,%ld,%ld)\n",
db->error,db->arg1,db->arg2);
diff --git a/apps/openssl.c b/apps/openssl.c
index cbb77b0c0a..40bcb76341 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -351,7 +351,9 @@ static LHASH *prog_init(void)
;
qsort(functions,i,sizeof *functions,SortFnByName);
- if ((ret=lh_new(hash,cmp)) == NULL) return(NULL);
+ if ((ret=lh_new((LHASH_HASH_FN_TYPE)hash,
+ (LHASH_COMP_FN_TYPE)cmp)) == NULL)
+ return(NULL);
for (f=functions; f->name != NULL; f++)
lh_insert(ret,f);