Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Archive/GZip/GZipUpdate.cpp')
-rwxr-xr-xCPP/7zip/Archive/GZip/GZipUpdate.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/CPP/7zip/Archive/GZip/GZipUpdate.cpp b/CPP/7zip/Archive/GZip/GZipUpdate.cpp
index 17e27c9f..1f5ebd0e 100755
--- a/CPP/7zip/Archive/GZip/GZipUpdate.cpp
+++ b/CPP/7zip/Archive/GZip/GZipUpdate.cpp
@@ -34,9 +34,7 @@ HRESULT UpdateArchive(
int indexInClient,
IArchiveUpdateCallback *updateCallback)
{
- UInt64 complexity = 0;
-
- complexity += unpackSize;
+ UInt64 complexity = unpackSize;
RINOK(updateCallback->SetTotal(complexity));
@@ -54,13 +52,9 @@ HRESULT UpdateArchive(
inStreamSpec->SetStream(fileInStream);
inStreamSpec->Init();
- CLocalProgress *localProgressSpec = new CLocalProgress;
- CMyComPtr<ICompressProgressInfo> localProgress = localProgressSpec;
- localProgressSpec->Init(updateCallback, true);
-
- CLocalCompressProgressInfo *localCompressProgressSpec =
- new CLocalCompressProgressInfo;
- CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec;
+ CLocalProgress *lps = new CLocalProgress;
+ CMyComPtr<ICompressProgressInfo> progress = lps;
+ lps->Init(updateCallback, true);
COutArchive outArchive;
outArchive.Create(outStream);
@@ -72,8 +66,6 @@ HRESULT UpdateArchive(
RINOK(outArchive.WriteHeader(item));
- localCompressProgressSpec->Init(localProgress, &complexity, NULL);
-
{
RINOK(CreateCoder(
EXTERNAL_CODECS_LOC_VARS
@@ -102,7 +94,7 @@ HRESULT UpdateArchive(
RINOK(deflateEncoder.QueryInterface(IID_ICompressSetCoderProperties, &setCoderProperties));
RINOK(setCoderProperties->SetCoderProperties(propIDs, properties, numProps));
}
- RINOK(deflateEncoder->Code(crcStream, outStream, NULL, NULL, compressProgress));
+ RINOK(deflateEncoder->Code(crcStream, outStream, NULL, NULL, progress));
item.FileCRC = inStreamSpec->GetCRC();
item.UnPackSize32 = (UInt32)inStreamSpec->GetSize();