shithub: mc

Download patch

ref: 7bca94e234b70a13a93c77b3e4801368ea173d3d
parent: 173bb6e6c75b1898527b187c030093bc8832d4fc
parent: fd429ed06586dfee29c14ef563f15caf92737781
author: Ori Bernstein <[email protected]>
date: Wed Feb 20 06:58:44 EST 2013

Merge branch 'master' of git+ssh://mimir.eigenstate.org/git/ori/mc

--- a/libstd/sys-linux.myr
+++ b/libstd/sys-linux.myr
@@ -52,7 +52,7 @@
 	const M32bit	: mopt = 0x40
 
 	/* return value for a failed mapping */
-	const Mapbad	: byte* = -1 castto(byte*)
+	const Mapbad	: byte# = -1 castto(byte#)
 
 	/* syscalls */
 	const Sysread			: scno = 0
@@ -369,7 +369,7 @@
 	const Sysprocess_vm_writev	: scno = 311
 
 	extern const syscall : (sc:scno, args:... -> int64)
-	extern const cstring : (str : byte[:] -> byte*)
+	extern const cstring : (str : byte[:] -> byte#)
 
 	const exit	: (status:int64 -> void)
 	const getpid	: ( -> int64)
@@ -380,9 +380,9 @@
 	const read	: (fd:int64, buf:byte[:] -> size)
 	const write	: (fd:int64, buf:byte[:] -> size)
 	const lseek	: (fd:int64, off:uint64, whence:int64 -> int64)
-	const fstat	: (fd:int64, sb:statbuf* -> int64)
-	const munmap	: (addr:byte*, len:size -> int64)
-	const mmap	: (addr:byte*, len:size, prot:mprot, flags:mopt, fd:int64, off:off -> byte*)
+	const fstat	: (fd:int64, sb:statbuf# -> int64)
+	const munmap	: (addr:byte#, len:size -> int64)
+	const mmap	: (addr:byte#, len:size, prot:mprot, flags:mopt, fd:int64, off:off -> byte#)
 ;;
 
 const exit	= {status;		syscall(Sysexit, 1)}
@@ -391,9 +391,9 @@
 const open	= {path, opts, mode;	-> syscall(Sysopen, cstring(path), opts, mode)}
 const close	= {fd;			-> syscall(Sysclose, fd)}
 const creat	= {path, mode;		-> syscall(Syscreat, cstring(path), mode)}
-const read	= {fd, buf;		-> syscall(Sysread, fd, buf castto(char*), buf.len castto(size)) castto(size)}
-const write	= {fd, buf;		-> syscall(Syswrite, fd, buf castto(char*), buf.len castto(size)) castto(size)}
+const read	= {fd, buf;		-> syscall(Sysread, fd, buf castto(byte#), buf.len castto(size)) castto(size)}
+const write	= {fd, buf;		-> syscall(Syswrite, fd, buf castto(byte#), buf.len castto(size)) castto(size)}
 const lseek	= {fd, off, whence;	-> syscall(Syslseek, fd, off, whence)}
 const fstat	= {fd, sb;		-> syscall(Sysfstat, fd, sb)}
 const munmap	= {addr, len;		-> syscall(Sysmunmap, addr, len)}
-const mmap	= {addr, len, prot, flags, fd, off;	-> syscall(Sysmmap, addr, len, prot, flags, fd, off) castto(byte*)}
+const mmap	= {addr, len, prot, flags, fd, off;	-> syscall(Sysmmap, addr, len, prot, flags, fd, off) castto(byte#)}
--- a/libstd/sys-osx.myr
+++ b/libstd/sys-osx.myr
@@ -62,7 +62,7 @@
 
 
 	/* return value for a failed mapping */
-	const Mapbad	: byte* = -1 castto(byte*)
+	const Mapbad	: byte# = -1 castto(byte#)
 
 	/* syscalls.
 	note, creat() implemented as open(path, Creat|Trunc|Wronly) */
@@ -415,7 +415,7 @@
 	const Sysfileport_makefd	: scno = 0x20001b1
 
 	extern const syscall : (sc:scno, args:... -> int64)
-	extern const cstring : (str : byte[:] -> byte*)
+	extern const cstring : (str : byte[:] -> byte#)
 
 	const exit	: (status:int64 -> void)
 	const getpid	: ( -> int64)
@@ -426,9 +426,9 @@
 	const read	: (fd:int64, buf:byte[:] -> size)
 	const write	: (fd:int64, buf:byte[:] -> size)
 	const lseek	: (fd:int64, off:uint64, whence:int64 -> int64)
-	const fstat	: (fd:int64, sb:statbuf* -> int64)
-	const munmap	: (addr:byte*, len:size -> int64)
-	const mmap	: (addr:byte*, len:size, prot:mprot, flags:mopt, fd:int64, off:off -> byte*)
+	const fstat	: (fd:int64, sb:statbuf# -> int64)
+	const munmap	: (addr:byte#, len:size -> int64)
+	const mmap	: (addr:byte#, len:size, prot:mprot, flags:mopt, fd:int64, off:off -> byte#)
 ;;
 
 const exit	= {status;		syscall(Sysexit, 1)}
@@ -437,9 +437,9 @@
 const open	= {path, opts, mode;	-> syscall(Sysopen, cstring(path), opts, mode)}
 const close	= {fd;			-> syscall(Sysclose, fd)}
 const creat	= {path, mode;		-> open(path, Ocreat | Otrunc | Owronly, mode)}
-const read	= {fd, buf;		-> syscall(Sysread, fd, buf castto(char*), buf.len castto(size)) castto(size)}
-const write	= {fd, buf;		-> syscall(Syswrite, fd, buf castto(char*), buf.len castto(size)) castto(size)}
+const read	= {fd, buf;		-> syscall(Sysread, fd, buf castto(char#), buf.len castto(size)) castto(size)}
+const write	= {fd, buf;		-> syscall(Syswrite, fd, buf castto(char#), buf.len castto(size)) castto(size)}
 const lseek	= {fd, off, whence;	-> syscall(Syslseek, fd, off, whence)}
 const fstat	= {fd, sb;		-> syscall(Sysfstat, fd, sb)}
 const munmap	= {addr, len;		-> syscall(Sysmunmap, addr, len)}
-const mmap	= {addr, len, prot, flags, fd, off;	-> syscall(Sysmmap, addr, len, prot, flags, fd, off) castto(byte*)}
+const mmap	= {addr, len, prot, flags, fd, off;	-> syscall(Sysmmap, addr, len, prot, flags, fd, off) castto(byte#)}
--- a/test/test.sh
+++ b/test/test.sh
@@ -14,7 +14,7 @@
 
 function build {
     rm -f $1 $1.o $1.s $1.use
-    ../myrbuild/myrbuild -b $1 $1.myr -C../6/6m -M../muse/muse -I../libstd
+    ../myrbuild/myrbuild -b $1 -C../6/6m -M../muse/muse -I../libstd $1.myr
 }
 
 function prints {