DSO_bind() is effectively a method-specific wrapper for dlopen() or

whatever the underlying API is. It must return (void *) because shared
libraries can expose functions, structures, or whatever. However, some
compilers give loads of warnings about casted function pointers through
this code, so I am explicitly casting them to the right prototypes.
This commit is contained in:
Geoff Thorpe 2000-06-14 14:28:16 +00:00
parent 28e94dc70d
commit 4c4ea428cc
2 changed files with 22 additions and 11 deletions

View File

@ -263,10 +263,14 @@ static int cswift_init()
ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_DSO_FAILURE); ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_DSO_FAILURE);
goto err; goto err;
} }
if(!(p1 = DSO_bind(cswift_dso, CSWIFT_F1)) || if(!(p1 = (t_swAcquireAccContext *)
!(p2 = DSO_bind(cswift_dso, CSWIFT_F2)) || DSO_bind(cswift_dso, CSWIFT_F1)) ||
!(p3 = DSO_bind(cswift_dso, CSWIFT_F3)) || !(p2 = (t_swAttachKeyParam *)
!(p4 = DSO_bind(cswift_dso, CSWIFT_F4))) DSO_bind(cswift_dso, CSWIFT_F2)) ||
!(p3 = (t_swSimpleRequest *)
DSO_bind(cswift_dso, CSWIFT_F3)) ||
!(p4 = (t_swReleaseAccContext *)
DSO_bind(cswift_dso, CSWIFT_F4)))
{ {
ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_DSO_FAILURE); ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_DSO_FAILURE);
goto err; goto err;

View File

@ -366,13 +366,20 @@ static int hwcrhk_init()
ENGINEerr(ENGINE_F_HWCRHK_INIT,ENGINE_R_DSO_FAILURE); ENGINEerr(ENGINE_F_HWCRHK_INIT,ENGINE_R_DSO_FAILURE);
goto err; goto err;
} }
if(!(p1 = DSO_bind(hwcrhk_dso, n_hwcrhk_Init)) || if(!(p1 = (HWCryptoHook_Init_t *)
!(p2 = DSO_bind(hwcrhk_dso, n_hwcrhk_Finish)) || DSO_bind(hwcrhk_dso, n_hwcrhk_Init)) ||
!(p3 = DSO_bind(hwcrhk_dso, n_hwcrhk_ModExp)) || !(p2 = (HWCryptoHook_Finish_t *)
!(p4 = DSO_bind(hwcrhk_dso, n_hwcrhk_RSA)) || DSO_bind(hwcrhk_dso, n_hwcrhk_Finish)) ||
!(p5 = DSO_bind(hwcrhk_dso, n_hwcrhk_RSAUnloadKey)) || !(p3 = (HWCryptoHook_ModExp_t *)
!(p6 = DSO_bind(hwcrhk_dso, n_hwcrhk_RandomBytes)) || DSO_bind(hwcrhk_dso, n_hwcrhk_ModExp)) ||
!(p7 = DSO_bind(hwcrhk_dso, n_hwcrhk_ModExpCRT))) !(p4 = (HWCryptoHook_RSA_t *)
DSO_bind(hwcrhk_dso, n_hwcrhk_RSA)) ||
!(p5 = (HWCryptoHook_RSAUnloadKey_t *)
DSO_bind(hwcrhk_dso, n_hwcrhk_RSAUnloadKey)) ||
!(p6 = (HWCryptoHook_RandomBytes_t *)
DSO_bind(hwcrhk_dso, n_hwcrhk_RandomBytes)) ||
!(p7 = (HWCryptoHook_ModExpCRT_t *)
DSO_bind(hwcrhk_dso, n_hwcrhk_ModExpCRT)))
{ {
ENGINEerr(ENGINE_F_HWCRHK_INIT,ENGINE_R_DSO_FAILURE); ENGINEerr(ENGINE_F_HWCRHK_INIT,ENGINE_R_DSO_FAILURE);
goto err; goto err;