From b02db857c75806cf7351da4813543242132e2354 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Mon, 4 Jan 2021 04:18:50 +0100 Subject: [PATCH] C++: Make C enum field type match underlying type --- Il2CppInspector.Common/Cpp/CppType.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Il2CppInspector.Common/Cpp/CppType.cs b/Il2CppInspector.Common/Cpp/CppType.cs index 573843f..f8d10f5 100644 --- a/Il2CppInspector.Common/Cpp/CppType.cs +++ b/Il2CppInspector.Common/Cpp/CppType.cs @@ -428,14 +428,7 @@ namespace Il2CppInspector.Cpp // For the C-compatible definition, we have an alignment problem when the enum // does not derive from the architecture integer width. - return UnderlyingType.SizeBytes switch - { - 1 => "uint8_t", - 2 => "uint16_t", - 4 => "uint32_t", - 8 => "uint16_t", - _ => "enum " + Name - } + " " + fieldName; + return UnderlyingType.Name + " " + fieldName; } // Format specifier: 'c' = don't output C++-style enum with base type, use C-compatible code only