summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-08-21 11:13:19 -0700
committerOri Bernstein <ori@markovcorp.com>2017-08-21 11:16:38 -0700
commit48434f5600e0d0096226462e4fe1e55270e1eb0d (patch)
tree9ac24f79289791d47587d11e94b93fb1a7deef68
parent73e2c5b1664a814e363364921270ae365473e622 (diff)
downloadmc-48434f5600e0d0096226462e4fe1e55270e1eb0d.tar.gz
Clean up dial+plan9.myr
-rw-r--r--lib/std/dial+plan9.myr11
-rw-r--r--parse/infer.c2
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/std/dial+plan9.myr b/lib/std/dial+plan9.myr
index 65ef984..cfdd2ba 100644
--- a/lib/std/dial+plan9.myr
+++ b/lib/std/dial+plan9.myr
@@ -70,9 +70,8 @@ const csdial = {netdir, proto, rem
seek(csfd, 0, 0)
while true
match read(csfd, buf[:])
- | `std.Ok _:
- | `std.Err e:
- break
+ | `std.Ok len: n = len
+ | `std.Err e: break
;;
match strfind(buf[:n], " ")
@@ -110,20 +109,22 @@ const call : (a : byte[:], b : byte[:], c : byte[:] -> result(fd, byte[:])) = {c
;;
match read(cfd, namebuf[:])
- | `Ok fd: /* nothing */
+ | `Ok len: n = len
| `Err m: goto cleanup
;;
- fput(cfd, "connect {}", addr)
+
name = strstrip(namebuf[:n])
match strrfind(c, "/")
| `None: die("there should be a '/' here\n")
| `Some i: base = c[:i]
;;
+
dpath = bfmt(databuf[:], "{}/{}/data", base, name)
match open(dpath, Ordwr)
| `Ok fd: datafd = `Ok fd
| `Err m: datafd = `Err "could not open data"
;;
+
:cleanup
close(cfd)
slfree(c)
diff --git a/parse/infer.c b/parse/infer.c
index 44fb805..693d074 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -477,7 +477,6 @@ static void
tyresolve(Type *t)
{
size_t i;
- Type *base;
if (t->resolved)
return;
@@ -529,7 +528,6 @@ tyresolve(Type *t)
tystr(t->sub[i]), tystr(t));
}
}
- base = tybase(t);
if (occurs(t))
lfatal(t->loc, "type %s includes itself", tystr(t));
popenv(t->env);