Skip to content

Commit

Permalink
15.08
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 f6444c3 commit 6543c28
Show file tree
Hide file tree
Showing 113 changed files with 3,100 additions and 381 deletions.
4 changes: 2 additions & 2 deletions C/7zArcIn.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* 7zArcIn.c -- 7z Input functions
2015-05-16 : Igor Pavlov : Public domain */
2015-09-28 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -1295,7 +1295,7 @@ static SRes SzReadHeader2(
{
SKIP_DATA(sd, size);
}
else switch((unsigned)type)
else switch ((unsigned)type)
{
case k7zIdName:
{
Expand Down
10 changes: 5 additions & 5 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 07
#define MY_VER_BUILD 00
#define MY_VERSION_NUMBERS "15.07"
#define MY_VERSION "15.07 beta"
#define MY_DATE "2015-09-17"
#define MY_VER_MINOR 8
#define MY_VER_BUILD 0
#define MY_VERSION_NUMBERS "15.08"
#define MY_VERSION "15.08 beta"
#define MY_DATE "2015-10-01"
#undef MY_COPYRIGHT
#undef MY_VERSION_COPYRIGHT_DATE
#define MY_AUTHOR_NAME "Igor Pavlov"
Expand Down
4 changes: 2 additions & 2 deletions C/MtCoder.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* MtCoder.c -- Multi-thread Coder
2010-09-24 : Igor Pavlov : Public domain */
2015-09-28 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -120,7 +120,7 @@ void CMtThread_Construct(CMtThread *p, CMtCoder *mtCoder)
LoopThread_Construct(&p->thread);
}

#define RINOK_THREAD(x) { if((x) != 0) return SZ_ERROR_THREAD; }
#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; }

static void CMtThread_CloseEvents(CMtThread *p)
{
Expand Down
6 changes: 3 additions & 3 deletions C/Ppmd7.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Ppmd7.c -- PPMdH codec
2010-03-12 : Igor Pavlov : Public domain
2015-09-28 : Igor Pavlov : Public domain
This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */

#include "Precomp.h"
Expand Down Expand Up @@ -66,7 +66,7 @@ void Ppmd7_Construct(CPpmd7 *p)
for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
{
unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
do { p->Units2Indx[k++] = (Byte)i; } while(--step);
do { p->Units2Indx[k++] = (Byte)i; } while (--step);
p->Indx2Units[i] = (Byte)k;
}

Expand Down Expand Up @@ -257,7 +257,7 @@ static void *AllocUnits(CPpmd7 *p, unsigned indx)

#define MyMem12Cpy(dest, src, num) \
{ UInt32 *d = (UInt32 *)dest; const UInt32 *s = (const UInt32 *)src; UInt32 n = num; \
do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while(--n); }
do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while (--n); }

static void *ShrinkUnits(CPpmd7 *p, void *oldPtr, unsigned oldNU, unsigned newNU)
{
Expand Down
4 changes: 2 additions & 2 deletions C/Ppmd7Enc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Ppmd7Enc.c -- PPMdH Encoder
2010-03-12 : Igor Pavlov : Public domain
2015-09-28 : Igor Pavlov : Public domain
This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */

#include "Precomp.h"
Expand All @@ -26,7 +26,7 @@ static void RangeEnc_ShiftLow(CPpmd7z_RangeEnc *p)
p->Stream->Write(p->Stream, (Byte)(temp + (Byte)(p->Low >> 32)));
temp = 0xFF;
}
while(--p->CacheSize != 0);
while (--p->CacheSize != 0);
p->Cache = (Byte)((UInt32)p->Low >> 24);
}
p->CacheSize++;
Expand Down
6 changes: 3 additions & 3 deletions C/Ppmd8.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Ppmd8.c -- PPMdI codec
2013-11-12 : Igor Pavlov : Public domain
2015-09-28 : Igor Pavlov : Public domain
This code is based on PPMd var.I (2002): Dmitry Shkarin : Public domain */

#include "Precomp.h"
Expand Down Expand Up @@ -67,7 +67,7 @@ void Ppmd8_Construct(CPpmd8 *p)
for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
{
unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
do { p->Units2Indx[k++] = (Byte)i; } while(--step);
do { p->Units2Indx[k++] = (Byte)i; } while (--step);
p->Indx2Units[i] = (Byte)k;
}

Expand Down Expand Up @@ -241,7 +241,7 @@ static void *AllocUnits(CPpmd8 *p, unsigned indx)

#define MyMem12Cpy(dest, src, num) \
{ UInt32 *d = (UInt32 *)dest; const UInt32 *s = (const UInt32 *)src; UInt32 n = num; \
do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while(--n); }
do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while (--n); }

static void *ShrinkUnits(CPpmd8 *p, void *oldPtr, unsigned oldNU, unsigned newNU)
{
Expand Down
6 changes: 3 additions & 3 deletions C/Util/7zipInstall/7zipInstall.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* 7zipInstall.c - 7-Zip Installer
2015-08-04 : Igor Pavlov : Public domain */
2015-09-28 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -1161,9 +1161,9 @@ if (res == SZ_OK)
if (res == SZ_OK)
{
UInt32 i;
UInt32 blockIndex = 0xFFFFFFFF; /* it can have any value before first call, if(!outBuf) */
UInt32 blockIndex = 0xFFFFFFFF; /* it can have any value before first call, if (!outBuf) */
Byte *outBuf = NULL; /* it must be NULL before first call for each new archive. */
size_t outBufSize = 0; /* it can have any value before first call, if(!outBuf) */
size_t outBufSize = 0; /* it can have any value before first call, if (!outBuf) */

g_TotalSize = 0;

Expand Down
4 changes: 2 additions & 2 deletions CPP/7zip/Archive/7z/7zIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ HRESULT CInArchive::ReadHeader(
bool isKnownType = true;
if (type > ((UInt32)1 << 30))
isKnownType = false;
else switch((UInt32)type)
else switch ((UInt32)type)
{
case NID::kName:
{
Expand Down Expand Up @@ -1338,7 +1338,7 @@ HRESULT CInArchive::ReadHeader(
db.UnsupportedFeatureWarning = true;
_inByteBack->SkipRem();
}
// SkipData worked incorrectly in some versions before v4.59 (7zVer <= 00.02)
// SkipData worked incorrectly in some versions before v4.59 (7zVer <= 0.02)
if (_inByteBack->GetRem() != 0)
ThrowIncorrect();
}
Expand Down
18 changes: 9 additions & 9 deletions CPP/7zip/Archive/7z/7zProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace N7z {
struct CPropMap
{
UInt32 FilePropID;
STATPROPSTG StatPROPSTG;
CStatProp StatProp;
};

static const CPropMap kPropMap[] =
Expand All @@ -24,11 +24,11 @@ static const CPropMap kPropMap[] =
{ NID::kPackInfo, { NULL, kpidPackSize, VT_UI8 } },

#ifdef _MULTI_PACK
{ 100, { L"Pack0", kpidPackedSize0, VT_UI8 } },
{ 101, { L"Pack1", kpidPackedSize1, VT_UI8 } },
{ 102, { L"Pack2", kpidPackedSize2, VT_UI8 } },
{ 103, { L"Pack3", kpidPackedSize3, VT_UI8 } },
{ 104, { L"Pack4", kpidPackedSize4, VT_UI8 } },
{ 100, { "Pack0", kpidPackedSize0, VT_UI8 } },
{ 101, { "Pack1", kpidPackedSize1, VT_UI8 } },
{ 102, { "Pack2", kpidPackedSize2, VT_UI8 } },
{ 103, { "Pack3", kpidPackedSize3, VT_UI8 } },
{ 104, { "Pack4", kpidPackedSize4, VT_UI8 } },
#endif

{ NID::kCTime, { NULL, kpidCTime, VT_FILETIME } },
Expand Down Expand Up @@ -90,7 +90,7 @@ void CHandler::FillPopIDs()
_fileInfoPopIDs.Clear();

#ifdef _7Z_VOL
if(_volumes.Size() < 1)
if (_volumes.Size() < 1)
return;
const CVolume &volume = _volumes.Front();
const CArchiveDatabaseEx &_db = volume.Database;
Expand Down Expand Up @@ -156,8 +156,8 @@ STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, BSTR *name, PROPID *propID,
const CPropMap &pr = kPropMap[i];
if (pr.FilePropID == id)
{
const STATPROPSTG &st = pr.StatPROPSTG;
*propID = st.propid;
const CStatProp &st = pr.StatProp;
*propID = st.PropID;
*varType = st.vt;
/*
if (st.lpwstrName)
Expand Down
4 changes: 2 additions & 2 deletions CPP/7zip/Archive/Chm/ChmHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
NCOM::CPropVariant prop;
if (m_Database.NewFormat)
{
switch(propID)
switch (propID)
{
case kpidSize:
prop = (UInt64)m_Database.NewFormatString.Len();
Expand Down Expand Up @@ -318,7 +318,7 @@ HRESULT CChmFolderOutStream::Write2(const void *data, UInt32 size, UInt32 *proce
if (processedSize)
*processedSize = 0;

while(size != 0)
while (size != 0)
{
if (m_FileIsOpen)
{
Expand Down
6 changes: 3 additions & 3 deletions CPP/7zip/Archive/ComHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,13 +592,13 @@ HRESULT CDatabase::Open(IInStream *inStream)
MainSubfile = -1;

{
FOR_VECTOR(t, Items)
FOR_VECTOR (t, Items)
{
Update_PhySize_WithItem(t);
}
}
{
FOR_VECTOR(t, Items)
FOR_VECTOR (t, Items)
{
const CItem &item = Items[t];

Expand Down Expand Up @@ -739,7 +739,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
return S_OK;
UInt32 i;
UInt64 totalSize = 0;
for(i = 0; i < numItems; i++)
for (i = 0; i < numItems; i++)
{
const CItem &item = _db.Items[_db.Refs[allFilesMode ? i : indices[i]].Did];
if (!item.IsDir())
Expand Down
6 changes: 3 additions & 3 deletions CPP/7zip/Archive/Common/MultiStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ HRESULT COutVolumeStream::Flush()
/*
STDMETHODIMP COutMultiStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
{
if(processedSize != NULL)
if (processedSize)
*processedSize = 0;
while(size > 0)
while (size > 0)
{
if (_streamIndex >= Streams.Size())
{
Expand Down Expand Up @@ -157,7 +157,7 @@ STDMETHODIMP COutMultiStream::Write(const void *data, UInt32 size, UInt32 *proce
_absPos += realProcessed;
if (_absPos > _length)
_length = _absPos;
if(processedSize != NULL)
if (processedSize)
*processedSize += realProcessed;
if (subStream.Pos == subStream.Size)
{
Expand Down
3 changes: 2 additions & 1 deletion CPP/7zip/Archive/CpioHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "../../../C/CpuArch.h"

#include "../../Common/ComTry.h"
#include "../../Common/MyLinux.h"
#include "../../Common/StringConvert.h"
#include "../../Common/StringToInt.h"
#include "../../Common/UTFConvert.h"
Expand Down Expand Up @@ -121,7 +122,7 @@ struct CItem

bool IsBin() const { return Type == k_Type_BinLe || Type == k_Type_BinBe; }
bool IsCrcFormat() const { return Type == k_Type_HexCrc; }
bool IsDir() const { return (Mode & 0170000) == 0040000; }
bool IsDir() const { return MY_LIN_S_ISDIR(Mode); }
bool IsTrailer() const { return strcmp(Name, kName_TRAILER) == 0; }
UInt64 GetDataPosition() const { return HeaderPos + HeaderSize; }
};
Expand Down
22 changes: 8 additions & 14 deletions CPP/7zip/Archive/CramfsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "../../../C/LzmaDec.h"

#include "../../Common/ComTry.h"
#include "../../Common/MyLinux.h"
#include "../../Common/StringConvert.h"

#include "../../Windows/PropVariantUtils.h"
Expand Down Expand Up @@ -98,7 +99,7 @@ struct CNode
#define Get32(p) (be ? GetBe32(p) : GetUi32(p))

static UInt32 GetMode(const Byte *p, bool be) { return be ? GetBe16(p) : GetUi16(p); }
static bool IsDir(const Byte *p, bool be) { return (GetMode(p, be) & 0xF000) == 0x4000; }
static bool IsDir(const Byte *p, bool be) { return MY_LIN_S_ISDIR(GetMode(p, be)); }

static UInt32 GetSize(const Byte *p, bool be)
{
Expand Down Expand Up @@ -146,7 +147,7 @@ struct CHeader
{
if (memcmp(p + 16, kSignature, ARRAY_SIZE(kSignature)) != 0)
return false;
switch(GetUi32(p))
switch (GetUi32(p))
{
case 0x28CD3D45: be = false; break;
case 0x453DCD28: be = true; break;
Expand Down Expand Up @@ -354,7 +355,7 @@ HRESULT CHandler::Open2(IInStream *inStream)

if (!_h.IsVer2())
{
FOR_VECTOR(i, _items)
FOR_VECTOR (i, _items)
{
const CItem &item = _items[i];
const Byte *p = _data + item.Offset;
Expand Down Expand Up @@ -530,7 +531,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
const Byte *p = _data + item.Offset;
bool be = _h.be;
bool isDir = IsDir(p, be);
switch(propID)
switch (propID)
{
case kpidPath: prop = MultiByteToUnicodeString(GetPath(index), CP_OEMCP); break;
case kpidIsDir: prop = isDir; break;
Expand Down Expand Up @@ -660,10 +661,6 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
CMyComPtr<ICompressProgressInfo> progress = lps;
lps->Init(extractCallback, false);

CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream;
CMyComPtr<ISequentialInStream> inStream(streamSpec);
streamSpec->SetStream(_stream);

for (i = 0; i < numItems; i++)
{
lps->InSize = totalPackSize;
Expand Down Expand Up @@ -701,20 +698,16 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
int res = NExtract::NOperationResult::kDataError;
{
CMyComPtr<ISequentialInStream> inSeqStream;
CMyComPtr<IInStream> inStream;
HRESULT hres = GetStream(index, &inSeqStream);
if (inSeqStream)
inSeqStream.QueryInterface(IID_IInStream, &inStream);
if (hres == E_OUTOFMEMORY)
return E_OUTOFMEMORY;
if (hres == S_FALSE || !inStream)
if (hres == S_FALSE || !inSeqStream)
res = NExtract::NOperationResult::kUnsupportedMethod;
else
{
RINOK(hres);
if (inStream)
{
HRESULT hres = copyCoder->Code(inStream, outStream, NULL, NULL, progress);
HRESULT hres = copyCoder->Code(inSeqStream, outStream, NULL, NULL, progress);
if (hres == S_OK)
{
if (copyCoderSpec->TotalSize == curSize)
Expand All @@ -729,6 +722,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
}
RINOK(extractCallback->SetOperationResult(res));
}

return S_OK;
COM_TRY_END
}
Expand Down
6 changes: 3 additions & 3 deletions CPP/7zip/Archive/ElfHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ enum
kpidInfoSection
};

static const STATPROPSTG kProps[] =
static const CStatProp kProps[] =
{
{ NULL, kpidPath, VT_BSTR },
{ NULL, kpidSize, VT_UI8 },
Expand All @@ -641,8 +641,8 @@ static const STATPROPSTG kProps[] =
{ NULL, kpidVa, VT_UI8 },
{ NULL, kpidType, VT_BSTR },
{ NULL, kpidCharacts, VT_BSTR }
, { (LPOLESTR)L"Link Section", kpidLinkSection, VT_BSTR}
, { (LPOLESTR)L"Info Section", kpidInfoSection, VT_BSTR}
, { "Link Section", kpidLinkSection, VT_BSTR}
, { "Info Section", kpidInfoSection, VT_BSTR}
};

IMP_IInArchive_Props_WITH_NAME
Expand Down
Loading

0 comments on commit 6543c28

Please sign in to comment.