Skip to content

Commit bc5fc07

Browse files
committed
Enable 'IDE0060' warnings, fix issues
1 parent 2c489cd commit bc5fc07

File tree

14 files changed

+18
-28
lines changed

14 files changed

+18
-28
lines changed

.globalconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,9 @@ dotnet_diagnostic.CA2242.severity = warning
6969

7070
dotnet_diagnostic.IDE0010.severity = none
7171
dotnet_diagnostic.IDE0130.severity = none
72-
dotnet_diagnostic.IDE0060.severity = none
7372
dotnet_diagnostic.IDE1006.severity = warning
7473
dotnet_diagnostic.IDE0023.severity = none
7574
dotnet_diagnostic.IDE0024.severity = none
76-
dotnet_diagnostic.IDE0060.severity = none
7775
dotnet_diagnostic.IDE0057.severity = none
7876
dotnet_diagnostic.IDE0046.severity = none
7977
dotnet_diagnostic.IDE0072.severity = none

samples/ComputeSharp.SwapChain.Shaders.D2D1/ProteanClouds.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private float2 Map(float3 p, float prm1, float2 bsMo)
6767
return new float2(d + (cl * 0.2f) + 0.25f, cl);
6868
}
6969

70-
private float4 Render(float3 ro, float3 rd, float time, float prm1, float2 bsMo)
70+
private float4 Render(float3 ro, float3 rd, float prm1, float2 bsMo)
7171
{
7272
float4 rez = 0;
7373
float t = 1.5f;
@@ -162,7 +162,7 @@ public float4 Execute()
162162
rd.XY = Hlsl.Mul(rd.XY, Rotate((-Disp(scaledTime + 3.5f).X * 0.2f) + bsMo.X));
163163

164164
float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f));
165-
float4 scn = Render(ro, rd, scaledTime, prm1, bsMo);
165+
float4 scn = Render(ro, rd, prm1, bsMo);
166166
float3 col = scn.RGB;
167167

168168
col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f));

samples/ComputeSharp.SwapChain.Shaders/ProteanClouds.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private float2 Map(float3 p, float prm1, float2 bsMo)
6262
return new float2(d + (cl * 0.2f) + 0.25f, cl);
6363
}
6464

65-
private float4 Render(float3 ro, float3 rd, float time, float prm1, float2 bsMo)
65+
private float4 Render(float3 ro, float3 rd, float prm1, float2 bsMo)
6666
{
6767
float4 rez = 0;
6868
float t = 1.5f;
@@ -156,7 +156,7 @@ public float4 Execute()
156156
rd.XY = Hlsl.Mul(rd.XY, Rotate((-Disp(scaledTime + 3.5f).X * 0.2f) + bsMo.X));
157157

158158
float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f));
159-
float4 scn = Render(ro, rd, scaledTime, prm1, bsMo);
159+
float4 scn = Render(ro, rd, prm1, bsMo);
160160
float3 col = scn.RGB;
161161

162162
col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f));

src/ComputeSharp.Core/Intrinsics/Hlsl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using ComputeSharp.Core.Intrinsics;
22

3-
#pragma warning disable IDE0022
3+
#pragma warning disable IDE0022, IDE0060
44

55
namespace ComputeSharp;
66

src/ComputeSharp.Core/Primitives/Bool/Bool.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using System.Runtime.InteropServices;
33

4+
#pragma warning disable IDE0060
5+
46
namespace ComputeSharp;
57

68
/// <summary>

src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.Execute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public static bool IsCandidatePropertyDeclaration(SyntaxNode node, CancellationT
5959
return false;
6060
}
6161

62+
token.ThrowIfCancellationRequested();
63+
6264
// The property must be in a type with a base type (as it must derive from CanvasEffect)
6365
return node.Parent?.IsTypeDeclarationWithOrPotentiallyWithBaseTypes<ClassDeclarationSyntax>() == true;
6466
}

src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasEffect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public Rect[] GetRequiredSourceRectangles(
145145
Span<ComPtr<ABI.Microsoft.Graphics.Canvas.Effects.ICanvasEffect>> canvasEffects = sourceEffects.Length <= 16
146146
? stackalloc ComPtr<ABI.Microsoft.Graphics.Canvas.Effects.ICanvasEffect>[16]
147147
: MemoryMarshal.Cast<IntPtr, ComPtr<ABI.Microsoft.Graphics.Canvas.Effects.ICanvasEffect>>(
148-
canvasEffectsAbiArray = ArrayPool<IntPtr>.Shared.Rent(sourceEffects.Length));
148+
(canvasEffectsAbiArray = ArrayPool<IntPtr>.Shared.Rent(sourceEffects.Length)).AsSpan());
149149

150150
// Clear the span to ensure no false positives are accidentally disposed
151151
canvasEffects.Clear();

src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1EffectImplMethods.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
using ComputeSharp.D2D1.Shaders.Interop.Extensions;
77
using ComputeSharp.Win32;
88

9+
#pragma warning disable IDE0060
10+
911
namespace ComputeSharp.D2D1.Interop.Effects;
1012

1113
/// <summary>

src/ComputeSharp.SourceGeneration/Helpers/ImmutableArrayBuilder{T}.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,6 @@ public void AddRange(ReadOnlySpan<T> items)
229229
this.index += items.Length;
230230
}
231231

232-
/// <inheritdoc cref="ImmutableArrayBuilder{T}.Clear"/>
233-
public void Clear(ReadOnlySpan<T> items)
234-
{
235-
this.index = 0;
236-
}
237-
238232
/// <inheritdoc cref="ImmutableArrayBuilder{T}.Insert"/>
239233
public void Insert(int index, T item)
240234
{
@@ -254,9 +248,7 @@ public void Insert(int index, T item)
254248
this.index++;
255249
}
256250

257-
/// <summary>
258-
/// Clears the items in the current writer.
259-
/// </summary>
251+
/// <inheritdoc cref="ImmutableArrayBuilder{T}.Clear"/>
260252
public void Clear()
261253
{
262254
if (typeof(T) != typeof(byte) &&

src/ComputeSharp.SourceGeneration/Helpers/IndentedTextWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Runtime.CompilerServices;
99
using System.Text;
1010

11-
#pragma warning disable IDE0290
11+
#pragma warning disable IDE0060, IDE0290
1212

1313
namespace ComputeSharp.SourceGeneration.Helpers;
1414

0 commit comments

Comments
 (0)