Browse Source

Fix CA1857

pull/2583/head
Stefan Nikolei 2 years ago
parent
commit
8b2e164c83
  1. 1
      src/ImageSharp.ruleset
  2. 5
      src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs
  3. 3
      src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs

1
src/ImageSharp.ruleset

@ -2,7 +2,6 @@
<RuleSet Name="ImageSharp" ToolsVersion="17.0">
<Include Path="..\shared-infrastructure\sixlabors.ruleset" Action="Default" />
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.NetAnalyzers" RuleNamespace="Microsoft.CodeAnalysis.CSharp.NetAnalyzers">
<Rule Id="CA1857" Action="None" />
<Rule Id="CA1859" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">

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

@ -1,6 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
@ -58,7 +59,7 @@ internal static partial class SimdUtils
public static void Shuffle4Reduce(
ref ReadOnlySpan<float> source,
ref Span<float> dest,
byte control)
[ConstantExpected] byte control)
{
if (Avx.IsSupported || Sse.IsSupported)
{
@ -217,7 +218,7 @@ internal static partial class SimdUtils
private static void Shuffle4(
ReadOnlySpan<float> source,
Span<float> dest,
byte control)
[ConstantExpected] byte control)
{
if (Avx.IsSupported)
{

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

@ -2,6 +2,7 @@
// Licensed under the Six Labors Split License.
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@ -20,7 +21,7 @@ internal static partial class SimdUtils
public static void Shuffle4(
ReadOnlySpan<float> source,
Span<float> dest,
byte control)
[ConstantExpected] byte control)
{
VerifyShuffle4SpanInput(source, dest);

Loading…
Cancel
Save