From 5c5b78cbbe6e9a3443448fd986f6068cfba9e136 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 22 Feb 2024 19:48:44 +0000 Subject: [PATCH] Improve `bit_field` printing --- core/fmt/fmt.odin | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 38e125c30..8c63055ed 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -2173,6 +2173,8 @@ fmt_named :: proc(fi: ^Info, v: any, verb: rune, info: runtime.Type_Info_Named) #partial switch b in info.base.variant { case runtime.Type_Info_Struct: fmt_struct(fi, v, verb, b, info.name) + case runtime.Type_Info_Bit_Field: + fmt_bit_field(fi, v, verb, b, info.name) case runtime.Type_Info_Bit_Set: fmt_bit_set(fi, v, verb = verb) case: @@ -2284,7 +2286,7 @@ fmt_matrix :: proc(fi: ^Info, v: any, verb: rune, info: runtime.Type_Info_Matrix } } -fmt_bit_field :: proc(fi: ^Info, v: any, verb: rune, info: runtime.Type_Info_Bit_Field) { +fmt_bit_field :: proc(fi: ^Info, v: any, verb: rune, info: runtime.Type_Info_Bit_Field, type_name: string) { read_bits :: proc(ptr: [^]byte, offset, size: uintptr) -> (res: u64) { for i in 0..