summaryrefslogtreecommitdiffstats
path: root/crypto/x509
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/x509
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/x509')
-rw-r--r--crypto/x509/x509_vpm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/crypto/x509/x509_vpm.c b/crypto/x509/x509_vpm.c
index 5c018e9832..ce8e676c2b 100644
--- a/crypto/x509/x509_vpm.c
+++ b/crypto/x509/x509_vpm.c
@@ -363,9 +363,9 @@ static int table_cmp(const X509_VERIFY_PARAM *a, const X509_VERIFY_PARAM *b)
}
DECLARE_OBJ_BSEARCH_CMP_FN(X509_VERIFY_PARAM, X509_VERIFY_PARAM,
- table_cmp);
+ table);
IMPLEMENT_OBJ_BSEARCH_CMP_FN(X509_VERIFY_PARAM, X509_VERIFY_PARAM,
- table_cmp);
+ table);
static int param_cmp(const X509_VERIFY_PARAM * const *a,
const X509_VERIFY_PARAM * const *b)
@@ -410,10 +410,8 @@ const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name)
if (idx != -1)
return sk_X509_VERIFY_PARAM_value(param_table, idx);
}
- return OBJ_bsearch(const X509_VERIFY_PARAM, &pm,
- const X509_VERIFY_PARAM, default_table,
- sizeof(default_table)/sizeof(X509_VERIFY_PARAM),
- table_cmp);
+ return OBJ_bsearch_table(&pm, default_table,
+ sizeof(default_table)/sizeof(X509_VERIFY_PARAM));
}
void X509_VERIFY_PARAM_table_cleanup(void)