diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2015-12-14 02:46:37 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2015-12-14 02:46:37 -0700 |
| commit | e411467e1dd4557bb11698f2a5d979dfcbaea444 (patch) | |
| tree | 8b9bf14a1dee5310a8e18099fc354e1b9b1d2152 /std/std.zig | |
| parent | 3d8eb10897a86b2616c6a1aa843b7ebe4134ac51 (diff) | |
| download | zig-e411467e1dd4557bb11698f2a5d979dfcbaea444.tar.gz zig-e411467e1dd4557bb11698f2a5d979dfcbaea444.zip | |
add number literal type
it gets implicitly casted to whatever is needed.
closes #24
Diffstat (limited to 'std/std.zig')
| -rw-r--r-- | std/std.zig | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/std/std.zig b/std/std.zig index ebb6e9e2b5..08036d73ee 100644 --- a/std/std.zig +++ b/std/std.zig @@ -15,10 +15,9 @@ fn syscall3(number: isize, arg1: isize, arg2: isize, arg3: isize) -> isize { // TODO error handling // TODO handle buffering and flushing -// TODO non-i32 integer literals so we can remove the casts // TODO constants for SYS_write and stdout_fileno pub fn print_str(str : string) -> isize { - let SYS_write = 1; - let stdout_fileno = 1; - return syscall3(SYS_write as isize, stdout_fileno as isize, str.ptr as isize, str.len as isize); + let SYS_write : isize = 1; + let stdout_fileno : isize = 1; + return syscall3(SYS_write, stdout_fileno, str.ptr as isize, str.len as isize); } |
