diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2015-12-24 16:07:21 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-01-11 17:50:27 +0000 |
commit | 63c75cd688352b83afd7f874b89139e282647046 (patch) | |
tree | 98d1484260069de69440e4f53c8f7406aa1a3140 /include | |
parent | 62d0577e0d5e3703436d0fba362d516481291810 (diff) |
Add lh_doall inlining
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/lhash.h | 15 | ||||
-rw-r--r-- | include/openssl/safestack.h | 12 |
2 files changed, 5 insertions, 22 deletions
diff --git a/include/openssl/lhash.h b/include/openssl/lhash.h index 057c831dd8..20d799bd6d 100644 --- a/include/openssl/lhash.h +++ b/include/openssl/lhash.h @@ -113,15 +113,6 @@ typedef void (*LHASH_DOALL_ARG_FN_TYPE) (void *, void *); return name##_cmp(a,b); } # define LHASH_COMP_FN(name) name##_LHASH_COMP -/* Third: "doall" functions */ -# define DECLARE_LHASH_DOALL_FN(name, o_type) \ - void name##_LHASH_DOALL(void *); -# define IMPLEMENT_LHASH_DOALL_FN(name, o_type) \ - void name##_LHASH_DOALL(void *arg) { \ - o_type *a = arg; \ - name##_doall(a); } -# define LHASH_DOALL_FN(name) name##_LHASH_DOALL - /* Fourth: "doall_arg" functions */ # define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \ void name##_LHASH_DOALL_ARG(void *, void *); @@ -246,13 +237,17 @@ void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out); { \ lh_set_down_load((_LHASH *)lh, dl); \ } \ + static inline void lh_##type##_doall(LHASH_OF(type) *lh, \ + void (*doall)(type *)) \ + { \ + lh_doall((_LHASH *)lh, (LHASH_DOALL_FN_TYPE)doall); \ + } \ LHASH_OF(type) # define CHECKED_LHASH_OF(type,lh) \ ((_LHASH *)CHECKED_PTR_OF(LHASH_OF(type),lh)) /* Define wrapper functions. */ -# define LHM_lh_doall(type, lh,fn) lh_doall(CHECKED_LHASH_OF(type, lh), fn) # define LHM_lh_doall_arg(type, lh, fn, arg_type, arg) \ lh_doall_arg(CHECKED_LHASH_OF(type, lh), fn, CHECKED_PTR_OF(arg_type, arg)) diff --git a/include/openssl/safestack.h b/include/openssl/safestack.h index 43493fc1e0..c6adbbee19 100644 --- a/include/openssl/safestack.h +++ b/include/openssl/safestack.h @@ -231,51 +231,39 @@ DEFINE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) */ -# define lh_ADDED_OBJ_doall(lh,fn) LHM_lh_doall(ADDED_OBJ,lh,fn) # define lh_ADDED_OBJ_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(ADDED_OBJ,lh,fn,arg_type,arg) -# define lh_APP_INFO_doall(lh,fn) LHM_lh_doall(APP_INFO,lh,fn) # define lh_APP_INFO_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(APP_INFO,lh,fn,arg_type,arg) -# define lh_CONF_VALUE_doall(lh,fn) LHM_lh_doall(CONF_VALUE,lh,fn) # define lh_CONF_VALUE_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(CONF_VALUE,lh,fn,arg_type,arg) -# define lh_ENGINE_PILE_doall(lh,fn) LHM_lh_doall(ENGINE_PILE,lh,fn) # define lh_ENGINE_PILE_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(ENGINE_PILE,lh,fn,arg_type,arg) -# define lh_ERR_STATE_doall(lh,fn) LHM_lh_doall(ERR_STATE,lh,fn) # define lh_ERR_STATE_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(ERR_STATE,lh,fn,arg_type,arg) -# define lh_ERR_STRING_DATA_doall(lh,fn) LHM_lh_doall(ERR_STRING_DATA,lh,fn) # define lh_ERR_STRING_DATA_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(ERR_STRING_DATA,lh,fn,arg_type,arg) -# define lh_FUNCTION_doall(lh,fn) LHM_lh_doall(FUNCTION,lh,fn) # define lh_FUNCTION_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(FUNCTION,lh,fn,arg_type,arg) -# define lh_MEM_doall(lh,fn) LHM_lh_doall(MEM,lh,fn) # define lh_MEM_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(MEM,lh,fn,arg_type,arg) -# define lh_OBJ_NAME_doall(lh,fn) LHM_lh_doall(OBJ_NAME,lh,fn) # define lh_OBJ_NAME_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(OBJ_NAME,lh,fn,arg_type,arg) -# define lh_OPENSSL_CSTRING_doall(lh,fn) LHM_lh_doall(OPENSSL_CSTRING,lh,fn) # define lh_OPENSSL_CSTRING_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(OPENSSL_CSTRING,lh,fn,arg_type,arg) -# define lh_OPENSSL_STRING_doall(lh,fn) LHM_lh_doall(OPENSSL_STRING,lh,fn) # define lh_OPENSSL_STRING_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(OPENSSL_STRING,lh,fn,arg_type,arg) -# define lh_SSL_SESSION_doall(lh,fn) LHM_lh_doall(SSL_SESSION,lh,fn) # define lh_SSL_SESSION_doall_arg(lh,fn,arg_type,arg) \ LHM_lh_doall_arg(SSL_SESSION,lh,fn,arg_type,arg) |