another bunch of data removed, zlib is now 34.5k

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1281 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
justin1014 2002-10-02 18:22:11 +00:00
parent e7c51b1510
commit 4ef667a353

View file

@ -63,15 +63,14 @@ int r=Z_OK;
case TYPE: case TYPE:
NEEDBITS(3) NEEDBITS(3)
t = (uInt)b & 7; t = (uInt)b & 7;
DUMPBITS(3)
s->last = t & 1; s->last = t & 1;
switch (t >> 1) switch (t >> 1)
{ {
case 0: /* stored */ case 0: /* stored */
Tracev((stderr, "inflate: stored block%s\n", Tracev((stderr, "inflate: stored block%s\n",
s->last ? " (last)" : "")); s->last ? " (last)" : ""));
DUMPBITS(3) DUMPBITS(k&7)
t = k & 7; /* go to byte boundary */
DUMPBITS(t)
s->mode = LENS; /* get length of stored block */ s->mode = LENS; /* get length of stored block */
break; break;
case 1: /* fixed */ case 1: /* fixed */
@ -84,17 +83,14 @@ int r=Z_OK;
inflate_trees_fixed(&bl, &bd, &tl, &td); inflate_trees_fixed(&bl, &bd, &tl, &td);
inflate_codes_new(&s->sub.decode.t_codes,bl, bd, tl, td); inflate_codes_new(&s->sub.decode.t_codes,bl, bd, tl, td);
} }
DUMPBITS(3)
s->mode = CODES; s->mode = CODES;
break; break;
case 2: /* dynamic */ case 2: /* dynamic */
Tracev((stderr, "inflate: dynamic codes block%s\n", Tracev((stderr, "inflate: dynamic codes block%s\n",
s->last ? " (last)" : "")); s->last ? " (last)" : ""));
DUMPBITS(3)
s->mode = TABLE; s->mode = TABLE;
break; break;
case 3: /* illegal */ default: /* illegal */
DUMPBITS(3)
s->mode = BAD; s->mode = BAD;
// z->msg = (char*)"err";//invalid block type"; // z->msg = (char*)"err";//invalid block type";
r = Z_DATA_ERROR; r = Z_DATA_ERROR;
@ -118,12 +114,8 @@ int r=Z_OK;
zmemcpy(q, p, t); zmemcpy(q, p, t);
p += t; n -= t; p += t; n -= t;
q += t; m -= t; q += t; m -= t;
if ((s->sub.left -= t) != 0) if (!(s->sub.left -= t))
break; s->mode = s->last ? DRY : TYPE;
Tracev((stderr, "inflate: stored end, %lu total out\n",
z->total_out + (q >= s->read ? q - s->read :
(s->end - s->read) + (q - s->window))));
s->mode = s->last ? DRY : TYPE;
break; break;
case TABLE: case TABLE:
NEEDBITS(14) NEEDBITS(14)
@ -173,17 +165,24 @@ int r=Z_OK;
h = s->sub.trees.tb + ((uInt)b & (uInt)inflate_mask[t]); h = s->sub.trees.tb + ((uInt)b & (uInt)inflate_mask[t]);
t = h->bits; t = h->bits;
c = h->base; c = h->base;
DUMPBITS(t)
if (c < 16) if (c < 16)
{ {
DUMPBITS(t)
s->sub.trees.t_blens[s->sub.trees.index++] = c; s->sub.trees.t_blens[s->sub.trees.index++] = c;
} }
else /* c == 16..18 */ else /* c == 16..18 */
{ {
i = c == 18 ? 7 : c - 14; if (c == 18)
j = c == 18 ? 11 : 3; {
NEEDBITS(t + i) i=7;
DUMPBITS(t) j=11;
}
else
{
i=c-14;
j=3;
}
NEEDBITS(i)
j += (uInt)b & (uInt)inflate_mask[i]; j += (uInt)b & (uInt)inflate_mask[i];
DUMPBITS(i) DUMPBITS(i)
i = s->sub.trees.index; i = s->sub.trees.index;
@ -247,10 +246,10 @@ int r=Z_OK;
case DONE: case DONE:
r = Z_STREAM_END; r = Z_STREAM_END;
LEAVE LEAVE
case BAD: // case BAD:
r = Z_DATA_ERROR; // r = Z_DATA_ERROR;
LEAVE // LEAVE
default: default: // we'll call Z_STREAM_ERROR if BAD anyway
r = Z_STREAM_ERROR; r = Z_STREAM_ERROR;
LEAVE LEAVE
} }