diff --git a/Source/zlib/INFBLOCK.C b/Source/zlib/INFBLOCK.C index 252aa9bc..778e1a8f 100644 --- a/Source/zlib/INFBLOCK.C +++ b/Source/zlib/INFBLOCK.C @@ -50,13 +50,26 @@ inflate_blocks_statef *s; z_streamp z; int r; { - uInt t; /* temporary storage */ - uLong b; /* bit buffer */ - uInt k; /* bits in bit buffer */ - Bytef *p; /* input data pointer */ - uInt n; /* bytes available there */ - Bytef *q; /* output window write pointer */ - uInt m; /* bytes to end of window or read pointer */ + + // lousy two bytes saved by doing this + struct + { + uInt t; /* temporary storage */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Bytef *p; /* input data pointer */ + uInt n; /* bytes available there */ + Bytef *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + } _state; + +#define t _state.t +#define b _state.b +#define k _state.k +#define p _state.p +#define n _state.n +#define q _state.q +#define m _state.m /* copy input/output information to locals (UPDATE macro restores) */ LOAD diff --git a/Source/zlib/INFLATE.C b/Source/zlib/INFLATE.C index cbd0150d..15856120 100644 --- a/Source/zlib/INFLATE.C +++ b/Source/zlib/INFLATE.C @@ -21,7 +21,6 @@ int ZEXPORT inflateReset(z_streamp z) { if (z == Z_NULL || z->state == Z_NULL) return Z_STREAM_ERROR; - z->total_in = z->total_out = 0; inflate_blocks_reset(&z->state->blocks, z, Z_NULL); return Z_OK; } diff --git a/Source/zlib/INFUTIL.C b/Source/zlib/INFUTIL.C index 432ca8ee..28de5c5a 100644 --- a/Source/zlib/INFUTIL.C +++ b/Source/zlib/INFUTIL.C @@ -20,6 +20,18 @@ unsigned short inflate_mask[17] = { 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff }; +/* +void NSISCALL genrtable() +{ + int x=17; + while (x>=0) + { + inflate_mask[x]=(1<avail_out -= n; - z->total_out += n; +// z->total_out += n; /* copy as far as end of window */ zmemcpy(p, q, n); @@ -69,7 +81,7 @@ int r; /* update counters */ z->avail_out -= n; - z->total_out += n; + //z->total_out += n; /* copy */ zmemcpy(p, q, n); diff --git a/Source/zlib/INFUTIL.H b/Source/zlib/INFUTIL.H index 7ccf8d71..2fc2e78a 100644 --- a/Source/zlib/INFUTIL.H +++ b/Source/zlib/INFUTIL.H @@ -58,7 +58,7 @@ struct inflate_blocks_state { /* defines for inflate input/output */ /* update pointers and return */ #define UPDBITS {s->bitb=b;s->bitk=k;} -#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} +#define UPDIN {z->avail_in=n;z->next_in=p;} #define UPDOUT {s->write=q;} #define UPDATE {UPDBITS UPDIN UPDOUT} #define LEAVE return __myleave(s,z,r,b,k,p,n,q); diff --git a/Source/zlib/ZLIB.H b/Source/zlib/ZLIB.H index 522b95c5..002a1599 100644 --- a/Source/zlib/ZLIB.H +++ b/Source/zlib/ZLIB.H @@ -54,11 +54,15 @@ struct internal_state; typedef struct z_stream_s { Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ +#ifndef EXEHEAD uLong total_in; /* total nb of input bytes read so far */ +#endif Bytef *next_out; /* next output byte should be put there */ uInt avail_out; /* remaining free space at next_out */ +#ifndef EXEHEAD uLong total_out; /* total nb of bytes output so far */ +#endif // char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */