hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 5b1dd37ce863df5825b582d8e1e9d78669cec0bc
parent 36690cd889efe83159a2bf37b8ca1a3f77d37ee9
Author: Ajay R <ar324@protonmail.com>
Date:   Thu, 10 Mar 2022 10:05:44 +0000

fix errors after disallowing assignment of non-void types to void

Signed-off-by: Ajay R <ar324@protonmail.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mhash/hash.ha | 1-
Mrt/+freebsd/syscalls.ha | 4+++-
Mrt/+linux/syscalls.ha | 4+++-
Mrt/+test/run.ha | 4+++-
4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/hash/hash.ha b/hash/hash.ha @@ -35,7 +35,6 @@ export fn write(h: *hash, buf: const []u8) size = export fn finish(h: *hash, buf: []u8) void = { sum(h, buf); io::close(h); - return buf; }; // Closes a hash, freeing its resources and discarding the checksum. diff --git a/rt/+freebsd/syscalls.ha b/rt/+freebsd/syscalls.ha @@ -243,7 +243,9 @@ export fn munmap(addr: *void, length: size) (void | errno) = { wrap_return(syscall2(SYS_munmap, addr: uintptr: u64, length: u64))?; }; -export @noreturn fn exit(status: int) void = syscall1(SYS_exit, status: u64); +export @noreturn fn exit(status: int) void = { + syscall1(SYS_exit, status: u64); +}; export fn kill(pid: int, signal: int) (void | errno) = { wrap_return(syscall2(SYS_kill, pid: u64, signal: u64))?; diff --git a/rt/+linux/syscalls.ha b/rt/+linux/syscalls.ha @@ -262,7 +262,9 @@ export fn sendfile( ) (size | errno) = wrap_return(syscall4(SYS_sendfile, out: u64, in: u64, offs: uintptr: u64, count: u64))?: size; -export @noreturn fn exit(status: int) void = syscall1(SYS_exit, status: u64); +export @noreturn fn exit(status: int) void = { + syscall1(SYS_exit, status: u64); +}; export fn kill(pid: int, signal: int) (void | errno) = { wrap_return(syscall2(SYS_kill, pid: u64, signal: u64))?; diff --git a/rt/+test/run.ha b/rt/+test/run.ha @@ -95,7 +95,9 @@ export fn tests_main() size = { return nfail; }; -fn print(msg: str) void = write(1, *(&msg: **void): *const char, len(msg))!; +fn print(msg: str) void = { + write(1, *(&msg: **void): *const char, len(msg))!; +}; fn dots(n: size) void = { // XXX: this is slow, I guess