shithub: mc

Download patch

ref: 48434f5600e0d0096226462e4fe1e55270e1eb0d
parent: 73e2c5b1664a814e363364921270ae365473e622
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Aug 21 07:13:19 EDT 2017

Clean up dial+plan9.myr

--- a/lib/std/dial+plan9.myr
+++ b/lib/std/dial+plan9.myr
@@ -70,9 +70,8 @@
 	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 @@
 	;;
 
 	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)
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -477,7 +477,6 @@
 tyresolve(Type *t)
 {
 	size_t i;
-	Type *base;
 
 	if (t->resolved)
 		return;
@@ -529,7 +528,6 @@
 				tystr(t->sub[i]), tystr(t));
 		}
 	}
-	base = tybase(t);
 	if (occurs(t))
 		lfatal(t->loc, "type %s includes itself", tystr(t));
 	popenv(t->env);