Skip to content

Commit

Permalink
Removed the use of out byref for return buffers.
Browse files Browse the repository at this point in the history
Fixes #196
Contributes to #233
  • Loading branch information
PathogenDavid committed Mar 9, 2022
1 parent e528654 commit 6248682
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Biohazrd.CSharp/CSharpLibraryGenerator.Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,18 +358,12 @@ void WriteOutReturnBuffer(EmitFunctionContext emitContext)
if (!first)
{ Writer.Write(", "); }

if (!declaration.IsVirtual)
{ Writer.Write("out "); }
else if (mode == EmitParameterListMode.TrampolineArguments)
if (mode == EmitParameterListMode.TrampolineArguments)
{ Writer.Write("&"); }

if (writeTypes)
{
WriteType(context, declaration, declaration.ReturnType);

//TODO: When fixing https://github.com/InfectedLibraries/Biohazrd/issues/196, use WriteTypeAsReference instead.
if (mode == EmitParameterListMode.VTableFunctionPointerParameters)
{ Writer.Write('*'); }
WriteTypeAsReference(context, declaration, declaration.ReturnType);

if (writeNames)
{ Writer.Write(' '); }
Expand Down

0 comments on commit 6248682

Please sign in to comment.