Browse Source

Fixed invalid names of static field (variables).

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/361/head
Dimitar Dobrev 11 years ago
parent
commit
88293d5c84
  1. 6
      src/Generator/Passes/CleanInvalidDeclNamesPass.cs
  2. 4
      tests/CSharpTemp/CSharpTemp.h

6
src/Generator/Passes/CleanInvalidDeclNamesPass.cs

@ -123,6 +123,12 @@ namespace CppSharp.Passes @@ -123,6 +123,12 @@ namespace CppSharp.Passes
return base.VisitTypedefDecl(typedef);
}
public override bool VisitVariableDecl(Variable variable)
{
variable.Name = CheckName(variable.Name);
return base.VisitVariableDecl(variable);
}
private static void CheckEnumName(Enumeration @enum)
{
// If we still do not have a valid name, then try to guess one

4
tests/CSharpTemp/CSharpTemp.h

@ -10,6 +10,8 @@ public: @@ -10,6 +10,8 @@ public:
int& operator[](int i);
int A;
static int null;
protected:
int P;
};
@ -265,4 +267,4 @@ public: @@ -265,4 +267,4 @@ public:
void setIgnoredType(const IgnoredType<int>& value);
private:
IgnoredType<int> _ignoredType;
};
};

Loading…
Cancel
Save