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/7z/7zUpdate.cpp')
-rwxr-xr-xCPP/7zip/Archive/7z/7zUpdate.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/CPP/7zip/Archive/7z/7zUpdate.cpp b/CPP/7zip/Archive/7z/7zUpdate.cpp
index 9506e8f7..d1082808 100755
--- a/CPP/7zip/Archive/7z/7zUpdate.cpp
+++ b/CPP/7zip/Archive/7z/7zUpdate.cpp
@@ -2,6 +2,8 @@
#include "StdAfx.h"
+#include "../../../../C/CpuArch.h"
+
#include "../../Common/LimitedStreams.h"
#include "../../Common/ProgressUtils.h"
@@ -32,6 +34,10 @@ static const UInt32 kDictionaryForBCJ2_LZMA = 1 << 20;
static const UInt32 kAlgorithmForBCJ2_LZMA = 1;
static const UInt32 kNumFastBytesForBCJ2_LZMA = 64;
+#ifdef MY_CPU_X86_OR_AMD64
+#define USE_86_FILTER
+#endif
+
static HRESULT WriteRange(IInStream *inStream, ISequentialOutStream *outStream,
UInt64 position, UInt64 size, ICompressProgressInfo *progress)
{
@@ -122,7 +128,7 @@ static int CompareFiles(const CFileItem &f1, const CFileItem &f2)
}
*/
-const struct CFolderRepack
+struct CFolderRepack
{
int FolderIndex;
int Group;
@@ -334,7 +340,9 @@ static bool IsExeExt(const UString &ext)
return false;
}
-static void GetMethodFull(UInt64 methodID, UInt32 numInStreams, CMethodFull &methodResult)
+#ifdef USE_86_FILTER
+
+static inline void GetMethodFull(UInt64 methodID, UInt32 numInStreams, CMethodFull &methodResult)
{
methodResult.Id = methodID;
methodResult.NumInStreams = numInStreams;
@@ -409,6 +417,8 @@ static void MakeExeMethod(const CCompressionMethodMode &method,
}
}
+#endif
+
static void FromUpdateItemToFileItem(const CUpdateItem &ui,
CFileItem &file, CFileItem2 &file2)
{
@@ -665,7 +675,9 @@ STDMETHODIMP CCryptoGetTextPassword::CryptoGetTextPassword(BSTR *password)
static const int kNumGroupsMax = 4;
+#ifdef USE_86_FILTER
static bool Is86Group(int group) { return (group & 1) != 0; }
+#endif
static bool IsEncryptedGroup(int group) { return (group & 2) != 0; }
static int GetGroupIndex(bool encrypted, int bcjFiltered)
{ return (encrypted ? 2 : 0) + (bcjFiltered ? 1 : 0); }
@@ -865,9 +877,11 @@ HRESULT Update(
const CSolidGroup &group = groups[groupIndex];
CCompressionMethodMode method;
+ #ifdef USE_86_FILTER
if (Is86Group(groupIndex))
MakeExeMethod(*options.Method, options.MaxFilter, method);
else
+ #endif
method = *options.Method;
if (IsEncryptedGroup(groupIndex))