From 7b91b6e7c8528f2d76374cfc5cfb532a75ef5cf5 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Tue, 26 Jan 2016 09:48:00 +0100 Subject: [PATCH 1/3] Commented out various unused fields that cause warnings and makes the WarningsAsErrors directive abort the build --- SharpCompress/Archive/Rar/FileInfoRarFilePart.cs | 4 ++-- SharpCompress/Common/GZip/GZipVolume.cs | 4 ++-- SharpCompress/Common/SevenZip/ArchiveReader.cs | 8 ++++---- SharpCompress/Common/SevenZip/DataReader.cs | 4 ++-- SharpCompress/Compressor/LZMA/Bcj2DecoderStream.cs | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/SharpCompress/Archive/Rar/FileInfoRarFilePart.cs b/SharpCompress/Archive/Rar/FileInfoRarFilePart.cs index 558cd14a..b871aeec 100644 --- a/SharpCompress/Archive/Rar/FileInfoRarFilePart.cs +++ b/SharpCompress/Archive/Rar/FileInfoRarFilePart.cs @@ -6,12 +6,12 @@ namespace SharpCompress.Archive.Rar { internal class FileInfoRarFilePart : SeekableFilePart { - private readonly FileInfoRarArchiveVolume volume; + //private readonly FileInfoRarArchiveVolume volume; internal FileInfoRarFilePart(FileInfoRarArchiveVolume volume, MarkHeader mh, FileHeader fh, FileInfo fi) : base(mh, fh, volume.Stream, volume.Password) { - this.volume = volume; + //this.volume = volume; FileInfo = fi; } diff --git a/SharpCompress/Common/GZip/GZipVolume.cs b/SharpCompress/Common/GZip/GZipVolume.cs index 82c7fd7f..4d83b4bd 100644 --- a/SharpCompress/Common/GZip/GZipVolume.cs +++ b/SharpCompress/Common/GZip/GZipVolume.cs @@ -5,7 +5,7 @@ namespace SharpCompress.Common.GZip public class GZipVolume : Volume { #if !PORTABLE && !NETFX_CORE - private readonly FileInfo fileInfo; + //private readonly FileInfo fileInfo; #endif public GZipVolume(Stream stream, Options options) @@ -17,7 +17,7 @@ namespace SharpCompress.Common.GZip public GZipVolume(FileInfo fileInfo, Options options) : base(fileInfo.OpenRead(), options) { - this.fileInfo = fileInfo; + //this.fileInfo = fileInfo; } #endif diff --git a/SharpCompress/Common/SevenZip/ArchiveReader.cs b/SharpCompress/Common/SevenZip/ArchiveReader.cs index 31455ca3..ea478445 100644 --- a/SharpCompress/Common/SevenZip/ArchiveReader.cs +++ b/SharpCompress/Common/SevenZip/ArchiveReader.cs @@ -1198,14 +1198,14 @@ namespace SharpCompress.Common.SevenZip private class FolderUnpackStream : Stream { private ArchiveDatabase _db; - private int _otherIndex; + //private int _otherIndex; private int _startIndex; private List _extractStatuses; public FolderUnpackStream(ArchiveDatabase db, int p, int startIndex, List list) { this._db = db; - this._otherIndex = p; + //this._otherIndex = p; this._startIndex = startIndex; this._extractStatuses = list; } @@ -1275,9 +1275,9 @@ namespace SharpCompress.Common.SevenZip private void OpenFile() { - bool skip = !_extractStatuses[_currentIndex]; + //bool skip = !_extractStatuses[_currentIndex]; int index = _startIndex + _currentIndex; - int realIndex = _otherIndex + index; + //int realIndex = _otherIndex + index; //string filename = @"D:\_testdump\" + _db.Files[index].Name; //Directory.CreateDirectory(Path.GetDirectoryName(filename)); //_stream = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.Delete); diff --git a/SharpCompress/Common/SevenZip/DataReader.cs b/SharpCompress/Common/SevenZip/DataReader.cs index 2b6f27cd..e99da390 100644 --- a/SharpCompress/Common/SevenZip/DataReader.cs +++ b/SharpCompress/Common/SevenZip/DataReader.cs @@ -34,7 +34,7 @@ namespace SharpCompress.Common.SevenZip #region Variables private byte[] _buffer; - private int _origin; + //private int _origin; private int _offset; private int _ending; @@ -45,7 +45,7 @@ namespace SharpCompress.Common.SevenZip public DataReader(byte[] buffer, int offset, int length) { _buffer = buffer; - _origin = offset; + //_origin = offset; _offset = offset; _ending = offset + length; } diff --git a/SharpCompress/Compressor/LZMA/Bcj2DecoderStream.cs b/SharpCompress/Compressor/LZMA/Bcj2DecoderStream.cs index c13f34b6..16e75235 100644 --- a/SharpCompress/Compressor/LZMA/Bcj2DecoderStream.cs +++ b/SharpCompress/Compressor/LZMA/Bcj2DecoderStream.cs @@ -99,7 +99,7 @@ namespace SharpCompress.Compressor.LZMA private RangeDecoder mRangeDecoder; private StatusDecoder[] mStatusDecoder; private long mWritten; - private long mLimit; + //private long mLimit; private IEnumerator mIter; private bool mFinished; private bool isDisposed; @@ -112,7 +112,7 @@ namespace SharpCompress.Compressor.LZMA if (streams.Length != 4) throw new NotSupportedException(); - mLimit = limit; + //mLimit = limit; mMainStream = streams[0]; mCallStream = streams[1]; mJumpStream = streams[2]; From 08b899fdac28492ced6c237200020598f013a229 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Tue, 26 Jan 2016 10:18:13 +0100 Subject: [PATCH 2/3] Deleted unused variables --- SharpCompress/Archive/Rar/FileInfoRarFilePart.cs | 3 --- SharpCompress/Common/GZip/GZipVolume.cs | 5 ----- SharpCompress/Common/SevenZip/ArchiveReader.cs | 3 --- SharpCompress/Common/SevenZip/DataReader.cs | 2 -- SharpCompress/Compressor/LZMA/Bcj2DecoderStream.cs | 2 -- 5 files changed, 15 deletions(-) diff --git a/SharpCompress/Archive/Rar/FileInfoRarFilePart.cs b/SharpCompress/Archive/Rar/FileInfoRarFilePart.cs index b871aeec..8c64e3b3 100644 --- a/SharpCompress/Archive/Rar/FileInfoRarFilePart.cs +++ b/SharpCompress/Archive/Rar/FileInfoRarFilePart.cs @@ -6,12 +6,9 @@ namespace SharpCompress.Archive.Rar { internal class FileInfoRarFilePart : SeekableFilePart { - //private readonly FileInfoRarArchiveVolume volume; - internal FileInfoRarFilePart(FileInfoRarArchiveVolume volume, MarkHeader mh, FileHeader fh, FileInfo fi) : base(mh, fh, volume.Stream, volume.Password) { - //this.volume = volume; FileInfo = fi; } diff --git a/SharpCompress/Common/GZip/GZipVolume.cs b/SharpCompress/Common/GZip/GZipVolume.cs index 4d83b4bd..0b49f649 100644 --- a/SharpCompress/Common/GZip/GZipVolume.cs +++ b/SharpCompress/Common/GZip/GZipVolume.cs @@ -4,10 +4,6 @@ namespace SharpCompress.Common.GZip { public class GZipVolume : Volume { -#if !PORTABLE && !NETFX_CORE - //private readonly FileInfo fileInfo; -#endif - public GZipVolume(Stream stream, Options options) : base(stream, options) { @@ -17,7 +13,6 @@ namespace SharpCompress.Common.GZip public GZipVolume(FileInfo fileInfo, Options options) : base(fileInfo.OpenRead(), options) { - //this.fileInfo = fileInfo; } #endif diff --git a/SharpCompress/Common/SevenZip/ArchiveReader.cs b/SharpCompress/Common/SevenZip/ArchiveReader.cs index ea478445..59e544a7 100644 --- a/SharpCompress/Common/SevenZip/ArchiveReader.cs +++ b/SharpCompress/Common/SevenZip/ArchiveReader.cs @@ -1198,14 +1198,12 @@ namespace SharpCompress.Common.SevenZip private class FolderUnpackStream : Stream { private ArchiveDatabase _db; - //private int _otherIndex; private int _startIndex; private List _extractStatuses; public FolderUnpackStream(ArchiveDatabase db, int p, int startIndex, List list) { this._db = db; - //this._otherIndex = p; this._startIndex = startIndex; this._extractStatuses = list; } @@ -1277,7 +1275,6 @@ namespace SharpCompress.Common.SevenZip { //bool skip = !_extractStatuses[_currentIndex]; int index = _startIndex + _currentIndex; - //int realIndex = _otherIndex + index; //string filename = @"D:\_testdump\" + _db.Files[index].Name; //Directory.CreateDirectory(Path.GetDirectoryName(filename)); //_stream = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.Delete); diff --git a/SharpCompress/Common/SevenZip/DataReader.cs b/SharpCompress/Common/SevenZip/DataReader.cs index e99da390..fe8d6435 100644 --- a/SharpCompress/Common/SevenZip/DataReader.cs +++ b/SharpCompress/Common/SevenZip/DataReader.cs @@ -34,7 +34,6 @@ namespace SharpCompress.Common.SevenZip #region Variables private byte[] _buffer; - //private int _origin; private int _offset; private int _ending; @@ -45,7 +44,6 @@ namespace SharpCompress.Common.SevenZip public DataReader(byte[] buffer, int offset, int length) { _buffer = buffer; - //_origin = offset; _offset = offset; _ending = offset + length; } diff --git a/SharpCompress/Compressor/LZMA/Bcj2DecoderStream.cs b/SharpCompress/Compressor/LZMA/Bcj2DecoderStream.cs index 16e75235..8034cd7a 100644 --- a/SharpCompress/Compressor/LZMA/Bcj2DecoderStream.cs +++ b/SharpCompress/Compressor/LZMA/Bcj2DecoderStream.cs @@ -99,7 +99,6 @@ namespace SharpCompress.Compressor.LZMA private RangeDecoder mRangeDecoder; private StatusDecoder[] mStatusDecoder; private long mWritten; - //private long mLimit; private IEnumerator mIter; private bool mFinished; private bool isDisposed; @@ -112,7 +111,6 @@ namespace SharpCompress.Compressor.LZMA if (streams.Length != 4) throw new NotSupportedException(); - //mLimit = limit; mMainStream = streams[0]; mCallStream = streams[1]; mJumpStream = streams[2]; From f20274aac7a9bd5f45bb8bed771289bfe8dc93ed Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Tue, 26 Jan 2016 10:18:23 +0100 Subject: [PATCH 3/3] Removed debug comments --- SharpCompress/Common/SevenZip/ArchiveReader.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/SharpCompress/Common/SevenZip/ArchiveReader.cs b/SharpCompress/Common/SevenZip/ArchiveReader.cs index 59e544a7..0196120b 100644 --- a/SharpCompress/Common/SevenZip/ArchiveReader.cs +++ b/SharpCompress/Common/SevenZip/ArchiveReader.cs @@ -1273,11 +1273,7 @@ namespace SharpCompress.Common.SevenZip private void OpenFile() { - //bool skip = !_extractStatuses[_currentIndex]; int index = _startIndex + _currentIndex; - //string filename = @"D:\_testdump\" + _db.Files[index].Name; - //Directory.CreateDirectory(Path.GetDirectoryName(filename)); - //_stream = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.Delete); #if DEBUG Log.WriteLine(_db.Files[index].Name); #endif