chore: update to latest builtin syntax

This commit is contained in:
2023-07-10 21:20:07 -05:00
parent 954fb279ad
commit d96c9c01ff
25 changed files with 679 additions and 684 deletions

View File

@@ -203,7 +203,7 @@ pub const audio = struct {
/// Sets a quarter (8) of the bits of the u32 `left` to the value of u8 `right`
pub inline fn setQuart(left: u32, addr: u8, right: u8) u32 {
const offset = @truncate(u2, addr);
const offset = @as(u2, @truncate(addr));
return switch (offset) {
0b00 => (left & 0xFFFF_FF00) | right,
@@ -217,11 +217,11 @@ pub inline fn setQuart(left: u32, addr: u8, right: u8) u32 {
///
/// TODO: Support u16 reads of u32 values?
pub inline fn getHalf(byte: u8) u4 {
return @truncate(u4, byte & 1) << 3;
return @as(u4, @truncate(byte & 1)) << 3;
}
pub inline fn setHalf(comptime T: type, left: T, addr: u8, right: HalfInt(T)) T {
const offset = @truncate(u1, addr >> if (T == u32) 1 else 0);
const offset = @as(u1, @truncate(addr >> if (T == u32) 1 else 0));
return switch (T) {
u32 => switch (offset) {