Add explicit discards to all value returning expressions

このコミットが含まれているのは:
Sergio Pedri committed 2022-10-15 09:10:18 -07:00
1 親 38adbe6087
コミット 9343ac7f7b
47ファイル変更
+144 -144

検索条件に一致するファイルはありません

+6 -6
ファイルの表示
@@ -26,12 +26,12 @@ public sealed class FxcCompilationException : Exception
{
StringBuilder builder = new(512);
builder.AppendLine("The FXC compiler encountered one or more errors while trying to compile the shader:");
builder.AppendLine();
builder.AppendLine(error.Trim());
builder.AppendLine();
builder.AppendLine("Make sure to only be using supported features by checking the README file in the ComputeSharp repository: https://github.com/Sergio0694/ComputeSharp.");
builder.Append("If you're sure that your C# shader code is valid, please open an issue an include a working repro and this error message.");
_ = builder.AppendLine("The FXC compiler encountered one or more errors while trying to compile the shader:");
_ = builder.AppendLine();
_ = builder.AppendLine(error.Trim());
_ = builder.AppendLine();
_ = builder.AppendLine("Make sure to only be using supported features by checking the README file in the ComputeSharp repository: https://github.com/Sergio0694/ComputeSharp.");
_ = builder.Append("If you're sure that your C# shader code is valid, please open an issue an include a working repro and this error message.");
return builder.ToString();
}
+1 -1
ファイルの表示
@@ -342,7 +342,7 @@ public sealed unsafe class D2D1ResourceTextureManager : ICustomQueryInterface
{
if (this.d2D1ResourceManagerImpl is not null)
{
this.d2D1ResourceManagerImpl->Release();
_ = this.d2D1ResourceManagerImpl->Release();
}
}
+2 -2
ファイルの表示
@@ -178,7 +178,7 @@ unsafe partial struct PixelShaderEffect
using ComPtr<ID2D1ResourceTextureManager> resourceTextureManager = this.resourceTextureManagerBuffer[resourceTextureIndex];
resourceTextureManager.CopyTo((ID2D1ResourceTextureManager**)data);
_ = resourceTextureManager.CopyTo((ID2D1ResourceTextureManager**)data);
if (actualSize is not null)
{
@@ -261,7 +261,7 @@ unsafe partial struct PixelShaderEffect
// If there's already an existing manager at this index, release it
if (currentResourceTextureManager is not null)
{
((IUnknown*)currentResourceTextureManager)->Release();
_ = ((IUnknown*)currentResourceTextureManager)->Release();
}
// Store the resource texture manager into the buffer
@@ -165,7 +165,7 @@ partial struct D2D1ResourceTextureManagerImpl
// If the texture has already been created, just return it
if (@this->d2D1ResourceTexture is not null)
{
@this->d2D1ResourceTexture->AddRef();
_ = @this->d2D1ResourceTexture->AddRef();
*resourceTexture = @this->d2D1ResourceTexture;
@@ -194,10 +194,10 @@ partial struct D2D1ResourceTextureManagerImpl
if (result == S.S_OK)
{
// Store the resource texture for later
d2D1ResourceTexture.CopyTo(&@this->d2D1ResourceTexture);
_ = d2D1ResourceTexture.CopyTo(&@this->d2D1ResourceTexture);
// Also return it to callers
d2D1ResourceTexture.CopyTo(resourceTexture);
_ = d2D1ResourceTexture.CopyTo(resourceTexture);
// Free the staging buffers
NativeMemory.Free(@this->resourceTextureProperties.extents);
+1 -1
ファイルの表示
@@ -31,7 +31,7 @@ internal readonly unsafe struct D2D1DrawInfoDispatchDataLoader : ID2D1DispatchDa
/// <inheritdoc/>
void ID2D1DispatchDataLoader.LoadConstantBuffer(ReadOnlySpan<byte> data)
{
this.d2D1DrawInfo->SetPixelShaderConstantBuffer(
_ = this.d2D1DrawInfo->SetPixelShaderConstantBuffer(
buffer: (byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)),
bufferCount: (uint)data.Length);
}