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/Common/ProgressUtils.cpp')
-rw-r--r--CPP/7zip/Common/ProgressUtils.cpp33
1 files changed, 21 insertions, 12 deletions
diff --git a/CPP/7zip/Common/ProgressUtils.cpp b/CPP/7zip/Common/ProgressUtils.cpp
index bac45c1c..41385ccb 100644
--- a/CPP/7zip/Common/ProgressUtils.cpp
+++ b/CPP/7zip/Common/ProgressUtils.cpp
@@ -4,11 +4,13 @@
#include "ProgressUtils.h"
-CLocalProgress::CLocalProgress()
-{
- ProgressOffset = InSize = OutSize = 0;
- SendRatio = SendProgress = true;
-}
+CLocalProgress::CLocalProgress():
+ ProgressOffset(0),
+ InSize(0),
+ OutSize(0),
+ SendRatio(true),
+ SendProgress(true)
+ {}
void CLocalProgress::Init(IProgress *progress, bool inSizeIsMain)
{
@@ -20,19 +22,26 @@ void CLocalProgress::Init(IProgress *progress, bool inSizeIsMain)
STDMETHODIMP CLocalProgress::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
{
- UInt64 inSizeNew = InSize, outSizeNew = OutSize;
+ UInt64 inSize2 = InSize;
+ UInt64 outSize2 = OutSize;
+
if (inSize)
- inSizeNew += (*inSize);
+ inSize2 += (*inSize);
if (outSize)
- outSizeNew += (*outSize);
+ outSize2 += (*outSize);
+
if (SendRatio && _ratioProgress)
{
- RINOK(_ratioProgress->SetRatioInfo(&inSizeNew, &outSizeNew));
+ RINOK(_ratioProgress->SetRatioInfo(&inSize2, &outSize2));
}
- inSizeNew += ProgressOffset;
- outSizeNew += ProgressOffset;
+
if (SendProgress)
- return _progress->SetCompleted(_inSizeIsMain ? &inSizeNew : &outSizeNew);
+ {
+ inSize2 += ProgressOffset;
+ outSize2 += ProgressOffset;
+ return _progress->SetCompleted(_inSizeIsMain ? &inSize2 : &outSize2);
+ }
+
return S_OK;
}