Fix typos

This commit is contained in:
gingerBill
2026-02-17 14:41:09 +00:00
parent 6c3904f235
commit 442b163871
2 changed files with 5 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ read_ptr :: proc(r: Reader, p: rawptr, byte_size: int, n_read: ^int = nil) -> (n
return read(r, ([^]byte)(p)[:byte_size], n_read)
}
read_slice :: proc(r: Reader, p: rawptr, byte_size: int, n_read: ^int = nil) -> (n: int, err: Error) {
read_slice :: proc(r: Reader, slice: $S/[]$T, n_read: ^int = nil) -> (n: int, err: Error) {
size := len(slice)*size_of(T)
return read_ptr(w, raw_data(slice), size, n_read)
}

View File

@@ -114,19 +114,19 @@ read_ptr :: proc(f: ^File, data: rawptr, len: int) -> (n: int, err: Error) {
/*
`write_slice` is a utility procedure that writes the bytes points at `slice`.
It is equivalent to: `write(f, ([^]byte)(raw_data(slice))[:len(slice)*size_of(slice[0]))])`
It is equivalent to: `write(f, ([^]byte)(raw_data(slice))[:len(slice)*size_of(slice[0])])`
*/
write_slice :: proc(f: ^File, slice: $S/[]$T) -> (n: int, err: Error) {
return write(f, ([^]byte)(raw_data(slice))[:len(slice)*size_of(slice[0]))])
return write(f, ([^]byte)(raw_data(slice))[:len(slice)*size_of(slice[0])])
}
/*
`read_slice` is a utility procedure that writes the bytes points at `slice`.
It is equivalent to: `read(f, ([^]byte)(raw_data(slice))[:len(slice)*size_of(slice[0]))])`
It is equivalent to: `read(f, ([^]byte)(raw_data(slice))[:len(slice)*size_of(slice[0])])`
*/
read_slice :: proc(f: ^File, slice: $S/[]$T) -> (n: int, err: Error) {
return read(f, ([^]byte)(raw_data(slice))[:len(slice)*size_of(slice[0]))])
return read(f, ([^]byte)(raw_data(slice))[:len(slice)*size_of(slice[0])])
}