mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Remove unnecessary use of transmute
This commit is contained in:
+2
-4
@@ -160,13 +160,11 @@ write_entire_file :: proc(name: string, data: []byte, truncate := true) -> (succ
|
||||
}
|
||||
|
||||
write_ptr :: proc(fd: Handle, data: rawptr, len: int) -> (int, Errno) {
|
||||
s := transmute([]byte)mem.Raw_Slice{data, len}
|
||||
return write(fd, s)
|
||||
return write(fd, ([^]byte)(data)[:len])
|
||||
}
|
||||
|
||||
read_ptr :: proc(fd: Handle, data: rawptr, len: int) -> (int, Errno) {
|
||||
s := transmute([]byte)mem.Raw_Slice{data, len}
|
||||
return read(fd, s)
|
||||
return read(fd, ([^]byte)(data)[:len])
|
||||
}
|
||||
|
||||
heap_allocator_proc :: runtime.heap_allocator_proc
|
||||
|
||||
Reference in New Issue
Block a user