Merge remote-tracking branch 'offical/master'

This commit is contained in:
ed
2024-05-16 17:18:43 -04:00
11 changed files with 98 additions and 37 deletions
+1 -1
View File
@@ -1960,7 +1960,7 @@ fmt_struct :: proc(fi: ^Info, v: any, the_verb: rune, info: runtime.Type_Info_St
fmt_arg(fi, any{data, t.id}, verb)
}
} else {
t := info.types[i].variant.(runtime.Type_Info_Pointer).elem
t := info.types[i].variant.(runtime.Type_Info_Multi_Pointer).elem
t_size := uintptr(t.size)
if reflect.is_any(t) {
io.write_string(fi.writer, "any{}", &fi.n)
+2 -2
View File
@@ -91,8 +91,8 @@ Inputs:
Returns:
- res: A string created from the null-terminated byte pointer and length
*/
string_from_null_terminated_ptr :: proc(ptr: ^byte, len: int) -> (res: string) {
s := transmute(string)mem.Raw_String{ptr, len}
string_from_null_terminated_ptr :: proc(ptr: [^]byte, len: int) -> (res: string) {
s := string(ptr[:len])
s = truncate_to_byte(s, 0)
return s
}