From e411467e1dd4557bb11698f2a5d979dfcbaea444 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 14 Dec 2015 02:46:37 -0700 Subject: add number literal type it gets implicitly casted to whatever is needed. closes #24 --- std/std.zig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'std/std.zig') 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); } -- cgit v1.2.3