chore: make std.zig.target.intByteSize return an u16

This commit is contained in:
GasInfinity 2025-10-27 11:13:25 +01:00
parent feb05a716d
commit 914acf13cb
No known key found for this signature in database

View File

@ -472,8 +472,9 @@ fn eqlIgnoreCase(ignore_case: bool, a: []const u8, b: []const u8) bool {
}
}
pub fn intByteSize(target: *const std.Target, bits: u16) u19 {
return std.mem.alignForward(u19, @intCast((@as(u17, bits) + 7) / 8), intAlignment(target, bits));
pub fn intByteSize(target: *const std.Target, bits: u16) u16 {
const previous_aligned = std.mem.alignBackward(u16, bits, 8);
return std.mem.alignForward(u16, @divExact(previous_aligned, 8) + @intFromBool(previous_aligned != bits), intAlignment(target, bits));
}
pub fn intAlignment(target: *const std.Target, bits: u16) u16 {