From 2ebce723aedd84a03987f68c7e37202fb1cb3e4e Mon Sep 17 00:00:00 2001 From: triton Date: Mon, 14 Apr 2014 03:16:56 +0100 Subject: [PATCH] Use SafeIdentifier when writing parameter names in the C# marshaller. TODO: There are still lots of instances in the marshaller where we do not do this. We should instead clean the parameter/declaration names before entering generation. --- src/Generator/Generators/CSharp/CSharpMarshal.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpMarshal.cs b/src/Generator/Generators/CSharp/CSharpMarshal.cs index 45041a78..c26a82a6 100644 --- a/src/Generator/Generators/CSharp/CSharpMarshal.cs +++ b/src/Generator/Generators/CSharp/CSharpMarshal.cs @@ -476,7 +476,7 @@ namespace CppSharp.Generators.CSharp } else - Context.Return.Write(Context.Parameter.Name); + Context.Return.Write(Helpers.SafeIdentifier(Context.Parameter.Name)); return true; } @@ -632,7 +632,7 @@ namespace CppSharp.Generators.CSharp public override bool VisitEnumDecl(Enumeration @enum) { - Context.Return.Write(Context.Parameter.Name); + Context.Return.Write(Helpers.SafeIdentifier(Context.Parameter.Name)); return true; }