From af281b286c4fd2190672705f58b1b599190020f8 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sat, 10 Aug 2024 21:06:26 +0800 Subject: [PATCH] avoid FFI warning ``` warning: `extern` fn uses type `[u16]`, which is not FFI-safe --> uefi-raw/src/protocol/shell.rs:56:24 | 56 | pub set_file_info: extern "efiapi" fn(file_handle: ShellFileHandle, file_info: &FileInfo) -> Status, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe | = help: consider using a raw pointer instead = note: slices have no C equivalent ``` Signed-off-by: Daniel Schaefer --- uefi-raw/src/protocol/shell.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/uefi-raw/src/protocol/shell.rs b/uefi-raw/src/protocol/shell.rs index 8f62b21d9..0cc215e12 100644 --- a/uefi-raw/src/protocol/shell.rs +++ b/uefi-raw/src/protocol/shell.rs @@ -142,8 +142,7 @@ pub struct ListEntry { } // TODO: Already defined in uefi/src/proto/media/file/info.rs -use ptr_meta::Pointee; -#[derive(Debug, Eq, PartialEq, Pointee)] +#[derive(Debug, Eq, PartialEq)] #[repr(C)] pub struct FileInfo { size: u64, @@ -153,7 +152,7 @@ pub struct FileInfo { last_access_time: Time, modification_time: Time, attribute: FileAttribute, - file_name: [Char16], + file_name: *const Char16, } /// TODO