Skip to content

Commit

Permalink
15.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Pavlov authored and kornelski committed May 27, 2016
1 parent a663a6d commit 7c8a265
Show file tree
Hide file tree
Showing 51 changed files with 815 additions and 484 deletions.
8 changes: 4 additions & 4 deletions C/7zVersion.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#define MY_VER_MAJOR 15
#define MY_VER_MINOR 9
#define MY_VER_MINOR 10
#define MY_VER_BUILD 0
#define MY_VERSION_NUMBERS "15.09"
#define MY_VERSION "15.09 beta"
#define MY_DATE "2015-10-16"
#define MY_VERSION_NUMBERS "15.10"
#define MY_VERSION "15.10 beta"
#define MY_DATE "2015-11-01"
#undef MY_COPYRIGHT
#undef MY_VERSION_COPYRIGHT_DATE
#define MY_AUTHOR_NAME "Igor Pavlov"
Expand Down
42 changes: 31 additions & 11 deletions C/CpuArch.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* CpuArch.h -- CPU specific code
2015-08-02: Igor Pavlov : Public domain */
2015-10-31: Igor Pavlov : Public domain */

#ifndef __CPU_ARCH_H
#define __CPU_ARCH_H
Expand All @@ -10,14 +10,18 @@ EXTERN_C_BEGIN

/*
MY_CPU_LE means that CPU is LITTLE ENDIAN.
If MY_CPU_LE is not defined, we don't know about that property of platform (it can be LITTLE ENDIAN).
MY_CPU_BE means that CPU is BIG ENDIAN.
If MY_CPU_LE and MY_CPU_BE are not defined, we don't know about ENDIANNESS of platform.
MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned memory accesses.
If MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of platform.
*/

#if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__)
#define MY_CPU_AMD64
#if defined(_M_X64) \
|| defined(_M_AMD64) \
|| defined(__x86_64__) \
|| defined(__AMD64__) \
|| defined(__amd64__)
#define MY_CPU_AMD64
#endif

#if defined(MY_CPU_AMD64) \
Expand Down Expand Up @@ -52,10 +56,6 @@ If MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of pla
#define MY_CPU_IA64_LE
#endif

#if defined(MY_CPU_X86_OR_AMD64)
#define MY_CPU_LE_UNALIGN
#endif

#if defined(MY_CPU_X86_OR_AMD64) \
|| defined(MY_CPU_ARM_LE) \
|| defined(MY_CPU_IA64_LE) \
Expand All @@ -65,7 +65,8 @@ If MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of pla
|| defined(__AARCH64EL__) \
|| defined(__MIPSEL__) \
|| defined(__MIPSEL) \
|| defined(_MIPSEL)
|| defined(_MIPSEL) \
|| (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
#define MY_CPU_LE
#endif

Expand All @@ -76,7 +77,9 @@ If MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of pla
|| defined(__MIPSEB__) \
|| defined(__MIPSEB) \
|| defined(_MIPSEB) \
|| defined(__m68k__)
|| defined(__m68k__) \
|| defined(__s390x__) \
|| (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
#define MY_CPU_BE
#endif

Expand All @@ -85,6 +88,14 @@ Stop_Compiling_Bad_Endian
#endif


#ifdef MY_CPU_LE
#if defined(MY_CPU_X86_OR_AMD64) \
/* || defined(__AARCH64EL__) */
#define MY_CPU_LE_UNALIGN
#endif
#endif


#ifdef MY_CPU_LE_UNALIGN

#define GetUi16(p) (*(const UInt16 *)(const void *)(p))
Expand Down Expand Up @@ -128,6 +139,8 @@ Stop_Compiling_Bad_Endian

#if defined(MY_CPU_LE_UNALIGN) && /* defined(_WIN64) && */ (_MSC_VER >= 1300)

/* Note: we use bswap instruction, that is unsupported in 386 cpu */

#include <stdlib.h>

#pragma intrinsic(_byteswap_ulong)
Expand All @@ -137,6 +150,13 @@ Stop_Compiling_Bad_Endian

#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = _byteswap_ulong(v)

#elif defined(MY_CPU_LE_UNALIGN) && defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))

#define GetBe32(p) __builtin_bswap32(*(const UInt32 *)(const Byte *)(p))
#define GetBe64(p) __builtin_bswap64(*(const UInt64 *)(const Byte *)(p))

#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = __builtin_bswap32(v)

#else

#define GetBe32(p) ( \
Expand Down
16 changes: 0 additions & 16 deletions CPP/7zip/Archive/7z/7z.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion CPP/7zip/Archive/7z/7zExtract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,16 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
lps->Init(extractCallback, false);

CDecoder decoder(
#ifndef USE_MIXER_ST
#if !defined(USE_MIXER_MT)
false
#elif !defined(USE_MIXER_ST)
true
#elif !defined(__7Z_SET_PROPERTIES)
#ifdef _7ZIP_ST
false
#else
true
#endif
#else
_useMultiThreadMixer
#endif
Expand Down
3 changes: 0 additions & 3 deletions CPP/7zip/Archive/7z/7zFolderOutStream.cpp

This file was deleted.

6 changes: 0 additions & 6 deletions CPP/7zip/Archive/7z/7zFolderOutStream.h

This file was deleted.

12 changes: 10 additions & 2 deletions CPP/7zip/Archive/7z/7zHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ CHandler::CHandler()
#endif

#ifdef EXTRACT_ONLY

_crcSize = 4;

#ifdef __7Z_SET_PROPERTIES
_numThreads = NSystem::GetNumberOfProcessors();
_useMultiThreadMixer = true;
#endif

#endif
}

Expand Down Expand Up @@ -722,10 +726,14 @@ STDMETHODIMP CHandler::SetProperties(const wchar_t * const *names, const PROPVAR
return E_INVALIDARG;
const PROPVARIANT &value = values[i];
UInt32 number;
int index = ParseStringToUInt32(name, number);
unsigned index = ParseStringToUInt32(name, number);
if (index == 0)
{
if (name.IsEqualTo("mtf")) return PROPVARIANT_to_bool(value, _useMultiThreadMixer);
if (name.IsEqualTo("mtf"))
{
RINOK(PROPVARIANT_to_bool(value, _useMultiThreadMixer));
continue;
}
if (name.IsPrefixedBy_Ascii_NoCase("mt"))
{
RINOK(ParseMtProp(name.Ptr(2), value, numProcessors, _numThreads));
Expand Down
8 changes: 4 additions & 4 deletions CPP/7zip/Archive/7z/7zHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ namespace N7z {
#ifndef __7Z_SET_PROPERTIES

#ifdef EXTRACT_ONLY
#if !defined(_7ZIP_ST) && !defined(_SFX)
#define __7Z_SET_PROPERTIES
#endif
#if !defined(_7ZIP_ST) && !defined(_SFX)
#define __7Z_SET_PROPERTIES
#endif
#else
#define __7Z_SET_PROPERTIES
#define __7Z_SET_PROPERTIES
#endif

#endif
Expand Down
2 changes: 0 additions & 2 deletions CPP/7zip/Archive/7z/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ AR_OBJS = \
$O\7zEncode.obj \
$O\7zExtract.obj \
$O\7zFolderInStream.obj \
$O\7zFolderOutStream.obj \
$O\7zHandler.obj \
$O\7zHandlerOut.obj \
$O\7zHeader.obj \
Expand Down Expand Up @@ -65,7 +64,6 @@ COMPRESS_OBJS = \

AR_COMMON_OBJS = \
$O\CoderMixer2.obj \
$O\CrossThreadProgress.obj \
$O\HandlerOut.obj \
$O\InStreamWithCRC.obj \
$O\ItemNameUtils.obj \
Expand Down
15 changes: 0 additions & 15 deletions CPP/7zip/Archive/Common/CrossThreadProgress.cpp

This file was deleted.

37 changes: 0 additions & 37 deletions CPP/7zip/Archive/Common/CrossThreadProgress.h

This file was deleted.

4 changes: 3 additions & 1 deletion CPP/7zip/Archive/Common/HandlerOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ HRESULT CSingleMethodProps::SetProperties(const wchar_t * const *names, const PR
#endif
}
else
return ParseMethodFromPROPVARIANT(names[i], value);
{
RINOK(ParseMethodFromPROPVARIANT(names[i], value));
}
}
return S_OK;
}
Expand Down
6 changes: 5 additions & 1 deletion CPP/7zip/Archive/Iso/IsoIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,11 @@ void CInArchive::ReadVolumeDescriptor(CVolumeDescriptor &d)
d.FileStructureVersion = ReadByte(); // = 1
SkipZeros(1);
ReadBytes(d.ApplicationUse, sizeof(d.ApplicationUse));
SkipZeros(653);

// Most ISO contains zeros in the following field (reserved for future standardization).
// But some ISO programs write some data to that area.
// So we disable check for zeros.
Skip(653); // SkipZeros(653);
}

static const Byte kSig_CD001[5] = { 'C', 'D', '0', '0', '1' };
Expand Down
28 changes: 23 additions & 5 deletions CPP/7zip/Archive/Rar/Rar5Handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,18 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
break;
}

case kpidError:
{
if (/* &_missingVol || */ !_missingVolName.IsEmpty())
{
UString s;
s.SetFromAscii("Missing volume : ");
s += _missingVolName;
prop = s;
}
break;
}

case kpidErrorFlags:
{
UInt32 v = _errorFlags;
Expand Down Expand Up @@ -1840,13 +1852,18 @@ HRESULT CHandler::Open2(IInStream *stream,
break;
}

HRESULT result = openVolumeCallback->GetStream(seqName.GetNextName(), &inStream);
if (result == S_FALSE)
break;
if (result != S_OK)
const UString volName = seqName.GetNextName();

HRESULT result = openVolumeCallback->GetStream(volName, &inStream);

if (result != S_OK && result != S_FALSE)
return result;
if (!inStream)

if (!inStream || result != S_OK)
{
_missingVolName = volName;
break;
}
}

UInt64 endPos = 0;
Expand Down Expand Up @@ -2120,6 +2137,7 @@ STDMETHODIMP CHandler::Open(IInStream *stream,
STDMETHODIMP CHandler::Close()
{
COM_TRY_BEGIN
_missingVolName.Empty();
_errorFlags = 0;
// _warningFlags = 0;
_isArc = false;
Expand Down
1 change: 1 addition & 0 deletions CPP/7zip/Archive/Rar/Rar5Handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ class CHandler:
// UInt32 _warningFlags;
bool _isArc;
CByteBuffer _comment;
UString _missingVolName;

DECL_EXTERNAL_CODECS_VARS

Expand Down
Loading

0 comments on commit 7c8a265

Please sign in to comment.