Browse Source

Simplified some code.

pull/696/head
Joao Matos 10 years ago
parent
commit
857b25db2f
  1. 18
      src/Generator/Generators/CLI/CLIHeaders.cs
  2. 3
      src/Generator/Passes/CheckDuplicatedNamesPass.cs

18
src/Generator/Generators/CLI/CLIHeaders.cs

@ -835,31 +835,29 @@ namespace CppSharp.Generators.CLI @@ -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);

3
src/Generator/Passes/CheckDuplicatedNamesPass.cs

@ -73,7 +73,8 @@ namespace CppSharp.Passes @@ -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();
}

Loading…
Cancel
Save