This commit is contained in:
gingerBill committed 2022-08-24 12:18:42 +01:00
1 parent 8c1dfabb6b
commit 2908923db9
3 files changed
+6 -5

No files matched your search

+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]
}
/*