Update to 7-Zip Version 18.06

This commit is contained in:
Tino Reichardt
2018-12-30 12:50:20 +01:00
parent 093cf20bad
commit a488536124
116 changed files with 1830 additions and 955 deletions

View File

@@ -324,7 +324,6 @@ static void PrintSize_MB(UString &s, UInt64 size)
s += kMB;
}
extern bool g_LargePagesMode;
UInt32 CBenchmarkDialog::OnChangeDictionary()
{
@@ -338,8 +337,14 @@ UInt32 CBenchmarkDialog::OnChangeDictionary()
s += " / ";
PrintSize_MB(s, ramSize);
}
if (g_LargePagesMode)
s += " LP";
#ifdef _7ZIP_LARGE_PAGES
{
AString s2;
Add_LargePages_String(s2);
s += s2;
}
#endif
SetItemText(IDT_BENCH_MEMORY_VAL, s);

View File

@@ -99,8 +99,10 @@ HRESULT CThreadExtracting::ProcessVirt()
CDecompressStat Stat;
#ifndef _SFX
/*
if (HashBundle)
HashBundle->Init();
*/
#endif
HRESULT res = Extract(codecs,
@@ -119,7 +121,7 @@ HRESULT CThreadExtracting::ProcessVirt()
{
AddValuePair(Pairs, IDS_ARCHIVES_COLON, Stat.NumArchives);
AddSizeValuePair(Pairs, IDS_PROP_PACKED_SIZE, Stat.PackSize);
AddHashBundleRes(Pairs, *HashBundle, UString());
AddHashBundleRes(Pairs, *HashBundle);
}
else if (Options->TestMode)
{

View File

@@ -27,6 +27,7 @@ class CHashCallbackGUI: public CProgressThreadVirt, public IHashCallbackUI
UInt64 NumFiles;
bool _curIsFolder;
UString FirstFileName;
// UString MainPath;
CPropNameValPairs PropNameValPairs;
@@ -71,9 +72,9 @@ void AddSizeValue(UString &s, UInt64 value)
if (value >= (1 << 10))
{
char c;
if (value >= ((UInt64)10 << 30)) { value >>= 30; c = 'G'; }
if (value >= (10 << 20)) { value >>= 20; c = 'M'; }
else { value >>= 10; c = 'K'; }
if (value >= ((UInt64)10 << 30)) { value >>= 30; c = 'G'; }
else if (value >= (10 << 20)) { value >>= 20; c = 'M'; }
else { value >>= 10; c = 'K'; }
char sz[32];
ConvertUInt64ToString(value, sz);
s += " (";
@@ -192,19 +193,25 @@ static void AddHashResString(CPropNameValPairs &s, const CHasherState &h, unsign
}
void AddHashBundleRes(CPropNameValPairs &s, const CHashBundle &hb, const UString &firstFileName)
void AddHashBundleRes(CPropNameValPairs &s, const CHashBundle &hb)
{
if (hb.NumErrors != 0)
AddValuePair(s, IDS_PROP_NUM_ERRORS, hb.NumErrors);
if (hb.NumFiles == 1 && hb.NumDirs == 0 && !firstFileName.IsEmpty())
if (hb.NumFiles == 1 && hb.NumDirs == 0 && !hb.FirstFileName.IsEmpty())
{
CProperty &pair = s.AddNew();
LangString(IDS_PROP_NAME, pair.Name);
pair.Value = firstFileName;
pair.Value = hb.FirstFileName;
}
else
{
if (!hb.MainName.IsEmpty())
{
CProperty &pair = s.AddNew();
LangString(IDS_PROP_NAME, pair.Name);
pair.Value = hb.MainName;
}
if (hb.NumDirs != 0)
AddValuePair(s, IDS_PROP_FOLDERS, hb.NumDirs);
AddValuePair(s, IDS_PROP_FILES, hb.NumFiles);
@@ -240,10 +247,10 @@ void AddHashBundleRes(CPropNameValPairs &s, const CHashBundle &hb, const UString
}
void AddHashBundleRes(UString &s, const CHashBundle &hb, const UString &firstFileName)
void AddHashBundleRes(UString &s, const CHashBundle &hb)
{
CPropNameValPairs pairs;
AddHashBundleRes(pairs, hb, firstFileName);
AddHashBundleRes(pairs, hb);
FOR_VECTOR (i, pairs)
{
@@ -263,9 +270,11 @@ void AddHashBundleRes(UString &s, const CHashBundle &hb, const UString &firstFil
}
HRESULT CHashCallbackGUI::AfterLastFile(const CHashBundle &hb)
HRESULT CHashCallbackGUI::AfterLastFile(CHashBundle &hb)
{
AddHashBundleRes(PropNameValPairs, hb, FirstFileName);
hb.FirstFileName = FirstFileName;
// MainPath
AddHashBundleRes(PropNameValPairs, hb);
CProgressSync &sync = Sync;
sync.Set_NumFilesCur(hb.NumFiles);
@@ -335,10 +344,10 @@ void ShowHashResults(const CPropNameValPairs &propPairs, HWND hwnd)
}
void ShowHashResults(const CHashBundle &hb, const UString &firstFileName, HWND hwnd)
void ShowHashResults(const CHashBundle &hb, HWND hwnd)
{
CPropNameValPairs propPairs;
AddHashBundleRes(propPairs, hb, firstFileName);
AddHashBundleRes(propPairs, hb);
ShowHashResults(propPairs, hwnd);
}

View File

@@ -18,10 +18,10 @@ void AddValuePair(CPropNameValPairs &pairs, UINT resourceID, UInt64 value);
void AddSizeValue(UString &s, UInt64 value);
void AddSizeValuePair(CPropNameValPairs &pairs, UINT resourceID, UInt64 value);
void AddHashBundleRes(CPropNameValPairs &s, const CHashBundle &hb, const UString &firstFileName);
void AddHashBundleRes(UString &s, const CHashBundle &hb, const UString &firstFileName);
void AddHashBundleRes(CPropNameValPairs &s, const CHashBundle &hb);
void AddHashBundleRes(UString &s, const CHashBundle &hb);
void ShowHashResults(const CPropNameValPairs &propPairs, HWND hwnd);
void ShowHashResults(const CHashBundle &hb, const UString &firstFileName, HWND hwnd);
void ShowHashResults(const CHashBundle &hb, HWND hwnd);
#endif