zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit b177e17d155c2f300188d82ea2753bbfd5d29038 (tree)
parent 546212ff7baee86d3408c465e906b52e2e585fe1
Author: xdBronch <51252236+xdBronch@users.noreply.github.com>
Date:   Thu, 13 Jul 2023 21:04:30 -0400

fix alignment error in uefi FileInfo protocol

previously complained about `[*]const u8` having alignment 1 and `[*:0]const u16` having alignment 2
Diffstat:
Mlib/std/os/uefi/protocols/file_protocol.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/os/uefi/protocols/file_protocol.zig b/lib/std/os/uefi/protocols/file_protocol.zig @@ -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;