Skip to content

Commit 210a3d6

Browse files
Apply suggestions from code review
Co-authored-by: Günther Foidl <[email protected]>
1 parent a4fe64a commit 210a3d6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,9 @@ public static Vector256<float> MultiplyAdd(
566566
/// <returns>The <see cref="Vector256{T}"/>.</returns>
567567
[MethodImpl(InliningOptions.AlwaysInline)]
568568
public static Vector128<float> MultiplyAdd(
569-
in Vector128<float> va,
570-
in Vector128<float> vm0,
571-
in Vector128<float> vm1)
569+
Vector128<float> va,
570+
Vector128<float> vm0,
571+
Vector128<float> vm1)
572572
{
573573
if (Fma.IsSupported)
574574
{

src/ImageSharp/Formats/Jpeg/Components/ColorConverters/JpegColorConverter.GrayScaleArm.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public override void ConvertToRgbInplace(in ComponentValues values)
2727
// Used for the color conversion
2828
var scale = Vector128.Create(1 / this.MaximumValue);
2929

30-
nint n = values.Component0.Length / Vector128<float>.Count;
31-
for (nint i = 0; i < n; i++)
30+
nuint n = (uint)values.Component0.Length / (uint)Vector128<float>.Count;
31+
for (nuint i = 0; i < n; i++)
3232
{
3333
ref Vector128<float> c0 = ref Unsafe.Add(ref c0Base, i);
3434
c0 = AdvSimd.Multiply(c0, scale);
@@ -53,8 +53,8 @@ public override void ConvertFromRgb(in ComponentValues values, Span<float> rLane
5353
var f0587 = Vector128.Create(0.587f);
5454
var f0114 = Vector128.Create(0.114f);
5555

56-
nint n = values.Component0.Length / Vector128<float>.Count;
57-
for (nint i = 0; i < n; i++)
56+
nuint n = (uint)values.Component0.Length / (uint)Vector128<float>.Count;
57+
for (nuint i = 0; i < n; i++)
5858
{
5959
ref Vector128<float> r = ref Unsafe.Add(ref srcRed, i);
6060
ref Vector128<float> g = ref Unsafe.Add(ref srcGreen, i);

0 commit comments

Comments
 (0)