overflow intrinsics take type as first argument

This commit is contained in:
Andrew Kelley
2016-01-14 17:04:35 -07:00
parent 68c4f617ed
commit 0c9afede9e
6 changed files with 183 additions and 199 deletions

View File

@@ -61,12 +61,12 @@ pub fn parse_u64(buf: []u8, radix: u8, result: &u64) bool => {
}
// x *= radix
if (@mul_with_overflow_u64(x, radix, &x)) {
if (@mul_with_overflow(u64, x, radix, &x)) {
return true;
}
// x += digit
if (@add_with_overflow_u64(x, digit, &x)) {
if (@add_with_overflow(u64, x, digit, &x)) {
return true;
}