diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-01-10 00:03:31 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-01-10 00:03:31 -0700 |
| commit | 49d0971cd4f6aa3f897a0f36272c05c641e25f79 (patch) | |
| tree | 38a52e168cbcf30efddb4b01f4431b4e5c19a30a /std/std.zig | |
| parent | 1fe1235e14cd599c1b3a6f079670b7cb7ea270d2 (diff) | |
| download | zig-49d0971cd4f6aa3f897a0f36272c05c641e25f79.tar.gz zig-49d0971cd4f6aa3f897a0f36272c05c641e25f79.zip | |
detect and report top level decl dependency loop
Diffstat (limited to 'std/std.zig')
| -rw-r--r-- | std/std.zig | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/std/std.zig b/std/std.zig index d42074a340..e1b66d9cb1 100644 --- a/std/std.zig +++ b/std/std.zig @@ -24,8 +24,7 @@ pub fn fprint_str(fd: isize, str: []const u8) -> isize { // TODO handle buffering and flushing (mutex protected) // TODO error handling pub fn print_u64(x: u64) -> isize { - // TODO use max_u64_base10_digits instead of hardcoding 20 - var buf: [20]u8; + var buf: [max_u64_base10_digits]u8; const len = buf_print_u64(buf, x); return write(stdout_fileno, buf.ptr, len); } @@ -33,8 +32,7 @@ pub fn print_u64(x: u64) -> isize { // TODO handle buffering and flushing (mutex protected) // TODO error handling pub fn print_i64(x: i64) -> isize { - // TODO use max_u64_base10_digits instead of hardcoding 20 - var buf: [20]u8; + var buf: [max_u64_base10_digits]u8; const len = buf_print_i64(buf, x); return write(stdout_fileno, buf.ptr, len); } |
