From 5263f43c29cb3753b577f62d9e894f89610fbb34 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 13 Feb 2026 15:01:12 +0000 Subject: [PATCH] more nulls and a namespace folder fix --- .../Archives/SevenZip/SevenZipArchive.cs | 2 +- .../Common/SevenZip/ArchiveDatabase.Async.cs | 5 +- .../Common/SevenZip/ArchiveDatabase.cs | 8 +- .../Common/SevenZip/ArchiveReader.Async.cs | 14 ++-- .../Common/SevenZip/ArchiveReader.cs | 81 +++++++++---------- .../Compressors/LZMA/AesDecoderStream.cs | 2 +- .../Compressors/LZMA/DecoderRegistry.Async.cs | 2 +- .../Compressors/LZMA/DecoderStream.cs | 2 +- .../Compressors/LZMA/Registry.cs | 2 +- .../Utils.cs => Utilities/BlockType.cs} | 23 +----- .../CrcBuilderStream.Async.cs | 2 +- .../CrcBuilderStream.cs | 4 +- .../{Utilites => Utilities}/CrcCheckStream.cs | 43 +--------- .../IPasswordProvider.cs | 2 +- src/SharpCompress/Compressors/Xz/Crc32.cs | 4 +- src/SharpCompress/Compressors/Xz/Crc64.cs | 4 +- .../Compressors/Xz/XZBlock.Async.cs | 2 - .../Rar/RarArchiveAsyncTests.cs | 2 +- .../SharpCompress.Test/Rar/RarArchiveTests.cs | 2 +- 19 files changed, 70 insertions(+), 136 deletions(-) rename src/SharpCompress/Compressors/LZMA/{Utilites/Utils.cs => Utilities/BlockType.cs} (57%) rename src/SharpCompress/Compressors/LZMA/{Utilites => Utilities}/CrcBuilderStream.Async.cs (93%) rename src/SharpCompress/Compressors/LZMA/{Utilites => Utilities}/CrcBuilderStream.cs (94%) rename src/SharpCompress/Compressors/LZMA/{Utilites => Utilities}/CrcCheckStream.cs (59%) rename src/SharpCompress/Compressors/LZMA/{Utilites => Utilities}/IPasswordProvider.cs (60%) diff --git a/src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs b/src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs index de0adc98..4d18ac04 100644 --- a/src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs +++ b/src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; using SharpCompress.Common; using SharpCompress.Common.SevenZip; -using SharpCompress.Compressors.LZMA.Utilites; +using SharpCompress.Compressors.LZMA.Utilities; using SharpCompress.IO; using SharpCompress.Readers; diff --git a/src/SharpCompress/Common/SevenZip/ArchiveDatabase.Async.cs b/src/SharpCompress/Common/SevenZip/ArchiveDatabase.Async.cs index e3f8cb9f..b816ba28 100644 --- a/src/SharpCompress/Common/SevenZip/ArchiveDatabase.Async.cs +++ b/src/SharpCompress/Common/SevenZip/ArchiveDatabase.Async.cs @@ -1,10 +1,8 @@ -#nullable disable - using System.IO; using System.Threading; using System.Threading.Tasks; using SharpCompress.Compressors.LZMA; -using SharpCompress.Compressors.LZMA.Utilites; +using SharpCompress.Compressors.LZMA.Utilities; namespace SharpCompress.Common.SevenZip; @@ -13,6 +11,7 @@ internal sealed partial class ArchiveDatabase internal async ValueTask GetFolderStreamAsync( Stream stream, CFolder folder, + IPasswordProvider pw, CancellationToken cancellationToken ) diff --git a/src/SharpCompress/Common/SevenZip/ArchiveDatabase.cs b/src/SharpCompress/Common/SevenZip/ArchiveDatabase.cs index f4eb0851..3c461522 100644 --- a/src/SharpCompress/Common/SevenZip/ArchiveDatabase.cs +++ b/src/SharpCompress/Common/SevenZip/ArchiveDatabase.cs @@ -1,10 +1,8 @@ -#nullable disable - using System; using System.Collections.Generic; using System.IO; using SharpCompress.Compressors.LZMA; -using SharpCompress.Compressors.LZMA.Utilites; +using SharpCompress.Compressors.LZMA.Utilities; namespace SharpCompress.Common.SevenZip; @@ -18,7 +16,7 @@ internal partial class ArchiveDatabase internal List _packSizes = new(); internal List _packCrCs = new(); internal List _folders = new(); - internal List _numUnpackStreamsVector; + internal List _numUnpackStreamsVector = null!; internal List _files = new(); internal List _packStreamStartPositions = new(); @@ -35,7 +33,7 @@ internal partial class ArchiveDatabase _packSizes.Clear(); _packCrCs.Clear(); _folders.Clear(); - _numUnpackStreamsVector = null; + _numUnpackStreamsVector = null!; _files.Clear(); _packStreamStartPositions.Clear(); diff --git a/src/SharpCompress/Common/SevenZip/ArchiveReader.Async.cs b/src/SharpCompress/Common/SevenZip/ArchiveReader.Async.cs index f81c52b9..4c193300 100644 --- a/src/SharpCompress/Common/SevenZip/ArchiveReader.Async.cs +++ b/src/SharpCompress/Common/SevenZip/ArchiveReader.Async.cs @@ -1,13 +1,13 @@ -#nullable disable - using System; using System.Collections.Generic; using System.IO; using System.Threading; using System.Threading.Tasks; +using SharpCompress.Compressors.Deflate64; using SharpCompress.Compressors.LZMA; -using SharpCompress.Compressors.LZMA.Utilites; +using SharpCompress.Compressors.LZMA.Utilities; using SharpCompress.IO; +using BlockType = SharpCompress.Compressors.LZMA.Utilities.BlockType; namespace SharpCompress.Common.SevenZip; @@ -264,7 +264,7 @@ internal sealed partial class ArchiveReader type = ReadId(); } - List dataVector = null; + List? dataVector = null; if (type == BlockType.AdditionalStreamsInfo) { dataVector = await ReadAndDecodePackedStreamsAsync( @@ -332,8 +332,8 @@ internal sealed partial class ArchiveReader } var emptyStreamVector = new BitVector(numFiles); - BitVector emptyFileVector = null; - BitVector antiFileVector = null; + BitVector emptyFileVector = null!; + BitVector antiFileVector = null!; var numEmptyStreams = 0; for (; ; ) @@ -351,7 +351,7 @@ internal sealed partial class ArchiveReader case BlockType.Name: using (var streamSwitch = new CStreamSwitch()) { - streamSwitch.Set(this, dataVector); + streamSwitch.Set(this, dataVector ?? []); #if DEBUG Log.Write("FileNames:"); #endif diff --git a/src/SharpCompress/Common/SevenZip/ArchiveReader.cs b/src/SharpCompress/Common/SevenZip/ArchiveReader.cs index bb19b4b1..1d50c0fb 100644 --- a/src/SharpCompress/Common/SevenZip/ArchiveReader.cs +++ b/src/SharpCompress/Common/SevenZip/ArchiveReader.cs @@ -1,5 +1,3 @@ -#nullable disable - using System; using System.Collections.Generic; using System.Diagnostics; @@ -7,20 +5,22 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using SharpCompress.Compressors.Deflate64; using SharpCompress.Compressors.LZMA; -using SharpCompress.Compressors.LZMA.Utilites; +using SharpCompress.Compressors.LZMA.Utilities; using SharpCompress.IO; +using BlockType = SharpCompress.Compressors.LZMA.Utilities.BlockType; namespace SharpCompress.Common.SevenZip; internal partial class ArchiveReader { - internal Stream _stream; + internal Stream _stream = null!; internal Stack _readerStack = new(); - internal DataReader _currentReader; + internal DataReader _currentReader = null!; internal long _streamOrigin; internal long _streamEnding; - internal byte[] _header; + internal byte[] _header = null!; private readonly Dictionary _cachedStreams = new(); @@ -54,9 +54,6 @@ internal partial class ArchiveReader { return null; } -#if DEBUG - Log.WriteLine("ReadId: {0}", (BlockType)id); -#endif return (BlockType)id; } @@ -130,12 +127,12 @@ internal partial class ArchiveReader return ReadBitVector(length); } - private void ReadNumberVector(List dataVector, int numFiles, Action action) + private void ReadNumberVector(List? dataVector, int numFiles, Action action) { var defined = ReadOptionalBitVector(numFiles); using var streamSwitch = new CStreamSwitch(); - streamSwitch.Set(this, dataVector); + streamSwitch.Set(this, dataVector ?? []); for (var i = 0; i < numFiles; i++) { @@ -164,7 +161,7 @@ internal partial class ArchiveReader } private void ReadDateTimeVector( - List dataVector, + List? dataVector, int numFiles, Action action ) => @@ -175,14 +172,14 @@ internal partial class ArchiveReader ); private void ReadAttributeVector( - List dataVector, + List? dataVector, int numFiles, Action action ) { var boolVector = ReadOptionalBitVector(numFiles); using var streamSwitch = new CStreamSwitch(); - streamSwitch.Set(this, dataVector); + streamSwitch.Set(this, dataVector ?? []); for (var i = 0; i < numFiles; i++) { if (boolVector[i]) @@ -427,7 +424,7 @@ internal partial class ArchiveReader #endif try { - packCrCs = null; + packCrCs = null!; dataOffset = checked((long)ReadNumber()); #if DEBUG @@ -489,7 +486,7 @@ internal partial class ArchiveReader } } - private void ReadUnpackInfo(List dataVector, out List folders) + private void ReadUnpackInfo(List? dataVector, out List folders) { #if DEBUG Log.WriteLine("-- ReadUnpackInfo --"); @@ -505,7 +502,7 @@ internal partial class ArchiveReader using (var streamSwitch = new CStreamSwitch()) { - streamSwitch.Set(this, dataVector); + streamSwitch.Set(this, dataVector ?? []); //folders.Clear(); //folders.Reserve(numFolders); @@ -586,7 +583,7 @@ internal partial class ArchiveReader #endif try { - numUnpackStreamsInFolders = null; + numUnpackStreamsInFolders = null!; BlockType? type; for (; ; ) @@ -679,7 +676,7 @@ internal partial class ArchiveReader numDigestsTotal += numSubstreams; } - digests = null; + digests = null!; for (; ; ) { @@ -696,7 +693,7 @@ internal partial class ArchiveReader var folder = folders[i]; if (numSubstreams == 1 && folder.UnpackCrcDefined) { - digests.Add(folder._unpackCrc.Value); + digests.Add(folder._unpackCrc!.Value); } else { @@ -741,7 +738,7 @@ internal partial class ArchiveReader } private void ReadStreamsInfo( - List dataVector, + List? dataVector, out long dataOffset, out List packSizes, out List packCrCs, @@ -758,12 +755,12 @@ internal partial class ArchiveReader try { dataOffset = long.MinValue; - packSizes = null; - packCrCs = null; - folders = null; - numUnpackStreamsInFolders = null; - unpackSizes = null; - digests = null; + packSizes = null!; + packCrCs = null!; + folders = null!; + numUnpackStreamsInFolders = null!; + unpackSizes = null!; + digests = null!; for (; ; ) { @@ -779,7 +776,7 @@ internal partial class ArchiveReader break; case BlockType.SubStreamsInfo: ReadSubStreamsInfo( - folders, + folders!, out numUnpackStreamsInFolders, out unpackSizes, out digests @@ -888,7 +885,7 @@ internal partial class ArchiveReader type = ReadId(); } - List dataVector = null; + List? dataVector = null; if (type == BlockType.AdditionalStreamsInfo) { dataVector = ReadAndDecodePackedStreams( @@ -954,8 +951,8 @@ internal partial class ArchiveReader } var emptyStreamVector = new BitVector(numFiles); - BitVector emptyFileVector = null; - BitVector antiFileVector = null; + BitVector emptyFileVector = null!; + BitVector antiFileVector = null!; var numEmptyStreams = 0; for (; ; ) @@ -973,7 +970,7 @@ internal partial class ArchiveReader case BlockType.Name: using (var streamSwitch = new CStreamSwitch()) { - streamSwitch.Set(this, dataVector); + streamSwitch.Set(this, dataVector ?? []); #if DEBUG Log.Write("FileNames:"); #endif @@ -1445,7 +1442,7 @@ internal partial class ArchiveReader public override void SetLength(long value) => throw new NotSupportedException(); - private Stream _stream; + private Stream? _stream; private long _rem; private int _currentIndex; @@ -1457,7 +1454,7 @@ internal partial class ArchiveReader ) { OpenFile(); - _stream.Dispose(); + _stream.NotNull().Dispose(); _stream = null; _currentIndex++; } @@ -1469,9 +1466,10 @@ internal partial class ArchiveReader #if DEBUG Log.WriteLine(_db._files[index].Name); #endif - if (_db._files[index].Crc.HasValue) + var crc = _db._files[index].Crc; + if (crc.HasValue) { - _stream = new CrcCheckStream(_db._files[index].Crc.Value); + _stream = new CrcCheckStream(crc.Value); } else { @@ -1568,11 +1566,10 @@ internal partial class ArchiveReader return new ReadOnlySubStream(s, db._files[fileIndex].Size); } - public void Extract(ArchiveDatabase db, int[] indices) + public void Extract(ArchiveDatabase db, int[]? indices) { - var allFilesMode = (indices is null); - - var numItems = allFilesMode ? db._files.Count : indices.Length; + var allFilesMode = indices is null; + var numItems = allFilesMode ? db._files.Count : indices!.Length; if (numItems == 0) { @@ -1582,7 +1579,7 @@ internal partial class ArchiveReader var extractFolderInfoVector = new List(); for (var i = 0; i < numItems; i++) { - var fileIndex = allFilesMode ? i : indices[i]; + var fileIndex = allFilesMode ? i : indices![i]; var folderIndex = db._fileIndexToFolderIndexMap[fileIndex]; if (folderIndex == -1) @@ -1608,7 +1605,7 @@ internal partial class ArchiveReader } } - byte[] buffer = null; + byte[] buffer = null!; foreach (var efi in extractFolderInfoVector) { int startIndex; diff --git a/src/SharpCompress/Compressors/LZMA/AesDecoderStream.cs b/src/SharpCompress/Compressors/LZMA/AesDecoderStream.cs index 48fd28b1..557456c8 100644 --- a/src/SharpCompress/Compressors/LZMA/AesDecoderStream.cs +++ b/src/SharpCompress/Compressors/LZMA/AesDecoderStream.cs @@ -4,7 +4,7 @@ using System.Security.Cryptography; using System.Text; using System.Threading; using System.Threading.Tasks; -using SharpCompress.Compressors.LZMA.Utilites; +using SharpCompress.Compressors.LZMA.Utilities; namespace SharpCompress.Compressors.LZMA; diff --git a/src/SharpCompress/Compressors/LZMA/DecoderRegistry.Async.cs b/src/SharpCompress/Compressors/LZMA/DecoderRegistry.Async.cs index a3d3a2ea..441a7b4d 100644 --- a/src/SharpCompress/Compressors/LZMA/DecoderRegistry.Async.cs +++ b/src/SharpCompress/Compressors/LZMA/DecoderRegistry.Async.cs @@ -7,7 +7,7 @@ using SharpCompress.Common.SevenZip; using SharpCompress.Compressors.BZip2; using SharpCompress.Compressors.Deflate; using SharpCompress.Compressors.Filters; -using SharpCompress.Compressors.LZMA.Utilites; +using SharpCompress.Compressors.LZMA.Utilities; using SharpCompress.Compressors.PPMd; using SharpCompress.Compressors.ZStandard; diff --git a/src/SharpCompress/Compressors/LZMA/DecoderStream.cs b/src/SharpCompress/Compressors/LZMA/DecoderStream.cs index 3963358b..ac50ac52 100644 --- a/src/SharpCompress/Compressors/LZMA/DecoderStream.cs +++ b/src/SharpCompress/Compressors/LZMA/DecoderStream.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Threading.Tasks; using SharpCompress.Common; using SharpCompress.Common.SevenZip; -using SharpCompress.Compressors.LZMA.Utilites; +using SharpCompress.Compressors.LZMA.Utilities; using SharpCompress.IO; namespace SharpCompress.Compressors.LZMA; diff --git a/src/SharpCompress/Compressors/LZMA/Registry.cs b/src/SharpCompress/Compressors/LZMA/Registry.cs index 23db75fe..10bb6129 100644 --- a/src/SharpCompress/Compressors/LZMA/Registry.cs +++ b/src/SharpCompress/Compressors/LZMA/Registry.cs @@ -5,7 +5,7 @@ using SharpCompress.Common.SevenZip; using SharpCompress.Compressors.BZip2; using SharpCompress.Compressors.Deflate; using SharpCompress.Compressors.Filters; -using SharpCompress.Compressors.LZMA.Utilites; +using SharpCompress.Compressors.LZMA.Utilities; using SharpCompress.Compressors.PPMd; using SharpCompress.Compressors.ZStandard; diff --git a/src/SharpCompress/Compressors/LZMA/Utilites/Utils.cs b/src/SharpCompress/Compressors/LZMA/Utilities/BlockType.cs similarity index 57% rename from src/SharpCompress/Compressors/LZMA/Utilites/Utils.cs rename to src/SharpCompress/Compressors/LZMA/Utilities/BlockType.cs index b57cd53f..37e8f220 100644 --- a/src/SharpCompress/Compressors/LZMA/Utilites/Utils.cs +++ b/src/SharpCompress/Compressors/LZMA/Utilities/BlockType.cs @@ -1,8 +1,7 @@ -using System; -using System.Diagnostics; -using System.IO; -namespace SharpCompress.Compressors.LZMA.Utilites; + + +namespace SharpCompress.Compressors.LZMA.Utilities; internal enum BlockType : byte { @@ -38,19 +37,3 @@ internal enum BlockType : byte #endregion } -internal static class Utils -{ - [Conditional("DEBUG")] - public static void Assert(bool expression) - { - if (!expression) - { - if (Debugger.IsAttached) - { - Debugger.Break(); - } - - throw new InvalidOperationException("Assertion failed."); - } - } -} diff --git a/src/SharpCompress/Compressors/LZMA/Utilites/CrcBuilderStream.Async.cs b/src/SharpCompress/Compressors/LZMA/Utilities/CrcBuilderStream.Async.cs similarity index 93% rename from src/SharpCompress/Compressors/LZMA/Utilites/CrcBuilderStream.Async.cs rename to src/SharpCompress/Compressors/LZMA/Utilities/CrcBuilderStream.Async.cs index 8ba2901b..8ff18ef7 100644 --- a/src/SharpCompress/Compressors/LZMA/Utilites/CrcBuilderStream.Async.cs +++ b/src/SharpCompress/Compressors/LZMA/Utilities/CrcBuilderStream.Async.cs @@ -3,7 +3,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace SharpCompress.Compressors.LZMA.Utilites; +namespace SharpCompress.Compressors.LZMA.Utilities; internal partial class CrcBuilderStream : Stream { diff --git a/src/SharpCompress/Compressors/LZMA/Utilites/CrcBuilderStream.cs b/src/SharpCompress/Compressors/LZMA/Utilities/CrcBuilderStream.cs similarity index 94% rename from src/SharpCompress/Compressors/LZMA/Utilites/CrcBuilderStream.cs rename to src/SharpCompress/Compressors/LZMA/Utilities/CrcBuilderStream.cs index 523e3e1f..1c5acb63 100644 --- a/src/SharpCompress/Compressors/LZMA/Utilites/CrcBuilderStream.cs +++ b/src/SharpCompress/Compressors/LZMA/Utilities/CrcBuilderStream.cs @@ -1,9 +1,7 @@ using System; using System.IO; -using System.Threading; -using System.Threading.Tasks; -namespace SharpCompress.Compressors.LZMA.Utilites; +namespace SharpCompress.Compressors.LZMA.Utilities; internal partial class CrcBuilderStream : Stream { diff --git a/src/SharpCompress/Compressors/LZMA/Utilites/CrcCheckStream.cs b/src/SharpCompress/Compressors/LZMA/Utilities/CrcCheckStream.cs similarity index 59% rename from src/SharpCompress/Compressors/LZMA/Utilites/CrcCheckStream.cs rename to src/SharpCompress/Compressors/LZMA/Utilities/CrcCheckStream.cs index d0e7b0c7..2c657519 100644 --- a/src/SharpCompress/Compressors/LZMA/Utilites/CrcCheckStream.cs +++ b/src/SharpCompress/Compressors/LZMA/Utilities/CrcCheckStream.cs @@ -1,64 +1,29 @@ using System; using System.Buffers; -using System.Diagnostics; using System.IO; using System.Threading; using System.Threading.Tasks; -namespace SharpCompress.Compressors.LZMA.Utilites; +namespace SharpCompress.Compressors.LZMA.Utilities; [CLSCompliant(false)] -public class CrcCheckStream : Stream +public class CrcCheckStream(uint crc) : Stream { - private readonly uint _mExpectedCrc; - private uint _mCurrentCrc; + private uint _mCurrentCrc = Crc.INIT_CRC; private bool _mClosed; private readonly long[] _mBytes = ArrayPool.Shared.Rent(256); - public CrcCheckStream(uint crc) - { - _mExpectedCrc = crc; - _mCurrentCrc = Crc.INIT_CRC; - } - protected override void Dispose(bool disposing) { - //Nanook - is not equal here - _mCurrentCrc is yet to be negated - //if (_mCurrentCrc != _mExpectedCrc) - //{ - // throw new InvalidOperationException(); - //} try { if (disposing && !_mClosed) { _mClosed = true; _mCurrentCrc = Crc.Finish(_mCurrentCrc); //now becomes equal -#if DEBUG - if (_mCurrentCrc == _mExpectedCrc) - { - Debug.WriteLine("CRC ok: " + _mExpectedCrc.ToString("x8")); - } - else - { - Debugger.Break(); - Debug.WriteLine("bad CRC"); - } - var lengthInv = 1.0 / _mLength; - double entropy = 0; - for (var i = 0; i < 256; i++) - { - if (_mBytes[i] != 0) - { - var p = lengthInv * _mBytes[i]; - entropy -= p * Math.Log(p, 256); - } - } - Debug.WriteLine("entropy: " + (int)(entropy * 100) + "%"); -#endif - if (_mCurrentCrc != _mExpectedCrc) //moved test to here + if (_mCurrentCrc != crc) //moved test to here { throw new InvalidOperationException(); } diff --git a/src/SharpCompress/Compressors/LZMA/Utilites/IPasswordProvider.cs b/src/SharpCompress/Compressors/LZMA/Utilities/IPasswordProvider.cs similarity index 60% rename from src/SharpCompress/Compressors/LZMA/Utilites/IPasswordProvider.cs rename to src/SharpCompress/Compressors/LZMA/Utilities/IPasswordProvider.cs index d7d787d2..868b4a52 100644 --- a/src/SharpCompress/Compressors/LZMA/Utilites/IPasswordProvider.cs +++ b/src/SharpCompress/Compressors/LZMA/Utilities/IPasswordProvider.cs @@ -1,4 +1,4 @@ -namespace SharpCompress.Compressors.LZMA.Utilites; +namespace SharpCompress.Compressors.LZMA.Utilities; internal interface IPasswordProvider { diff --git a/src/SharpCompress/Compressors/Xz/Crc32.cs b/src/SharpCompress/Compressors/Xz/Crc32.cs index 611238c5..be303898 100644 --- a/src/SharpCompress/Compressors/Xz/Crc32.cs +++ b/src/SharpCompress/Compressors/Xz/Crc32.cs @@ -1,5 +1,3 @@ -#nullable disable - using System; namespace SharpCompress.Compressors.Xz; @@ -10,7 +8,7 @@ public static class Crc32 public const uint DefaultPolynomial = 0xedb88320u; public const uint DefaultSeed = 0xffffffffu; - private static uint[] defaultTable; + private static uint[]? defaultTable; public static uint Compute(byte[] buffer) => Compute(DefaultSeed, buffer); diff --git a/src/SharpCompress/Compressors/Xz/Crc64.cs b/src/SharpCompress/Compressors/Xz/Crc64.cs index 2c7df9d5..e37d04a9 100644 --- a/src/SharpCompress/Compressors/Xz/Crc64.cs +++ b/src/SharpCompress/Compressors/Xz/Crc64.cs @@ -1,5 +1,3 @@ -#nullable disable - using System; namespace SharpCompress.Compressors.Xz; @@ -9,7 +7,7 @@ public static class Crc64 { public const ulong DefaultSeed = 0x0; - internal static ulong[] Table; + internal static ulong[]? Table; public const ulong Iso3309Polynomial = 0xD800000000000000; diff --git a/src/SharpCompress/Compressors/Xz/XZBlock.Async.cs b/src/SharpCompress/Compressors/Xz/XZBlock.Async.cs index 78d2de3d..08c0da70 100644 --- a/src/SharpCompress/Compressors/Xz/XZBlock.Async.cs +++ b/src/SharpCompress/Compressors/Xz/XZBlock.Async.cs @@ -1,5 +1,3 @@ -#nullable disable - using System; using System.Collections.Generic; using System.IO; diff --git a/tests/SharpCompress.Test/Rar/RarArchiveAsyncTests.cs b/tests/SharpCompress.Test/Rar/RarArchiveAsyncTests.cs index bed63133..bba174d6 100644 --- a/tests/SharpCompress.Test/Rar/RarArchiveAsyncTests.cs +++ b/tests/SharpCompress.Test/Rar/RarArchiveAsyncTests.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using SharpCompress.Archives; using SharpCompress.Archives.Rar; using SharpCompress.Common; -using SharpCompress.Compressors.LZMA.Utilites; +using SharpCompress.Compressors.LZMA.Utilities; using SharpCompress.Readers; using SharpCompress.Test.Mocks; using Xunit; diff --git a/tests/SharpCompress.Test/Rar/RarArchiveTests.cs b/tests/SharpCompress.Test/Rar/RarArchiveTests.cs index 72029d56..57a2ec76 100644 --- a/tests/SharpCompress.Test/Rar/RarArchiveTests.cs +++ b/tests/SharpCompress.Test/Rar/RarArchiveTests.cs @@ -4,7 +4,7 @@ using System.Linq; using SharpCompress.Archives; using SharpCompress.Archives.Rar; using SharpCompress.Common; -using SharpCompress.Compressors.LZMA.Utilites; +using SharpCompress.Compressors.LZMA.Utilities; using SharpCompress.Readers; using SharpCompress.Test.Mocks; using Xunit;