diff options
Diffstat (limited to 'crypto/objects')
-rw-r--r-- | crypto/objects/o_names.c | 20 | ||||
-rw-r--r-- | crypto/objects/obj_dat.c | 6 |
2 files changed, 6 insertions, 20 deletions
diff --git a/crypto/objects/o_names.c b/crypto/objects/o_names.c index df6240bfd0..f7216f210e 100644 --- a/crypto/objects/o_names.c +++ b/crypto/objects/o_names.c @@ -42,20 +42,15 @@ static STACK_OF(NAME_FUNCS) *name_funcs_stack; * casting without the need for macro-generated wrapper functions. */ -/* static unsigned long obj_name_hash(OBJ_NAME *a); */ -static unsigned long obj_name_hash(const void *a_void); -/* static int obj_name_cmp(OBJ_NAME *a,OBJ_NAME *b); */ -static int obj_name_cmp(const void *a_void, const void *b_void); - -static IMPLEMENT_LHASH_HASH_FN(obj_name, OBJ_NAME) -static IMPLEMENT_LHASH_COMP_FN(obj_name, OBJ_NAME) +static unsigned long obj_name_hash(const OBJ_NAME *a); +static int obj_name_cmp(const OBJ_NAME *a, const OBJ_NAME *b); int OBJ_NAME_init(void) { if (names_lh != NULL) return (1); CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); - names_lh = lh_OBJ_NAME_new(); + names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp); CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); return (names_lh != NULL); } @@ -103,12 +98,9 @@ int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *), return (ret); } -/* static int obj_name_cmp(OBJ_NAME *a, OBJ_NAME *b) */ -static int obj_name_cmp(const void *a_void, const void *b_void) +static int obj_name_cmp(const OBJ_NAME *a, const OBJ_NAME *b) { int ret; - const OBJ_NAME *a = (const OBJ_NAME *)a_void; - const OBJ_NAME *b = (const OBJ_NAME *)b_void; ret = a->type - b->type; if (ret == 0) { @@ -122,11 +114,9 @@ static int obj_name_cmp(const void *a_void, const void *b_void) return (ret); } -/* static unsigned long obj_name_hash(OBJ_NAME *a) */ -static unsigned long obj_name_hash(const void *a_void) +static unsigned long obj_name_hash(const OBJ_NAME *a) { unsigned long ret; - const OBJ_NAME *a = (const OBJ_NAME *)a_void; if ((name_funcs_stack != NULL) && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) { diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index 51a44a285f..cbd6e346c1 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -134,8 +134,6 @@ static unsigned long added_obj_hash(const ADDED_OBJ *ca) return (ret); } -static IMPLEMENT_LHASH_HASH_FN(added_obj, ADDED_OBJ) - static int added_obj_cmp(const ADDED_OBJ *ca, const ADDED_OBJ *cb) { ASN1_OBJECT *a, *b; @@ -174,13 +172,11 @@ static int added_obj_cmp(const ADDED_OBJ *ca, const ADDED_OBJ *cb) } } -static IMPLEMENT_LHASH_COMP_FN(added_obj, ADDED_OBJ) - static int init_added(void) { if (added != NULL) return (1); - added = lh_ADDED_OBJ_new(); + added = lh_ADDED_OBJ_new(added_obj_hash, added_obj_cmp); return (added != NULL); } |