Browse Source

Removed unused parameters from the utility functions.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/849/head
Dimitar Dobrev 9 years ago
parent
commit
8479ed3735
  1. 6
      src/Generator/AST/Utils.cs
  2. 6
      src/Generator/Generators/CLI/CLIHeaders.cs
  3. 2
      src/Generator/Generators/CLI/CLISources.cs
  4. 8
      src/Generator/Generators/CSharp/CSharpSources.cs
  5. 4
      src/Generator/Passes/CheckDuplicatedNamesPass.cs

6
src/Generator/AST/Utils.cs

@ -6,17 +6,17 @@ namespace CppSharp.AST
{ {
public static class ASTUtils public static class ASTUtils
{ {
public static bool CheckIgnoreFunction(Function function, DriverOptions options) public static bool CheckIgnoreFunction(Function function)
{ {
if (!function.IsGenerated) return true; if (!function.IsGenerated) return true;
if (function is Method) if (function is Method)
return CheckIgnoreMethod(function as Method, options); return CheckIgnoreMethod(function as Method);
return false; return false;
} }
public static bool CheckIgnoreMethod(Method method, DriverOptions options) public static bool CheckIgnoreMethod(Method method)
{ {
if (!method.IsGenerated) return true; if (!method.IsGenerated) return true;

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

@ -385,7 +385,7 @@ namespace CppSharp.Generators.CLI
foreach (var ctor in @class.Constructors) foreach (var ctor in @class.Constructors)
{ {
if (ASTUtils.CheckIgnoreMethod(ctor, Options) || FunctionIgnored(ctor)) if (ASTUtils.CheckIgnoreMethod(ctor) || FunctionIgnored(ctor))
continue; continue;
// C++/CLI does not allow special member funtions for value types. // C++/CLI does not allow special member funtions for value types.
@ -517,7 +517,7 @@ namespace CppSharp.Generators.CLI
var staticMethods = new List<Method>(); var staticMethods = new List<Method>();
foreach (var method in methods) foreach (var method in methods)
{ {
if (ASTUtils.CheckIgnoreMethod(method, Options) || FunctionIgnored(method)) if (ASTUtils.CheckIgnoreMethod(method) || FunctionIgnored(method))
continue; continue;
if (method.IsConstructor) if (method.IsConstructor)
@ -710,7 +710,7 @@ namespace CppSharp.Generators.CLI
public void GenerateMethod(Method method) public void GenerateMethod(Method method)
{ {
if (ASTUtils.CheckIgnoreMethod(method, Options) || FunctionIgnored(method)) return; if (ASTUtils.CheckIgnoreMethod(method) || FunctionIgnored(method)) return;
PushBlock(BlockKind.Method, method); PushBlock(BlockKind.Method, method);
GenerateDeclarationCommon(method); GenerateDeclarationCommon(method);

2
src/Generator/Generators/CLI/CLISources.cs

@ -210,7 +210,7 @@ namespace CppSharp.Generators.CLI
foreach (var method in @class.Methods.Where(m => @class == realOwner || !m.IsOperator)) foreach (var method in @class.Methods.Where(m => @class == realOwner || !m.IsOperator))
{ {
if (ASTUtils.CheckIgnoreMethod(method, Options) || CLIHeaders.FunctionIgnored(method)) if (ASTUtils.CheckIgnoreMethod(method) || CLIHeaders.FunctionIgnored(method))
continue; continue;
// C++/CLI does not allow special member funtions for value types. // C++/CLI does not allow special member funtions for value types.

8
src/Generator/Generators/CSharp/CSharpSources.cs

@ -385,7 +385,7 @@ namespace CppSharp.Generators.CSharp
WriteStartBraceIndent(); WriteStartBraceIndent();
foreach (var method in @class.Methods.Where(m => foreach (var method in @class.Methods.Where(m =>
!ASTUtils.CheckIgnoreMethod(m, Options) && m.Access == AccessSpecifier.Public)) !ASTUtils.CheckIgnoreMethod(m) && m.Access == AccessSpecifier.Public))
{ {
PushBlock(BlockKind.Method); PushBlock(BlockKind.Method);
GenerateDeclarationCommon(method); GenerateDeclarationCommon(method);
@ -512,7 +512,7 @@ namespace CppSharp.Generators.CSharp
foreach (var method in @class.Methods) foreach (var method in @class.Methods)
{ {
if (ASTUtils.CheckIgnoreMethod(method, Options)) if (ASTUtils.CheckIgnoreMethod(method))
continue; continue;
if (method.IsConstructor) if (method.IsConstructor)
@ -1129,7 +1129,7 @@ namespace CppSharp.Generators.CSharp
var staticMethods = new List<Method>(); var staticMethods = new List<Method>();
foreach (var method in methods) foreach (var method in methods)
{ {
if (ASTUtils.CheckIgnoreMethod(method, Options)) if (ASTUtils.CheckIgnoreMethod(method))
continue; continue;
if (method.IsConstructor) if (method.IsConstructor)
@ -1786,7 +1786,7 @@ namespace CppSharp.Generators.CSharp
foreach (var ctor in @class.Constructors) foreach (var ctor in @class.Constructors)
{ {
if (ASTUtils.CheckIgnoreMethod(ctor, Options)) if (ASTUtils.CheckIgnoreMethod(ctor))
continue; continue;
GenerateMethod(ctor, @class); GenerateMethod(ctor, @class);

4
src/Generator/Passes/CheckDuplicatedNamesPass.cs

@ -126,7 +126,7 @@ namespace CppSharp.Passes
if (!VisitDeclaration(decl)) if (!VisitDeclaration(decl))
return false; return false;
if (ASTUtils.CheckIgnoreFunction(decl, Options)) if (ASTUtils.CheckIgnoreFunction(decl))
return false; return false;
CheckDuplicate(decl); CheckDuplicate(decl);
@ -138,7 +138,7 @@ namespace CppSharp.Passes
if (!VisitDeclaration(decl)) if (!VisitDeclaration(decl))
return false; return false;
if (ASTUtils.CheckIgnoreMethod(decl, Options)) if (ASTUtils.CheckIgnoreMethod(decl))
return false; return false;
if (decl.ExplicitInterfaceImpl == null) if (decl.ExplicitInterfaceImpl == null)

Loading…
Cancel
Save