follow masque interface

This commit is contained in:
Jan Petykiewicz 2026-04-02 20:35:31 -07:00
commit d3bf15f47a

View file

@ -20,7 +20,7 @@ use arrow::ffi::{to_ffi, FFI_ArrowArray, FFI_ArrowSchema};
use arrow::array::Array;
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn read_path(
cpath: *const c_char,
arr: *mut FFI_ArrowArray,
@ -40,7 +40,7 @@ pub unsafe extern "C" fn read_path(
let input = fs::read(path).expect("File read failed");
let (_input, struct_arr) = read_library(&input).expect("Read failed");
(*arr, *schema) = to_ffi(&struct_arr.to_data()).unwrap();
unsafe { (*arr, *schema) = to_ffi(&struct_arr.to_data()).unwrap(); }
}
@ -80,40 +80,40 @@ macro_rules! impl_i32be {
}
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn f64_to_i16(arr: *mut f64, size: usize) -> f64 { impl_i16be!(f64, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn f64_to_i32(arr: *mut f64, size: usize) -> f64 { impl_i32be!(f64, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn f32_to_i16(arr: *mut f32, size: usize) -> f32 { impl_i16be!(f32, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn f32_to_i32(arr: *mut f32, size: usize) -> f32 { impl_i32be!(f32, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn u64_to_i16(arr: *mut u64, size: usize) -> u64 { impl_i16be!(u64, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn u64_to_i32(arr: *mut u64, size: usize) -> u64 { impl_i32be!(u64, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn i64_to_i16(arr: *mut i64, size: usize) -> i64 { impl_i16be!(i64, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn i64_to_i32(arr: *mut i64, size: usize) -> i64 { impl_i32be!(i64, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn u32_to_i16(arr: *mut u32, size: usize) -> u32 { impl_i16be!(u32, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn u32_to_i32(arr: *mut u32, size: usize) -> u32 { impl_i32be!(u32, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn i32_to_i16(arr: *mut i32, size: usize) -> i32 { impl_i16be!(i32, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn i32_to_i32(arr: *mut i32, size: usize) -> i32 { impl_i32be!(i32, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn u16_to_i16(arr: *mut u16, size: usize) -> u16 { impl_i16be!(u16, arr, size) }
#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn i16_to_i16(arr: *mut i16, size: usize) -> i16 { impl_i16be!(i16, arr, size) }