From 19017294c2af2f52150be3b19ad1b5926550d11d Mon Sep 17 00:00:00 2001 From: Eric Mellino Date: Sat, 27 Oct 2018 10:21:38 -0700 Subject: [PATCH] Remove Bool8 entirely, as it is no longer used. --- src/CodeGenerator/Program.cs | 10 ---------- src/ImGui.NET/Bool8.cs | 21 --------------------- 2 files changed, 31 deletions(-) delete mode 100644 src/ImGui.NET/Bool8.cs diff --git a/src/CodeGenerator/Program.cs b/src/CodeGenerator/Program.cs index 5cc2dbc..6b38064 100644 --- a/src/CodeGenerator/Program.cs +++ b/src/CodeGenerator/Program.cs @@ -14,7 +14,6 @@ namespace CodeGenerator { private static readonly Dictionary s_wellKnownTypes = new Dictionary() { - // { "bool", "Bool8" }, { "bool", "byte" }, { "unsigned char", "byte" }, { "char", "byte" }, @@ -305,15 +304,6 @@ namespace CodeGenerator if (field.ArraySize != 0) { string addrTarget = s_legalFixedTypes.Contains(rawType) ? $"NativePtr->{field.Name}" : $"&NativePtr->{field.Name}_0"; - - if (field.Type == "bool") - { - // There appear to be codegen bugs on Unix when RangeAccessor is used which result - // in values beyond the accessed range becoming corrupted. - // Besides, bool is a better type to use in the first place. - typeStr = "bool"; - } - writer.WriteLine($"public RangeAccessor<{typeStr}> {field.Name} => new RangeAccessor<{typeStr}>({addrTarget}, {field.ArraySize});"); } else if (typeStr.Contains("ImVector")) diff --git a/src/ImGui.NET/Bool8.cs b/src/ImGui.NET/Bool8.cs deleted file mode 100644 index 2258c2e..0000000 --- a/src/ImGui.NET/Bool8.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace ImGuiNET -{ - public struct Bool8 - { - public readonly byte Value; - public static implicit operator bool(Bool8 b8) => b8.Value != 0; - public static implicit operator Bool8(bool b) => new Bool8(b); - - public Bool8(bool value) - { - Value = value ? (byte)1 : (byte)0; - } - - public Bool8(byte value) - { - Value = value; - } - - public override string ToString() => string.Format("{0} [{1}]", (bool)this, Value); - } -}