Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed Jan 14, 2025
1 parent 3875f62 commit a89fc3a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/SharpCompress/Archives/Rar/RarArchive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ namespace SharpCompress.Archives.Rar;
public class RarArchive : AbstractArchive<RarArchiveEntry, RarVolume>
{
private bool _disposed;
internal Lazy<IRarUnpack> UnpackV2017 { get; } = new(() => new Compressors.Rar.UnpackV2017.Unpack());
internal Lazy<IRarUnpack> UnpackV2017 { get; } =
new(() => new Compressors.Rar.UnpackV2017.Unpack());
internal Lazy<IRarUnpack> UnpackV1 { get; } = new(() => new Compressors.Rar.UnpackV1.Unpack());

/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion src/SharpCompress/Compressors/Rar/UnpackV1/Unpack20.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ private bool ReadTables20()
{
Span<byte> BitLength = stackalloc byte[PackDef.BC20];
Span<byte> Table = stackalloc byte[PackDef.MC20 * 4];
int TableSize, N, I;
int TableSize,
N,
I;
if (inAddr > readTop - 25)
{
if (!unpReadBuf())
Expand Down
10 changes: 8 additions & 2 deletions src/SharpCompress/Compressors/Rar/UnpackV1/UnpackUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,18 @@ internal static int decodeNumber(this BitInput input, Decode.Decode dec)
return (dec.DecodeNum[N]);
}

internal static void makeDecodeTables(Span<byte> lenTab, int offset, Decode.Decode dec, int size)
internal static void makeDecodeTables(
Span<byte> lenTab,
int offset,
Decode.Decode dec,
int size
)
{
Span<int> lenCount = stackalloc int[16];
Span<int> tmpPos = stackalloc int[16];
int i;
long M, N;
long M,
N;

new Span<int>(dec.DecodeNum).Clear(); // memset(Dec->DecodeNum,0,Size*sizeof(*Dec->DecodeNum));

Expand Down
3 changes: 2 additions & 1 deletion src/SharpCompress/Readers/Rar/RarReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public abstract class RarReader : AbstractReader<RarReaderEntry, RarVolume>
{
private bool _disposed;
private RarVolume? volume;
private Lazy<IRarUnpack> UnpackV2017 { get; } = new(() => new Compressors.Rar.UnpackV2017.Unpack());
private Lazy<IRarUnpack> UnpackV2017 { get; } =
new(() => new Compressors.Rar.UnpackV2017.Unpack());
private Lazy<IRarUnpack> UnpackV1 { get; } = new(() => new Compressors.Rar.UnpackV1.Unpack());

internal RarReader(ReaderOptions options)
Expand Down

0 comments on commit a89fc3a

Please sign in to comment.