fix alignment error in uefi FileInfo protocol

previously complained about `[*]const u8` having alignment 1 and `[*:0]const u16` having alignment 2
This commit is contained in:
xdBronch 2023-07-13 21:04:30 -04:00 committed by Andrew Kelley
parent 546212ff7b
commit b177e17d15

View File

@ -153,7 +153,7 @@ pub const FileInfo = extern struct {
attribute: u64,
pub fn getFileName(self: *const FileInfo) [*:0]const u16 {
return @as([*:0]const u16, @ptrCast(@as([*]const u8, @ptrCast(self)) + @sizeOf(FileInfo)));
return @ptrCast(@alignCast(@as([*]const u8, @ptrCast(self)) + @sizeOf(FileInfo)));
}
pub const efi_file_read_only: u64 = 0x0000000000000001;