Skip to content

Commit 8b2e164

Browse files
committed
Fix CA1857
1 parent d1c3c31 commit 8b2e164

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/ImageSharp.ruleset

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<RuleSet Name="ImageSharp" ToolsVersion="17.0">
33
<Include Path="..\shared-infrastructure\sixlabors.ruleset" Action="Default" />
44
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.NetAnalyzers" RuleNamespace="Microsoft.CodeAnalysis.CSharp.NetAnalyzers">
5-
<Rule Id="CA1857" Action="None" />
65
<Rule Id="CA1859" Action="None" />
76
</Rules>
87
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">

src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Diagnostics.CodeAnalysis;
45
using System.Runtime.CompilerServices;
56
using System.Runtime.InteropServices;
67
using System.Runtime.Intrinsics;
@@ -58,7 +59,7 @@ public static Vector256<uint> PermuteMaskShiftAlpha8x32() => Vector256.Create(
5859
public static void Shuffle4Reduce(
5960
ref ReadOnlySpan<float> source,
6061
ref Span<float> dest,
61-
byte control)
62+
[ConstantExpected] byte control)
6263
{
6364
if (Avx.IsSupported || Sse.IsSupported)
6465
{
@@ -217,7 +218,7 @@ public static void Shuffle4Slice3Reduce(
217218
private static void Shuffle4(
218219
ReadOnlySpan<float> source,
219220
Span<float> dest,
220-
byte control)
221+
[ConstantExpected] byte control)
221222
{
222223
if (Avx.IsSupported)
223224
{

src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Six Labors Split License.
33

44
using System.Diagnostics;
5+
using System.Diagnostics.CodeAnalysis;
56
using System.Runtime.CompilerServices;
67
using System.Runtime.InteropServices;
78

@@ -20,7 +21,7 @@ internal static partial class SimdUtils
2021
public static void Shuffle4(
2122
ReadOnlySpan<float> source,
2223
Span<float> dest,
23-
byte control)
24+
[ConstantExpected] byte control)
2425
{
2526
VerifyShuffle4SpanInput(source, dest);
2627

0 commit comments

Comments
 (0)