This commit is contained in:
gingerBill
2022-08-24 12:18:42 +01:00
parent 8c1dfabb6b
commit 2908923db9
3 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -14,14 +14,14 @@ _ :: mem
Turn a pointer and a length into a slice.
*/
from_ptr :: proc "contextless" (ptr: ^$T, count: int) -> []T {
return ([^]T)(ptr)[:count]
return ([^]T)(ptr)[:count]
}
/*
Turn a pointer and a length into a byte slice.
*/
bytes_from_ptr :: proc "contextless" (ptr: rawptr, byte_count: int) -> []byte {
return ([^]byte)(ptr)[:byte_count]
return ([^]byte)(ptr)[:byte_count]
}
/*