Internal Fixes, etc. (#20)

* Start removing mixed usages

* Check for directories before opening

* Fix writing

* Kinda fix rebuild

* One more try

* Better internal handling

* Slighty fix a couple more things

* Update RVWorld Compress code to db7d750bba

* Fix build

Co-authored-by: Matt Nadareski <mnadareski@mparticle.com>
This commit is contained in:
Matt Nadareski
2020-04-03 13:19:21 -07:00
committed by GitHub
parent 1de4bc7b18
commit 916d2a3b51
79 changed files with 3377 additions and 2337 deletions

View File

@@ -71,4 +71,4 @@ namespace Compress.SevenZip.Compress.LZMA
(1 << kNumHighLenBits);
public const uint kMatchMaxLen = kMatchMinLen + kNumLenSymbols - 1;
}
}
}

View File

@@ -387,7 +387,7 @@ namespace Compress.SevenZip.Compress.LZMA
set { }
}
public override void Flush() { }
public override int Read(byte[] buffer, int offset, int count)
public override int Read(byte[] buffer, int offset, int count)
{
return 0;
}
@@ -401,4 +401,4 @@ namespace Compress.SevenZip.Compress.LZMA
public override void SetLength(long value) {}
*/
}
}
}

View File

@@ -876,7 +876,7 @@ namespace Compress.SevenZip.Compress.LZMA
}
}
UInt32 startLen = 2; // speed optimization
UInt32 startLen = 2; // speed optimization
for (UInt32 repIndex = 0; repIndex < Base.kNumRepDistances; repIndex++)
{
@@ -1418,7 +1418,7 @@ namespace Compress.SevenZip.Compress.LZMA
}
static string[] kMatchFinderIDs =
static string[] kMatchFinderIDs =
{
"BT2",
"BT4",
@@ -1544,4 +1544,4 @@ namespace Compress.SevenZip.Compress.LZMA
}
}
}
}

View File

@@ -54,4 +54,4 @@ namespace Compress.SevenZip.Compress.LZMA
};
}
}
}
}

View File

@@ -181,11 +181,11 @@ namespace Compress.SevenZip.Compress.LZMA
toProcess = (int)availableBytes;
outWindow.SetLimit(toProcess);
if(uncompressedChunk)
if (uncompressedChunk)
{
inputPosition += outWindow.CopyStream(inputStream, toProcess);
}
else if(decoder.Code(dictionarySize, outWindow, rangeDecoder)
else if (decoder.Code(dictionarySize, outWindow, rangeDecoder)
&& outputSize < 0)
{
availableBytes = outWindow.AvailableBytes;
@@ -281,10 +281,10 @@ namespace Compress.SevenZip.Compress.LZMA
public override long Seek(long offset, SeekOrigin origin)
{
if (origin!=SeekOrigin.Current)
throw new NotImplementedException();
if (origin != SeekOrigin.Current)
throw new NotImplementedException();
byte[] tmpBuff=new byte[1024];
byte[] tmpBuff = new byte[1024];
long sizeToGo = offset;
while (sizeToGo > 0)
{
@@ -292,7 +292,7 @@ namespace Compress.SevenZip.Compress.LZMA
Read(tmpBuff, 0, sizenow);
sizeToGo -= sizenow;
}
return offset;
}
@@ -315,4 +315,4 @@ namespace Compress.SevenZip.Compress.LZMA
}
}
}
}
}