mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 07:14:56 -06:00
Update to 7-Zip Version 21.02
This commit is contained in:
@@ -309,11 +309,14 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
|
||||
|
||||
case kpidMethod:
|
||||
{
|
||||
UInt32 realFolderIndex = item.GetFolderIndex(db.Folders.Size());
|
||||
const CFolder &folder = db.Folders[realFolderIndex];
|
||||
char s[kMethodNameBufSize];;
|
||||
SetMethodName(s, folder.GetMethod(), folder.MethodMinor);
|
||||
prop = s;
|
||||
const int realFolderIndex = item.GetFolderIndex(db.Folders.Size());
|
||||
if (realFolderIndex >= 0)
|
||||
{
|
||||
const CFolder &folder = db.Folders[(unsigned)realFolderIndex];
|
||||
char s[kMethodNameBufSize];;
|
||||
SetMethodName(s, folder.GetMethod(), folder.MethodMinor);
|
||||
prop = s;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -341,7 +344,8 @@ STDMETHODIMP CHandler::Open(IInStream *inStream,
|
||||
|
||||
CInArchive archive;
|
||||
CMyComPtr<IArchiveOpenVolumeCallback> openVolumeCallback;
|
||||
callback->QueryInterface(IID_IArchiveOpenVolumeCallback, (void **)&openVolumeCallback);
|
||||
if (callback)
|
||||
callback->QueryInterface(IID_IArchiveOpenVolumeCallback, (void **)&openVolumeCallback);
|
||||
|
||||
CMyComPtr<IInStream> nextStream = inStream;
|
||||
bool prevChecked = false;
|
||||
@@ -420,7 +424,10 @@ STDMETHODIMP CHandler::Open(IInStream *inStream,
|
||||
}
|
||||
}
|
||||
|
||||
RINOK(callback->SetCompleted(&numItems, NULL));
|
||||
if (callback)
|
||||
{
|
||||
RINOK(callback->SetCompleted(&numItems, NULL));
|
||||
}
|
||||
|
||||
nextStream = NULL;
|
||||
|
||||
@@ -1007,7 +1014,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned startIndex2 = m_Database.FolderStartFileIndex[folderIndex];
|
||||
const unsigned startIndex2 = m_Database.FolderStartFileIndex[(unsigned)folderIndex];
|
||||
unsigned startIndex = startIndex2;
|
||||
extractStatuses.Clear();
|
||||
for (; startIndex < index; startIndex++)
|
||||
@@ -1037,8 +1044,10 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
||||
CFolderOutStream *cabFolderOutStream = new CFolderOutStream;
|
||||
CMyComPtr<ISequentialOutStream> outStream(cabFolderOutStream);
|
||||
|
||||
unsigned folderIndex2 = item.GetFolderIndex(db.Folders.Size());
|
||||
const CFolder &folder = db.Folders[folderIndex2];
|
||||
const int folderIndex2 = item.GetFolderIndex(db.Folders.Size());
|
||||
if (folderIndex2 < 0)
|
||||
return E_FAIL;
|
||||
const CFolder &folder = db.Folders[(unsigned)folderIndex2];
|
||||
|
||||
cabFolderOutStream->Init(&m_Database, &extractStatuses, startIndex2,
|
||||
curUnpack, extractCallback, testMode);
|
||||
@@ -1107,12 +1116,14 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
||||
}
|
||||
|
||||
const CDatabaseEx &db2 = m_Database.Volumes[volIndex];
|
||||
const CFolder &folder2 = db2.Folders[locFolderIndex];
|
||||
if (locFolderIndex < 0)
|
||||
return E_FAIL;
|
||||
const CFolder &folder2 = db2.Folders[(unsigned)locFolderIndex];
|
||||
|
||||
if (bl == 0)
|
||||
{
|
||||
cabBlockInStreamSpec->ReservedSize = db2.ArcInfo.GetDataBlockReserveSize();
|
||||
RINOK(db2.Stream->Seek(db2.StartPosition + folder2.DataStart, STREAM_SEEK_SET, NULL));
|
||||
RINOK(db2.Stream->Seek((Int64)(db2.StartPosition + folder2.DataStart), STREAM_SEEK_SET, NULL));
|
||||
}
|
||||
|
||||
if (bl == folder2.NumDataBlocks)
|
||||
@@ -1242,7 +1253,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
||||
|
||||
if (res != S_OK || cabFolderOutStream->NeedMoreWrite())
|
||||
{
|
||||
RINOK(cabFolderOutStream->FlushCorrupted(folderIndex2));
|
||||
RINOK(cabFolderOutStream->FlushCorrupted((unsigned)folderIndex2));
|
||||
}
|
||||
|
||||
totalUnPacked += curUnpack;
|
||||
|
||||
@@ -114,8 +114,8 @@ HRESULT CSignatureFinder::Find()
|
||||
Byte b = Signature[0];
|
||||
for (;;)
|
||||
{
|
||||
if (*p == b) break; p++;
|
||||
if (*p == b) break; p++;
|
||||
if (*p == b) { break; } p++;
|
||||
if (*p == b) { break; } p++;
|
||||
}
|
||||
Pos = (UInt32)(p - Buf);
|
||||
if (End - Pos < _HeaderSize)
|
||||
@@ -311,7 +311,7 @@ HRESULT CInArchive::Open2(CDatabaseEx &db, const UInt64 *searchHeaderSizeLimit)
|
||||
{
|
||||
// printf("\n!!! Seek Error !!!!\n");
|
||||
// fflush(stdout);
|
||||
RINOK(db.Stream->Seek(db.StartPosition + ai.FileHeadersOffset, STREAM_SEEK_SET, NULL));
|
||||
RINOK(db.Stream->Seek((Int64)(db.StartPosition + ai.FileHeadersOffset), STREAM_SEEK_SET, NULL));
|
||||
limitedStreamSpec->Init(ai.Size - ai.FileHeadersOffset);
|
||||
_inBuffer.Init();
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ struct CDatabase
|
||||
|
||||
int GetNumberOfNewFolders() const
|
||||
{
|
||||
int res = Folders.Size();
|
||||
int res = (int)Folders.Size();
|
||||
if (IsTherePrevFolder())
|
||||
res--;
|
||||
return res;
|
||||
|
||||
@@ -56,8 +56,8 @@ struct CItem
|
||||
if (ContinuedFromPrev())
|
||||
return 0;
|
||||
if (ContinuedToNext())
|
||||
return numFolders - 1;
|
||||
return FolderIndex;
|
||||
return (int)numFolders - 1;
|
||||
return (int)FolderIndex;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user