From d84dafa9106abfe1c18dd4c39fce82b077b6fa66 Mon Sep 17 00:00:00 2001 From: Mathew Gordon Date: Tue, 27 Feb 2024 21:35:27 -0700 Subject: [PATCH] Fix x86 build --- lib/Table.zig | 3 ++- lib/squashfuse.zig | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Table.zig b/lib/Table.zig index a813194..acbdb79 100644 --- a/lib/Table.zig +++ b/lib/Table.zig @@ -62,7 +62,8 @@ pub fn get( var bpos = table.blocks[bnum]; - const block = try sqfs.mdCache(allocator, &bpos); + // TODO: Update functions to u64 + const block = try sqfs.mdCache(allocator, @ptrCast(&bpos)); @memcpy(buf[0..table.each], block.data[off..][0..table.each]); diff --git a/lib/squashfuse.zig b/lib/squashfuse.zig index 80d55c6..09a00e3 100644 --- a/lib/squashfuse.zig +++ b/lib/squashfuse.zig @@ -544,7 +544,7 @@ pub const SquashFs = struct { ); offset.* = inode.internal.xtra.reg.frag_off; - size.* = inode.internal.xtra.reg.file_size % sqfs.internal.sb.block_size; + size.* = @intCast(inode.internal.xtra.reg.file_size % sqfs.internal.sb.block_size); return block; } @@ -1005,7 +1005,7 @@ pub const SquashFs = struct { pub fn fromInodeId(id: u64, base: u64) MdCursor { return .{ .block = @intCast((id >> 16) + base), - .offset = id & 0xffff, + .offset = @intCast(id & 0xffff), }; } }; @@ -1124,7 +1124,7 @@ fn readRange( data_off = 0; if (bl.input_size == 0) { - data_size = file_size - bl.pos; + data_size = @intCast(file_size - bl.pos); if (data_size > block_size) data_size = block_size; } else {