[crypto,tls] simplify function pointer cast

This commit is contained in:
akallabeth 2024-09-04 12:32:46 +02:00
parent 5aff241096
commit 9776cc109e
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
1 changed files with 3 additions and 9 deletions

View File

@ -313,16 +313,10 @@ static long bio_rdp_tls_ctrl(BIO* bio, int cmd, long num, void* ptr)
* we get a function pointer returned and have to cast it to ULONG_PTR
* to return the value to the caller.
*
* This, of course, is something compilers warn about. So silence it by casting
* by the means of a union */
* This, of course, is something compilers warn about. So silence it by casting */
{
union
{
void (*fkt)(const SSL*, int, int);
ULONG_PTR uptr;
} cnv;
cnv.fkt = SSL_get_info_callback(tls->ssl);
*((ULONG_PTR*)ptr) = cnv.uptr;
void* vptr = (void*)SSL_get_info_callback(tls->ssl);
*((void**)ptr) = vptr;
status = 1;
}
break;