aboutsummaryrefslogtreecommitdiff
path: root/std/std.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-14 02:52:33 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-14 02:52:33 -0700
commit5f9ecb8566645f16ff9bf8527c92c7db9baf9719 (patch)
tree539e1d309e50a96ee243623e0788fb5cca4a5efe /std/std.zig
parentd121ed961ac9fa58a5a6e2695dc62dbb01c60523 (diff)
downloadzig-5f9ecb8566645f16ff9bf8527c92c7db9baf9719.tar.gz
zig-5f9ecb8566645f16ff9bf8527c92c7db9baf9719.zip
instead of 'as' to cast, call type as function
Diffstat (limited to 'std/std.zig')
-rw-r--r--std/std.zig8
1 files changed, 4 insertions, 4 deletions
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;