diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:26:29 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:26:29 -0700 |
commit | 639be997883d9016baaf46017a2802b2ce1698bd (patch) | |
tree | db90fc577d10564b335980824111e8d11c5527e2 /contrib/infback9 | |
parent | d6231142d2b883a8c3b253fa34992b5cdb4ac2fe (diff) | |
download | zlib-1.2.3.3.tar.gz zlib-1.2.3.3.tar.bz2 zlib-1.2.3.3.zip |
zlib 1.2.3.3v1.2.3.3
Diffstat (limited to 'contrib/infback9')
-rw-r--r-- | contrib/infback9/infback9.c | 80 | ||||
-rw-r--r-- | contrib/infback9/inftree9.c | 4 |
2 files changed, 42 insertions, 42 deletions
diff --git a/contrib/infback9/infback9.c b/contrib/infback9/infback9.c index f5ddde6..c5547ae 100644 --- a/contrib/infback9/infback9.c +++ b/contrib/infback9/infback9.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* infback9.c -- inflate deflate64 data using a call-back interface | 1 | /* infback9.c -- inflate deflate64 data using a call-back interface |
2 | * Copyright (C) 1995-2003 Mark Adler | 2 | * Copyright (C) 1995-2006 Mark Adler |
3 | * For conditions of distribution and use, see copyright notice in zlib.h | 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -242,7 +242,7 @@ void FAR *out_desc; | |||
242 | code const FAR *distcode; /* starting table for distance codes */ | 242 | code const FAR *distcode; /* starting table for distance codes */ |
243 | unsigned lenbits; /* index bits for lencode */ | 243 | unsigned lenbits; /* index bits for lencode */ |
244 | unsigned distbits; /* index bits for distcode */ | 244 | unsigned distbits; /* index bits for distcode */ |
245 | code this; /* current decoding table entry */ | 245 | code here; /* current decoding table entry */ |
246 | code last; /* parent table entry */ | 246 | code last; /* parent table entry */ |
247 | unsigned len; /* length to copy for repeats, bits to drop */ | 247 | unsigned len; /* length to copy for repeats, bits to drop */ |
248 | int ret; /* return code */ | 248 | int ret; /* return code */ |
@@ -384,19 +384,19 @@ void FAR *out_desc; | |||
384 | state->have = 0; | 384 | state->have = 0; |
385 | while (state->have < state->nlen + state->ndist) { | 385 | while (state->have < state->nlen + state->ndist) { |
386 | for (;;) { | 386 | for (;;) { |
387 | this = lencode[BITS(lenbits)]; | 387 | here = lencode[BITS(lenbits)]; |
388 | if ((unsigned)(this.bits) <= bits) break; | 388 | if ((unsigned)(here.bits) <= bits) break; |
389 | PULLBYTE(); | 389 | PULLBYTE(); |
390 | } | 390 | } |
391 | if (this.val < 16) { | 391 | if (here.val < 16) { |
392 | NEEDBITS(this.bits); | 392 | NEEDBITS(here.bits); |
393 | DROPBITS(this.bits); | 393 | DROPBITS(here.bits); |
394 | state->lens[state->have++] = this.val; | 394 | state->lens[state->have++] = here.val; |
395 | } | 395 | } |
396 | else { | 396 | else { |
397 | if (this.val == 16) { | 397 | if (here.val == 16) { |
398 | NEEDBITS(this.bits + 2); | 398 | NEEDBITS(here.bits + 2); |
399 | DROPBITS(this.bits); | 399 | DROPBITS(here.bits); |
400 | if (state->have == 0) { | 400 | if (state->have == 0) { |
401 | strm->msg = (char *)"invalid bit length repeat"; | 401 | strm->msg = (char *)"invalid bit length repeat"; |
402 | mode = BAD; | 402 | mode = BAD; |
@@ -406,16 +406,16 @@ void FAR *out_desc; | |||
406 | copy = 3 + BITS(2); | 406 | copy = 3 + BITS(2); |
407 | DROPBITS(2); | 407 | DROPBITS(2); |
408 | } | 408 | } |
409 | else if (this.val == 17) { | 409 | else if (here.val == 17) { |
410 | NEEDBITS(this.bits + 3); | 410 | NEEDBITS(here.bits + 3); |
411 | DROPBITS(this.bits); | 411 | DROPBITS(here.bits); |
412 | len = 0; | 412 | len = 0; |
413 | copy = 3 + BITS(3); | 413 | copy = 3 + BITS(3); |
414 | DROPBITS(3); | 414 | DROPBITS(3); |
415 | } | 415 | } |
416 | else { | 416 | else { |
417 | NEEDBITS(this.bits + 7); | 417 | NEEDBITS(here.bits + 7); |
418 | DROPBITS(this.bits); | 418 | DROPBITS(here.bits); |
419 | len = 0; | 419 | len = 0; |
420 | copy = 11 + BITS(7); | 420 | copy = 11 + BITS(7); |
421 | DROPBITS(7); | 421 | DROPBITS(7); |
@@ -460,28 +460,28 @@ void FAR *out_desc; | |||
460 | case LEN: | 460 | case LEN: |
461 | /* get a literal, length, or end-of-block code */ | 461 | /* get a literal, length, or end-of-block code */ |
462 | for (;;) { | 462 | for (;;) { |
463 | this = lencode[BITS(lenbits)]; | 463 | here = lencode[BITS(lenbits)]; |
464 | if ((unsigned)(this.bits) <= bits) break; | 464 | if ((unsigned)(here.bits) <= bits) break; |
465 | PULLBYTE(); | 465 | PULLBYTE(); |
466 | } | 466 | } |
467 | if (this.op && (this.op & 0xf0) == 0) { | 467 | if (here.op && (here.op & 0xf0) == 0) { |
468 | last = this; | 468 | last = here; |
469 | for (;;) { | 469 | for (;;) { |
470 | this = lencode[last.val + | 470 | here = lencode[last.val + |
471 | (BITS(last.bits + last.op) >> last.bits)]; | 471 | (BITS(last.bits + last.op) >> last.bits)]; |
472 | if ((unsigned)(last.bits + this.bits) <= bits) break; | 472 | if ((unsigned)(last.bits + here.bits) <= bits) break; |
473 | PULLBYTE(); | 473 | PULLBYTE(); |
474 | } | 474 | } |
475 | DROPBITS(last.bits); | 475 | DROPBITS(last.bits); |
476 | } | 476 | } |
477 | DROPBITS(this.bits); | 477 | DROPBITS(here.bits); |
478 | length = (unsigned)this.val; | 478 | length = (unsigned)here.val; |
479 | 479 | ||
480 | /* process literal */ | 480 | /* process literal */ |
481 | if (this.op == 0) { | 481 | if (here.op == 0) { |
482 | Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? | 482 | Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? |
483 | "inflate: literal '%c'\n" : | 483 | "inflate: literal '%c'\n" : |
484 | "inflate: literal 0x%02x\n", this.val)); | 484 | "inflate: literal 0x%02x\n", here.val)); |
485 | ROOM(); | 485 | ROOM(); |
486 | *put++ = (unsigned char)(length); | 486 | *put++ = (unsigned char)(length); |
487 | left--; | 487 | left--; |
@@ -490,21 +490,21 @@ void FAR *out_desc; | |||
490 | } | 490 | } |
491 | 491 | ||
492 | /* process end of block */ | 492 | /* process end of block */ |
493 | if (this.op & 32) { | 493 | if (here.op & 32) { |
494 | Tracevv((stderr, "inflate: end of block\n")); | 494 | Tracevv((stderr, "inflate: end of block\n")); |
495 | mode = TYPE; | 495 | mode = TYPE; |
496 | break; | 496 | break; |
497 | } | 497 | } |
498 | 498 | ||
499 | /* invalid code */ | 499 | /* invalid code */ |
500 | if (this.op & 64) { | 500 | if (here.op & 64) { |
501 | strm->msg = (char *)"invalid literal/length code"; | 501 | strm->msg = (char *)"invalid literal/length code"; |
502 | mode = BAD; | 502 | mode = BAD; |
503 | break; | 503 | break; |
504 | } | 504 | } |
505 | 505 | ||
506 | /* length code -- get extra bits, if any */ | 506 | /* length code -- get extra bits, if any */ |
507 | extra = (unsigned)(this.op) & 31; | 507 | extra = (unsigned)(here.op) & 31; |
508 | if (extra != 0) { | 508 | if (extra != 0) { |
509 | NEEDBITS(extra); | 509 | NEEDBITS(extra); |
510 | length += BITS(extra); | 510 | length += BITS(extra); |
@@ -514,30 +514,30 @@ void FAR *out_desc; | |||
514 | 514 | ||
515 | /* get distance code */ | 515 | /* get distance code */ |
516 | for (;;) { | 516 | for (;;) { |
517 | this = distcode[BITS(distbits)]; | 517 | here = distcode[BITS(distbits)]; |
518 | if ((unsigned)(this.bits) <= bits) break; | 518 | if ((unsigned)(here.bits) <= bits) break; |
519 | PULLBYTE(); | 519 | PULLBYTE(); |
520 | } | 520 | } |
521 | if ((this.op & 0xf0) == 0) { | 521 | if ((here.op & 0xf0) == 0) { |
522 | last = this; | 522 | last = here; |
523 | for (;;) { | 523 | for (;;) { |
524 | this = distcode[last.val + | 524 | here = distcode[last.val + |
525 | (BITS(last.bits + last.op) >> last.bits)]; | 525 | (BITS(last.bits + last.op) >> last.bits)]; |
526 | if ((unsigned)(last.bits + this.bits) <= bits) break; | 526 | if ((unsigned)(last.bits + here.bits) <= bits) break; |
527 | PULLBYTE(); | 527 | PULLBYTE(); |
528 | } | 528 | } |
529 | DROPBITS(last.bits); | 529 | DROPBITS(last.bits); |
530 | } | 530 | } |
531 | DROPBITS(this.bits); | 531 | DROPBITS(here.bits); |
532 | if (this.op & 64) { | 532 | if (here.op & 64) { |
533 | strm->msg = (char *)"invalid distance code"; | 533 | strm->msg = (char *)"invalid distance code"; |
534 | mode = BAD; | 534 | mode = BAD; |
535 | break; | 535 | break; |
536 | } | 536 | } |
537 | offset = (unsigned)this.val; | 537 | offset = (unsigned)here.val; |
538 | 538 | ||
539 | /* get distance extra bits, if any */ | 539 | /* get distance extra bits, if any */ |
540 | extra = (unsigned)(this.op) & 15; | 540 | extra = (unsigned)(here.op) & 15; |
541 | if (extra != 0) { | 541 | if (extra != 0) { |
542 | NEEDBITS(extra); | 542 | NEEDBITS(extra); |
543 | offset += BITS(extra); | 543 | offset += BITS(extra); |
diff --git a/contrib/infback9/inftree9.c b/contrib/infback9/inftree9.c index dede93b..c24302b 100644 --- a/contrib/infback9/inftree9.c +++ b/contrib/infback9/inftree9.c | |||
@@ -9,7 +9,7 @@ | |||
9 | #define MAXBITS 15 | 9 | #define MAXBITS 15 |
10 | 10 | ||
11 | const char inflate9_copyright[] = | 11 | const char inflate9_copyright[] = |
12 | " inflate9 1.2.3.2 Copyright 1995-2006 Mark Adler "; | 12 | " inflate9 1.2.3.3 Copyright 1995-2006 Mark Adler "; |
13 | /* | 13 | /* |
14 | If you use the zlib library in a product, an acknowledgment is welcome | 14 | If you use the zlib library in a product, an acknowledgment is welcome |
15 | in the documentation of your product. If for some reason you cannot | 15 | in the documentation of your product. If for some reason you cannot |
@@ -64,7 +64,7 @@ unsigned short FAR *work; | |||
64 | static const unsigned short lext[31] = { /* Length codes 257..285 extra */ | 64 | static const unsigned short lext[31] = { /* Length codes 257..285 extra */ |
65 | 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, | 65 | 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, |
66 | 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, | 66 | 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, |
67 | 133, 133, 133, 133, 144, 192, 204}; | 67 | 133, 133, 133, 133, 144, 201, 203}; |
68 | static const unsigned short dbase[32] = { /* Distance codes 0..31 base */ | 68 | static const unsigned short dbase[32] = { /* Distance codes 0..31 base */ |
69 | 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, | 69 | 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, |
70 | 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, | 70 | 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, |