From b41d3cfb6eaad3e8d7ece328205e1f0d23f572aa Mon Sep 17 00:00:00 2001 From: triton Date: Wed, 22 May 2013 16:18:02 +0100 Subject: [PATCH] Remove one-line method GenerateStructMarshaling and inline its content where it was called. --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 2275e89c..0ae8348c 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -341,11 +341,6 @@ namespace CppSharp.Generators.CSharp typePrinter.PopContext(); } - private void GenerateStructMarshaling(Class @class) - { - GenerateStructMarshalingFields(@class); - } - private void GenerateStructMarshalingFields(Class @class) { foreach (var @base in @class.Bases) @@ -834,7 +829,10 @@ namespace CppSharp.Generators.CSharp } else { - GenerateStructMarshaling(@class); + WriteLine("var {0} = (Internal*){1}.ToPointer();", + Helpers.GeneratedIdentifier("ptr"), "native"); + + GenerateStructMarshalingFields(@class); } WriteCloseBraceIndent();