mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-03-08 10:10:00 +00:00
Array overloads with count=1 should be turned into ref/out parameters.
This fixes an issue where arrays with count=1 would remain as unsafe pointers instead of becoming ref/out parameters.
This commit is contained in:
parent
a23b846800
commit
9685f6e2f0
|
@ -341,11 +341,22 @@ namespace Bind
|
|||
// Array overloads
|
||||
foreach (Parameter p in _this.Parameters)
|
||||
{
|
||||
if (p.WrapperType == WrapperTypes.ArrayParameter && p.ElementCount != 1)
|
||||
if (p.WrapperType == WrapperTypes.ArrayParameter)
|
||||
{
|
||||
p.Reference = false;
|
||||
p.Array++;
|
||||
p.Pointer--;
|
||||
if (p.ElementCount != 1)
|
||||
{
|
||||
// Create a proper array
|
||||
p.Reference = false;
|
||||
p.Array++;
|
||||
p.Pointer--;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Create a reference
|
||||
p.Reference = true;
|
||||
p.Array--;
|
||||
p.Pointer--;
|
||||
}
|
||||
}
|
||||
}
|
||||
f = new Function(_this);
|
||||
|
@ -373,7 +384,7 @@ namespace Bind
|
|||
|
||||
_this = func;
|
||||
// Pointer overloads
|
||||
// Should be last to work around Intellisense bug, where
|
||||
// Should be last to work around an Intellisense bug, where
|
||||
// array overloads are not reported if there is a pointer overload.
|
||||
foreach (Parameter p in _this.Parameters)
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue