Skip to content

Commit

Permalink
Use ref readonly instead of in (dotnet#1882)
Browse files Browse the repository at this point in the history
* Regen bindings, update notes, and fix a small maths bug

* Use ref readonly instead of in

* Our C# isn't cool enough yet

* Our C# isn't cool enough yet

* Fix attribute accessibility errors

---------

Co-authored-by: Dylan Perks <[email protected]>
  • Loading branch information
Perksey and Dylan Perks committed Mar 21, 2024
1 parent f98e5e5 commit 7c38fa2
Show file tree
Hide file tree
Showing 1,399 changed files with 104,649 additions and 104,591 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -477,4 +477,7 @@ src/**/build/
# Silk.NET Website Generation Output
/docs/
src/Website/Silk.NET.Statiq/temp
src/Website/Silk.NET.Statiq/cache
src/Website/Silk.NET.Statiq/cache

# As much as I love Mac, really not interested in this litter.
**/.DS_Store
1 change: 1 addition & 0 deletions build/props/bindings.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\src\Core\Silk.NET.Core\Silk.NET.Core.csproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\src\Core\Silk.NET.SilkTouch\Silk.NET.SilkTouch.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
<Compile Include="$(MSBuildThisFileDirectory)..\..\src\Core\Silk.NET.Core\Attributes\RequiresLocationAttribute.cs" />
</ItemGroup>
<PropertyGroup>
<SilkPublicApiExempt>true</SilkPublicApiExempt>
Expand Down
946 changes: 473 additions & 473 deletions src/Assimp/Silk.NET.Assimp/Assimp.gen.cs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/Assimp/Silk.NET.Assimp/AssimpOverloads.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3122,7 +3122,7 @@ public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.

/// <summary>To be documented.</summary>
[NativeName("Src", "Line 1477, Column 28 in material.h")]
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] Material* pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<byte> pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in MaterialProperty* pPropOut)
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] Material* pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<byte> pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in MaterialProperty* pPropOut)
{
// SpanOverloader
return thisApi.GetMaterialProperty(pMat, in pKey.GetPinnableReference(), type, index, in pPropOut);
Expand All @@ -3138,7 +3138,7 @@ public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.

/// <summary>To be documented.</summary>
[NativeName("Src", "Line 1477, Column 28 in material.h")]
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] byte* pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in MaterialProperty* pPropOut)
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] byte* pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in MaterialProperty* pPropOut)
{
// SpanOverloader
return thisApi.GetMaterialProperty(in pMat.GetPinnableReference(), pKey, type, index, in pPropOut);
Expand All @@ -3154,7 +3154,7 @@ public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.

/// <summary>To be documented.</summary>
[NativeName("Src", "Line 1477, Column 28 in material.h")]
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<byte> pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in MaterialProperty* pPropOut)
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<byte> pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in MaterialProperty* pPropOut)
{
// SpanOverloader
return thisApi.GetMaterialProperty(in pMat.GetPinnableReference(), in pKey.GetPinnableReference(), type, index, in pPropOut);
Expand All @@ -3170,7 +3170,7 @@ public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.

/// <summary>To be documented.</summary>
[NativeName("Src", "Line 1477, Column 28 in material.h")]
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In), UnmanagedType(Silk.NET.Core.Native.UnmanagedType.LPUTF8Str)] string pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in MaterialProperty* pPropOut)
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In), UnmanagedType(Silk.NET.Core.Native.UnmanagedType.LPUTF8Str)] string pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in MaterialProperty* pPropOut)
{
// SpanOverloader
return thisApi.GetMaterialProperty(in pMat.GetPinnableReference(), pKey, type, index, in pPropOut);
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Silk.NET.BuildTools/Common/Functions/Type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public int IndirectionLevels
public string ToString(bool allowFunctionPointers)
{
return (IsThis ? "this " : string.Empty) +
(IsIn ? "in " : string.Empty) +
(IsIn ? "[RequiresLocation] in " : string.Empty) +
(IsOut ? "out " : string.Empty) +
(IsByRef ? "ref " : string.Empty) +
(IsFunctionPointer && allowFunctionPointers && Name == "void"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static unsafe int FillAppend(this ComPtr<IFillLockBytes> thisVtbl, [Flow(
}

/// <summary>To be documented.</summary>
public static unsafe int FillAppend<T0>(this ComPtr<IFillLockBytes> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
public static unsafe int FillAppend<T0>(this ComPtr<IFillLockBytes> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
{
var @this = thisVtbl.Handle;
int ret = default;
Expand All @@ -118,7 +118,7 @@ public static unsafe int FillAppend(this ComPtr<IFillLockBytes> thisVtbl, [Flow(
}

/// <summary>To be documented.</summary>
public static int FillAppend<T0>(this ComPtr<IFillLockBytes> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
public static int FillAppend<T0>(this ComPtr<IFillLockBytes> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
{
var @this = thisVtbl.Handle;
int ret = default;
Expand Down Expand Up @@ -154,7 +154,7 @@ public static unsafe int FillAt(this ComPtr<IFillLockBytes> thisVtbl, ulong ulOf
}

/// <summary>To be documented.</summary>
public static unsafe int FillAt<T0>(this ComPtr<IFillLockBytes> thisVtbl, ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
public static unsafe int FillAt<T0>(this ComPtr<IFillLockBytes> thisVtbl, ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
{
var @this = thisVtbl.Handle;
int ret = default;
Expand All @@ -166,7 +166,7 @@ public static unsafe int FillAt(this ComPtr<IFillLockBytes> thisVtbl, ulong ulOf
}

/// <summary>To be documented.</summary>
public static int FillAt<T0>(this ComPtr<IFillLockBytes> thisVtbl, ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
public static int FillAt<T0>(this ComPtr<IFillLockBytes> thisVtbl, ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
{
var @this = thisVtbl.Handle;
int ret = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public IFillLockBytes
}

/// <summary>To be documented.</summary>
public readonly unsafe int FillAppend<T0>([Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
public readonly unsafe int FillAppend<T0>([Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
{
var @this = (IFillLockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
int ret = default;
Expand All @@ -144,7 +144,7 @@ public IFillLockBytes
}

/// <summary>To be documented.</summary>
public readonly int FillAppend<T0>([Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
public readonly int FillAppend<T0>([Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
{
var @this = (IFillLockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
int ret = default;
Expand Down Expand Up @@ -180,7 +180,7 @@ public IFillLockBytes
}

/// <summary>To be documented.</summary>
public readonly unsafe int FillAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
public readonly unsafe int FillAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
{
var @this = (IFillLockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
int ret = default;
Expand All @@ -192,7 +192,7 @@ public IFillLockBytes
}

/// <summary>To be documented.</summary>
public readonly int FillAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
public readonly int FillAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
{
var @this = (IFillLockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
int ret = default;
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Silk.NET.Core.Win32Extras/Structs/ILockBytes.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public ILockBytes
}

/// <summary>To be documented.</summary>
public readonly unsafe int WriteAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
public readonly unsafe int WriteAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
{
var @this = (ILockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
int ret = default;
Expand All @@ -192,7 +192,7 @@ public ILockBytes
}

/// <summary>To be documented.</summary>
public readonly int WriteAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
public readonly int WriteAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
{
var @this = (ILockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
int ret = default;
Expand Down
Loading

0 comments on commit 7c38fa2

Please sign in to comment.