Browse Source

Improved the marshalling of arrays.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/145/head
Dimitar Dobrev 12 years ago
parent
commit
227e592c1a
  1. 4
      src/Generator/Generators/CSharp/CSharpMarshal.cs

4
src/Generator/Generators/CSharp/CSharpMarshal.cs

@ -124,8 +124,8 @@ namespace CppSharp.Generators.CSharp @@ -124,8 +124,8 @@ namespace CppSharp.Generators.CSharp
string to = Generator.GeneratedIdentifier("to");
supportBefore.WriteLine("{0}* {1} = {2};", array.Type, to, v);
string from = Generator.GeneratedIdentifier("from");
supportBefore.WriteLine("{0}* {1} = {2}->{3};",
array.Type, from, Generator.GeneratedIdentifier("ptr"), Context.ArgName);
supportBefore.WriteLine("{0}* {1} = {2};",
array.Type, from, Context.ReturnVarName);
supportBefore.WriteLine("for (int i = 0; i < {0}; i++)", array.Size);
supportBefore.WriteLineIndent("*{0}++ = *{1}++;", to, from);
supportBefore.WriteCloseBraceIndent();

Loading…
Cancel
Save