diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/openssl.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/apps/openssl.c b/apps/openssl.c index b7e50c7374..14cb93ee26 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -73,8 +73,15 @@ #include "s_apps.h" #include <openssl/err.h> -static unsigned long MS_CALLBACK hash(FUNCTION *a); -static int MS_CALLBACK cmp(FUNCTION *a,FUNCTION *b); +/* The LHASH callbacks ("hash" & "cmp") have been replaced by functions with the + * base prototypes (we cast each variable inside the function to the required + * type of "FUNCTION*"). This removes the necessity for macro-generated wrapper + * functions. */ + +/* static unsigned long MS_CALLBACK hash(FUNCTION *a); */ +static unsigned long MS_CALLBACK hash(void *a_void); +/* static int MS_CALLBACK cmp(FUNCTION *a,FUNCTION *b); */ +static int MS_CALLBACK cmp(void *a_void,void *b_void); static LHASH *prog_init(void ); static int do_cmd(LHASH *prog,int argc,char *argv[]); LHASH *config=NULL; @@ -85,9 +92,6 @@ char *default_config_file=NULL; BIO *bio_err=NULL; #endif -static IMPLEMENT_LHASH_HASH_FN(hash,FUNCTION *) -static IMPLEMENT_LHASH_COMP_FN(cmp,FUNCTION *) - int main(int Argc, char *Argv[]) { ARGS arg; @@ -354,8 +358,7 @@ static LHASH *prog_init(void) ; qsort(functions,i,sizeof *functions,SortFnByName); - if ((ret=lh_new(LHASH_HASH_FN(hash), - LHASH_COMP_FN(cmp))) == NULL) + if ((ret=lh_new(hash, cmp)) == NULL) return(NULL); for (f=functions; f->name != NULL; f++) @@ -363,12 +366,15 @@ static LHASH *prog_init(void) return(ret); } -static int MS_CALLBACK cmp(FUNCTION *a, FUNCTION *b) +/* static int MS_CALLBACK cmp(FUNCTION *a, FUNCTION *b) */ +static int MS_CALLBACK cmp(void *a_void, void *b_void) { - return(strncmp(a->name,b->name,8)); + return(strncmp(((FUNCTION *)a_void)->name, + ((FUNCTION *)b_void)->name,8)); } -static unsigned long MS_CALLBACK hash(FUNCTION *a) +/* static unsigned long MS_CALLBACK hash(FUNCTION *a) */ +static unsigned long MS_CALLBACK hash(void *a_void) { - return(lh_strhash(a->name)); + return(lh_strhash(((FUNCTION *)a_void)->name)); } |