some more byte savings

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1290 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
justin1014 2002-10-03 01:54:43 +00:00
parent 6b489bdc60
commit 5040298c75

View file

@ -67,9 +67,6 @@ int r;
if (e == 0) /* literal */ if (e == 0) /* literal */
{ {
c->sub.lit = t->base; c->sub.lit = t->base;
Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
"inflate: literal '%c'\n" :
"inflate: literal 0x%02x\n", t->base));
c->mode = LIT; c->mode = LIT;
break; break;
} }
@ -88,14 +85,10 @@ int r;
} }
if (e & 32) /* end of block */ if (e & 32) /* end of block */
{ {
Tracevv((stderr, "inflate: end of block\n"));
c->mode = WASH; c->mode = WASH;
break; break;
} }
c->mode = BADCODE; /* invalid code */ goto badcode;
// z->msg = (char*)"err";//invalid literal/length code";
r = Z_DATA_ERROR;
LEAVE
case LENEXT: /* i: getting length extra (have base) */ case LENEXT: /* i: getting length extra (have base) */
j = c->sub.copy.get; j = c->sub.copy.get;
NEEDBITS(j) NEEDBITS(j)
@ -103,7 +96,6 @@ int r;
DUMPBITS(j) DUMPBITS(j)
c->sub.code.need = c->dbits; c->sub.code.need = c->dbits;
c->sub.code.tree = c->dtree; c->sub.code.tree = c->dtree;
Tracevv((stderr, "inflate: length %u\n", c->len));
c->mode = DIST; c->mode = DIST;
case DIST: /* i: get distance next */ case DIST: /* i: get distance next */
j = c->sub.code.need; j = c->sub.code.need;
@ -124,27 +116,21 @@ int r;
c->sub.code.tree = t + t->base; c->sub.code.tree = t + t->base;
break; break;
} }
c->mode = BADCODE; /* invalid code */ goto badcode;
// z->msg = (char*)"err";//invalid distance code"; // c->mode = BADCODE; /* invalid code */
r = Z_DATA_ERROR; // r = Z_DATA_ERROR;
LEAVE // LEAVE
case DISTEXT: /* i: getting distance extra */ case DISTEXT: /* i: getting distance extra */
j = c->sub.copy.get; j = c->sub.copy.get;
NEEDBITS(j) NEEDBITS(j)
c->sub.copy.dist += (uInt)b & (uInt)inflate_mask[j]; c->sub.copy.dist += (uInt)b & (uInt)inflate_mask[j];
DUMPBITS(j) DUMPBITS(j)
Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
c->mode = COPY; c->mode = COPY;
case COPY: /* o: copying bytes in window, waiting for space */ case COPY: /* o: copying bytes in window, waiting for space */
#ifndef __TURBOC__ /* Turbo C bug for following expression */
f = (uInt)(q - s->window) < c->sub.copy.dist ? f = (uInt)(q - s->window) < c->sub.copy.dist ?
s->end - (c->sub.copy.dist - (q - s->window)) : s->end - (c->sub.copy.dist - (q - s->window)) :
q - c->sub.copy.dist; q - c->sub.copy.dist;
#else
f = q - c->sub.copy.dist;
if ((uInt)(q - s->window) < c->sub.copy.dist)
f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));
#endif
while (c->len) while (c->len)
{ {
NEEDOUT NEEDOUT
@ -163,7 +149,6 @@ int r;
case WASH: /* o: got eob, possibly more output */ case WASH: /* o: got eob, possibly more output */
if (k > 7) /* return unused byte, if any */ if (k > 7) /* return unused byte, if any */
{ {
Assert(k < 16, "inflate_codes grabbed too many bytes")
k -= 8; k -= 8;
n++; n++;
p--; /* can always return one */ p--; /* can always return one */
@ -175,16 +160,11 @@ int r;
case END: case END:
r = Z_STREAM_END; r = Z_STREAM_END;
LEAVE LEAVE
case BADCODE: /* x: got error */
r = Z_DATA_ERROR;
LEAVE
default: default:
badcode:
r = Z_STREAM_ERROR; r = Z_STREAM_ERROR;
LEAVE LEAVE
} }
#ifdef NEED_DUMMY_RETURN
return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
#endif
} }