Clean up error handling

This commit is contained in:
gingerBill
2024-08-04 11:21:09 +01:00
parent 7dae38ce89
commit 29b6eebcd5
15 changed files with 118 additions and 135 deletions
+3
View File
@@ -88,6 +88,9 @@ read_at_least :: proc(f: ^File, buf: []byte, min: int) -> (n: int, err: Error) {
return
}
read_full :: proc(f: ^File, buf: []byte) -> (n: int, err: Error) {
return read_at_least(f, buf, len(buf))
}
write_ptr :: proc(f: ^File, data: rawptr, len: int) -> (n: int, err: Error) {
return write(f, ([^]byte)(data)[:len])