mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-26 09:23:48 +00:00
Support matrix literals
This commit is contained in:
+2
-2
@@ -1967,7 +1967,7 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) {
|
||||
for col in 0..<info.column_count {
|
||||
if col > 0 { io.write_string(fi.writer, ", ") }
|
||||
|
||||
offset := row*info.elem_size + col*info.stride
|
||||
offset := (row + col*info.elem_stride)*info.elem_size
|
||||
|
||||
data := uintptr(v.data) + uintptr(offset)
|
||||
fmt_arg(fi, any{rawptr(data), info.elem.id}, verb)
|
||||
@@ -1980,7 +1980,7 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) {
|
||||
for col in 0..<info.column_count {
|
||||
if col > 0 { io.write_string(fi.writer, "; ") }
|
||||
|
||||
offset := row*info.elem_size + col*info.stride
|
||||
offset := (row + col*info.elem_stride)*info.elem_size
|
||||
|
||||
data := uintptr(v.data) + uintptr(offset)
|
||||
fmt_arg(fi, any{rawptr(data), info.elem.id}, verb)
|
||||
|
||||
@@ -165,7 +165,7 @@ Type_Info_Relative_Slice :: struct {
|
||||
Type_Info_Matrix :: struct {
|
||||
elem: ^Type_Info,
|
||||
elem_size: int,
|
||||
stride: int, // bytes
|
||||
elem_stride: int,
|
||||
row_count: int,
|
||||
column_count: int,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user