summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-08-30 01:00:57 -0700
committerOri Bernstein <ori@eigenstate.org>2017-08-30 01:00:57 -0700
commite363cc6bdebc37d56a27cd4fc3d9b03db4c2d6d6 (patch)
tree062a111e5d865f2eeab7020849c9fcd112cefaee
parenta367763275faf9bbda3196f58998e9e74484a9a0 (diff)
downloadmc-e363cc6bdebc37d56a27cd4fc3d9b03db4c2d6d6.tar.gz
Fix some straggling Ordonly
-rw-r--r--lib/std/dir+plan9.myr2
-rw-r--r--lib/std/intparse.myr7
-rw-r--r--lib/std/syswrap+plan9.myr6
-rw-r--r--lib/std/syswrap-ss+plan9.myr2
4 files changed, 10 insertions, 7 deletions
diff --git a/lib/std/dir+plan9.myr b/lib/std/dir+plan9.myr
index e363662..82e301f 100644
--- a/lib/std/dir+plan9.myr
+++ b/lib/std/dir+plan9.myr
@@ -26,7 +26,7 @@ const diropen = {p
var fd
var dir
- match open(p, Ordonly)
+ match open(p, Oread)
| `Ok f: fd = f
| `Err e: -> `Err "couldn't open directory"
;;
diff --git a/lib/std/intparse.myr b/lib/std/intparse.myr
index 18cc478..df4eefe 100644
--- a/lib/std/intparse.myr
+++ b/lib/std/intparse.myr
@@ -48,11 +48,14 @@ generic intparsebase = {s, base
}
generic doparse = {s, isneg, base -> option(@a::(integral,numeric))
- var v
+ var c, v, i
var cv : int32
v = 0
- for c : std.bychar(s)
+ i = 0
+ while true
+ c = std.decode(s[i:])
+ i += std.charlen(c)
if c == '_'
continue
;;
diff --git a/lib/std/syswrap+plan9.myr b/lib/std/syswrap+plan9.myr
index e4a04ba..9f0ccc9 100644
--- a/lib/std/syswrap+plan9.myr
+++ b/lib/std/syswrap+plan9.myr
@@ -27,8 +27,8 @@ pkg std =
const Failmem : byte# = (-1 : byte#)
- const Oread : fdopt = (sys.Ordonly : fdopt)
- const Owrite : fdopt = (sys.Owronly : fdopt)
+ const Oread : fdopt = (sys.Oread : fdopt)
+ const Owrite : fdopt = (sys.Owrite : fdopt)
const Ordwr : fdopt = (sys.Ordwr : fdopt)
const Otrunc : fdopt = (sys.Otrunc : fdopt)
const Ocexec : fdopt = (sys.Ocexec : fdopt)
@@ -198,7 +198,7 @@ const chdir = {path; -> sys.chdir(path) == 0}
const mkdir = {path, mode;
var fd
- fd = sys.create(path, sys.Ordonly, sys.Dmdir | (mode : int))
+ fd = sys.create(path, sys.Oread, sys.Dmdir | (mode : int))
if fd < 0
-> lasterr()
;;
diff --git a/lib/std/syswrap-ss+plan9.myr b/lib/std/syswrap-ss+plan9.myr
index 96a2973..58a751a 100644
--- a/lib/std/syswrap-ss+plan9.myr
+++ b/lib/std/syswrap-ss+plan9.myr
@@ -22,7 +22,7 @@ const nanosleep = {nsecs
const bgetcwd = {buf
var fd
- fd = sys.open(".", sys.Ordonly)
+ fd = sys.open(".", sys.Oread)
if fd < 0
-> (fd : errno)
;;