hare

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

commit 2b3a18c263337ebd46a31e268f7922c6ea728173
parent a9799a93449a950531c73b6d9e9388415735ba53
Author: Sebastian <sebastian@sebsite.pw>
Date:   Thu, 14 Sep 2023 00:04:10 -0400

Remove unnecessary rt::errno->int casts

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mrt/+freebsd/errno.ha | 4++--
Mrt/+linux/errno.ha | 4++--
Munix/tty/+freebsd/pty.ha | 4++--
Munix/tty/+freebsd/winsize.ha | 2+-
Munix/tty/+linux/pty.ha | 4++--
Munix/tty/+linux/winsize.ha | 2+-
6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/rt/+freebsd/errno.ha b/rt/+freebsd/errno.ha @@ -16,7 +16,7 @@ fn wrap_return(r: u64) (errno | u64) = { // Obtains a human-friendly reading of an [[errno]] (e.g. "Operation not // permitted"). The return value may be statically allocated. export fn strerror(err: errno) str = { - switch (err: int) { + switch (err) { case EPERM => return "Operation not permitted"; case ENOENT => @@ -217,7 +217,7 @@ export fn strerror(err: errno) str = { // Gets the programmer-friendly name for an [[errno]] (e.g. EPERM). The return // value may be statically allocated. export fn errname(err: errno) str = { - switch (err: int) { + switch (err) { case EPERM => return "EPERM"; case ENOENT => diff --git a/rt/+linux/errno.ha b/rt/+linux/errno.ha @@ -17,7 +17,7 @@ fn wrap_return(r: u64) (errno | u64) = { // Obtains a human-friendly reading of an [[errno]] (e.g. "Operation not // permitted"). The return value may be statically allocated. export fn strerror(err: errno) str = { - switch (err: int) { + switch (err) { case EPERM => return "Operation not permitted"; case ENOENT => @@ -288,7 +288,7 @@ export fn strerror(err: errno) str = { // Gets the programmer-friendly name for an [[errno]] (e.g. EPERM). The return // value may be statically allocated. export fn errname(err: errno) str = { - switch (err: int) { + switch (err) { case EPERM => return "EPERM"; case ENOENT => diff --git a/unix/tty/+freebsd/pty.ha b/unix/tty/+freebsd/pty.ha @@ -37,7 +37,7 @@ export fn ptsname(master: io::file) (str | error) = { let fiodgname_arg = (len(name), &name); match (rt::ioctl(master, rt::FIODGNAME, &fiodgname_arg)) { case let e: rt::errno => - switch (e: int) { + switch (e) { case rt::EBADF => return errors::invalid; case rt::EINVAL, rt::ENOTTY => @@ -57,7 +57,7 @@ export fn set_winsize(pty: io::file, sz: ttysize) (void | error) = { let wsz = rt::winsize { ws_row = sz.rows, ws_col = sz.columns, ... }; match (rt::ioctl(pty, rt::TIOCSWINSZ, &wsz)) { case let e: rt::errno => - switch (e: int) { + switch (e) { case rt::EBADF, rt::EINVAL => return errors::invalid; case rt::ENOTTY => diff --git a/unix/tty/+freebsd/winsize.ha b/unix/tty/+freebsd/winsize.ha @@ -11,7 +11,7 @@ export fn winsize(fd: io::file) (ttysize | error) = { let wsz = rt::winsize { ... }; match (rt::ioctl(fd, rt::TIOCGWINSZ, &wsz: *opaque)) { case let e: rt::errno => - switch (e: int) { + switch (e) { case rt::EBADF => return errors::invalid; case rt::ENOTTY => diff --git a/unix/tty/+linux/pty.ha b/unix/tty/+linux/pty.ha @@ -38,7 +38,7 @@ export fn ptsname(master: io::file) (str | error) = { let pty = 0; match (rt::ioctl(master, rt::TIOCGPTN, &pty)) { case let e: rt::errno => - switch (e: int) { + switch (e) { case rt::EBADF => return errors::invalid; case rt::ENOTTY => @@ -57,7 +57,7 @@ export fn set_winsize(pty: io::file, sz: ttysize) (void | error) = { let wsz = rt::winsize { ws_row = sz.rows, ws_col = sz.columns, ... }; match (rt::ioctl(pty, rt::TIOCSWINSZ, &wsz)) { case let e: rt::errno => - switch (e: int) { + switch (e) { case rt::EBADF => return errors::invalid; case rt::ENOTTY => diff --git a/unix/tty/+linux/winsize.ha b/unix/tty/+linux/winsize.ha @@ -12,7 +12,7 @@ export fn winsize(fd: io::file) (ttysize | error) = { let wsz = rt::winsize { ... }; match (rt::ioctl(fd, rt::TIOCGWINSZ, &wsz: *opaque)) { case let e: rt::errno => - switch (e: int) { + switch (e) { case rt::EBADFD => return errors::invalid; case rt::ENOTTY =>