more bzip2 code reduction, disabled data reduction for now so we can hit targets
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1204 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
5b792cc6a0
commit
83655f8352
3 changed files with 11 additions and 5 deletions
|
@ -125,7 +125,7 @@ typedef unsigned short UInt16;
|
||||||
|
|
||||||
/*-- Stuff for randomising repetitive blocks. --*/
|
/*-- Stuff for randomising repetitive blocks. --*/
|
||||||
|
|
||||||
extern Int16 BZ2_rNums[513];
|
extern Int16 BZ2_rNums[512]; // make this 513 for smaller-data mode.
|
||||||
|
|
||||||
#define BZ_RAND_DECLS \
|
#define BZ_RAND_DECLS \
|
||||||
Int32 rNToGo; \
|
Int32 rNToGo; \
|
||||||
|
|
|
@ -63,7 +63,10 @@
|
||||||
|
|
||||||
#include "bzlib_private.h"
|
#include "bzlib_private.h"
|
||||||
|
|
||||||
#if 1
|
|
||||||
|
// smaller data mode that saves 336 bytes of data, but adds 60 bytes of code.
|
||||||
|
// currently saving code is more important to reach our targets. this may change tho.
|
||||||
|
#if 0
|
||||||
|
|
||||||
#define PACK3(x,y,z) ((z) << 20)|((y) << 10)|(x)
|
#define PACK3(x,y,z) ((z) << 20)|((y) << 10)|(x)
|
||||||
|
|
||||||
|
@ -264,8 +267,7 @@ void NSISCALL genrtable()
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
Int16 BZ2_rNums[512]
|
Int16 BZ2_rNums[512] = {
|
||||||
= {
|
|
||||||
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
|
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
|
||||||
985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
|
985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
|
||||||
733, 859, 335, 708, 621, 574, 73 , 654, 730, 472,
|
733, 859, 335, 708, 621, 574, 73 , 654, 730, 472,
|
||||||
|
|
|
@ -13,7 +13,11 @@
|
||||||
#ifdef NSIS_COMPRESS_USE_BZIP2
|
#ifdef NSIS_COMPRESS_USE_BZIP2
|
||||||
#include "../bzip2/bzlib.h"
|
#include "../bzip2/bzlib.h"
|
||||||
static int bz2_needreinit;
|
static int bz2_needreinit;
|
||||||
void NSISCALL genrtable();
|
// void NSISCALL genrtable(); // using this method reduces data by 336, but adds ~60 to code.
|
||||||
|
// currently it makes sense to spend the money on data and reduce code size, but that may change.
|
||||||
|
#define genrtable()
|
||||||
|
|
||||||
|
|
||||||
#define z_stream bz_stream
|
#define z_stream bz_stream
|
||||||
#define inflateInit(x) { if (BZ2_bzDecompressInit(x)<0) return _LANG_INVALIDCRC; }
|
#define inflateInit(x) { if (BZ2_bzDecompressInit(x)<0) return _LANG_INVALIDCRC; }
|
||||||
#define inflate(x) BZ2_bzDecompress(x)
|
#define inflate(x) BZ2_bzDecompress(x)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue