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,12 +341,23 @@ namespace Bind
|
||||||
// Array overloads
|
// Array overloads
|
||||||
foreach (Parameter p in _this.Parameters)
|
foreach (Parameter p in _this.Parameters)
|
||||||
{
|
{
|
||||||
if (p.WrapperType == WrapperTypes.ArrayParameter && p.ElementCount != 1)
|
if (p.WrapperType == WrapperTypes.ArrayParameter)
|
||||||
{
|
{
|
||||||
|
if (p.ElementCount != 1)
|
||||||
|
{
|
||||||
|
// Create a proper array
|
||||||
p.Reference = false;
|
p.Reference = false;
|
||||||
p.Array++;
|
p.Array++;
|
||||||
p.Pointer--;
|
p.Pointer--;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Create a reference
|
||||||
|
p.Reference = true;
|
||||||
|
p.Array--;
|
||||||
|
p.Pointer--;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
f = new Function(_this);
|
f = new Function(_this);
|
||||||
CreateBody(f, false, enums);
|
CreateBody(f, false, enums);
|
||||||
|
@ -373,7 +384,7 @@ namespace Bind
|
||||||
|
|
||||||
_this = func;
|
_this = func;
|
||||||
// Pointer overloads
|
// 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.
|
// array overloads are not reported if there is a pointer overload.
|
||||||
foreach (Parameter p in _this.Parameters)
|
foreach (Parameter p in _this.Parameters)
|
||||||
{
|
{
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue