Skip to content

Commit

Permalink
avoid FFI warning
Browse files Browse the repository at this point in the history
```
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 <[email protected]>
  • Loading branch information
JohnAZoidberg committed Aug 10, 2024
1 parent 25dff5f commit af281b2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions uefi-raw/src/protocol/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -153,7 +152,7 @@ pub struct FileInfo {
last_access_time: Time,
modification_time: Time,
attribute: FileAttribute,
file_name: [Char16],
file_name: *const Char16,
}

/// TODO
Expand Down

0 comments on commit af281b2

Please sign in to comment.