hare

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

commit 84d3720a46af582bfe4ebb182dfeda29c0cc5ff3
parent a6092178bc99b176fd427998f125ffcee8b97a3f
Author: Drew DeVault <sir@cmpwn.com>
Date:   Wed, 12 May 2021 10:20:01 -1000

errors: fix errors::errno strerror

Diffstat:
Merrors/opaque.ha | 4++--
Merrors/rt.ha | 2+-
Mnet/+linux/util.ha | 3+--
3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/errors/opaque.ha b/errors/opaque.ha @@ -6,14 +6,14 @@ // The following example shows the usage of this type for custom errors: // // fn wraperror(err: myerror) error::opaque = { -// static assert(size(myerror) <= size(error::opaque_data)); +// static assert(size(myerror) <= size(errors::opaque_data)); // let wrapped = errors::opaque { strerror = &opaque_strerror, ... }; // let myptr = &wrapped.data: *myerror; // *myptr = err; // return wrapped; // }; // -// fn opaque_strerror(err: *opaque_data) const str = { +// fn opaque_strerror(err: *errors::opaque_data) const str = { // let ptr = &err: *myerr; // return strerror(*ptr); // }; diff --git a/errors/rt.ha b/errors/rt.ha @@ -11,6 +11,6 @@ export fn errno(errno: rt::errno) opaque = { }; fn rt_strerror(err: *opaque_data) const str = { - let err = &err: *rt::errno; + let err = err: *rt::errno; return rt::strerror(*err); }; diff --git a/net/+linux/util.ha b/net/+linux/util.ha @@ -21,8 +21,7 @@ fn setfcntl(sockfd: int, flag: int) (void | rt::errno) = { fn wrap(ie: (int | rt::errno)) (int | io::error) = { match (ie) { i: int => i, - // XXX: Why do we have to cast this? - er: rt::errno => errors::errno(er): io::error, + err: rt::errno => errors::errno(err), }; };