Browse Source

Removed unused parameters from the utility functions.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/849/head
Dimitar Dobrev 8 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 @@ -6,17 +6,17 @@ namespace CppSharp.AST
{
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 is Method)
return CheckIgnoreMethod(function as Method, options);
return CheckIgnoreMethod(function as Method);
return false;
}
public static bool CheckIgnoreMethod(Method method, DriverOptions options)
public static bool CheckIgnoreMethod(Method method)
{
if (!method.IsGenerated) return true;

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

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

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

@ -210,7 +210,7 @@ namespace CppSharp.Generators.CLI @@ -210,7 +210,7 @@ namespace CppSharp.Generators.CLI
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;
// 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 @@ -385,7 +385,7 @@ namespace CppSharp.Generators.CSharp
WriteStartBraceIndent();
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);
GenerateDeclarationCommon(method);
@ -512,7 +512,7 @@ namespace CppSharp.Generators.CSharp @@ -512,7 +512,7 @@ namespace CppSharp.Generators.CSharp
foreach (var method in @class.Methods)
{
if (ASTUtils.CheckIgnoreMethod(method, Options))
if (ASTUtils.CheckIgnoreMethod(method))
continue;
if (method.IsConstructor)
@ -1129,7 +1129,7 @@ namespace CppSharp.Generators.CSharp @@ -1129,7 +1129,7 @@ namespace CppSharp.Generators.CSharp
var staticMethods = new List<Method>();
foreach (var method in methods)
{
if (ASTUtils.CheckIgnoreMethod(method, Options))
if (ASTUtils.CheckIgnoreMethod(method))
continue;
if (method.IsConstructor)
@ -1786,7 +1786,7 @@ namespace CppSharp.Generators.CSharp @@ -1786,7 +1786,7 @@ namespace CppSharp.Generators.CSharp
foreach (var ctor in @class.Constructors)
{
if (ASTUtils.CheckIgnoreMethod(ctor, Options))
if (ASTUtils.CheckIgnoreMethod(ctor))
continue;
GenerateMethod(ctor, @class);

4
src/Generator/Passes/CheckDuplicatedNamesPass.cs

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

Loading…
Cancel
Save