Commit 864662b1 authored by bdbai's avatar bdbai
Browse files

fix rustc clippy errors

parent 79e0bff4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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;
+18 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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 {