chore: clippy allow unsafe in ffi

This commit is contained in:
Oskar Thoren 2022-03-16 14:25:13 +08:00
parent 292ece2945
commit 83fc39730f
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
2 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,7 @@ impl<'a> From<&Buffer> for &'a [u8] {
} }
} }
#[allow(clippy::not_unsafe_ptr_arg_deref)]
#[no_mangle] #[no_mangle]
pub extern "C" fn new_circuit(ctx: *mut *mut Multiplier) -> bool { pub extern "C" fn new_circuit(ctx: *mut *mut Multiplier) -> bool {
println!("multiplier ffi: new"); println!("multiplier ffi: new");
@ -38,6 +39,7 @@ pub extern "C" fn new_circuit(ctx: *mut *mut Multiplier) -> bool {
true true
} }
#[allow(clippy::not_unsafe_ptr_arg_deref)]
#[no_mangle] #[no_mangle]
pub extern "C" fn prove(ctx: *const Multiplier, output_buffer: *mut Buffer) -> bool { pub extern "C" fn prove(ctx: *const Multiplier, output_buffer: *mut Buffer) -> bool {
println!("multiplier ffi: prove"); println!("multiplier ffi: prove");
@ -53,6 +55,7 @@ pub extern "C" fn prove(ctx: *const Multiplier, output_buffer: *mut Buffer) -> b
true true
} }
#[allow(clippy::not_unsafe_ptr_arg_deref)]
#[no_mangle] #[no_mangle]
pub extern "C" fn verify( pub extern "C" fn verify(
ctx: *const Multiplier, ctx: *const Multiplier,

View File

@ -28,6 +28,7 @@ impl<'a> From<&Buffer> for &'a [u8] {
} }
} }
#[allow(clippy::not_unsafe_ptr_arg_deref)]
#[no_mangle] #[no_mangle]
pub extern "C" fn new_circuit(ctx: *mut *mut Multiplier) -> bool { pub extern "C" fn new_circuit(ctx: *mut *mut Multiplier) -> bool {
println!("multiplier ffi: new"); println!("multiplier ffi: new");
@ -38,6 +39,7 @@ pub extern "C" fn new_circuit(ctx: *mut *mut Multiplier) -> bool {
true true
} }
#[allow(clippy::not_unsafe_ptr_arg_deref)]
#[no_mangle] #[no_mangle]
pub extern "C" fn prove(ctx: *const Multiplier, output_buffer: *mut Buffer) -> bool { pub extern "C" fn prove(ctx: *const Multiplier, output_buffer: *mut Buffer) -> bool {
println!("multiplier ffi: prove"); println!("multiplier ffi: prove");
@ -53,6 +55,7 @@ pub extern "C" fn prove(ctx: *const Multiplier, output_buffer: *mut Buffer) -> b
true true
} }
#[allow(clippy::not_unsafe_ptr_arg_deref)]
#[no_mangle] #[no_mangle]
pub extern "C" fn verify( pub extern "C" fn verify(
ctx: *const Multiplier, ctx: *const Multiplier,