hare

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

commit 0bf113ada0bd707abf6b2cdd216498b0a230c42c
parent b8f06c95d64eec548cbb6785816f20e55423671a
Author: Drew DeVault <sir@cmpwn.com>
Date:   Mon,  8 Nov 2021 11:25:55 +0100

rt: remove extraneous return statements

These are no longer necessary.

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mrt/+freebsd/syscalls.ha | 22----------------------
Mrt/+linux/syscalls.ha | 26--------------------------
2 files changed, 0 insertions(+), 48 deletions(-)

diff --git a/rt/+freebsd/syscalls.ha b/rt/+freebsd/syscalls.ha @@ -50,7 +50,6 @@ export fn write(fd: int, buf: *const void, count: size) (size | errno) = { export fn close(fd: int) (void | errno) = { wrap_return(syscall1(SYS_close, fd: u64))?; - return; }; export fn lseek(fd: int, off: i64, whence: uint) (i64 | errno) = { @@ -60,7 +59,6 @@ export fn lseek(fd: int, off: i64, whence: uint) (i64 | errno) = { export fn pipe2(pipefd: *[2]int, flags: int) (void | errno) = { wrap_return(syscall2(SYS_pipe2, pipefd: uintptr: u64, flags: u64))?; - return; }; export fn ioctl(fd: int, req: u64, arg: nullable *void) (int | errno) = { @@ -87,7 +85,6 @@ export fn unlink(path: path) (void | errno) = { let path = kpath(path)?; wrap_return(syscall3(SYS_unlinkat, AT_FDCWD: u64, path: uintptr: u64, 0u64))?; - return; }; export fn renameat( @@ -102,14 +99,12 @@ export fn renameat( wrap_return(syscall4(SYS_renameat, olddirfd: u64, oldpath: uintptr: u64, newdirfd: u64, newpath: uintptr: u64))?; - return; }; export fn unlinkat(dirfd: int, path: path, flags: int) (void | errno) = { let path = kpath(path)?; wrap_return(syscall3(SYS_unlinkat, dirfd: u64, path: uintptr: u64, flags: u64))?; - return; }; export fn fstatat(fd: int, path: path, stat: *st, flag: int) (void | errno) = { @@ -136,7 +131,6 @@ export fn fstatat(fd: int, path: path, stat: *st, flag: int) (void | errno) = { stat.blocks = fbstat.st_blocks; stat.blksz = fbstat.st_blksize; stat.flags = fbstat.st_flags; - return; }; export fn readlinkat( @@ -155,21 +149,18 @@ export fn mkdirat(dirfd: int, path: path, mode: uint) (void | errno) = { let path = kpath(path)?; wrap_return(syscall3(SYS_mkdirat, dirfd: u64, path: uintptr: u64, mode: u64))?; - return; }; export fn fchmodat(dirfd: int, path: path, mode: uint, flags: int) (void | errno) = { let path = kpath(path)?; wrap_return(syscall4(SYS_fchmodat, dirfd: u64, path: uintptr: u64, mode: u64, flags: u64))?; - return; }; export fn fchownat(dirfd: int, path: path, uid: uint, gid: uint, flags: int) (void | errno) = { let path = kpath(path)?; wrap_return(syscall5(SYS_fchownat, dirfd: u64, path: uintptr: u64, uid: u32, gid: u32, flags: u64))?; - return; }; export fn faccessat( @@ -218,19 +209,16 @@ export fn getcwd() (*const char | errno) = { export fn fchdir(fd: int) (void | errno) = { wrap_return(syscall1(SYS_fchdir, fd: u64))?; - return; }; export fn chdir(path: path) (void | errno) = { let path = kpath(path)?; wrap_return(syscall1(SYS_chdir, path: uintptr: u64))?; - return; }; export fn chroot(path: path) (void | errno) = { let path = kpath(path)?; wrap_return(syscall1(SYS_chroot, path: uintptr: u64))?; - return; }; export fn mmap( @@ -248,14 +236,12 @@ export fn mmap( export fn munmap(addr: *void, length: size) (void | errno) = { wrap_return(syscall2(SYS_munmap, addr: uintptr: u64, length: u64))?; - return; }; 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))?; - return; }; export fn fork() (int | void | errno) = { @@ -306,7 +292,6 @@ export fn getpriority(which: int, who: id_t) (int | errno) = { export fn setpriority(which: int, who: id_t, prio: int) (void | errno) = { wrap_return(syscall3(SYS_setpriority, which: u64, who: u64, prio: u64))?; - return; }; export fn umask(mode: mode_t) (mode_t | errno) = { @@ -315,12 +300,10 @@ export fn umask(mode: mode_t) (mode_t | errno) = { export fn setresuid(uid: uid_t, euid: uid_t, suid: uid_t) (void | errno) = { wrap_return(syscall3(SYS_setresuid, uid: u64, euid: u64, suid: u64))?; - return; }; export fn setresgid(gid: gid_t, egid: gid_t, sgid: gid_t) (void | errno) = { wrap_return(syscall3(SYS_setresgid, gid: u64, egid: u64, sgid: u64))?; - return; }; export fn getresuid(uid: *uid_t, euid: *uid_t, suid: *uid_t) (void | errno) = { @@ -328,7 +311,6 @@ export fn getresuid(uid: *uid_t, euid: *uid_t, suid: *uid_t) (void | errno) = { uid: uintptr: u64, euid: uintptr: u64, suid: uintptr: u64))?; - return; }; export fn getresgid(gid: *gid_t, egid: *gid_t, sgid: *gid_t) (void | errno) = { @@ -336,19 +318,16 @@ export fn getresgid(gid: *gid_t, egid: *gid_t, sgid: *gid_t) (void | errno) = { gid: uintptr: u64, egid: uintptr: u64, sgid: uintptr: u64))?; - return; }; export fn clock_gettime(clock_id: int, tp: *timespec) (void | errno) = { wrap_return(syscall2(SYS_clock_gettime, clock_id: u64, tp: uintptr: u64))?; - return; }; export fn nanosleep(req: *const timespec, rem: *timespec) (void | errno) = { wrap_return(syscall2(SYS_nanosleep, req: uintptr: u64, rem: uintptr: u64))?; - return; }; export fn getrandom(buf: *void, bufln: size, flags: uint) (size | errno) = { @@ -468,7 +447,6 @@ export fn sysctlbyname(name: str, oldp: nullable *void, oldlenp: nullable *size, kname: uintptr: u64, len(name): u64, oldp: uintptr: u64, oldlenp: uintptr: u64, newp: uintptr: u64, newlen: u64))?; - return; }; export fn dup2(oldfd: int, newfd: int) (int | errno) = { diff --git a/rt/+linux/syscalls.ha b/rt/+linux/syscalls.ha @@ -88,14 +88,12 @@ export fn unlink(path: path) (void | errno) = { let path = kpath(path)?; wrap_return(syscall3(SYS_unlinkat, AT_FDCWD: u64, path: uintptr: u64, 0u64))?; - return; }; export fn unlinkat(dirfd: int, path: path, flags: int) (void | errno) = { let path = kpath(path)?; wrap_return(syscall3(SYS_unlinkat, dirfd: u64, path: uintptr: u64, flags: u64))?; - return; }; export fn mknodat( @@ -107,35 +105,30 @@ export fn mknodat( let path = kpath(path)?; wrap_return(syscall3(SYS_mknodat, path: uintptr: u64, mode: u64, dev: u64))?; - return; }; export fn chmod(path: path, mode: uint) (void | errno) = { let path = kpath(path)?; wrap_return(syscall4(SYS_fchmodat, AT_FDCWD: u64, path: uintptr: u64, mode: u64, 0))?; - return; }; export fn fchmodat(dirfd: int, path: path, mode: uint, flags: int) (void | errno) = { let path = kpath(path)?; wrap_return(syscall4(SYS_fchmodat, dirfd: u64, path: uintptr: u64, mode: u64, flags: u64))?; - return; }; export fn chown(path: path, uid: uint, gid: uint) (void | errno) = { let path = kpath(path)?; wrap_return(syscall5(SYS_fchownat, AT_FDCWD: u64, path: uintptr: u64, uid: u32, gid: u32, 0))?; - return; }; export fn fchownat(dirfd: int, path: path, uid: uint, gid: uint, flags: int) (void | errno) = { let path = kpath(path)?; wrap_return(syscall5(SYS_fchownat, dirfd: u64, path: uintptr: u64, uid: u32, gid: u32, flags: u64))?; - return; }; export fn renameat( @@ -152,7 +145,6 @@ export fn renameat( olddirfd: u64, oldpath: uintptr: u64, newdirfd: u64, newpath: uintptr: u64, flags: u64))?; - return; }; export fn dup(fd: int) (int | errno) = { @@ -170,38 +162,32 @@ export fn dup3(oldfd: int, newfd: int, flags: int) (int | errno) = { export fn close(fd: int) (void | errno) = { wrap_return(syscall1(SYS_close, fd: u64))?; - return; }; export fn chdir(path: path) (void | errno) = { let path = kpath(path)?; wrap_return(syscall1(SYS_chdir, path: uintptr: u64))?; - return; }; export fn fchdir(fd: int) (void | errno) = { wrap_return(syscall1(SYS_fchdir, fd: u64))?; - return; }; export fn chroot(path: path) (void | errno) = { let path = kpath(path)?; wrap_return(syscall1(SYS_chroot, path: uintptr: u64))?; - return; }; export fn mkdir(path: path, mode: uint) (void | errno) = { let path = kpath(path)?; wrap_return(syscall3(SYS_mkdirat, AT_FDCWD: u64, path: uintptr: u64, mode: u64))?; - return; }; export fn mkdirat(dirfd: int, path: path, mode: uint) (void | errno) = { let path = kpath(path)?; wrap_return(syscall3(SYS_mkdirat, dirfd: u64, path: uintptr: u64, mode: u64))?; - return; }; export fn execveat(dirfd: int, path: path, argv: *[*]nullable *const char, @@ -246,12 +232,10 @@ 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))?; - return; }; export fn pipe2(pipefd: *[2]int, flags: int) (void | errno) = { wrap_return(syscall2(SYS_pipe2, pipefd: uintptr: u64, flags: u64))?; - return; }; export fn mmap( @@ -281,14 +265,12 @@ export fn mmap( export fn munmap(addr: *void, length: size) (void | errno) = { wrap_return(syscall2(SYS_munmap, addr: uintptr: u64, length: u64))?; - return; }; export fn mprotect(addr: *void, length: size, prot: uint) (void | errno) = { wrap_return(syscall3(SYS_mprotect, addr: uintptr: u64, length: u64, prot: u64))?; - return; }; @@ -381,18 +363,15 @@ export fn getrandom(buf: *void, bufln: size, flags: uint) (size | errno) = { export fn clock_gettime(clock_id: int, tp: *timespec) (void | errno) = { wrap_return(syscall2(SYS_clock_gettime, clock_id: u64, tp: uintptr: u64))?; - return; }; export fn nanosleep(req: *const timespec, rem: *timespec) (void | errno) = { wrap_return(syscall2(SYS_nanosleep, req: uintptr: u64, rem: uintptr: u64))?; - return; }; export fn uname(uts: *utsname) (void | errno) = { wrap_return(syscall1(SYS_uname, uts: uintptr: u64))?; - return; }; // The return value is statically allocated and must be duplicated before @@ -624,12 +603,10 @@ export fn umask(mode: mode_t) (mode_t | errno) = { export fn setresuid(uid: uid_t, euid: uid_t, suid: uid_t) (void | errno) = { wrap_return(syscall3(SYS_setresuid, uid: u64, euid: u64, suid: u64))?; - return; }; export fn setresgid(gid: gid_t, egid: gid_t, sgid: gid_t) (void | errno) = { wrap_return(syscall3(SYS_setresgid, gid: u64, egid: u64, sgid: u64))?; - return; }; export fn getresuid(uid: *uid_t, euid: *uid_t, suid: *uid_t) (void | errno) = { @@ -637,7 +614,6 @@ export fn getresuid(uid: *uid_t, euid: *uid_t, suid: *uid_t) (void | errno) = { uid: uintptr: u64, euid: uintptr: u64, suid: uintptr: u64))?; - return; }; export fn getresgid(gid: *gid_t, egid: *gid_t, sgid: *gid_t) (void | errno) = { @@ -645,7 +621,6 @@ export fn getresgid(gid: *gid_t, egid: *gid_t, sgid: *gid_t) (void | errno) = { gid: uintptr: u64, egid: uintptr: u64, sgid: uintptr: u64))?; - return; }; export fn getpriority(which: int, who: id_t) (int | errno) = { @@ -655,7 +630,6 @@ export fn getpriority(which: int, who: id_t) (int | errno) = { export fn setpriority(which: int, who: id_t, prio: int) (void | errno) = { wrap_return(syscall3(SYS_setpriority, which: u64, who: u64, prio: u64))?; - return; }; export fn io_uring_setup(entries: u32, params: *void) (int | errno) = {