diff --git a/src/Generator/Generators/CLI/CLIHeaders.cs b/src/Generator/Generators/CLI/CLIHeaders.cs index 4b0afce4..b10cf433 100644 --- a/src/Generator/Generators/CLI/CLIHeaders.cs +++ b/src/Generator/Generators/CLI/CLIHeaders.cs @@ -835,31 +835,29 @@ namespace CppSharp.Generators.CLI new TypeQualifiers()); if (@enum.BuiltinType.Type != PrimitiveType.Int) - WriteLine(" : {0}", typeName); - else - NewLine(); + Write(" : {0}", typeName); - WriteLine("{"); + NewLine(); + WriteStartBraceIndent(); - PushIndent(); foreach (var item in @enum.Items) { PushBlock(CLIBlockKind.EnumItem); GenerateInlineSummary(item.Comment); + + Write(item.Name); + if (item.ExplicitValue) - Write(String.Format("{0} = {1}", item.Name, - @enum.GetItemValueAsString(item))); - else - Write(String.Format("{0}", item.Name)); + Write(" = {0}", @enum.GetItemValueAsString(item)); if (item != @enum.Items.Last()) WriteLine(","); PopBlock(NewLineKind.Never); } - PopIndent(); + PopIndent(); WriteLine("};"); PopBlock(NewLineKind.BeforeNextBlock); diff --git a/src/Generator/Passes/CheckDuplicatedNamesPass.cs b/src/Generator/Passes/CheckDuplicatedNamesPass.cs index 08352dbe..95aee21b 100644 --- a/src/Generator/Passes/CheckDuplicatedNamesPass.cs +++ b/src/Generator/Passes/CheckDuplicatedNamesPass.cs @@ -73,7 +73,8 @@ namespace CppSharp.Passes if (function.IsOperator) { - // TODO: turn into a method; append the original type (say, "signed long") of the last parameter to the type so that the user knows which overload is called + // TODO: turn into a method; append the original type (say, "signed long") + // of the last parameter to the type so that the user knows which overload is called diagnostics.Warning("Duplicate operator {0} ignored", function.Name); function.ExplicitlyIgnore(); }