From 5f9ecb8566645f16ff9bf8527c92c7db9baf9719 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 14 Jan 2016 02:52:33 -0700 Subject: instead of 'as' to cast, call type as function --- std/std.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'std/std.zig') diff --git a/std/std.zig b/std/std.zig index 667210f433..f19578aba0 100644 --- a/std/std.zig +++ b/std/std.zig @@ -43,7 +43,7 @@ pub fn readline(buf: []u8, out_len: &usize) bool => { if (amt_read < 0) { return true; } - *out_len = amt_read as usize; + *out_len = usize(amt_read); return false; } @@ -94,9 +94,9 @@ const max_u64_base10_digits: usize = 20; fn buf_print_i64(out_buf: []u8, x: i64) usize => { if (x < 0) { out_buf[0] = '-'; - return 1 + buf_print_u64(out_buf[1...], ((-(x + 1)) as u64) + 1); + return 1 + buf_print_u64(out_buf[1...], u64(-(x + 1)) + 1); } else { - return buf_print_u64(out_buf, x as u64); + return buf_print_u64(out_buf, u64(x)); } } @@ -108,7 +108,7 @@ fn buf_print_u64(out_buf: []u8, x: u64) usize => { while (true) { const digit = a % 10; index -= 1; - buf[index] = '0' + (digit as u8); + buf[index] = '0' + u8(digit); a /= 10; if (a == 0) break; -- cgit v1.2.3