authorgravatar for me@gasinfinity.devGasInfinity <me@gasinfinity.dev> 2025-10-27 11:13:25+01:00
committergravatar for me@gasinfinity.devGasInfinity <me@gasinfinity.dev> 2025-10-27 11:13:25+01:00
log914acf13cba7adc4e55734d85f60ab09e7fdf8ac
tree8a0e989247089ffca69bf5068a227081c34e9251
parentfeb05a716d1ae105cf0e8f9966b6ade7f32dc680
signaturebadge-check Signed by SSH key SHA256:p3IHbr0lyK2ekfDC1Zi7dOEV/9T6lGghNawhl5sBnM4

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


1 files changed, 3 insertions(+), 2 deletions(-)

lib/std/zig/target.zig+3-2
......@@ -472,8 +472,9 @@ fn eqlIgnoreCase(ignore_case: bool, a: []const u8, b: []const u8) bool {
472472 }
473473}
474474
475pub fn intByteSize(target: *const std.Target, bits: u16) u19 {
476 return std.mem.alignForward(u19, @intCast((@as(u17, bits) + 7) / 8), intAlignment(target, bits));
475pub fn intByteSize(target: *const std.Target, bits: u16) u16 {
476 const previous_aligned = std.mem.alignBackward(u16, bits, 8);
477 return std.mem.alignForward(u16, @divExact(previous_aligned, 8) + @intFromBool(previous_aligned != bits), intAlignment(target, bits));
477478}
478479
479480pub fn intAlignment(target: *const std.Target, bits: u16) u16 {