From d4fc063bbc1368d4162c02bdf0121f982959b47e Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Mon, 21 Feb 2022 22:57:20 +0100 Subject: [PATCH] Rename BLOCK_SIZE to BlockSize --- src/ImageSharp/Compression/Zlib/Adler32.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ImageSharp/Compression/Zlib/Adler32.cs b/src/ImageSharp/Compression/Zlib/Adler32.cs index 1f3b7e2a23..b13e2e4211 100644 --- a/src/ImageSharp/Compression/Zlib/Adler32.cs +++ b/src/ImageSharp/Compression/Zlib/Adler32.cs @@ -31,7 +31,7 @@ namespace SixLabors.ImageSharp.Compression.Zlib #if SUPPORTS_RUNTIME_INTRINSICS private const int MinBufferSize = 64; - private const int BLOCK_SIZE = 1 << 5; + private const int BlockSize = 1 << 5; // The C# compiler emits this as a compile-time constant embedded in the PE file. private static ReadOnlySpan Tap1Tap2 => new byte[] @@ -91,15 +91,15 @@ namespace SixLabors.ImageSharp.Compression.Zlib // Process the data in blocks. uint length = (uint)buffer.Length; - uint blocks = length / BLOCK_SIZE; - length -= blocks * BLOCK_SIZE; + uint blocks = length / BlockSize; + length -= blocks * BlockSize; int index = 0; fixed (byte* bufferPtr = buffer) { fixed (byte* tapPtr = Tap1Tap2) { - index += (int)blocks * BLOCK_SIZE; + index += (int)blocks * BlockSize; var localBufferPtr = bufferPtr; // _mm_setr_epi8 on x86 @@ -110,7 +110,7 @@ namespace SixLabors.ImageSharp.Compression.Zlib while (blocks > 0) { - uint n = NMAX / BLOCK_SIZE; /* The NMAX constraint. */ + uint n = NMAX / BlockSize; /* The NMAX constraint. */ if (n > blocks) { n = blocks; @@ -143,7 +143,7 @@ namespace SixLabors.ImageSharp.Compression.Zlib Vector128 mad2 = Ssse3.MultiplyAddAdjacent(bytes2, tap2); v_s2 = Sse2.Add(v_s2, Sse2.MultiplyAddAdjacent(mad2, ones).AsUInt32()); - localBufferPtr += BLOCK_SIZE; + localBufferPtr += BlockSize; } while (--n > 0); @@ -227,7 +227,7 @@ namespace SixLabors.ImageSharp.Compression.Zlib vs2 = Avx2.Add(vsum2.AsUInt32(), vs2); vs10 = vs1; - localBufferPtr += BLOCK_SIZE; + localBufferPtr += BlockSize; k -= 32; }