stage2 更多的工具库 stage1 修复问题

This commit is contained in:
zzy committed 2026-09-18 10:10:53 +08:00
1 parent 16a1f030d4
commit b3e38ba7e4
28 files changed
+2274 -523

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
// Expect retcode = 6
// exit.spl
// usage: type exit = @import("exit.spl"); exit.ok();
// usage: type exit = @import("exit.spl"); exit.ok();
#extern(vm) fn vm_exit(code: i32);
+3 -3
View File
@@ -34,12 +34,12 @@ fn write_byte(f: *File, b: u8): u64 {
ret write(f, &tmp, 1);
}
fn read(f: *File, buf: *u8, n: u64): u64 {
fn read(f: *File, buf: *u8, n: usize): usize {
if f.handle == null { ret 0; }
ret vm_fread(buf as *any, 1, n, f.handle);
}
fn size(f: *File): u64 {
fn size(f: *File): usize {
if f.handle == null { ret 0; }
ret vm_fsize(f.handle);
}
@@ -67,4 +67,4 @@ fn main(): void {
@assert(n == msg.len, "write");
putchar(46 as u8);
putchar(10 as u8);
}
}
+1 -1
View File
@@ -76,4 +76,4 @@ fn main(): void {
free(q);
free(buf);
free(null);
}
}