From 4f568222048d49a12eb66bf92bc5787d74582863 Mon Sep 17 00:00:00 2001 From: Tetralux Date: Mon, 12 Aug 2024 16:24:01 +0000 Subject: [PATCH] [fmt] Add bit fields to the pointer printing logic core:fmt prints pointers to structs as `&StructName{ ... }` but `bit_field`s are currently printed the same as rawptrs (`0xAABBCCDDEEFF` only). This commit changes that so they behave the same as structs and unions. --- core/fmt/fmt.odin | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 7b86fd1b7..0d11ad8a9 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -2728,7 +2728,8 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) { } case runtime.Type_Info_Struct, - runtime.Type_Info_Union: + runtime.Type_Info_Union, + runtime.Type_Info_Bit_Field: if ptr == nil { io.write_string(fi.writer, "", &fi.n) return