reduced zlib size by 16 or so
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1208 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
4811f17832
commit
6a6260aeb6
3 changed files with 25 additions and 30 deletions
|
@ -38,11 +38,6 @@ uLongf *c;
|
||||||
Tracev((stderr, "inflate: blocks reset\n"));
|
Tracev((stderr, "inflate: blocks reset\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
int inflate_blocks_getssize()
|
|
||||||
{
|
|
||||||
return sizeof(struct inflate_blocks_state);
|
|
||||||
}
|
|
||||||
|
|
||||||
void inflate_blocks_init(z_streamp z,inflate_blocks_statef *s)
|
void inflate_blocks_init(z_streamp z,inflate_blocks_statef *s)
|
||||||
{
|
{
|
||||||
s->end = s->window + (1 << DEF_WBITS);
|
s->end = s->window + (1 << DEF_WBITS);
|
||||||
|
@ -297,7 +292,7 @@ int r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int inflate_blocks_free(s, z)
|
/*int inflate_blocks_free(s, z)
|
||||||
inflate_blocks_statef *s;
|
inflate_blocks_statef *s;
|
||||||
z_streamp z;
|
z_streamp z;
|
||||||
{
|
{
|
||||||
|
@ -306,4 +301,5 @@ z_streamp z;
|
||||||
Tracev((stderr, "inflate: blocks freed\n"));
|
Tracev((stderr, "inflate: blocks freed\n"));
|
||||||
return Z_OK;
|
return Z_OK;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
#endif
|
#endif
|
|
@ -11,25 +11,10 @@
|
||||||
|
|
||||||
#include "zutil.h"
|
#include "zutil.h"
|
||||||
#include "infblock.h"
|
#include "infblock.h"
|
||||||
|
#include "inftrees.h"
|
||||||
|
#include "infcodes.h"
|
||||||
|
#include "infutil.h"
|
||||||
|
|
||||||
struct inflate_blocks_state { int dummy; }; /* for buggy compilers */
|
|
||||||
|
|
||||||
|
|
||||||
/* inflate private state */
|
|
||||||
struct internal_state {
|
|
||||||
|
|
||||||
/* mode dependent information */
|
|
||||||
union {
|
|
||||||
uInt method; /* if FLAGS, method byte */
|
|
||||||
struct {
|
|
||||||
uLong was; /* computed check value */
|
|
||||||
uLong need; /* stream check value */
|
|
||||||
} check; /* if CHECK, check values to compare */
|
|
||||||
uInt marker; /* if BAD, inflateSync's marker bytes count */
|
|
||||||
} sub; /* submode */
|
|
||||||
|
|
||||||
inflate_blocks_statef blocks; /* current inflate_blocks state */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
int ZEXPORT inflateReset(z_streamp z)
|
int ZEXPORT inflateReset(z_streamp z)
|
||||||
|
@ -41,15 +26,16 @@ int ZEXPORT inflateReset(z_streamp z)
|
||||||
return Z_OK;
|
return Z_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct internal_state __mstate;
|
||||||
|
|
||||||
int ZEXPORT inflateInit(z_streamp z)
|
int ZEXPORT inflateInit(z_streamp z)
|
||||||
{
|
{
|
||||||
int inflate_blocks_getssize(void);
|
void inflate_blocks_init(z_streamp z,struct inflate_blocks_state *s);
|
||||||
void inflate_blocks_init(z_streamp z,inflate_blocks_statef *s);
|
|
||||||
|
|
||||||
if ((z->state =
|
z->state=&__mstate;
|
||||||
(struct internal_state FAR *) ZALLOC(z,1,sizeof(struct internal_state)+inflate_blocks_getssize())) == Z_NULL)
|
// if ((z->state =
|
||||||
return Z_MEM_ERROR;
|
// (struct internal_state FAR *) ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)
|
||||||
|
//return Z_MEM_ERROR;
|
||||||
|
|
||||||
inflate_blocks_init(z,&z->state->blocks);
|
inflate_blocks_init(z,&z->state->blocks);
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,19 @@ extern int inflate_flush OF((
|
||||||
z_streamp ,
|
z_streamp ,
|
||||||
int));
|
int));
|
||||||
|
|
||||||
struct internal_state {int dummy;}; /* for buggy compilers */
|
struct internal_state {
|
||||||
|
|
||||||
|
/* mode dependent information */
|
||||||
|
union {
|
||||||
|
uInt method; /* if FLAGS, method byte */
|
||||||
|
struct {
|
||||||
|
uLong was; /* computed check value */
|
||||||
|
uLong need; /* stream check value */
|
||||||
|
} check; /* if CHECK, check values to compare */
|
||||||
|
uInt marker; /* if BAD, inflateSync's marker bytes count */
|
||||||
|
} sub; /* submode */
|
||||||
|
|
||||||
|
struct inflate_blocks_state blocks; /* current inflate_blocks state */
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue