20 bytes removed from bzip2 and some cleanup =)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1291 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
justin1014 2002-10-03 06:11:22 +00:00
parent 5040298c75
commit df46b6aefc
3 changed files with 5 additions and 39 deletions

View file

@ -439,9 +439,7 @@ int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm )
/*---------------------------------------------------*/ /*---------------------------------------------------*/
/*--- Decompression stuff ---*/ /*--- Decompression stuff ---*/
/*---------------------------------------------------*/ /*---------------------------------------------------*/
static DState local_state;
/*---------------------------------------------------*/
int BZ_API(BZ2_bzDecompressInit) int BZ_API(BZ2_bzDecompressInit)
( DState * s) ( DState * s)
{ {
@ -451,22 +449,6 @@ int BZ_API(BZ2_bzDecompressInit)
} }
/*---------------------------------------------------*/
/*---------------------------------------------------*/
__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
{
Int32 nb, na, mid;
nb = 0;
na = 256;
do {
mid = (nb + na) >> 1;
if (indx >= cftab[mid]) nb = mid; else na = mid;
}
while (na - nb != 1);
return nb;
}
#ifdef NSIS_COMPRESS_BZIP2_SMALLMODE #ifdef NSIS_COMPRESS_BZIP2_SMALLMODE
@ -519,18 +501,17 @@ void unRLE_obuf_to_output_FAST ( DState* s )
UChar k1; UChar k1;
/* restore */ /* restore */
// UInt32 c_calculatedBlockCRC = s->calculatedBlockCRC;
UChar c_state_out_ch = s->state_out_ch; UChar c_state_out_ch = s->state_out_ch;
Int32 c_state_out_len = s->state_out_len; Int32 c_state_out_len = s->state_out_len;
Int32 c_nblock_used = s->nblock_used; Int32 c_nblock_used = s->nblock_used;
Int32 c_k0 = s->k0; Int32 c_k0 = s->k0;
UInt32* c_tt = s->tt;
UInt32 c_tPos = s->tPos; UInt32 c_tPos = s->tPos;
char* cs_next_out = s->next_out; char* cs_next_out = s->next_out;
unsigned int cs_avail_out = s->avail_out; unsigned int cs_avail_out = s->avail_out;
/* end restore */ /* end restore */
UInt32 avail_out_INIT = cs_avail_out; UInt32* c_tt = s->tt;
Int32 s_save_nblockPP = s->save.nblock+1; Int32 s_save_nblockPP = s->save.nblock+1;
// unsigned int total_out_lo32_old; // unsigned int total_out_lo32_old;
@ -588,7 +569,6 @@ void unRLE_obuf_to_output_FAST ( DState* s )
s->state_out_len = c_state_out_len; s->state_out_len = c_state_out_len;
s->nblock_used = c_nblock_used; s->nblock_used = c_nblock_used;
s->k0 = c_k0; s->k0 = c_k0;
// s->tt = c_tt;
s->tPos = c_tPos; s->tPos = c_tPos;
s->next_out = cs_next_out; s->next_out = cs_next_out;
s->avail_out = cs_avail_out; s->avail_out = cs_avail_out;

View file

@ -383,24 +383,19 @@ typedef
/* state indicator for this stream */ /* state indicator for this stream */
char state; char state;
/* for doing the final run-length decoding */
UChar state_out_ch; UChar state_out_ch;
Int32 state_out_len; Int32 state_out_len;
Int32 nblock_used;
Int32 k0;
UInt32 tPos;
/* the buffer for bit stream reading */ /* the buffer for bit stream reading */
UInt32 bsBuff; UInt32 bsBuff;
Int32 bsLive; Int32 bsLive;
/* misc administratium */
Int32 currBlockNo;
Int32 verbosity;
/* for undoing the Burrows-Wheeler transform */ /* for undoing the Burrows-Wheeler transform */
Int32 origPtr; Int32 origPtr;
UInt32 tPos;
Int32 k0;
Int32 unzftab[256]; Int32 unzftab[256];
Int32 nblock_used;
Int32 cftab[257]; Int32 cftab[257];
Int32 cftabCopy[257]; Int32 cftabCopy[257];
@ -413,12 +408,6 @@ typedef
UChar ll4 [((1 + NSIS_COMPRESS_BZIP2_LEVEL*100000) >> 1) ]; UChar ll4 [((1 + NSIS_COMPRESS_BZIP2_LEVEL*100000) >> 1) ];
#endif #endif
/* stored and calculated CRCs */
// UInt32 storedBlockCRC;
// UInt32 storedCombinedCRC;
// UInt32 calculatedBlockCRC;
//UInt32 calculatedCombinedCRC;
/* map of bytes used in block */ /* map of bytes used in block */
Int32 nInUse; Int32 nInUse;
Bool inUse[256]; Bool inUse[256];
@ -439,7 +428,6 @@ typedef
/* save area for scalars in the main decompress code */ /* save area for scalars in the main decompress code */
DState_save save; DState_save save;
} }
DState; DState;

View file

@ -187,8 +187,6 @@ Int32 BZ2_decompress ( DState* s )
} }
if (uc != 0x31) RETURN(BZ_DATA_ERROR); if (uc != 0x31) RETURN(BZ_DATA_ERROR);
s->currBlockNo++;
s->origPtr = 0; s->origPtr = 0;
GET_UCHAR(BZ_X_ORIGPTR_1, uc); GET_UCHAR(BZ_X_ORIGPTR_1, uc);
s->origPtr = (s->origPtr << 8) | ((Int32)uc); s->origPtr = (s->origPtr << 8) | ((Int32)uc);