Skip to content

Commit 31363f8

Browse files
Fix XML comment warnings
1 parent b2948ab commit 31363f8

10 files changed

Lines changed: 190 additions & 237 deletions

File tree

src/ICSharpCode.SharpZipLib/BZip2/BZip2InputStream.cs

Lines changed: 69 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,73 @@ public class BZip2InputStream : Stream
1818
const int NO_RAND_PART_B_STATE = 6;
1919
const int NO_RAND_PART_C_STATE = 7;
2020
#endregion
21-
#region Constructors
21+
22+
#region Instance Fields
23+
/*--
24+
index of the last char in the block, so
25+
the block size == last + 1.
26+
--*/
27+
int last;
28+
29+
/*--
30+
index in zptr[] of original string after sorting.
31+
--*/
32+
int origPtr;
33+
34+
/*--
35+
always: in the range 0 .. 9.
36+
The current block size is 100000 * this number.
37+
--*/
38+
int blockSize100k;
39+
40+
bool blockRandomised;
41+
42+
int bsBuff;
43+
int bsLive;
44+
IChecksum mCrc = new BZip2Crc();
45+
46+
bool[] inUse = new bool[256];
47+
int nInUse;
48+
49+
byte[] seqToUnseq = new byte[256];
50+
byte[] unseqToSeq = new byte[256];
51+
52+
byte[] selector = new byte[BZip2Constants.MaximumSelectors];
53+
byte[] selectorMtf = new byte[BZip2Constants.MaximumSelectors];
54+
55+
int[] tt;
56+
byte[] ll8;
57+
58+
/*--
59+
freq table collected to save a pass over the data
60+
during decompression.
61+
--*/
62+
int[] unzftab = new int[256];
63+
64+
int[][] limit = new int[BZip2Constants.GroupCount][];
65+
int[][] baseArray = new int[BZip2Constants.GroupCount][];
66+
int[][] perm = new int[BZip2Constants.GroupCount][];
67+
int[] minLens = new int[BZip2Constants.GroupCount];
68+
69+
Stream baseStream;
70+
bool streamEnd;
71+
72+
int currentChar = -1;
73+
74+
int currentState = START_BLOCK_STATE;
75+
76+
int storedBlockCRC, storedCombinedCRC;
77+
int computedBlockCRC;
78+
uint computedCombinedCRC;
79+
80+
int count, chPrev, ch2;
81+
int tPos;
82+
int rNToGo;
83+
int rTPos;
84+
int i2, j2;
85+
byte z;
86+
#endregion
87+
2288
/// <summary>
2389
/// Construct instance for reading from stream
2490
/// </summary>
@@ -38,17 +104,11 @@ public BZip2InputStream(Stream stream)
38104
SetupBlock();
39105
}
40106

41-
#endregion
42-
43107
/// <summary>
44108
/// Get/set flag indicating ownership of underlying stream.
45-
/// When the flag is true <see cref="Close"></see> will close the underlying stream also.
109+
/// When the flag is true <see cref="Stream.Dispose()" /> will close the underlying stream also.
46110
/// </summary>
47-
public bool IsStreamOwner {
48-
get { return isStreamOwner; }
49-
set { isStreamOwner = value; }
50-
}
51-
111+
public bool IsStreamOwner { get; set; } = true;
52112

53113
#region Stream Overrides
54114
/// <summary>
@@ -838,72 +898,5 @@ static void HbCreateDecodeTables(int[] limit, int[] baseArray, int[] perm, char[
838898
baseArray[i] = ((limit[i - 1] + 1) << 1) - baseArray[i];
839899
}
840900
}
841-
842-
#region Instance Fields
843-
/*--
844-
index of the last char in the block, so
845-
the block size == last + 1.
846-
--*/
847-
int last;
848-
849-
/*--
850-
index in zptr[] of original string after sorting.
851-
--*/
852-
int origPtr;
853-
854-
/*--
855-
always: in the range 0 .. 9.
856-
The current block size is 100000 * this number.
857-
--*/
858-
int blockSize100k;
859-
860-
bool blockRandomised;
861-
862-
int bsBuff;
863-
int bsLive;
864-
IChecksum mCrc = new BZip2Crc();
865-
866-
bool[] inUse = new bool[256];
867-
int nInUse;
868-
869-
byte[] seqToUnseq = new byte[256];
870-
byte[] unseqToSeq = new byte[256];
871-
872-
byte[] selector = new byte[BZip2Constants.MaximumSelectors];
873-
byte[] selectorMtf = new byte[BZip2Constants.MaximumSelectors];
874-
875-
int[] tt;
876-
byte[] ll8;
877-
878-
/*--
879-
freq table collected to save a pass over the data
880-
during decompression.
881-
--*/
882-
int[] unzftab = new int[256];
883-
884-
int[][] limit = new int[BZip2Constants.GroupCount][];
885-
int[][] baseArray = new int[BZip2Constants.GroupCount][];
886-
int[][] perm = new int[BZip2Constants.GroupCount][];
887-
int[] minLens = new int[BZip2Constants.GroupCount];
888-
889-
Stream baseStream;
890-
bool streamEnd;
891-
892-
int currentChar = -1;
893-
894-
int currentState = START_BLOCK_STATE;
895-
896-
int storedBlockCRC, storedCombinedCRC;
897-
int computedBlockCRC;
898-
uint computedCombinedCRC;
899-
900-
int count, chPrev, ch2;
901-
int tPos;
902-
int rNToGo;
903-
int rTPos;
904-
int i2, j2;
905-
byte z;
906-
bool isStreamOwner = true;
907-
#endregion
908901
}
909902
}

src/ICSharpCode.SharpZipLib/BZip2/BZip2OutputStream.cs

Lines changed: 67 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,69 @@ because the number of elems to sort is
4141
};
4242
#endregion
4343

44-
#region Constructors
44+
#region Instance Fields
45+
/*--
46+
index of the last char in the block, so
47+
the block size == last + 1.
48+
--*/
49+
int last;
50+
51+
/*--
52+
index in zptr[] of original string after sorting.
53+
--*/
54+
int origPtr;
55+
56+
/*--
57+
always: in the range 0 .. 9.
58+
The current block size is 100000 * this number.
59+
--*/
60+
int blockSize100k;
61+
62+
bool blockRandomised;
63+
64+
int bytesOut;
65+
int bsBuff;
66+
int bsLive;
67+
IChecksum mCrc = new BZip2Crc();
68+
69+
bool[] inUse = new bool[256];
70+
int nInUse;
71+
72+
char[] seqToUnseq = new char[256];
73+
char[] unseqToSeq = new char[256];
74+
75+
char[] selector = new char[BZip2Constants.MaximumSelectors];
76+
char[] selectorMtf = new char[BZip2Constants.MaximumSelectors];
77+
78+
byte[] block;
79+
int[] quadrant;
80+
int[] zptr;
81+
short[] szptr;
82+
int[] ftab;
83+
84+
int nMTF;
85+
86+
int[] mtfFreq = new int[BZip2Constants.MaximumAlphaSize];
87+
88+
/*
89+
* Used when sorting. If too many long comparisons
90+
* happen, we stop sorting, randomise the block
91+
* slightly, and try again.
92+
*/
93+
int workFactor;
94+
int workDone;
95+
int workLimit;
96+
bool firstAttempt;
97+
int nBlocksRandomised;
98+
99+
int currentChar = -1;
100+
int runLength;
101+
uint blockCRC, combinedCRC;
102+
int allowableBlockSize;
103+
Stream baseStream;
104+
bool disposed_;
105+
#endregion
106+
45107
/// <summary>
46108
/// Construct a default output stream with maximum block size
47109
/// </summary>
@@ -77,9 +139,7 @@ public BZip2OutputStream(Stream stream, int blockSize)
77139
Initialize();
78140
InitBlock();
79141
}
80-
#endregion
81142

82-
#region Destructor
83143
/// <summary>
84144
/// Ensures that resources are freed and other cleanup operations
85145
/// are performed when the garbage collector reclaims the BZip2OutputStream.
@@ -88,20 +148,14 @@ public BZip2OutputStream(Stream stream, int blockSize)
88148
{
89149
Dispose(false);
90150
}
91-
#endregion
92151

93152
/// <summary>
94-
/// Get/set flag indicating ownership of underlying stream.
95-
/// When the flag is true <see cref="Close"></see> will close the underlying stream also.
153+
/// Gets or sets a flag indicating ownership of underlying stream.
154+
/// When the flag is true <see cref="Stream.Dispose()" /> will close the underlying stream also.
96155
/// </summary>
97-
public bool IsStreamOwner
98-
{
99-
get { return isStreamOwner; }
100-
set { isStreamOwner = value; }
101-
}
156+
/// <remarks>The default value is true.</remarks>
157+
public bool IsStreamOwner { get; set; } = true;
102158

103-
104-
#region Stream overrides
105159
/// <summary>
106160
/// Gets a value indicating whether the current stream supports reading
107161
/// </summary>
@@ -259,7 +313,6 @@ public override void WriteByte(byte value)
259313
}
260314
}
261315

262-
#endregion
263316
void MakeMaps()
264317
{
265318
nInUse = 0;
@@ -1730,70 +1783,5 @@ struct StackElement
17301783
public int hh;
17311784
public int dd;
17321785
}
1733-
1734-
#region Instance Fields
1735-
bool isStreamOwner = true;
1736-
1737-
/*--
1738-
index of the last char in the block, so
1739-
the block size == last + 1.
1740-
--*/
1741-
int last;
1742-
1743-
/*--
1744-
index in zptr[] of original string after sorting.
1745-
--*/
1746-
int origPtr;
1747-
1748-
/*--
1749-
always: in the range 0 .. 9.
1750-
The current block size is 100000 * this number.
1751-
--*/
1752-
int blockSize100k;
1753-
1754-
bool blockRandomised;
1755-
1756-
int bytesOut;
1757-
int bsBuff;
1758-
int bsLive;
1759-
IChecksum mCrc = new BZip2Crc();
1760-
1761-
bool[] inUse = new bool[256];
1762-
int nInUse;
1763-
1764-
char[] seqToUnseq = new char[256];
1765-
char[] unseqToSeq = new char[256];
1766-
1767-
char[] selector = new char[BZip2Constants.MaximumSelectors];
1768-
char[] selectorMtf = new char[BZip2Constants.MaximumSelectors];
1769-
1770-
byte[] block;
1771-
int[] quadrant;
1772-
int[] zptr;
1773-
short[] szptr;
1774-
int[] ftab;
1775-
1776-
int nMTF;
1777-
1778-
int[] mtfFreq = new int[BZip2Constants.MaximumAlphaSize];
1779-
1780-
/*
1781-
* Used when sorting. If too many long comparisons
1782-
* happen, we stop sorting, randomise the block
1783-
* slightly, and try again.
1784-
*/
1785-
int workFactor;
1786-
int workDone;
1787-
int workLimit;
1788-
bool firstAttempt;
1789-
int nBlocksRandomised;
1790-
1791-
int currentChar = -1;
1792-
int runLength;
1793-
uint blockCRC, combinedCRC;
1794-
int allowableBlockSize;
1795-
Stream baseStream;
1796-
bool disposed_;
1797-
#endregion
17981786
}
17991787
}

src/ICSharpCode.SharpZipLib/Lzw/LzwInputStream.cs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,11 @@ namespace ICSharpCode.SharpZipLib.Lzw
4444
public class LzwInputStream : Stream
4545
{
4646
/// <summary>
47-
/// Get/set flag indicating ownership of underlying stream.
48-
/// When the flag is true <see cref="Close"/> will close the underlying stream also.
47+
/// Gets or sets a flag indicating ownership of underlying stream.
48+
/// When the flag is true <see cref="Stream.Dispose()" /> will close the underlying stream also.
4949
/// </summary>
50-
/// <remarks>
51-
/// The default value is true.
52-
/// </remarks>
53-
public bool IsStreamOwner {
54-
get { return isStreamOwner; }
55-
set { isStreamOwner = value; }
56-
}
50+
/// <remarks>The default value is true.</remarks>
51+
public bool IsStreamOwner { get; set; } = true;
5752

5853
/// <summary>
5954
/// Creates a LzwInputStream
@@ -485,7 +480,7 @@ protected override void Dispose(bool disposing)
485480
{
486481
if (!isClosed) {
487482
isClosed = true;
488-
if (isStreamOwner) {
483+
if (IsStreamOwner) {
489484
baseInputStream.Dispose();
490485
}
491486
}
@@ -497,12 +492,6 @@ protected override void Dispose(bool disposing)
497492

498493
Stream baseInputStream;
499494

500-
/// <summary>
501-
/// Flag indicating wether this instance is designated the stream owner.
502-
/// When closing if this flag is true the underlying stream is closed.
503-
/// </summary>
504-
bool isStreamOwner = true;
505-
506495
/// <summary>
507496
/// Flag indicating wether this instance has been closed or not.
508497
/// </summary>

0 commit comments

Comments
 (0)