summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/ameth_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2008-10-22 15:43:01 +0000
committerDr. Stephen Henson <steve@openssl.org>2008-10-22 15:43:01 +0000
commite19106f5fb7da7db15449a9a50f9be9047800757 (patch)
tree0341d860168821112fb47ded07b1f761895c04cd /crypto/asn1/ameth_lib.c
parentae7ec4c71de74fa52c5d89e32e28445c6602990d (diff)
Create function of the form OBJ_bsearch_xxx() in bsearch typesafe macros
with the appropriate parameters which calls OBJ_bsearch(). A compiler will typically inline this. This avoids the need for cmp_xxx variables and fixes unchecked const issues with CHECKED_PTR_OF()
Diffstat (limited to 'crypto/asn1/ameth_lib.c')
-rw-r--r--crypto/asn1/ameth_lib.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c
index fee7198b85..5063191515 100644
--- a/crypto/asn1/ameth_lib.c
+++ b/crypto/asn1/ameth_lib.c
@@ -113,7 +113,7 @@ void main()
#endif
DECLARE_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_ASN1_METHOD *,
- const EVP_PKEY_ASN1_METHOD *, ameth_cmp);
+ const EVP_PKEY_ASN1_METHOD *, ameth);
static int ameth_cmp(const EVP_PKEY_ASN1_METHOD * const *a,
const EVP_PKEY_ASN1_METHOD * const *b)
@@ -122,7 +122,7 @@ static int ameth_cmp(const EVP_PKEY_ASN1_METHOD * const *a,
}
IMPLEMENT_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_ASN1_METHOD *,
- const EVP_PKEY_ASN1_METHOD *, ameth_cmp);
+ const EVP_PKEY_ASN1_METHOD *, ameth);
int EVP_PKEY_asn1_get_count(void)
{
@@ -155,11 +155,9 @@ static const EVP_PKEY_ASN1_METHOD *pkey_asn1_find(int type)
if (idx >= 0)
return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
}
- ret = OBJ_bsearch(const EVP_PKEY_ASN1_METHOD *, &t,
- const EVP_PKEY_ASN1_METHOD *, standard_methods,
+ ret = OBJ_bsearch_ameth(&t, standard_methods,
sizeof(standard_methods)
- /sizeof(EVP_PKEY_ASN1_METHOD *),
- ameth_cmp);
+ /sizeof(EVP_PKEY_ASN1_METHOD *));
if (!ret || !*ret)
return NULL;
return *ret;