Skip to content

Commit

Permalink
update csharpier
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Hathcock committed Apr 11, 2024
1 parent 4b9c814 commit 1115308
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 54 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.27.3",
"version": "0.28.0",
"commands": [
"dotnet-csharpier"
]
Expand Down
1 change: 0 additions & 1 deletion src/SharpCompress/Archives/Zip/ZipArchive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ protected override IEnumerable<ZipArchiveEntry> LoadEntries(IEnumerable<ZipVolum
switch (h.ZipHeaderType)
{
case ZipHeaderType.DirectoryEntry:

{
var deh = (DirectoryEntryHeader)h;
Stream s;
Expand Down
6 changes: 0 additions & 6 deletions src/SharpCompress/Common/Rar/Headers/FileHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ private void ReadFromReaderV5(MarkingBinaryReader reader)
switch (type)
{
case FHEXTRA_CRYPT: // file encryption

{
Rar5CryptoInfo = new Rar5CryptoInfo(reader, true);

Expand All @@ -132,7 +131,6 @@ private void ReadFromReaderV5(MarkingBinaryReader reader)
}
break;
case FHEXTRA_HASH:

{
const uint FHEXTRA_HASH_BLAKE2 = 0x0;
// const uint HASH_BLAKE2 = 0x03;
Expand All @@ -146,7 +144,6 @@ private void ReadFromReaderV5(MarkingBinaryReader reader)
}
break;
case FHEXTRA_HTIME: // file time

{
var flags = reader.ReadRarVIntUInt16();
var isWindowsTime = (flags & 1) == 0;
Expand All @@ -171,7 +168,6 @@ private void ReadFromReaderV5(MarkingBinaryReader reader)
// }
// break;
case FHEXTRA_REDIR: // file system redirection

{
RedirType = reader.ReadRarVIntByte();
RedirFlags = reader.ReadRarVIntByte();
Expand Down Expand Up @@ -284,7 +280,6 @@ private void ReadFromReaderV4(MarkingBinaryReader reader)
switch (HeaderCode)
{
case HeaderCodeV.RAR4_FILE_HEADER:

{
if (HasFlag(FileFlagsV4.UNICODE))
{
Expand All @@ -311,7 +306,6 @@ private void ReadFromReaderV4(MarkingBinaryReader reader)
}
break;
case HeaderCodeV.RAR4_NEW_SUB_HEADER:

{
var datasize = HeaderSize - newLhdSize - nameSize;
if (HasFlag(FileFlagsV4.SALT))
Expand Down
6 changes: 0 additions & 6 deletions src/SharpCompress/Common/Rar/Headers/RarHeaderFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,11 @@ public IEnumerable<IRarHeader> ReadHeaders(Stream stream)
switch (StreamingMode)
{
case StreamingMode.Seekable:

{
reader.BaseStream.Position += ph.DataSize;
}
break;
case StreamingMode.Streaming:

{
reader.BaseStream.Skip(ph.DataSize);
}
Expand Down Expand Up @@ -146,14 +144,12 @@ public IEnumerable<IRarHeader> ReadHeaders(Stream stream)
switch (StreamingMode)
{
case StreamingMode.Seekable:

{
fh.DataStartPosition = reader.BaseStream.Position;
reader.BaseStream.Position += fh.CompressedSize;
}
break;
case StreamingMode.Streaming:

{
var ms = new ReadOnlySubStream(reader.BaseStream, fh.CompressedSize);
if (fh.R4Salt is null && fh.Rar5CryptoInfo is null)
Expand Down Expand Up @@ -204,14 +200,12 @@ private void SkipData(FileHeader fh, RarCrcBinaryReader reader)
switch (StreamingMode)
{
case StreamingMode.Seekable:

{
fh.DataStartPosition = reader.BaseStream.Position;
reader.BaseStream.Position += fh.CompressedSize;
}
break;
case StreamingMode.Streaming:

{
//skip the data because it's useless?
reader.BaseStream.Skip(fh.CompressedSize);
Expand Down
4 changes: 0 additions & 4 deletions src/SharpCompress/Common/Rar/RarVolume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,16 @@ internal IEnumerable<RarFilePart> GetVolumeFileParts()
switch (header.HeaderType)
{
case HeaderType.Mark:

{
lastMarkHeader = (MarkHeader)header;
}
break;
case HeaderType.Archive:

{
ArchiveHeader = (ArchiveHeader)header;
}
break;
case HeaderType.File:

{
var fh = (FileHeader)header;
if (_maxCompressionAlgorithm < fh.CompressionAlgorithm)
Expand All @@ -63,7 +60,6 @@ internal IEnumerable<RarFilePart> GetVolumeFileParts()
}
break;
case HeaderType.Service:

{
var fh = (FileHeader)header;
if (fh.FileName == "CMT")
Expand Down
2 changes: 0 additions & 2 deletions src/SharpCompress/Common/Tar/TarHeaderFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ ArchiveEncoding archiveEncoding
switch (mode)
{
case StreamingMode.Seekable:

{
header.DataStartPosition = reader.BaseStream.Position;

Expand All @@ -37,7 +36,6 @@ ArchiveEncoding archiveEncoding
}
break;
case StreamingMode.Streaming:

{
header.PackedStream = new TarReadOnlySubStream(stream, header.Size);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ private byte[] ApplyFilter(byte[] __d, uint DataSize, UnpackFilter Flt)
{
case FILTER_E8:
case FILTER_E8E9:

{
var FileOffset = (uint)WrittenFileSize;

Expand Down Expand Up @@ -569,7 +568,6 @@ private byte[] ApplyFilter(byte[] __d, uint DataSize, UnpackFilter Flt)
}
return SrcData;
case FILTER_ARM:

{
var FileOffset = (uint)WrittenFileSize;
// DataSize is unsigned, so we use "CurPos+3" and not "DataSize-3"
Expand Down
28 changes: 0 additions & 28 deletions src/SharpCompress/Compressors/Rar/VM/RarVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_CMP:

{
var value1 = (VMFlags)GetValue(cmd.IsByteMode, Mem, op1);
var result = value1 - GetValue(cmd.IsByteMode, Mem, op2);
Expand All @@ -247,7 +246,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_CMPB:

{
var value1 = (VMFlags)GetValue(true, Mem, op1);
var result = value1 - GetValue(true, Mem, op2);
Expand All @@ -265,7 +263,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_CMPD:

{
var value1 = (VMFlags)GetValue(false, Mem, op1);
var result = value1 - GetValue(false, Mem, op2);
Expand All @@ -283,7 +280,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_ADD:

{
var value1 = GetValue(cmd.IsByteMode, Mem, op1);
var result = (int)(
Expand Down Expand Up @@ -351,7 +347,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_SUB:

{
var value1 = GetValue(cmd.IsByteMode, Mem, op1);
var result = (int)(
Expand Down Expand Up @@ -411,7 +406,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_INC:

{
var result = (int)(GetValue(cmd.IsByteMode, Mem, op1) & (0xFFffFFffL + 1L));
if (cmd.IsByteMode)
Expand Down Expand Up @@ -440,7 +434,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_DEC:

{
var result = (int)(GetValue(cmd.IsByteMode, Mem, op1) & (0xFFffFFff - 1));
SetValue(cmd.IsByteMode, Mem, op1, result);
Expand All @@ -463,7 +456,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
continue;

case VMCommands.VM_XOR:

{
var result =
GetValue(cmd.IsByteMode, Mem, op1) ^ GetValue(cmd.IsByteMode, Mem, op2);
Expand All @@ -475,7 +467,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_AND:

{
var result =
GetValue(cmd.IsByteMode, Mem, op1) & GetValue(cmd.IsByteMode, Mem, op2);
Expand All @@ -487,7 +478,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_OR:

{
var result =
GetValue(cmd.IsByteMode, Mem, op1) | GetValue(cmd.IsByteMode, Mem, op2);
Expand All @@ -499,7 +489,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_TEST:

{
var result =
GetValue(cmd.IsByteMode, Mem, op1) & GetValue(cmd.IsByteMode, Mem, op2);
Expand Down Expand Up @@ -578,7 +567,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_SHL:

{
var value1 = GetValue(cmd.IsByteMode, Mem, op1);
var value2 = GetValue(cmd.IsByteMode, Mem, op2);
Expand All @@ -596,7 +584,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_SHR:

{
var value1 = GetValue(cmd.IsByteMode, Mem, op1);
var value2 = GetValue(cmd.IsByteMode, Mem, op2);
Expand All @@ -610,7 +597,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_SAR:

{
var value1 = GetValue(cmd.IsByteMode, Mem, op1);
var value2 = GetValue(cmd.IsByteMode, Mem, op2);
Expand All @@ -624,7 +610,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_NEG:

{
var result = -GetValue(cmd.IsByteMode, Mem, op1);
flags = (VMFlags)(
Expand All @@ -645,7 +630,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_PUSHA:

{
for (int i = 0, SP = R[7] - 4; i < regCount; i++, SP -= 4)
{
Expand All @@ -656,7 +640,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_POPA:

{
for (int i = 0, SP = R[7]; i < regCount; i++, SP += 4)
{
Expand Down Expand Up @@ -684,7 +667,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_XCHG:

{
var value1 = GetValue(cmd.IsByteMode, Mem, op1);
SetValue(cmd.IsByteMode, Mem, op1, GetValue(cmd.IsByteMode, Mem, op2));
Expand All @@ -693,7 +675,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_MUL:

{
var result = (int)(
(
Expand All @@ -707,7 +688,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_DIV:

{
var divider = GetValue(cmd.IsByteMode, Mem, op2);
if (divider != 0)
Expand All @@ -719,7 +699,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_ADC:

{
var value1 = GetValue(cmd.IsByteMode, Mem, op1);
var FC = (int)(flags & VMFlags.VM_FC);
Expand Down Expand Up @@ -749,7 +728,6 @@ private bool ExecuteCode(List<VMPreparedCommand> preparedCode, int cmdCount)
break;

case VMCommands.VM_SBB:

{
var value1 = GetValue(cmd.IsByteMode, Mem, op1);
var FC = (int)(flags & VMFlags.VM_FC);
Expand Down Expand Up @@ -1156,7 +1134,6 @@ private void ExecuteStandardFilter(VMStandardFilters filterType)
{
case VMStandardFilters.VMSF_E8:
case VMStandardFilters.VMSF_E8E9:

{
var dataSize = R[4];
long fileOffset = R[6] & unchecked((int)0xFFffFFff);
Expand Down Expand Up @@ -1211,7 +1188,6 @@ private void ExecuteStandardFilter(VMStandardFilters filterType)
break;

case VMStandardFilters.VMSF_ITANIUM:

{
var dataSize = R[4];
long fileOffset = R[6] & unchecked((int)0xFFffFFff);
Expand Down Expand Up @@ -1269,7 +1245,6 @@ private void ExecuteStandardFilter(VMStandardFilters filterType)
break;

case VMStandardFilters.VMSF_DELTA:

{
var dataSize = R[4] & unchecked((int)0xFFffFFff);
var channels = R[0] & unchecked((int)0xFFffFFff);
Expand Down Expand Up @@ -1300,7 +1275,6 @@ private void ExecuteStandardFilter(VMStandardFilters filterType)
break;

case VMStandardFilters.VMSF_RGB:

{
// byte *SrcData=Mem,*DestData=SrcData+DataSize;
int dataSize = R[4],
Expand Down Expand Up @@ -1366,7 +1340,6 @@ private void ExecuteStandardFilter(VMStandardFilters filterType)
break;

case VMStandardFilters.VMSF_AUDIO:

{
int dataSize = R[4],
channels = R[0];
Expand Down Expand Up @@ -1497,7 +1470,6 @@ private void ExecuteStandardFilter(VMStandardFilters filterType)
break;

case VMStandardFilters.VMSF_UPCASE:

{
int dataSize = R[4],
srcPos = 0,
Expand Down
Loading

0 comments on commit 1115308

Please sign in to comment.