Skip to content

Commit 864662b

Browse files
committed
fix rustc clippy errors
1 parent 79e0bff commit 864662b

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

openssl-sys/src/bio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ cfg_if! {
8989
BIO_ctrl(bio, BIO_CTRL_DGRAM_GET_NO_TRUNC, 0, ptr::null_mut()) as c_int
9090
}
9191
pub unsafe fn BIO_dgram_set_no_trunc(bio: *mut BIO, enable: c_int) -> c_int {
92-
BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_NO_TRUNC, enable, ptr::null_mut()) as c_int
92+
BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_NO_TRUNC, enable as c_long, ptr::null_mut()) as c_int
9393
}
9494
pub unsafe fn BIO_dgram_get_cap(bio: *mut BIO) -> u32 {
9595
BIO_ctrl(bio, BIO_CTRL_DGRAM_GET_CAPS, 0, ptr::null_mut()) as u32

openssl-sys/src/err.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ pub const ERR_LIB_ASN1: c_int = 13;
99

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

1515
pub const ERR_LIB_OFFSET: c_ulong = 23;
1616
pub const ERR_LIB_MASK: c_ulong = 0xff;

openssl-sys/src/tls1.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@ pub unsafe fn SSL_CTX_set_tlsext_servername_callback__fixed_rust(
7474
ctx: *mut SSL_CTX,
7575
cb: Option<unsafe extern "C" fn(*mut SSL, *mut c_int, *mut c_void) -> c_int>,
7676
) -> c_long {
77-
SSL_CTX_callback_ctrl__fixed_rust(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, mem::transmute(cb))
77+
SSL_CTX_callback_ctrl__fixed_rust(
78+
ctx,
79+
SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,
80+
mem::transmute::<
81+
std::option::Option<
82+
unsafe extern "C" fn(*mut SSL, *mut c_int, *mut libc::c_void) -> i32,
83+
>,
84+
std::option::Option<unsafe extern "C" fn()>,
85+
>(cb),
86+
)
7887
}
7988

8089
pub const SSL_TLSEXT_ERR_OK: c_int = 0;
@@ -90,7 +99,14 @@ pub unsafe fn SSL_CTX_set_tlsext_status_cb(
9099
ctx: *mut SSL_CTX,
91100
cb: Option<unsafe extern "C" fn(*mut SSL, *mut c_void) -> c_int>,
92101
) -> c_long {
93-
SSL_CTX_callback_ctrl__fixed_rust(ctx, SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB, mem::transmute(cb))
102+
SSL_CTX_callback_ctrl__fixed_rust(
103+
ctx,
104+
SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,
105+
mem::transmute::<
106+
std::option::Option<unsafe extern "C" fn(*mut SSL, *mut c_void) -> i32>,
107+
std::option::Option<unsafe extern "C" fn()>,
108+
>(cb),
109+
)
94110
}
95111

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

0 commit comments

Comments
 (0)