From f0584df47ccb5de15264dd3bcb1925d8166d7a24 Mon Sep 17 00:00:00 2001 From: a pirate Date: Sat, 10 Aug 2024 09:26:38 -0700 Subject: [PATCH] Update stdlib --- external/bonsai_stdlib | 2 +- ...erate_string_table_entity_behavior_flags.h | 21 ++++++++++++------- ..._and_value_tables_engine_debug_view_mode.h | 21 ++++++++++++------- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/external/bonsai_stdlib b/external/bonsai_stdlib index 41664d02b..b49cf84d1 160000 --- a/external/bonsai_stdlib +++ b/external/bonsai_stdlib @@ -1 +1 @@ -Subproject commit 41664d02b3a109dc85e2eab9d060fdfb0e0f683b +Subproject commit b49cf84d13b1536e176608e0d0e8e037f4182e59 diff --git a/generated/generate_string_table_entity_behavior_flags.h b/generated/generate_string_table_entity_behavior_flags.h index 3af9c6adf..8bffafeae 100644 --- a/generated/generate_string_table_entity_behavior_flags.h +++ b/generated/generate_string_table_entity_behavior_flags.h @@ -22,14 +22,21 @@ ToStringPrefixless(entity_behavior_flags Type) { u32 CurrentFlags = u32(Type); - u32 FirstValue = UnsetLeastSignificantSetBit(&CurrentFlags); - Result = ToStringPrefixless(entity_behavior_flags(FirstValue)); - - while (CurrentFlags) + if (CountBitsSet_Kernighan(CurrentFlags) == 1) { - u32 Value = UnsetLeastSignificantSetBit(&CurrentFlags); - cs Next = ToStringPrefixless(entity_behavior_flags(Value)); - Result = FSz("%S | %S", Result, Next); + Result = FSz("(invalid value for entity_behavior_flags (%d))", CurrentFlags); + } + else + { + u32 FirstValue = UnsetLeastSignificantSetBit(&CurrentFlags); + Result = ToStringPrefixless(entity_behavior_flags(FirstValue)); + + while (CurrentFlags) + { + u32 Value = UnsetLeastSignificantSetBit(&CurrentFlags); + cs Next = ToStringPrefixless(entity_behavior_flags(Value)); + Result = FSz("%S | %S", Result, Next); + } } } break; diff --git a/generated/string_and_value_tables_engine_debug_view_mode.h b/generated/string_and_value_tables_engine_debug_view_mode.h index 23d561779..dc9ad63a4 100644 --- a/generated/string_and_value_tables_engine_debug_view_mode.h +++ b/generated/string_and_value_tables_engine_debug_view_mode.h @@ -21,14 +21,21 @@ ToStringPrefixless(engine_debug_view_mode Type) { u32 CurrentFlags = u32(Type); - u32 FirstValue = UnsetLeastSignificantSetBit(&CurrentFlags); - Result = ToStringPrefixless(engine_debug_view_mode(FirstValue)); - - while (CurrentFlags) + if (CountBitsSet_Kernighan(CurrentFlags) == 1) { - u32 Value = UnsetLeastSignificantSetBit(&CurrentFlags); - cs Next = ToStringPrefixless(engine_debug_view_mode(Value)); - Result = FSz("%S | %S", Result, Next); + Result = FSz("(invalid value for engine_debug_view_mode (%d))", CurrentFlags); + } + else + { + u32 FirstValue = UnsetLeastSignificantSetBit(&CurrentFlags); + Result = ToStringPrefixless(engine_debug_view_mode(FirstValue)); + + while (CurrentFlags) + { + u32 Value = UnsetLeastSignificantSetBit(&CurrentFlags); + cs Next = ToStringPrefixless(engine_debug_view_mode(Value)); + Result = FSz("%S | %S", Result, Next); + } } } break;