Skip to content

Use ref readonly instead of in #1882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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<T0>(this ComPtr<IFillLockBytes> thisVtbl, [F
}

/// <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<T0>(this ComPtr<IFillLockBytes> thisVtbl, ulong
}

/// <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 readonly unsafe int FillAppend([Flow(Silk.NET.Core.Native.FlowDirection.I
}

/// <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 readonly unsafe int FillAppend<T0>([Flow(Silk.NET.Core.Native.FlowDirecti
}

/// <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 readonly unsafe int FillAt(ulong ulOffset, [Flow(Silk.NET.Core.Native.Flo
}

/// <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 readonly unsafe int FillAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native
}

/// <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
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public readonly unsafe int WriteAt(ulong ulOffset, [Flow(Silk.NET.Core.Native.Fl
}

/// <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 readonly unsafe int WriteAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Nativ
}

/// <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
Loading