shithub: mc

Download patch

ref: 10fd260127c1561a96797b8f93e6583a97d265e3
parent: e44f649c1ed1037595650a461e130cde1bb9a30c
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Feb 22 17:24:29 EST 2015

Update mbld to new libstd fmt api.

--- a/build.myr
+++ b/build.myr
@@ -366,17 +366,17 @@
 
 const findlib = {lib, incs
 	var buf : byte[512]
-	var n, p
+	var sl, p
 
-	n = std.bfmt(buf[:], "lib%s.a", lib)
+	sl = std.bfmt(buf[:], "lib%s.a", lib)
 	for i in incs
-		p = std.pathjoin([i, buf[:n]][:])
+		p = std.pathjoin([i, sl][:])
 		if std.fexists(p)
 			-> `std.Some p
 		;;
 		std.slfree(p)
 	;;
-	p = std.pathjoin([opt_instroot, "lib/myr", buf[:n]][:])
+	p = std.pathjoin([opt_instroot, "lib/myr", sl][:])
 	if std.fexists(p)
 		-> `std.Some p
 	;;
--- a/parse.myr
+++ b/parse.myr
@@ -12,11 +12,11 @@
 const failparse = {p : parser#, msg, args : ...
 	var buf : byte[1024]
 	var ap
-	var n
+	var sl
 
 	ap = std.vastart(&args)
-	n = std.bfmtv(buf[:], msg, ap)
-	std.fput(1, "%s:%i: %s", p.fname, p.line, buf[:n])
+	sl = std.bfmtv(buf[:], msg, ap)
+	std.fput(1, "%s:%i: %s", p.fname, p.line, sl)
 	std.exit(1)
 }