From 76f909edebf86a5d46d24a9dcf897f2cc3ded86d Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 14 May 2016 12:38:27 -0700 Subject: [PATCH] std: take advantage of ability to cast maybe pointer to isize --- std/linux.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/std/linux.zig b/std/linux.zig index 7ce3a9ce08..eceb9a8fa5 100644 --- a/std/linux.zig +++ b/std/linux.zig @@ -226,9 +226,7 @@ pub fn get_errno(r: isize) -> isize { } pub fn mmap(address: ?&u8, length: isize, prot: isize, flags: isize, fd: isize, offset: isize) -> isize { - // TODO ability to cast maybe pointer to isize - const addr = if (const unwrapped ?= address) isize(unwrapped) else 0; - arch.syscall6(arch.SYS_mmap, addr, length, prot, flags, fd, offset) + arch.syscall6(arch.SYS_mmap, isize(address), length, prot, flags, fd, offset) } pub fn munmap(address: &u8, length: isize) -> isize {