mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 05:15:00 -06:00
15.11
This commit is contained in:
committed by
Kornel Lesiński
parent
7c8a265a15
commit
e24f7fba53
@@ -1,5 +1,5 @@
|
||||
/* 7zAlloc.c -- Allocation functions
|
||||
2015-02-21 : Igor Pavlov : Public domain */
|
||||
2015-11-09 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Precomp.h"
|
||||
|
||||
@@ -26,7 +26,7 @@ void *SzAlloc(void *p, size_t size)
|
||||
if (size == 0)
|
||||
return 0;
|
||||
#ifdef _SZ_ALLOC_DEBUG
|
||||
fprintf(stderr, "\nAlloc %10d bytes; count = %10d", size, g_allocCount);
|
||||
fprintf(stderr, "\nAlloc %10u bytes; count = %10d", (unsigned)size, g_allocCount);
|
||||
g_allocCount++;
|
||||
#endif
|
||||
return malloc(size);
|
||||
@@ -51,7 +51,7 @@ void *SzAllocTemp(void *p, size_t size)
|
||||
if (size == 0)
|
||||
return 0;
|
||||
#ifdef _SZ_ALLOC_DEBUG
|
||||
fprintf(stderr, "\nAlloc_temp %10d bytes; count = %10d", size, g_allocCountTemp);
|
||||
fprintf(stderr, "\nAlloc_temp %10u bytes; count = %10d", (unsigned)size, g_allocCountTemp);
|
||||
g_allocCountTemp++;
|
||||
#ifdef _WIN32
|
||||
return HeapAlloc(GetProcessHeap(), 0, size);
|
||||
|
||||
63
C/7zArcIn.c
63
C/7zArcIn.c
@@ -1,5 +1,5 @@
|
||||
/* 7zArcIn.c -- 7z Input functions
|
||||
2015-09-28 : Igor Pavlov : Public domain */
|
||||
2015-11-13 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Precomp.h"
|
||||
|
||||
@@ -942,7 +942,6 @@ typedef struct
|
||||
static SRes ReadSubStreamsInfo(CSzAr *p, CSzData *sd, CSubStreamInfo *ssi)
|
||||
{
|
||||
UInt64 type = 0;
|
||||
UInt32 i;
|
||||
UInt32 numSubDigests = 0;
|
||||
UInt32 numFolders = p->NumFolders;
|
||||
UInt32 numUnpackStreams = numFolders;
|
||||
@@ -953,6 +952,7 @@ static SRes ReadSubStreamsInfo(CSzAr *p, CSzData *sd, CSubStreamInfo *ssi)
|
||||
RINOK(ReadID(sd, &type));
|
||||
if (type == k7zIdNumUnpackStream)
|
||||
{
|
||||
UInt32 i;
|
||||
ssi->sdNumSubStreams.Data = sd->Data;
|
||||
numUnpackStreams = 0;
|
||||
numSubDigests = 0;
|
||||
@@ -1215,7 +1215,6 @@ static SRes SzReadHeader2(
|
||||
UInt64 type;
|
||||
UInt32 numFiles = 0;
|
||||
UInt32 numEmptyStreams = 0;
|
||||
UInt32 i;
|
||||
CSubStreamInfo ssi;
|
||||
const Byte *emptyStreams = 0;
|
||||
const Byte *emptyFiles = 0;
|
||||
@@ -1397,22 +1396,22 @@ static SRes SzReadHeader2(
|
||||
}
|
||||
|
||||
{
|
||||
UInt32 i;
|
||||
UInt32 emptyFileIndex = 0;
|
||||
|
||||
UInt32 folderIndex = 0;
|
||||
UInt32 indexInFolder = 0;
|
||||
UInt32 remSubStreams = 0;
|
||||
UInt32 numSubStreams = 0;
|
||||
UInt64 unpackPos = 0;
|
||||
const Byte *digestsDefs = 0;
|
||||
const Byte *digestsVals = 0;
|
||||
UInt32 digestsValsIndex = 0;
|
||||
UInt32 digestIndex;
|
||||
Byte allDigestsDefined = 0;
|
||||
UInt32 curNumSubStreams = (UInt32)(Int32)-1;
|
||||
Byte isDirMask = 0;
|
||||
Byte crcMask = 0;
|
||||
Byte mask = 0x80;
|
||||
// size_t unpSizesOffset = 0;
|
||||
CSzData sdCodersUnpSizes;
|
||||
|
||||
sdCodersUnpSizes.Data = p->db.UnpackSizesData;
|
||||
sdCodersUnpSizes.Size = p->db.UnpackSizesDataSize;
|
||||
|
||||
@@ -1437,6 +1436,7 @@ static SRes SzReadHeader2(
|
||||
}
|
||||
|
||||
digestIndex = 0;
|
||||
|
||||
for (i = 0; i < numFiles; i++, mask >>= 1)
|
||||
{
|
||||
if (mask == 0)
|
||||
@@ -1451,49 +1451,45 @@ static SRes SzReadHeader2(
|
||||
|
||||
p->UnpackPositions[i] = unpackPos;
|
||||
p->CRCs.Vals[i] = 0;
|
||||
// p->CRCs.Defs[i] = 0;
|
||||
if (emptyStreams && SzBitArray_Check(emptyStreams , i))
|
||||
|
||||
if (emptyStreams && SzBitArray_Check(emptyStreams, i))
|
||||
{
|
||||
if (!emptyFiles || !SzBitArray_Check(emptyFiles, emptyFileIndex))
|
||||
isDirMask |= mask;
|
||||
emptyFileIndex++;
|
||||
if (indexInFolder == 0)
|
||||
if (remSubStreams == 0)
|
||||
{
|
||||
p->FileIndexToFolderIndexMap[i] = (UInt32)-1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (indexInFolder == 0)
|
||||
|
||||
if (remSubStreams == 0)
|
||||
{
|
||||
/*
|
||||
v3.13 incorrectly worked with empty folders
|
||||
v4.07: Loop for skipping empty folders
|
||||
*/
|
||||
for (;;)
|
||||
{
|
||||
if (folderIndex >= p->db.NumFolders)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
p->FolderStartFileIndex[folderIndex] = i;
|
||||
if (curNumSubStreams == (UInt32)(Int32)-1);
|
||||
numSubStreams = 1;
|
||||
if (ssi.sdNumSubStreams.Data)
|
||||
{
|
||||
curNumSubStreams = 1;
|
||||
if (ssi.sdNumSubStreams.Data != 0)
|
||||
{
|
||||
RINOK(SzReadNumber32(&ssi.sdNumSubStreams, &curNumSubStreams));
|
||||
}
|
||||
RINOK(SzReadNumber32(&ssi.sdNumSubStreams, &numSubStreams));
|
||||
}
|
||||
if (curNumSubStreams != 0)
|
||||
remSubStreams = numSubStreams;
|
||||
if (numSubStreams != 0)
|
||||
break;
|
||||
curNumSubStreams = (UInt32)(Int32)-1;
|
||||
folderIndex++; // check it
|
||||
p->db.FoSizesOffsets[folderIndex] = sdCodersUnpSizes.Data - p->db.UnpackSizesData;
|
||||
folderIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
p->FileIndexToFolderIndexMap[i] = folderIndex;
|
||||
if (emptyStreams && SzBitArray_Check(emptyStreams , i))
|
||||
|
||||
if (emptyStreams && SzBitArray_Check(emptyStreams, i))
|
||||
continue;
|
||||
|
||||
indexInFolder++;
|
||||
if (indexInFolder >= curNumSubStreams)
|
||||
if (--remSubStreams == 0)
|
||||
{
|
||||
UInt64 folderUnpackSize = 0;
|
||||
UInt64 startFolderUnpackPos;
|
||||
@@ -1523,7 +1519,7 @@ static SRes SzReadHeader2(
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
unpackPos = startFolderUnpackPos + folderUnpackSize;
|
||||
|
||||
if (curNumSubStreams == 1 && SzBitWithVals_Check(&p->db.FolderCRCs, i))
|
||||
if (numSubStreams == 1 && SzBitWithVals_Check(&p->db.FolderCRCs, i))
|
||||
{
|
||||
p->CRCs.Vals[i] = p->db.FolderCRCs.Vals[folderIndex];
|
||||
crcMask |= mask;
|
||||
@@ -1534,14 +1530,16 @@ static SRes SzReadHeader2(
|
||||
digestsValsIndex++;
|
||||
crcMask |= mask;
|
||||
}
|
||||
|
||||
folderIndex++;
|
||||
indexInFolder = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
UInt64 v;
|
||||
RINOK(ReadNumber(&ssi.sdSizes, &v));
|
||||
unpackPos += v;
|
||||
if (unpackPos < v)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
if (allDigestsDefined || (digestsDefs && SzBitArray_Check(digestsDefs, digestIndex)))
|
||||
{
|
||||
p->CRCs.Vals[i] = GetUi32(digestsVals + (size_t)digestsValsIndex * 4);
|
||||
@@ -1550,12 +1548,14 @@ static SRes SzReadHeader2(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mask != 0x80)
|
||||
{
|
||||
UInt32 byteIndex = (i - 1) >> 3;
|
||||
p->IsDirs[byteIndex] = isDirMask;
|
||||
p->CRCs.Defs[byteIndex] = crcMask;
|
||||
}
|
||||
|
||||
p->UnpackPositions[i] = unpackPos;
|
||||
p->FolderStartFileIndex[folderIndex] = i;
|
||||
p->db.FoSizesOffsets[folderIndex] = sdCodersUnpSizes.Data - p->db.UnpackSizesData;
|
||||
@@ -1567,9 +1567,8 @@ static SRes SzReadHeader(
|
||||
CSzArEx *p,
|
||||
CSzData *sd,
|
||||
ILookInStream *inStream,
|
||||
ISzAlloc *allocMain
|
||||
,ISzAlloc *allocTemp
|
||||
)
|
||||
ISzAlloc *allocMain,
|
||||
ISzAlloc *allocTemp)
|
||||
{
|
||||
// Byte *emptyStreamVector = 0;
|
||||
// Byte *emptyFileVector = 0;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#define MY_VER_MAJOR 15
|
||||
#define MY_VER_MINOR 10
|
||||
#define MY_VER_MINOR 11
|
||||
#define MY_VER_BUILD 0
|
||||
#define MY_VERSION_NUMBERS "15.10"
|
||||
#define MY_VERSION "15.10 beta"
|
||||
#define MY_DATE "2015-11-01"
|
||||
#define MY_VERSION_NUMBERS "15.11"
|
||||
#define MY_VERSION "15.11 beta"
|
||||
#define MY_DATE "2015-11-14"
|
||||
#undef MY_COPYRIGHT
|
||||
#undef MY_VERSION_COPYRIGHT_DATE
|
||||
#define MY_AUTHOR_NAME "Igor Pavlov"
|
||||
|
||||
@@ -513,4 +513,3 @@ UInt32 BlockSort(UInt32 *Indices, const Byte *data, UInt32 blockSize)
|
||||
#endif
|
||||
return Groups[0];
|
||||
}
|
||||
|
||||
|
||||
10
C/Lzma2Dec.c
10
C/Lzma2Dec.c
@@ -1,5 +1,5 @@
|
||||
/* Lzma2Dec.c -- LZMA2 Decoder
|
||||
2014-10-29 : Igor Pavlov : Public domain */
|
||||
2015-11-09 : Igor Pavlov : Public domain */
|
||||
|
||||
/* #define SHOW_DEBUG_INFO */
|
||||
|
||||
@@ -103,8 +103,8 @@ static ELzma2State Lzma2Dec_UpdateState(CLzma2Dec *p, Byte b)
|
||||
{
|
||||
case LZMA2_STATE_CONTROL:
|
||||
p->control = b;
|
||||
PRF(printf("\n %4X ", p->decoder.dicPos));
|
||||
PRF(printf(" %2X", b));
|
||||
PRF(printf("\n %4X ", (unsigned)p->decoder.dicPos));
|
||||
PRF(printf(" %2X", (unsigned)b));
|
||||
if (p->control == 0)
|
||||
return LZMA2_STATE_FINISHED;
|
||||
if (LZMA2_IS_UNCOMPRESSED_STATE(p))
|
||||
@@ -124,7 +124,7 @@ static ELzma2State Lzma2Dec_UpdateState(CLzma2Dec *p, Byte b)
|
||||
case LZMA2_STATE_UNPACK1:
|
||||
p->unpackSize |= (UInt32)b;
|
||||
p->unpackSize++;
|
||||
PRF(printf(" %8d", p->unpackSize));
|
||||
PRF(printf(" %8u", (unsigned)p->unpackSize));
|
||||
return (LZMA2_IS_UNCOMPRESSED_STATE(p)) ? LZMA2_STATE_DATA : LZMA2_STATE_PACK0;
|
||||
|
||||
case LZMA2_STATE_PACK0:
|
||||
@@ -134,7 +134,7 @@ static ELzma2State Lzma2Dec_UpdateState(CLzma2Dec *p, Byte b)
|
||||
case LZMA2_STATE_PACK1:
|
||||
p->packSize |= (UInt32)b;
|
||||
p->packSize++;
|
||||
PRF(printf(" %8d", p->packSize));
|
||||
PRF(printf(" %8u", (unsigned)p->packSize));
|
||||
return LZMA2_IS_THERE_PROP(LZMA2_GET_LZMA_MODE(p)) ? LZMA2_STATE_PROP:
|
||||
(p->needInitProp ? LZMA2_STATE_ERROR : LZMA2_STATE_DATA);
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/* Lzma86Dec.c -- LZMA + x86 (BCJ) Filter Decoder
|
||||
2009-08-14 : Igor Pavlov : Public domain */
|
||||
2015-11-08 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Precomp.h"
|
||||
|
||||
#include "Lzma86.h"
|
||||
|
||||
@@ -7,8 +9,8 @@
|
||||
#include "Bra.h"
|
||||
#include "LzmaDec.h"
|
||||
|
||||
static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
|
||||
static void SzFree(void *p, void *address) { p = p; MyFree(address); }
|
||||
static void *SzAlloc(void *p, size_t size) { UNUSED_VAR(p); return MyAlloc(size); }
|
||||
static void SzFree(void *p, void *address) { UNUSED_VAR(p); MyFree(address); }
|
||||
|
||||
SRes Lzma86_GetUnpackSize(const Byte *src, SizeT srcLen, UInt64 *unpackSize)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/* Lzma86Enc.c -- LZMA + x86 (BCJ) Filter Encoder
|
||||
2009-08-14 : Igor Pavlov : Public domain */
|
||||
2015-11-08 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Precomp.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -11,8 +13,8 @@
|
||||
|
||||
#define SZE_OUT_OVERFLOW SZE_DATA_ERROR
|
||||
|
||||
static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
|
||||
static void SzFree(void *p, void *address) { p = p; MyFree(address); }
|
||||
static void *SzAlloc(void *p, size_t size) { UNUSED_VAR(p); return MyAlloc(size); }
|
||||
static void SzFree(void *p, void *address) { UNUSED_VAR(p); MyFree(address); }
|
||||
|
||||
int Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen,
|
||||
int level, UInt32 dictSize, int filterMode)
|
||||
|
||||
18
C/LzmaEnc.c
18
C/LzmaEnc.c
@@ -1,5 +1,5 @@
|
||||
/* LzmaEnc.c -- LZMA Encoder
|
||||
2015-10-15 Igor Pavlov : Public domain */
|
||||
2015-11-08 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Precomp.h"
|
||||
|
||||
@@ -854,7 +854,7 @@ static void MovePos(CLzmaEnc *p, UInt32 num)
|
||||
{
|
||||
#ifdef SHOW_STAT
|
||||
g_STAT_OFFSET += num;
|
||||
printf("\n MovePos %d", num);
|
||||
printf("\n MovePos %u", num);
|
||||
#endif
|
||||
|
||||
if (num != 0)
|
||||
@@ -871,12 +871,12 @@ static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes)
|
||||
numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches);
|
||||
|
||||
#ifdef SHOW_STAT
|
||||
printf("\n i = %d numPairs = %d ", g_STAT_OFFSET, numPairs / 2);
|
||||
printf("\n i = %u numPairs = %u ", g_STAT_OFFSET, numPairs / 2);
|
||||
g_STAT_OFFSET++;
|
||||
{
|
||||
UInt32 i;
|
||||
for (i = 0; i < numPairs; i += 2)
|
||||
printf("%2d %6d | ", p->matches[i], p->matches[i + 1]);
|
||||
printf("%2u %6u | ", p->matches[i], p->matches[i + 1]);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1167,12 +1167,12 @@ static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes)
|
||||
cur = 0;
|
||||
|
||||
#ifdef SHOW_STAT2
|
||||
if (position >= 0)
|
||||
/* if (position >= 0) */
|
||||
{
|
||||
unsigned i;
|
||||
printf("\n pos = %4X", position);
|
||||
for (i = cur; i <= lenEnd; i++)
|
||||
printf("\nprice[%4X] = %d", position - cur + i, p->opt[i].price);
|
||||
printf("\nprice[%4X] = %u", position - cur + i, p->opt[i].price);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1397,13 +1397,13 @@ static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes)
|
||||
{
|
||||
UInt32 lenTest2 = lenTest + 1;
|
||||
UInt32 limit = lenTest2 + p->numFastBytes;
|
||||
UInt32 nextRepMatchPrice;
|
||||
if (limit > numAvailFull)
|
||||
limit = numAvailFull;
|
||||
for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++);
|
||||
lenTest2 -= lenTest + 1;
|
||||
if (lenTest2 >= 2)
|
||||
{
|
||||
UInt32 nextRepMatchPrice;
|
||||
UInt32 state2 = kRepNextStates[state];
|
||||
UInt32 posStateNext = (position + lenTest) & p->pbMask;
|
||||
UInt32 curAndLenCharPrice =
|
||||
@@ -1487,13 +1487,13 @@ static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes)
|
||||
const Byte *data2 = data - curBack - 1;
|
||||
UInt32 lenTest2 = lenTest + 1;
|
||||
UInt32 limit = lenTest2 + p->numFastBytes;
|
||||
UInt32 nextRepMatchPrice;
|
||||
if (limit > numAvailFull)
|
||||
limit = numAvailFull;
|
||||
for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++);
|
||||
lenTest2 -= lenTest + 1;
|
||||
if (lenTest2 >= 2)
|
||||
{
|
||||
UInt32 nextRepMatchPrice;
|
||||
UInt32 state2 = kMatchNextStates[state];
|
||||
UInt32 posStateNext = (position + lenTest) & p->pbMask;
|
||||
UInt32 curAndLenCharPrice = curAndLenPrice +
|
||||
@@ -1829,7 +1829,7 @@ static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize
|
||||
len = GetOptimum(p, nowPos32, &pos);
|
||||
|
||||
#ifdef SHOW_STAT2
|
||||
printf("\n pos = %4X, len = %d pos = %d", nowPos32, len, pos);
|
||||
printf("\n pos = %4X, len = %u pos = %u", nowPos32, len, pos);
|
||||
#endif
|
||||
|
||||
posState = nowPos32 & p->pbMask;
|
||||
|
||||
37
C/Sha256.c
37
C/Sha256.c
@@ -1,5 +1,5 @@
|
||||
/* Crypto/Sha256.c -- SHA-256 Hash
|
||||
2015-03-02 : Igor Pavlov : Public domain
|
||||
2015-11-14 : Igor Pavlov : Public domain
|
||||
This code is based on public domain code from Wei Dai's Crypto++ library. */
|
||||
|
||||
#include "Precomp.h"
|
||||
@@ -113,10 +113,26 @@ static void Sha256_WriteByteBlock(CSha256 *p)
|
||||
{
|
||||
UInt32 W[16];
|
||||
unsigned j;
|
||||
UInt32 *state = p->state;
|
||||
UInt32 *state;
|
||||
|
||||
#ifdef _SHA256_UNROLL2
|
||||
UInt32 a,b,c,d,e,f,g,h;
|
||||
#else
|
||||
UInt32 T[8];
|
||||
#endif
|
||||
|
||||
for (j = 0; j < 16; j += 4)
|
||||
{
|
||||
const Byte *ccc = p->buffer + j * 4;
|
||||
W[j ] = GetBe32(ccc);
|
||||
W[j + 1] = GetBe32(ccc + 4);
|
||||
W[j + 2] = GetBe32(ccc + 8);
|
||||
W[j + 3] = GetBe32(ccc + 12);
|
||||
}
|
||||
|
||||
state = p->state;
|
||||
|
||||
#ifdef _SHA256_UNROLL2
|
||||
a = state[0];
|
||||
b = state[1];
|
||||
c = state[2];
|
||||
@@ -126,17 +142,10 @@ static void Sha256_WriteByteBlock(CSha256 *p)
|
||||
g = state[6];
|
||||
h = state[7];
|
||||
#else
|
||||
UInt32 T[8];
|
||||
for (j = 0; j < 8; j++)
|
||||
T[j] = state[j];
|
||||
#endif
|
||||
|
||||
for (j = 0; j < 16; j += 2)
|
||||
{
|
||||
W[j ] = GetBe32(p->buffer + j * 4);
|
||||
W[j + 1] = GetBe32(p->buffer + j * 4 + 4);
|
||||
}
|
||||
|
||||
for (j = 0; j < 64; j += 16)
|
||||
{
|
||||
RX_16
|
||||
@@ -226,11 +235,13 @@ void Sha256_Final(CSha256 *p, Byte *digest)
|
||||
|
||||
Sha256_WriteByteBlock(p);
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
for (i = 0; i < 8; i += 2)
|
||||
{
|
||||
UInt32 v = p->state[i];
|
||||
SetBe32(digest, v);
|
||||
digest += 4;
|
||||
UInt32 v0 = p->state[i];
|
||||
UInt32 v1 = p->state[i + 1];
|
||||
SetBe32(digest , v0);
|
||||
SetBe32(digest + 4, v1);
|
||||
digest += 8;
|
||||
}
|
||||
|
||||
Sha256_Init(p);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* 7zipInstall.c - 7-Zip Installer
|
||||
2015-09-28 : Igor Pavlov : Public domain */
|
||||
2015-11-08 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Precomp.h"
|
||||
|
||||
@@ -261,7 +261,7 @@ static LONG MyRegistry_CreateKeyAndVal(HKEY parentKey, LPCWSTR keyName, LPCWSTR
|
||||
if (res == ERROR_SUCCESS)
|
||||
{
|
||||
res = MyRegistry_SetString(destKey, valName, val);
|
||||
res = RegCloseKey(destKey);
|
||||
/* res = */ RegCloseKey(destKey);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -284,7 +284,7 @@ static LONG MyRegistry_CreateKeyAndVal_32(HKEY parentKey, LPCWSTR keyName, LPCWS
|
||||
if (res == ERROR_SUCCESS)
|
||||
{
|
||||
res = MyRegistry_SetString(destKey, valName, val);
|
||||
res = RegCloseKey(destKey);
|
||||
/* res = */ RegCloseKey(destKey);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -322,7 +322,7 @@ static Bool FindSignature(CSzFile *stream, UInt64 *resPos)
|
||||
processed -= k7zStartHeaderSize;
|
||||
for (pos = 0; pos <= processed; pos++)
|
||||
{
|
||||
for (; buf[pos] != '7' && pos <= processed; pos++);
|
||||
for (; pos <= processed && buf[pos] != '7'; pos++);
|
||||
if (pos > processed)
|
||||
break;
|
||||
if (memcmp(buf + pos, k7zSignature, k7zSignatureSize) == 0)
|
||||
@@ -598,8 +598,8 @@ static LONG SetRegKey_Path2(HKEY parentKey)
|
||||
if (res == ERROR_SUCCESS)
|
||||
{
|
||||
res = MyRegistry_SetString(destKey, k_Reg_Path32, path);
|
||||
res = MyRegistry_SetString(destKey, k_Reg_Path, path);
|
||||
res = RegCloseKey(destKey);
|
||||
/* res = */ MyRegistry_SetString(destKey, k_Reg_Path, path);
|
||||
/* res = */ RegCloseKey(destKey);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -718,10 +718,10 @@ static void WriteCLSID()
|
||||
WCHAR destPath[MAX_PATH + 10];
|
||||
wcscpy(destPath, path);
|
||||
wcscat(destPath, L"7-zip32.dll");
|
||||
res = MyRegistry_SetString(destKey, NULL, destPath);
|
||||
res = MyRegistry_SetString(destKey, L"ThreadingModel", L"Apartment");
|
||||
/* res = */ MyRegistry_SetString(destKey, NULL, destPath);
|
||||
/* res = */ MyRegistry_SetString(destKey, L"ThreadingModel", L"Apartment");
|
||||
// DeleteRegValue(destKey, L"InprocServer32");
|
||||
res = RegCloseKey(destKey);
|
||||
/* res = */ RegCloseKey(destKey);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -737,10 +737,10 @@ static void WriteCLSID()
|
||||
WCHAR destPath[MAX_PATH + 10];
|
||||
wcscpy(destPath, path);
|
||||
wcscat(destPath, L"7-zip.dll");
|
||||
res = MyRegistry_SetString(destKey, NULL, destPath);
|
||||
res = MyRegistry_SetString(destKey, L"ThreadingModel", L"Apartment");
|
||||
/* res = */ MyRegistry_SetString(destKey, NULL, destPath);
|
||||
/* res = */ MyRegistry_SetString(destKey, L"ThreadingModel", L"Apartment");
|
||||
// DeleteRegValue(destKey, L"InprocServer32");
|
||||
res = RegCloseKey(destKey);
|
||||
/* res = */ RegCloseKey(destKey);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1083,7 +1083,6 @@ static int Install()
|
||||
WCHAR sfxPath[MAX_PATH + 2];
|
||||
|
||||
Bool needReboot = False;
|
||||
size_t pathLen;
|
||||
|
||||
allocImp.Alloc = SzAlloc;
|
||||
allocImp.Free = SzFree;
|
||||
@@ -1116,6 +1115,7 @@ static int Install()
|
||||
|
||||
if (res == SZ_OK)
|
||||
{
|
||||
size_t pathLen;
|
||||
if (!g_SilentMode)
|
||||
{
|
||||
GetDlgItemTextW(g_HWND, IDE_EXTRACT_PATH, path, MAX_PATH);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* 7zipUninstall.c - 7-Zip Uninstaller
|
||||
2015-08-09 : Igor Pavlov : Public domain */
|
||||
2015-11-08 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Precomp.h"
|
||||
|
||||
@@ -384,7 +384,7 @@ static void WriteCLSID()
|
||||
if (res == ERROR_SUCCESS)
|
||||
{
|
||||
RegDeleteValueW(destKey, k_7zip_CLSID);
|
||||
res = RegCloseKey(destKey);
|
||||
/* res = */ RegCloseKey(destKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -419,7 +419,7 @@ static void WriteCLSID()
|
||||
if (res == ERROR_SUCCESS)
|
||||
{
|
||||
RegDeleteValueW(destKey, k_7zip_CLSID);
|
||||
res = RegCloseKey(destKey);
|
||||
/* res = */ RegCloseKey(destKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* LzmaUtil.c -- Test application for LZMA compression
|
||||
2015-06-13 : Igor Pavlov : Public domain */
|
||||
2015-11-08 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "../../Precomp.h"
|
||||
|
||||
@@ -133,7 +133,7 @@ static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 file
|
||||
SRes res;
|
||||
CLzmaEncProps props;
|
||||
|
||||
rs = rs;
|
||||
UNUSED_VAR(rs);
|
||||
|
||||
enc = LzmaEnc_Create(&g_Alloc);
|
||||
if (enc == 0)
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
/* LzmaLibExports.c -- LZMA library DLL Entry point
|
||||
2008-10-04 : Igor Pavlov : Public domain */
|
||||
2015-11-08 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "../../Precomp.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
|
||||
{
|
||||
hInstance = hInstance;
|
||||
dwReason = dwReason;
|
||||
lpReserved = lpReserved;
|
||||
UNUSED_VAR(hInstance);
|
||||
UNUSED_VAR(dwReason);
|
||||
UNUSED_VAR(lpReserved);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* SfxSetup.c - 7z SFX Setup
|
||||
2015-03-25 : Igor Pavlov : Public domain */
|
||||
2015-11-08 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Precomp.h"
|
||||
|
||||
@@ -88,7 +88,7 @@ static unsigned FindItem(const char * const *items, unsigned num, const wchar_t
|
||||
#ifdef _CONSOLE
|
||||
static BOOL WINAPI HandlerRoutine(DWORD ctrlType)
|
||||
{
|
||||
ctrlType = ctrlType;
|
||||
UNUSED_VAR(ctrlType);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
@@ -144,7 +144,7 @@ static Bool FindSignature(CSzFile *stream, UInt64 *resPos)
|
||||
processed -= k7zStartHeaderSize;
|
||||
for (pos = 0; pos <= processed; pos++)
|
||||
{
|
||||
for (; buf[pos] != '7' && pos <= processed; pos++);
|
||||
for (; pos <= processed && buf[pos] != '7'; pos++);
|
||||
if (pos > processed)
|
||||
break;
|
||||
if (memcmp(buf + pos, k7zSignature, k7zSignatureSize) == 0)
|
||||
@@ -257,10 +257,10 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
#ifdef _CONSOLE
|
||||
SetConsoleCtrlHandler(HandlerRoutine, TRUE);
|
||||
#else
|
||||
hInstance = hInstance;
|
||||
hPrevInstance = hPrevInstance;
|
||||
lpCmdLine = lpCmdLine;
|
||||
nCmdShow = nCmdShow;
|
||||
UNUSED_VAR(hInstance);
|
||||
UNUSED_VAR(hPrevInstance);
|
||||
UNUSED_VAR(lpCmdLine);
|
||||
UNUSED_VAR(nCmdShow);
|
||||
#endif
|
||||
|
||||
CrcGenerateTable();
|
||||
|
||||
16
C/XzDec.c
16
C/XzDec.c
@@ -1,5 +1,5 @@
|
||||
/* XzDec.c -- Xz Decode
|
||||
2015-05-01 : Igor Pavlov : Public domain */
|
||||
2015-11-09 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Precomp.h"
|
||||
|
||||
@@ -74,7 +74,7 @@ static void BraState_Free(void *pp, ISzAlloc *alloc)
|
||||
static SRes BraState_SetProps(void *pp, const Byte *props, size_t propSize, ISzAlloc *alloc)
|
||||
{
|
||||
CBraState *p = ((CBraState *)pp);
|
||||
alloc = alloc;
|
||||
UNUSED_VAR(alloc);
|
||||
p->ip = 0;
|
||||
if (p->methodId == XZ_ID_Delta)
|
||||
{
|
||||
@@ -129,9 +129,9 @@ static SRes BraState_Code(void *pp, Byte *dest, SizeT *destLen, const Byte *src,
|
||||
CBraState *p = ((CBraState *)pp);
|
||||
SizeT destLenOrig = *destLen;
|
||||
SizeT srcLenOrig = *srcLen;
|
||||
UNUSED_VAR(finishMode);
|
||||
*destLen = 0;
|
||||
*srcLen = 0;
|
||||
finishMode = finishMode;
|
||||
*wasFinished = 0;
|
||||
while (destLenOrig > 0)
|
||||
{
|
||||
@@ -236,8 +236,8 @@ static void SbState_Free(void *pp, ISzAlloc *alloc)
|
||||
static SRes SbState_SetProps(void *pp, const Byte *props, size_t propSize, ISzAlloc *alloc)
|
||||
{
|
||||
UNUSED_VAR(pp);
|
||||
props = props;
|
||||
alloc = alloc;
|
||||
UNUSED_VAR(props);
|
||||
UNUSED_VAR(alloc);
|
||||
return (propSize == 0) ? SZ_OK : SZ_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ static SRes SbState_Code(void *pp, Byte *dest, SizeT *destLen, const Byte *src,
|
||||
{
|
||||
CSbDec *p = (CSbDec *)pp;
|
||||
SRes res;
|
||||
srcWasFinished = srcWasFinished;
|
||||
UNUSED_VAR(srcWasFinished);
|
||||
p->dest = dest;
|
||||
p->destLen = *destLen;
|
||||
p->src = src;
|
||||
@@ -308,7 +308,7 @@ static SRes Lzma2State_Code(void *pp, Byte *dest, SizeT *destLen, const Byte *sr
|
||||
ELzmaStatus status;
|
||||
/* ELzmaFinishMode fm = (finishMode == LZMA_FINISH_ANY) ? LZMA_FINISH_ANY : LZMA_FINISH_END; */
|
||||
SRes res = Lzma2Dec_DecodeToBuf((CLzma2Dec *)pp, dest, destLen, src, srcLen, (ELzmaFinishMode)finishMode, &status);
|
||||
srcWasFinished = srcWasFinished;
|
||||
UNUSED_VAR(srcWasFinished);
|
||||
*wasFinished = (status == LZMA_STATUS_FINISHED_WITH_MARK);
|
||||
return res;
|
||||
}
|
||||
@@ -555,7 +555,7 @@ SRes XzBlock_Parse(CXzBlock *p, const Byte *header)
|
||||
pos += (unsigned)size;
|
||||
|
||||
#ifdef XZ_DUMP
|
||||
printf("\nf[%d] = %2X: ", i, filter->id);
|
||||
printf("\nf[%u] = %2X: ", i, (unsigned)filter->id);
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < size; i++)
|
||||
|
||||
5
C/XzIn.c
5
C/XzIn.c
@@ -1,5 +1,5 @@
|
||||
/* XzIn.c - Xz input
|
||||
2015-04-21 : Igor Pavlov : Public domain */
|
||||
2015-11-08 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Precomp.h"
|
||||
|
||||
@@ -72,7 +72,7 @@ SRes XzBlock_ReadFooter(CXzBlock *p, CXzStreamFlags f, ISeqInStream *inStream)
|
||||
|
||||
static SRes Xz_ReadIndex2(CXzStream *p, const Byte *buf, size_t size, ISzAlloc *alloc)
|
||||
{
|
||||
size_t i, numBlocks, pos = 1;
|
||||
size_t numBlocks, pos = 1;
|
||||
UInt32 crc;
|
||||
|
||||
if (size < 5 || buf[0] != 0)
|
||||
@@ -94,6 +94,7 @@ static SRes Xz_ReadIndex2(CXzStream *p, const Byte *buf, size_t size, ISzAlloc *
|
||||
Xz_Free(p, alloc);
|
||||
if (numBlocks != 0)
|
||||
{
|
||||
size_t i;
|
||||
p->numBlocks = numBlocks;
|
||||
p->numBlocksAllocated = numBlocks;
|
||||
p->blocks = alloc->Alloc(alloc, sizeof(CXzBlockSizes) * numBlocks);
|
||||
|
||||
Reference in New Issue
Block a user