From 0a7656e25747ad630ebba56814e7e3e4a9e0b5ce Mon Sep 17 00:00:00 2001 From: triton Date: Mon, 15 Jul 2013 18:30:36 +0100 Subject: [PATCH] Fix the build. --- src/Generator/AST/Utils.cs | 2 +- src/Generator/Generators/CLI/CLIHeadersTemplate.cs | 6 +++--- src/Generator/Generators/CLI/CLISourcesTemplate.cs | 8 ++++---- .../Generators/CSharp/CSharpTextTemplate.cs | 14 +++++++------- src/Generator/Passes/CheckAmbiguousOverloads.cs | 5 +++-- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/Generator/AST/Utils.cs b/src/Generator/AST/Utils.cs index c85c8ab3..2f8c2b48 100644 --- a/src/Generator/AST/Utils.cs +++ b/src/Generator/AST/Utils.cs @@ -1,7 +1,7 @@  namespace CppSharp.AST { - public static class Utils + public static class ASTUtils { public static bool CheckIgnoreFunction(Class @class, Function function) { diff --git a/src/Generator/Generators/CLI/CLIHeadersTemplate.cs b/src/Generator/Generators/CLI/CLIHeadersTemplate.cs index edeefa3c..d1a99d71 100644 --- a/src/Generator/Generators/CLI/CLIHeadersTemplate.cs +++ b/src/Generator/Generators/CLI/CLIHeadersTemplate.cs @@ -364,7 +364,7 @@ namespace CppSharp.Generators.CLI PushIndent(); foreach (var field in @class.Fields) { - if (Utils.CheckIgnoreField(@class, field)) continue; + if (ASTUtils.CheckIgnoreField(@class, field)) continue; GenerateDeclarationCommon(field); if (@class.IsUnion) @@ -421,7 +421,7 @@ namespace CppSharp.Generators.CLI var staticMethods = new List(); foreach (var method in @class.Methods) { - if (Utils.CheckIgnoreMethod(@class, method)) + if (ASTUtils.CheckIgnoreMethod(@class, method)) continue; if (method.IsConstructor) @@ -499,7 +499,7 @@ namespace CppSharp.Generators.CLI PushIndent(); foreach (var field in @class.Fields) { - if (Utils.CheckIgnoreField(@class, field)) + if (ASTUtils.CheckIgnoreField(@class, field)) continue; GenerateDeclarationCommon(field); diff --git a/src/Generator/Generators/CLI/CLISourcesTemplate.cs b/src/Generator/Generators/CLI/CLISourcesTemplate.cs index ff8c6dbf..8b32cbc4 100644 --- a/src/Generator/Generators/CLI/CLISourcesTemplate.cs +++ b/src/Generator/Generators/CLI/CLISourcesTemplate.cs @@ -143,7 +143,7 @@ namespace CppSharp.Generators.CLI foreach (var method in @class.Methods) { - if (Utils.CheckIgnoreMethod(@class, method)) + if (ASTUtils.CheckIgnoreMethod(@class, method)) continue; GenerateDeclarationCommon(method); @@ -156,7 +156,7 @@ namespace CppSharp.Generators.CLI { foreach (var field in @class.Fields) { - if (Utils.CheckIgnoreField(@class, field)) + if (ASTUtils.CheckIgnoreField(@class, field)) continue; GenerateFieldProperty(field); @@ -482,7 +482,7 @@ namespace CppSharp.Generators.CLI foreach (var field in @class.Fields) { - if (Utils.CheckIgnoreField(@class, field)) continue; + if (ASTUtils.CheckIgnoreField(@class, field)) continue; var nativeField = string.Format("{0}{1}", nativeVar, field.OriginalName); @@ -612,7 +612,7 @@ namespace CppSharp.Generators.CLI foreach (var field in @class.Fields) { - if (Utils.CheckIgnoreField(@class, field)) continue; + if (ASTUtils.CheckIgnoreField(@class, field)) continue; var varName = string.Format("_native.{0}", field.OriginalName); diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 1a3ab879..74a4c87a 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -346,7 +346,7 @@ namespace CppSharp.Generators.CSharp foreach (var method in @class.Methods) { - if (Utils.CheckIgnoreMethod(@class, method)) + if (ASTUtils.CheckIgnoreMethod(@class, method)) continue; if (method.IsConstructor) @@ -404,7 +404,7 @@ namespace CppSharp.Generators.CSharp foreach (var field in @class.Fields) { - if (Utils.CheckIgnoreField(@class, field)) continue; + if (ASTUtils.CheckIgnoreField(@class, field)) continue; var nativeField = string.Format("{0}->{1}", Helpers.GeneratedIdentifier("ptr"), field.OriginalName); @@ -554,7 +554,7 @@ namespace CppSharp.Generators.CSharp foreach (var field in @class.Fields) { - if (Utils.CheckIgnoreField(@class, field)) continue; + if (ASTUtils.CheckIgnoreField(@class, field)) continue; NewLineIfNeeded(); @@ -751,7 +751,7 @@ namespace CppSharp.Generators.CSharp var staticMethods = new List(); foreach (var method in @class.Methods) { - if (Utils.CheckIgnoreMethod(@class, method)) + if (ASTUtils.CheckIgnoreMethod(@class, method)) continue; if (method.IsConstructor) @@ -842,7 +842,7 @@ namespace CppSharp.Generators.CSharp var args = TypePrinter.VisitParameters(@event.Parameters, hasNames: true); TypePrinter.PopContext(); - delegateInstance = Helpers.GeneratedIdentifier(@event.Name); + delegateInstance = Helpers.GeneratedIdentifier(@event.OriginalName); delegateName = delegateInstance + "Delegate"; delegateRaise = delegateInstance + "RaiseInstance"; @@ -949,7 +949,7 @@ namespace CppSharp.Generators.CSharp foreach (var ctor in @class.Constructors) { - if (Utils.CheckIgnoreMethod(@class, ctor)) + if (ASTUtils.CheckIgnoreMethod(@class, ctor)) continue; NewLineIfNeeded(); @@ -1759,7 +1759,7 @@ namespace CppSharp.Generators.CSharp retType = "System.IntPtr"; } - for(var i = 0; i < function.Parameters.Count; ++i) + for (var i = 0; i < function.Parameters.Count; ++i) { var param = function.Parameters[i]; diff --git a/src/Generator/Passes/CheckAmbiguousOverloads.cs b/src/Generator/Passes/CheckAmbiguousOverloads.cs index 6e94bf0a..ae6922d5 100644 --- a/src/Generator/Passes/CheckAmbiguousOverloads.cs +++ b/src/Generator/Passes/CheckAmbiguousOverloads.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using CppSharp.AST; using CppSharp.Generators; namespace CppSharp.Passes @@ -30,10 +31,10 @@ namespace CppSharp.Passes if (overload1.Function == overload2.Function) return false; - if (AST.Utils.CheckIgnoreFunction(@class, overload1.Function)) + if (ASTUtils.CheckIgnoreFunction(@class, overload1.Function)) return false; - if (AST.Utils.CheckIgnoreFunction(@class, overload2.Function)) + if (ASTUtils.CheckIgnoreFunction(@class, overload2.Function)) return false; // TODO: Default parameters?