diff --git a/src/Lucene.Net/Util/Packed/Direct16.cs b/src/Lucene.Net/Util/Packed/Direct16.cs index 0150811315..c9fbb6ddfa 100644 --- a/src/Lucene.Net/Util/Packed/Direct16.cs +++ b/src/Lucene.Net/Util/Packed/Direct16.cs @@ -49,7 +49,7 @@ internal Direct16(int packedIntsVersion, DataInput @in, int valueCount) values[i] = @in.ReadInt16(); } // because packed ints have not always been byte-aligned - int remaining = (int) (PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, 16) - 2L * valueCount); + int remaining = (int)(PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, 16) - 2L * valueCount); for (int i = 0; i < remaining; ++i) { @in.ReadByte(); @@ -65,7 +65,7 @@ public override long Get(int index) [MethodImpl(MethodImplOptions.AggressiveInlining)] public override void Set(int index, long value) { - values[index] = (short) (value); + values[index] = (short)(value); } public override long RamBytesUsed() @@ -80,7 +80,7 @@ public override long RamBytesUsed() [MethodImpl(MethodImplOptions.AggressiveInlining)] public override void Clear() { - Arrays.Fill(values, (short) 0L); + Arrays.Fill(values, (short)0L); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -120,7 +120,7 @@ public override int Set(int index, long[] arr, int off, int len) int sets = Math.Min(m_valueCount - index, len); for (int i = index, o = off, end = index + sets; i < end; ++i, ++o) { - values[i] = (short) arr[o]; + values[i] = (short)arr[o]; } return sets; } @@ -129,7 +129,7 @@ public override int Set(int index, long[] arr, int off, int len) public override void Fill(int fromIndex, int toIndex, long val) { if (Debugging.AssertsEnabled) Debugging.Assert(val == (val & 0xFFFFL)); - Arrays.Fill(values, fromIndex, toIndex, (short) val); + Arrays.Fill(values, fromIndex, toIndex, (short)val); } } } diff --git a/src/Lucene.Net/Util/Packed/Direct32.cs b/src/Lucene.Net/Util/Packed/Direct32.cs index b6f6fe0a0c..a8abd57169 100644 --- a/src/Lucene.Net/Util/Packed/Direct32.cs +++ b/src/Lucene.Net/Util/Packed/Direct32.cs @@ -49,7 +49,7 @@ internal Direct32(int packedIntsVersion, DataInput @in, int valueCount) values[i] = @in.ReadInt32(); } // because packed ints have not always been byte-aligned - int remaining = (int) (PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, 32) - 4L * valueCount); + int remaining = (int)(PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, 32) - 4L * valueCount); for (int i = 0; i < remaining; ++i) { @in.ReadByte(); @@ -65,7 +65,7 @@ public override long Get(int index) [MethodImpl(MethodImplOptions.AggressiveInlining)] public override void Set(int index, long value) { - values[index] = (int) (value); + values[index] = (int)(value); } public override long RamBytesUsed() @@ -80,7 +80,7 @@ public override long RamBytesUsed() [MethodImpl(MethodImplOptions.AggressiveInlining)] public override void Clear() { - Arrays.Fill(values, (int) 0L); + Arrays.Fill(values, (int)0L); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -120,7 +120,7 @@ public override int Set(int index, long[] arr, int off, int len) int sets = Math.Min(m_valueCount - index, len); for (int i = index, o = off, end = index + sets; i < end; ++i, ++o) { - values[i] = (int) arr[o]; + values[i] = (int)arr[o]; } return sets; } @@ -129,7 +129,7 @@ public override int Set(int index, long[] arr, int off, int len) public override void Fill(int fromIndex, int toIndex, long val) { if (Debugging.AssertsEnabled) Debugging.Assert(val == (val & 0xFFFFFFFFL)); - Arrays.Fill(values, fromIndex, toIndex, (int) val); + Arrays.Fill(values, fromIndex, toIndex, (int)val); } } } diff --git a/src/Lucene.Net/Util/Packed/Direct8.cs b/src/Lucene.Net/Util/Packed/Direct8.cs index 738bcb88c8..53636d07dd 100644 --- a/src/Lucene.Net/Util/Packed/Direct8.cs +++ b/src/Lucene.Net/Util/Packed/Direct8.cs @@ -46,7 +46,7 @@ internal Direct8(int packedIntsVersion, DataInput @in, int valueCount) { @in.ReadBytes(values, 0, valueCount); // because packed ints have not always been byte-aligned - int remaining = (int) (PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, 8) - 1L * valueCount); + int remaining = (int)(PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, 8) - 1L * valueCount); for (int i = 0; i < remaining; ++i) { @in.ReadByte(); @@ -62,7 +62,7 @@ public override long Get(int index) [MethodImpl(MethodImplOptions.AggressiveInlining)] public override void Set(int index, long value) { - values[index] = (byte) (value); + values[index] = (byte)(value); } public override long RamBytesUsed() @@ -77,7 +77,7 @@ public override long RamBytesUsed() [MethodImpl(MethodImplOptions.AggressiveInlining)] public override void Clear() { - Arrays.Fill(values, (byte) 0L); + Arrays.Fill(values, (byte)0L); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -117,7 +117,7 @@ public override int Set(int index, long[] arr, int off, int len) int sets = Math.Min(m_valueCount - index, len); for (int i = index, o = off, end = index + sets; i < end; ++i, ++o) { - values[i] = (byte) arr[o]; + values[i] = (byte)arr[o]; } return sets; } @@ -126,7 +126,7 @@ public override int Set(int index, long[] arr, int off, int len) public override void Fill(int fromIndex, int toIndex, long val) { if (Debugging.AssertsEnabled) Debugging.Assert(val == (val & 0xFFL)); - Arrays.Fill(values, fromIndex, toIndex, (byte) val); + Arrays.Fill(values, fromIndex, toIndex, (byte)val); } } } diff --git a/src/Lucene.Net/Util/Packed/Packed16ThreeBlocks.cs b/src/Lucene.Net/Util/Packed/Packed16ThreeBlocks.cs index c895d48111..921690a150 100644 --- a/src/Lucene.Net/Util/Packed/Packed16ThreeBlocks.cs +++ b/src/Lucene.Net/Util/Packed/Packed16ThreeBlocks.cs @@ -55,7 +55,7 @@ internal Packed16ThreeBlocks(int packedIntsVersion, DataInput @in, int valueCoun blocks[i] = @in.ReadInt16(); } // because packed ints have not always been byte-aligned - int remaining = (int) (PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, 48) - 3L * valueCount * 2); + int remaining = (int)(PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, 48) - 3L * valueCount * 2); for (int i = 0; i < remaining; ++i) { @in.ReadByte(); @@ -89,9 +89,9 @@ public override int Get(int index, long[] arr, int off, int len) public override void Set(int index, long value) { int o = index * 3; - blocks[o] = (short) (value >>> 32); - blocks[o + 1] = (short) (value >>> 16); - blocks[o + 2] = (short) value; + blocks[o] = (short)(value >>> 32); + blocks[o + 1] = (short)(value >>> 16); + blocks[o + 2] = (short)value; } public override int Set(int index, long[] arr, int off, int len) @@ -107,18 +107,18 @@ public override int Set(int index, long[] arr, int off, int len) for (int i = off, o = index * 3, end = off + sets; i < end; ++i) { long value = arr[i]; - blocks[o++] = (short) (value >>> 32); - blocks[o++] = (short) (value >>> 16); - blocks[o++] = (short) value; + blocks[o++] = (short)(value >>> 32); + blocks[o++] = (short)(value >>> 16); + blocks[o++] = (short)value; } return sets; } public override void Fill(int fromIndex, int toIndex, long val) { - short block1 = (short) (val >>> 32); - short block2 = (short) (val >>> 16); - short block3 = (short) val; + short block1 = (short)(val >>> 32); + short block2 = (short)(val >>> 16); + short block3 = (short)val; for (int i = fromIndex * 3, end = toIndex * 3; i < end; i += 3) { blocks[i] = block1; @@ -130,7 +130,7 @@ public override void Fill(int fromIndex, int toIndex, long val) [MethodImpl(MethodImplOptions.AggressiveInlining)] public override void Clear() { - Arrays.Fill(blocks, (short) 0); + Arrays.Fill(blocks, (short)0); } public override long RamBytesUsed() diff --git a/src/Lucene.Net/Util/Packed/Packed8ThreeBlocks.cs b/src/Lucene.Net/Util/Packed/Packed8ThreeBlocks.cs index 522d8540ce..777817c200 100644 --- a/src/Lucene.Net/Util/Packed/Packed8ThreeBlocks.cs +++ b/src/Lucene.Net/Util/Packed/Packed8ThreeBlocks.cs @@ -52,7 +52,7 @@ internal Packed8ThreeBlocks(int packedIntsVersion, DataInput @in, int valueCount { @in.ReadBytes(blocks, 0, 3 * valueCount); // because packed ints have not always been byte-aligned - int remaining = (int) (PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, 24) - 3L * valueCount * 1); + int remaining = (int)(PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, 24) - 3L * valueCount * 1); for (int i = 0; i < remaining; ++i) { @in.ReadByte(); @@ -86,9 +86,9 @@ public override int Get(int index, long[] arr, int off, int len) public override void Set(int index, long value) { int o = index * 3; - blocks[o] = (byte) (value >>> 16); - blocks[o + 1] = (byte) (value >>> 8); - blocks[o + 2] = (byte) value; + blocks[o] = (byte)(value >>> 16); + blocks[o + 1] = (byte)(value >>> 8); + blocks[o + 2] = (byte)value; } public override int Set(int index, long[] arr, int off, int len) @@ -104,18 +104,18 @@ public override int Set(int index, long[] arr, int off, int len) for (int i = off, o = index * 3, end = off + sets; i < end; ++i) { long value = arr[i]; - blocks[o++] = (byte) (value >>> 16); - blocks[o++] = (byte) (value >>> 8); - blocks[o++] = (byte) value; + blocks[o++] = (byte)(value >>> 16); + blocks[o++] = (byte)(value >>> 8); + blocks[o++] = (byte)value; } return sets; } public override void Fill(int fromIndex, int toIndex, long val) { - byte block1 = (byte) (val >>> 16); - byte block2 = (byte) (val >>> 8); - byte block3 = (byte) val; + byte block1 = (byte)(val >>> 16); + byte block2 = (byte)(val >>> 8); + byte block3 = (byte)val; for (int i = fromIndex * 3, end = toIndex * 3; i < end; i += 3) { blocks[i] = block1; @@ -127,7 +127,7 @@ public override void Fill(int fromIndex, int toIndex, long val) [MethodImpl(MethodImplOptions.AggressiveInlining)] public override void Clear() { - Arrays.Fill(blocks, (byte) 0); + Arrays.Fill(blocks, (byte)0); } public override long RamBytesUsed() diff --git a/src/Lucene.Net/Util/Packed/gen_Direct.py b/src/Lucene.Net/Util/Packed/gen_Direct.py index 7c73c76d1c..5e74784b75 100644 --- a/src/Lucene.Net/Util/Packed/gen_Direct.py +++ b/src/Lucene.Net/Util/Packed/gen_Direct.py @@ -49,7 +49,7 @@ TYPES = {8: "byte", 16: "short", 32: "int", 64: "long"} DOTNET_READ_TYPES = {8: "Byte", 16: "Int16", 32: "Int32", 64: "Int64"} # LUCENENET specific MASKS = {8: " & 0xFFL", 16: " & 0xFFFFL", 32: " & 0xFFFFFFFFL", 64: ""} -CASTS = {8: "(byte) ", 16: "(short) ", 32: "(int) ", 64: ""} +CASTS = {8: "(byte)", 16: "(short)", 32: "(int)", 64: ""} # LUCENENET specific - removed space from casts to match existing C# port style if __name__ == '__main__': for bpv in TYPES.keys(): @@ -94,7 +94,7 @@ f.write(" }\n") if bpv != 64: f.write(" // because packed ints have not always been byte-aligned\n") - f.write(" int remaining = (int) (PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, %d) - %dL * valueCount);\n" %(bpv, bpv / 8)) + f.write(" int remaining = (int)(PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, %d) - %dL * valueCount);\n" %(bpv, bpv / 8)) f.write(" for (int i = 0; i < remaining; ++i)\n") f.write(" {\n") f.write(" @in.ReadByte();\n") diff --git a/src/Lucene.Net/Util/Packed/gen_PackedThreeBlocks.py b/src/Lucene.Net/Util/Packed/gen_PackedThreeBlocks.py index a18ac3f6d9..b1e7e02df1 100644 --- a/src/Lucene.Net/Util/Packed/gen_PackedThreeBlocks.py +++ b/src/Lucene.Net/Util/Packed/gen_PackedThreeBlocks.py @@ -52,7 +52,7 @@ TYPES = {8: "byte", 16: "short"} DOTNET_READ_TYPES = {8: "Byte", 16: "Int16"} # LUCENENET specific MASKS = {8: " & 0xFFL", 16: " & 0xFFFFL", 32: " & 0xFFFFFFFFL", 64: ""} -CASTS = {8: "(byte) ", 16: "(short) ", 32: "(int) ", 64: ""} +CASTS = {8: "(byte)", 16: "(short)", 32: "(int)", 64: ""} # LUCENENET specific - removed space from casts to match existing C# port style if __name__ == '__main__': for bpv in TYPES.keys(): @@ -91,7 +91,7 @@ f.write(" blocks[i] = @in.Read%s();\n" %DOTNET_READ_TYPES[bpv].title()) # LUCENENET specific f.write(" }\n") f.write(" // because packed ints have not always been byte-aligned\n") - f.write(" int remaining = (int) (PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, %d) - 3L * valueCount * %d);\n" %(3 * bpv, bpv / 8)) + f.write(" int remaining = (int)(PackedInt32s.Format.PACKED.ByteCount(packedIntsVersion, valueCount, %d) - 3L * valueCount * %d);\n" %(3 * bpv, bpv / 8)) f.write(" for (int i = 0; i < remaining; ++i)\n") f.write(" {\n") f.write(" @in.ReadByte();\n")