4.60 beta

This commit is contained in:
Igor Pavlov
2008-08-19 00:00:00 +00:00
committed by Kornel Lesiński
parent 173c07e166
commit c10e6b16f6
107 changed files with 490 additions and 503 deletions

View File

@@ -1,5 +1,5 @@
/* 7zExtract.c -- Extracting from 7z archive
2008-08-05
2008-08-17
Igor Pavlov
Copyright (c) 1999-2008 Igor Pavlov
Read 7zExtract.h for license options */
@@ -79,7 +79,7 @@ SRes SzAr_Extract(
UInt32 i;
CSzFileItem *fileItem = p->db.Files + fileIndex;
*offset = 0;
for(i = p->FolderStartFileIndex[folderIndex]; i < fileIndex; i++)
for (i = p->FolderStartFileIndex[folderIndex]; i < fileIndex; i++)
*offset += (UInt32)p->db.Files[i].Size;
*outSizeProcessed = (size_t)fileItem->Size;
if (*offset + *outSizeProcessed > *outBufferSize)

View File

@@ -1,5 +1,5 @@
/* 7zIn.c -- 7z Input functions
2008-08-05
2008-08-17
Igor Pavlov
Copyright (c) 1999-2008 Igor Pavlov
Read 7zIn.h for license options */
@@ -8,7 +8,7 @@ Read 7zIn.h for license options */
#include "7zDecode.h"
#include "../../7zCrc.h"
#define RINOM(x) { if((x) == 0) return SZ_ERROR_MEM; }
#define RINOM(x) { if ((x) == 0) return SZ_ERROR_MEM; }
void SzArEx_Init(CSzArEx *p)
{
@@ -847,7 +847,7 @@ static SRes SzReadFileNames(CSzData *sd, UInt32 numFiles, CSzFileItem *files, IS
UInt32 len = 0;
UInt32 pos = 0;
CSzFileItem *file = files + i;
while(pos + 2 <= sd->Size)
while (pos + 2 <= sd->Size)
{
int numAdds;
UInt32 value = (UInt32)(sd->Data[pos] | (((UInt32)sd->Data[pos + 1]) << 8));
@@ -879,7 +879,7 @@ static SRes SzReadFileNames(CSzData *sd, UInt32 numFiles, CSzFileItem *files, IS
MY_ALLOC(char, file->Name, (size_t)len, alloc);
len = 0;
while(2 <= sd->Size)
while (2 <= sd->Size)
{
int numAdds;
UInt32 value = (UInt32)(sd->Data[0] | (((UInt32)sd->Data[1]) << 8));
@@ -906,7 +906,7 @@ static SRes SzReadFileNames(CSzData *sd, UInt32 numFiles, CSzFileItem *files, IS
numAdds--;
file->Name[len++] = (char)(0x80 + ((value >> (6 * numAdds)) & 0x3F));
}
while(numAdds > 0);
while (numAdds > 0);
len += numAdds;
}
@@ -1041,7 +1041,7 @@ static SRes SzReadHeader2(
file->HasStream = 1;
else
file->HasStream = (Byte)((*emptyStreamVector)[i] ? 0 : 1);
if(file->HasStream)
if (file->HasStream)
{
file->IsDir = 0;
file->Size = (*unpackSizes)[sizeIndex];

View File

@@ -1,5 +1,5 @@
/* 7zMain.c - Test application for 7z Decoder
2008-08-05
2008-08-17
Igor Pavlov
Public domain */
@@ -40,7 +40,7 @@ void ConvertNumberToString(CFileSize value, char *s)
while (value != 0);
do
*s++ = temp[--pos];
while(pos > 0);
while (pos > 0);
*s = '\0';
}

View File

@@ -1,5 +1,5 @@
/* Bcj2.c -- Converter for x86 code (BCJ2)
2008-08-05
2008-08-17
Copyright (c) 1999-2008 Igor Pavlov
Read Bra.h for license options */
@@ -24,7 +24,7 @@ Read Bra.h for license options */
#define RC_READ_BYTE (*buffer++)
#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }
#define RC_INIT2 code = 0; range = 0xFFFFFFFF; \
{ int i; for(i = 0; i < 5; i++) { RC_TEST; code = (code << 8) | RC_READ_BYTE; }}
{ int i; for (i = 0; i < 5; i++) { RC_TEST; code = (code << 8) | RC_READ_BYTE; }}
#define NORMALIZE if (range < kTopValue) { RC_TEST; range <<= 8; code = (code << 8) | RC_READ_BYTE; }

View File

@@ -1,5 +1,5 @@
/* Bra.h -- Branch converters for executables
2008-08-05
2008-08-17
Copyright (c) 1999-2008 Igor Pavlov
Read LzmaDec.h for license options */
@@ -41,7 +41,7 @@ in CALL instructions to increase the compression ratio.
Example:
UInt32 ip = 0;
for()
for ()
{
// size must be >= Alignment + LookAhead, if it's not last block
SizeT processed = Convert(data, size, ip, 1);

View File

@@ -1,5 +1,5 @@
/* Bra86.c -- converter for x86 code (BCJ)
2008-03-19
2008-08-17
Copyright (c) 1999-2008 Igor Pavlov
Read Bra.h for license options */
@@ -19,7 +19,7 @@ SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding
ip += 5;
prevPosT = (SizeT)0 - 1;
for(;;)
for (;;)
{
Byte *p = data + bufferPos;
Byte *limit = data + size - 4;

View File

@@ -1,5 +1,5 @@
/* BwtSort.c -- BWT block sorting
2008-08-05
2008-08-17
Igor Pavlov
Public domain */
@@ -225,7 +225,7 @@ UInt32 NO_INLINE SortGroup(UInt32 BlockSize, UInt32 NumSortedBytes, UInt32 group
break;
}
}
while(++i < j);
while (++i < j);
if (i == 0)
{
range = range - (mid - left);
@@ -438,7 +438,7 @@ UInt32 BlockSort(UInt32 *Indices, const Byte *data, UInt32 blockSize)
i++;
continue;
}
for(groupSize = 1;
for (groupSize = 1;
(Flags[(i + groupSize) >> kNumFlagsBits] & (1 << ((i + groupSize) & kFlagsMask))) != 0;
groupSize++);

View File

@@ -1,5 +1,5 @@
/* LzFind.c -- Match finder for LZ algorithms
2008-08-05
2008-08-17
Copyright (c) 1999-2008 Igor Pavlov
Read LzFind.h for license options */
@@ -263,7 +263,7 @@ static void MatchFinder_SetLimits(CMatchFinder *p)
void MatchFinder_Init(CMatchFinder *p)
{
UInt32 i;
for(i = 0; i < p->hashSizeSum; i++)
for (i = 0; i < p->hashSizeSum; i++)
p->hash[i] = kEmptyHashValue;
p->cyclicBufferPos = 0;
p->buffer = p->bufferBase;
@@ -327,7 +327,7 @@ static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos,
if (pb[maxLen] == cur[maxLen] && *pb == *cur)
{
UInt32 len = 0;
while(++len != lenLimit)
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
if (maxLen < len)
@@ -364,7 +364,7 @@ UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byt
if (pb[len] == cur[len])
{
if (++len != lenLimit && pb[len] == cur[len])
while(++len != lenLimit)
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
if (maxLen < len)
@@ -417,7 +417,7 @@ static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const
UInt32 len = (len0 < len1 ? len0 : len1);
if (pb[len] == cur[len])
{
while(++len != lenLimit)
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
{

View File

@@ -1,5 +1,5 @@
/* LzFindMt.c -- multithreaded Match finder for LZ algorithms
2008-08-05
2008-08-17
Copyright (c) 1999-2008 Igor Pavlov
Read LzFind.h for license options */
@@ -97,7 +97,7 @@ void MtSync_Destruct(CMtSync *p)
p->wasCreated = False;
}
#define RINOK_THREAD(x) { if((x) != 0) return SZ_ERROR_THREAD; }
#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; }
static SRes MtSync_Create2(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks)
{
@@ -262,7 +262,7 @@ Int32 NO_INLINE GetMatchesSpecN(UInt32 lenLimit, UInt32 pos, const Byte *cur, CL
if (pb[len] == cur[len])
{
if (++len != lenLimit && pb[len] == cur[len])
while(++len != lenLimit)
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
if (maxLen < len)
@@ -715,7 +715,7 @@ UInt32 MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *distances)
#define SKIP_HEADER2 do { GET_NEXT_BLOCK_IF_REQUIRED
#define SKIP_HEADER(n) SKIP_HEADER2 if (p->btNumAvailBytes-- >= (n)) { const Byte *cur = p->pointerToCurPos; UInt32 *hash = p->hash;
#define SKIP_FOOTER } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while(--num != 0);
#define SKIP_FOOTER } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while (--num != 0);
void MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num)
{

View File

@@ -1,5 +1,5 @@
/* LzmaDec.c -- LZMA Decoder
2008-08-05
2008-08-17
Copyright (c) 1999-2008 Igor Pavlov
Read LzmaDec.h for license options */
@@ -56,7 +56,7 @@ Read LzmaDec.h for license options */
{ UPDATE_1_CHECK; i = (i + i) + 1; A1; }
#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
#define TREE_DECODE_CHECK(probs, limit, i) \
{ i = 1; do { GET_BIT_CHECK(probs + i, i) } while(i < limit); i -= limit; }
{ i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
#define kNumPosBitsMax 4
@@ -328,7 +328,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
GET_BIT2(prob + i, i, ; , distance |= mask);
mask <<= 1;
}
while(--numDirectBits != 0);
while (--numDirectBits != 0);
}
}
else
@@ -679,7 +679,7 @@ static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inS
{
GET_BIT_CHECK(prob + i, i);
}
while(--numDirectBits != 0);
while (--numDirectBits != 0);
}
}
}

View File

@@ -1,5 +1,5 @@
/* LzmaEnc.c -- LZMA Encoder
2008-08-13
2008-08-17
Copyright (c) 1999-2008 Igor Pavlov
Read LzmaEnc.h for license options */
@@ -1966,7 +1966,7 @@ void LzmaEnc_Init(CLzmaEnc *p)
{
UInt32 i;
p->state = 0;
for(i = 0 ; i < LZMA_NUM_REPS; i++)
for (i = 0 ; i < LZMA_NUM_REPS; i++)
p->reps[i] = 0;
RangeEnc_Init(&p->rc);
@@ -2002,7 +2002,7 @@ void LzmaEnc_Init(CLzmaEnc *p)
}
}
{
for(i = 0; i < kNumFullDistances - kEndPosModelIndex; i++)
for (i = 0; i < kNumFullDistances - kEndPosModelIndex; i++)
p->posEncoders[i] = kProbInitValue;
}

View File

@@ -1,5 +1,5 @@
/* Sort.c -- Sort functions
2008-03-13
2008-08-17
Igor Pavlov
Public domain */
@@ -27,7 +27,7 @@ void HeapSort(UInt32 *p, UInt32 size)
UInt32 k = i;
HeapSortDown(p, k, size, temp)
}
while(--i != 0);
while (--i != 0);
}
/*
do
@@ -82,7 +82,7 @@ void HeapSortRef(UInt32 *p, UInt32 *vals, UInt32 size)
UInt32 temp = p[i];
HeapSortRefDown(p, vals, i, size, temp);
}
while(--i != 0);
while (--i != 0);
}
do
{