Skip to content

Commit

Permalink
fix rustc clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbai committed Jul 3, 2024
1 parent 79e0bff commit 864662b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion openssl-sys/src/bio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ cfg_if! {
BIO_ctrl(bio, BIO_CTRL_DGRAM_GET_NO_TRUNC, 0, ptr::null_mut()) as c_int
}
pub unsafe fn BIO_dgram_set_no_trunc(bio: *mut BIO, enable: c_int) -> c_int {
BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_NO_TRUNC, enable, ptr::null_mut()) as c_int
BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_NO_TRUNC, enable as c_long, ptr::null_mut()) as c_int
}
pub unsafe fn BIO_dgram_get_cap(bio: *mut BIO) -> u32 {
BIO_ctrl(bio, BIO_CTRL_DGRAM_GET_CAPS, 0, ptr::null_mut()) as u32
Expand Down
4 changes: 2 additions & 2 deletions openssl-sys/src/err.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pub const ERR_LIB_ASN1: c_int = 13;

cfg_if! {
if #[cfg(ossl300)] {
pub const ERR_SYSTEM_FLAG: c_ulong = c_int::max_value() as c_ulong + 1;
pub const ERR_SYSTEM_MASK: c_ulong = c_int::max_value() as c_ulong;
pub const ERR_SYSTEM_FLAG: c_ulong = c_int::MAX as c_ulong + 1;
pub const ERR_SYSTEM_MASK: c_ulong = c_int::MAX as c_ulong;

pub const ERR_LIB_OFFSET: c_ulong = 23;
pub const ERR_LIB_MASK: c_ulong = 0xff;
Expand Down
20 changes: 18 additions & 2 deletions openssl-sys/src/tls1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,16 @@ pub unsafe fn SSL_CTX_set_tlsext_servername_callback__fixed_rust(
ctx: *mut SSL_CTX,
cb: Option<unsafe extern "C" fn(*mut SSL, *mut c_int, *mut c_void) -> c_int>,
) -> c_long {
SSL_CTX_callback_ctrl__fixed_rust(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, mem::transmute(cb))
SSL_CTX_callback_ctrl__fixed_rust(
ctx,
SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,
mem::transmute::<
std::option::Option<
unsafe extern "C" fn(*mut SSL, *mut c_int, *mut libc::c_void) -> i32,
>,
std::option::Option<unsafe extern "C" fn()>,
>(cb),
)
}

pub const SSL_TLSEXT_ERR_OK: c_int = 0;
Expand All @@ -90,7 +99,14 @@ pub unsafe fn SSL_CTX_set_tlsext_status_cb(
ctx: *mut SSL_CTX,
cb: Option<unsafe extern "C" fn(*mut SSL, *mut c_void) -> c_int>,
) -> c_long {
SSL_CTX_callback_ctrl__fixed_rust(ctx, SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB, mem::transmute(cb))
SSL_CTX_callback_ctrl__fixed_rust(
ctx,
SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,
mem::transmute::<
std::option::Option<unsafe extern "C" fn(*mut SSL, *mut c_void) -> i32>,
std::option::Option<unsafe extern "C" fn()>,
>(cb),
)
}

pub unsafe fn SSL_CTX_set_tlsext_status_arg(ctx: *mut SSL_CTX, arg: *mut c_void) -> c_long {
Expand Down

0 comments on commit 864662b

Please sign in to comment.