zig

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

commit 80ae27bc844ce7fe18bc686ce4befa24ab0f86bb (tree)
parent 5f4c9a7449bf891fdc0f2bb2e1f9c205031b2237
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Sat, 23 Sep 2023 13:23:26 -0700

resinator: fix 32-bit builds

This is unfortunately not caught by the CI because the resinator code is
not enabled unless `-Denable-llvm` is used.

Diffstat:
Msrc/resinator/compile.zig | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/resinator/compile.zig b/src/resinator/compile.zig @@ -828,7 +828,7 @@ pub const Compiler = struct { try writeResourceDataNoPadding(writer, file_reader, @intCast(bitmap_info.getActualPaletteByteLen())); const padding_bytes = bitmap_info.getMissingPaletteByteLen(); if (padding_bytes > 0) { - try writer.writeByteNTimes(0, padding_bytes); + try writer.writeByteNTimes(0, @intCast(padding_bytes)); } } try file.seekTo(bitmap_info.pixel_data_offset); @@ -2866,7 +2866,8 @@ pub fn HeaderSlurpingReader(comptime size: usize, comptime ReaderType: anytype) if (self.bytes_read < size) { const bytes_to_add = @min(amt, size - self.bytes_read); const end_index = self.bytes_read + bytes_to_add; - std.mem.copy(u8, self.slurped_header[self.bytes_read..end_index], buf[0..bytes_to_add]); + const dest = self.slurped_header[@intCast(self.bytes_read)..@intCast(end_index)]; + std.mem.copy(u8, dest, buf[0..bytes_to_add]); } self.bytes_read += amt; return amt;