- All message boxes in code now have a default for silent installers
- Some size optimizations git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3221 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
0139636e18
commit
f6ebb29045
9 changed files with 101 additions and 117 deletions
|
@ -9,7 +9,7 @@ const int kNumRepDistances = 4;
|
|||
|
||||
const int kNumStates = 12;
|
||||
|
||||
const BYTE kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
|
||||
const BYTE kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
|
||||
const BYTE kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
|
||||
const BYTE kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
|
||||
const BYTE kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
|
||||
|
|
|
@ -7,7 +7,6 @@ void CLZMADecoder::Create(BYTE *memoryPointer,
|
|||
int numLiteralPosStateBits,
|
||||
int numPosStateBits)
|
||||
{
|
||||
|
||||
int numPosStates = 1 << numPosStateBits;
|
||||
m_PosStateMask = numPosStates - 1;
|
||||
m_LiteralDecoder.Create(memoryPointer, numLiteralPosStateBits, numLiteralContextBits);
|
||||
|
@ -139,15 +138,14 @@ UINT32 CLZMADecoder::Code(CLZMAStateP lzmaState)
|
|||
repDistances[2] = repDistances[1];
|
||||
repDistances[1] = repDistances[0];
|
||||
repDistances[0] = distance;
|
||||
//LZMAMemCopy(repDistances, repDistances + 1, kNumRepDistances * sizeof(UINT32));
|
||||
}
|
||||
if (distance > nowPos || distance == 0)
|
||||
{
|
||||
// it's for stream version (without knowing uncompressed size)
|
||||
// if (distance >= _dictionarySizeCheck)
|
||||
if (distance == (UINT32)(0))
|
||||
break;
|
||||
// it's for stream version (without knowing uncompressed size)
|
||||
//if (distance >= _dictionarySizeCheck)
|
||||
if (!distance)
|
||||
break;
|
||||
if (distance > nowPos)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
len += kMatchMinLen;
|
||||
nowPos += len;
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
Range <<= 8;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Init(CLZMAStateP state)
|
||||
{
|
||||
Stream.Init(state);
|
||||
|
@ -40,18 +40,18 @@ public:
|
|||
for (int i = numTotalBits; i > 0; i--)
|
||||
{
|
||||
range >>= 1;
|
||||
/*
|
||||
|
||||
result <<= 1;
|
||||
if (code >= range)
|
||||
{
|
||||
code -= range;
|
||||
result |= 1;
|
||||
}
|
||||
*/
|
||||
UINT32 t = (code - range) >> 31;
|
||||
|
||||
/*UINT32 t = (code - range) >> 31;
|
||||
code -= range & (t - 1);
|
||||
// range = aRangeTmp + ((range & 1) & (1 - t));
|
||||
result = (result + result) | (1 - t);
|
||||
result = (result + result) | (1 - t);*/
|
||||
|
||||
if (range < kTopValue)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
}} \
|
||||
RC_NORMALIZE
|
||||
|
||||
//modelIndex <<= 1; if (code >= newBound) modelIndex++;
|
||||
|
||||
#define RC_GETBIT(prob, modelIndex) RC_GETBIT2(prob, modelIndex, ; , ;)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -95,12 +95,10 @@ DWORD WINAPI lzmaDecompressThread(LPVOID lpParameter)
|
|||
lzmaDecodeder->Create((LPBYTE) lzmaState->DynamicData,
|
||||
numLiteralContextBits, numLiteralPosStateBits, numPosStateBits);
|
||||
|
||||
UINT32 dictionarySize = 0;
|
||||
for (int i = 0; i < 4; i++)
|
||||
dictionarySize += ((UINT32)properties[1 + i]) << (i * 8);
|
||||
if (lzmaState->Dictionary == 0 || dictionarySize != lzmaState->DictionarySize)
|
||||
UINT32 dictionarySize = *(UINT32 *)(properties + 1);
|
||||
if (dictionarySize != lzmaState->DictionarySize)
|
||||
{
|
||||
if (lzmaState->Dictionary != 0)
|
||||
if (lzmaState->Dictionary)
|
||||
LZMAFree(lzmaState->Dictionary);
|
||||
lzmaState->Dictionary = LZMAAlloc(dictionarySize);
|
||||
lzmaState->DictionarySize = dictionarySize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue