mach: update to @min/@max (std.math.min/max is going away) (#774)

this commit is the beginning scope for resolving #771
This commit is contained in:
sophia 2023-05-16 04:36:13 -04:00 committed by GitHub
parent edf34cf00d
commit ef7b079149
Failed to generate hash of commit
2 changed files with 2 additions and 5 deletions

View file

@ -1880,7 +1880,7 @@ pub fn peekToken(
pub fn advanceToken(p: *Parser) Ast.Index { pub fn advanceToken(p: *Parser) Ast.Index {
const prev = p.tok_i; const prev = p.tok_i;
p.tok_i = std.math.min(prev +| 1, p.tokens.len); p.tok_i = @min(prev +| 1, p.tokens.len);
return prev; return prev;
} }

View file

@ -311,10 +311,7 @@ pub const Player = struct {
} }
const stride = self.format.frameSize(self.channels.len); const stride = self.format.frameSize(self.channels.len);
const n_frames = std.math.min( const n_frames = @min(buf.*.requested, buf.*.buffer.*.datas[0].maxsize / stride);
buf.*.requested,
buf.*.buffer.*.datas[0].maxsize / stride,
);
buf.*.buffer.*.datas[0].chunk.*.stride = stride; buf.*.buffer.*.datas[0].chunk.*.stride = stride;
buf.*.buffer.*.datas[0].chunk.*.size = n_frames * stride; buf.*.buffer.*.datas[0].chunk.*.size = n_frames * stride;