Changeset b4983fe4 in rtems


Ignore:
Timestamp:
Sep 1, 2008, 9:26:47 PM (11 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.9, master
Children:
9fe6e06
Parents:
1162b7a
Message:

Upgrade to zlib-1.2.3.

Location:
cpukit/zlib
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • cpukit/zlib/ChangeLog.zlib

    r1162b7a rb4983fe4  
    11
    22                ChangeLog file for zlib
     3
     4Changes in 1.2.3 (18 July 2005)
     5- Apply security vulnerability fixes to contrib/infback9 as well
     6- Clean up some text files (carriage returns, trailing space)
     7- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant]
     8
     9Changes in 1.2.2.4 (11 July 2005)
     10- Add inflatePrime() function for starting inflation at bit boundary
     11- Avoid some Visual C warnings in deflate.c
     12- Avoid more silly Visual C warnings in inflate.c and inftrees.c for 64-bit
     13  compile
     14- Fix some spelling errors in comments [Betts]
     15- Correct inflateInit2() error return documentation in zlib.h
     16- Added zran.c example of compressed data random access to examples
     17  directory, shows use of inflatePrime()
     18- Fix cast for assignments to strm->state in inflate.c and infback.c
     19- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer]
     20- Move declarations of gf2 functions to right place in crc32.c [Oberhumer]
     21- Add cast in trees.c t avoid a warning [Oberhumer]
     22- Avoid some warnings in fitblk.c, gun.c, gzjoin.c in examples [Oberhumer]
     23- Update make_vms.com [Zinser]
     24- Initialize state->write in inflateReset() since copied in inflate_fast()
     25- Be more strict on incomplete code sets in inflate_table() and increase
     26  ENOUGH and MAXD -- this repairs a possible security vulnerability for
     27  invalid inflate input.  Thanks to Tavis Ormandy and Markus Oberhumer for
     28  discovering the vulnerability and providing test cases.
     29- Add ia64 support to configure for HP-UX [Smith]
     30- Add error return to gzread() for format or i/o error [Levin]
     31- Use malloc.h for OS/2 [Necasek]
     32
     33Changes in 1.2.2.3 (27 May 2005)
     34- Replace 1U constants in inflate.c and inftrees.c for 64-bit compile
     35- Typecast fread() return values in gzio.c [Vollant]
     36- Remove trailing space in minigzip.c outmode (VC++ can't deal with it)
     37- Fix crc check bug in gzread() after gzungetc() [Heiner]
     38- Add the deflateTune() function to adjust internal compression parameters
     39- Add a fast gzip decompressor, gun.c, to examples (use of inflateBack)
     40- Remove an incorrect assertion in examples/zpipe.c
     41- Add C++ wrapper in infback9.h [Donais]
     42- Fix bug in inflateCopy() when decoding fixed codes
     43- Note in zlib.h how much deflateSetDictionary() actually uses
     44- Remove USE_DICT_HEAD in deflate.c (would mess up inflate if used)
     45- Add _WIN32_WCE to define WIN32 in zconf.in.h [Spencer]
     46- Don't include stderr.h or errno.h for _WIN32_WCE in zutil.h [Spencer]
     47- Add gzdirect() function to indicate transparent reads
     48- Update contrib/minizip [Vollant]
     49- Fix compilation of deflate.c when both ASMV and FASTEST [Oberhumer]
     50- Add casts in crc32.c to avoid warnings [Oberhumer]
     51- Add contrib/masmx64 [Vollant]
     52- Update contrib/asm586, asm686, masmx86, testzlib, vstudio [Vollant]
    353
    454Changes in 1.2.2.2 (30 December 2004)
     
    491541- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
    492542  gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
    493 - Fix a deflate bug occuring only with compression level 0 (thanks to
     543- Fix a deflate bug occurring only with compression level 0 (thanks to
    494544  Andy Buckler for finding this one).
    495545- In minigzip, pass transparently also the first byte for .Z files.
  • cpukit/zlib/README

    r1162b7a rb4983fe4  
    11ZLIB DATA COMPRESSION LIBRARY
    22
    3 zlib 1.2.2.2 is a general purpose data compression library.  All the code is
     3zlib 1.2.3 is a general purpose data compression library.  All the code is
    44thread safe.  The data format used by the zlib library is described by RFCs
    55(Request for Comments) 1950 to 1952 in the files
     
    3434http://dogma.net/markn/articles/zlibtool/zlibtool.htm
    3535
    36 The changes made in version 1.2.2.2 are documented in the file ChangeLog.
     36The changes made in version 1.2.3 are documented in the file ChangeLog.
    3737
    3838Unsupported third party contributions are provided in directory "contrib".
  • cpukit/zlib/adler32.c

    r1162b7a rb4983fe4  
    44 */
    55
    6 /* $Id$ */
     6/* @(#) $Id$ */
    77
    88#define ZLIB_INTERNAL
  • cpukit/zlib/compress.c

    r1162b7a rb4983fe4  
    44 */
    55
    6 /* $Id$ */
     6/* @(#) $Id$ */
    77
    88#define ZLIB_INTERNAL
  • cpukit/zlib/crc32.c

    r1162b7a rb4983fe4  
    11/* crc32.c -- compute the CRC-32 of a data stream
    2  * Copyright (C) 1995-2004 Mark Adler
     2 * Copyright (C) 1995-2005 Mark Adler
    33 * For conditions of distribution and use, see copyright notice in zlib.h
    44 *
     
    1010 */
    1111
    12 /* $Id$ */
     12/* @(#) $Id$ */
    1313
    1414/*
     
    6565#endif /* BYFOUR */
    6666
     67/* Local functions for crc concatenation */
     68local unsigned long gf2_matrix_times OF((unsigned long *mat,
     69                                         unsigned long vec));
     70local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
     71
    6772#ifdef DYNAMIC_CRC_TABLE
    6873
     
    7378   local void write_table OF((FILE *, const unsigned long FAR *));
    7479#endif /* MAKECRCH */
    75 local unsigned long gf2_matrix_times OF((unsigned long *mat,
    76                                          unsigned long vec));
    77 local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
    78 
    7980/*
    8081  Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
     
    202203 * This function can be used by asm versions of crc32()
    203204 */
    204 const uLongf * ZEXPORT get_crc_table()
     205const unsigned long FAR * ZEXPORT get_crc_table()
    205206{
    206207#ifdef DYNAMIC_CRC_TABLE
     
    208209        make_crc_table();
    209210#endif /* DYNAMIC_CRC_TABLE */
    210     return (const uLongf *)crc_table;
     211    return (const unsigned long FAR *)crc_table;
    211212}
    212213
     
    216217
    217218/* ========================================================================= */
    218 uLong ZEXPORT crc32(crc, buf, len)
    219     uLong crc;
    220     const Bytef *buf;
    221     uInt len;
     219unsigned long ZEXPORT crc32(crc, buf, len)
     220    unsigned long crc;
     221    const unsigned char FAR *buf;
     222    unsigned len;
    222223{
    223224    if (buf == Z_NULL) return 0UL;
     
    274275    }
    275276
    276     buf4 = (const u4 FAR *)buf;
     277    buf4 = (const u4 FAR *)(const void FAR *)buf;
    277278    while (len >= 32) {
    278279        DOLIT32;
     
    314315    }
    315316
    316     buf4 = (const u4 FAR *)buf;
     317    buf4 = (const u4 FAR *)(const void FAR *)buf;
    317318    buf4--;
    318319    while (len >= 32) {
     
    339340
    340341/* ========================================================================= */
    341 local unsigned long gf2_matrix_times(
    342     unsigned long *mat,
    343     unsigned long vec )
     342local unsigned long gf2_matrix_times(mat, vec)
     343    unsigned long *mat;
     344    unsigned long vec;
    344345{
    345346    unsigned long sum;
     
    356357
    357358/* ========================================================================= */
    358 local void gf2_matrix_square(
    359     unsigned long *square,
    360     unsigned long *mat)
     359local void gf2_matrix_square(square, mat)
     360    unsigned long *square;
     361    unsigned long *mat;
    361362{
    362363    int n;
     
    367368
    368369/* ========================================================================= */
    369 uLong ZEXPORT crc32_combine(
    370     uLong crc1,
    371     uLong crc2,
    372     z_off_t len2)
     370uLong ZEXPORT crc32_combine(crc1, crc2, len2)
     371    uLong crc1;
     372    uLong crc2;
     373    z_off_t len2;
    373374{
    374375    int n;
  • cpukit/zlib/deflate.c

    r1162b7a rb4983fe4  
    11/* deflate.c -- compress data using the deflation algorithm
    2  * Copyright (C) 1995-2004 Jean-loup Gailly.
     2 * Copyright (C) 1995-2005 Jean-loup Gailly.
    33 * For conditions of distribution and use, see copyright notice in zlib.h
    44 */
     
    4848 */
    4949
    50 /* $Id$ */
     50/* @(#) $Id$ */
    5151
    5252#include "deflate.h"
    5353
    5454const char deflate_copyright[] =
    55    " deflate 1.2.2.2 Copyright 1995-2004 Jean-loup Gailly ";
     55   " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly ";
    5656/*
    5757  If you use the zlib library in a product, an acknowledgment is welcome
     
    335335    if (length > MAX_DIST(s)) {
    336336        length = MAX_DIST(s);
    337 #ifndef USE_DICT_HEAD
    338337        dictionary += dictLength - length; /* use the tail of the dictionary */
    339 #endif
    340338    }
    341339    zmemcpy(s->window, dictionary, length);
     
    451449    s->strategy = strategy;
    452450    return err;
     451}
     452
     453/* ========================================================================= */
     454int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
     455    z_streamp strm;
     456    int good_length;
     457    int max_lazy;
     458    int nice_length;
     459    int max_chain;
     460{
     461    deflate_state *s;
     462
     463    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
     464    s = strm->state;
     465    s->good_match = good_length;
     466    s->max_lazy_match = max_lazy;
     467    s->nice_match = nice_length;
     468    s->max_chain_length = max_chain;
     469    return Z_OK;
    453470}
    454471
     
    584601                            (s->gzhead->comment == Z_NULL ? 0 : 16)
    585602                        );
    586                 put_byte(s, s->gzhead->time & 0xff);
    587                 put_byte(s, (s->gzhead->time >> 8) & 0xff);
    588                 put_byte(s, (s->gzhead->time >> 16) & 0xff);
    589                 put_byte(s, (s->gzhead->time >> 24) & 0xff);
     603                put_byte(s, (Byte)(s->gzhead->time & 0xff));
     604                put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
     605                put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
     606                put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
    590607                put_byte(s, s->level == 9 ? 2 :
    591608                            (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
     
    635652    if (s->status == EXTRA_STATE) {
    636653        if (s->gzhead->extra != NULL) {
    637             int beg = s->pending;   /* start of bytes to update crc */
     654            uInt beg = s->pending;  /* start of bytes to update crc */
    638655
    639656            while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
     
    663680    if (s->status == NAME_STATE) {
    664681        if (s->gzhead->name != NULL) {
    665             int beg = s->pending;   /* start of bytes to update crc */
     682            uInt beg = s->pending;  /* start of bytes to update crc */
    666683            int val;
    667684
     
    694711    if (s->status == COMMENT_STATE) {
    695712        if (s->gzhead->comment != NULL) {
    696             int beg = s->pending;   /* start of bytes to update crc */
     713            uInt beg = s->pending;  /* start of bytes to update crc */
    697714            int val;
    698715
     
    726743                flush_pending(strm);
    727744            if (s->pending + 2 <= s->pending_buf_size) {
    728                 put_byte(s, strm->adler & 0xff);
    729                 put_byte(s, (strm->adler >> 8) & 0xff);
     745                put_byte(s, (Byte)(strm->adler & 0xff));
     746                put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
    730747                strm->adler = crc32(0L, Z_NULL, 0);
    731748                s->status = BUSY_STATE;
     
    9871004    s->match_available = 0;
    9881005    s->ins_h = 0;
     1006#ifndef FASTEST
    9891007#ifdef ASMV
    9901008    match_init(); /* initialize the asm code */
     1009#endif
    9911010#endif
    9921011}
     
    12851304               zlib, so we don't care about this pathological case.)
    12861305             */
     1306            /* %%% avoid this when Z_RLE */
    12871307            n = s->hash_size;
    12881308            p = &s->head[n];
     
    16541674}
    16551675#endif /* FASTEST */
     1676
     1677#if 0
     1678/* ===========================================================================
     1679 * For Z_RLE, simply look for runs of bytes, generate matches only of distance
     1680 * one.  Do not maintain a hash table.  (It will be regenerated if this run of
     1681 * deflate switches away from Z_RLE.)
     1682 */
     1683local block_state deflate_rle(s, flush)
     1684    deflate_state *s;
     1685    int flush;
     1686{
     1687    int bflush;         /* set if current block must be flushed */
     1688    uInt run;           /* length of run */
     1689    uInt max;           /* maximum length of run */
     1690    uInt prev;          /* byte at distance one to match */
     1691    Bytef *scan;        /* scan for end of run */
     1692
     1693    for (;;) {
     1694        /* Make sure that we always have enough lookahead, except
     1695         * at the end of the input file. We need MAX_MATCH bytes
     1696         * for the longest encodable run.
     1697         */
     1698        if (s->lookahead < MAX_MATCH) {
     1699            fill_window(s);
     1700            if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) {
     1701                return need_more;
     1702            }
     1703            if (s->lookahead == 0) break; /* flush the current block */
     1704        }
     1705
     1706        /* See how many times the previous byte repeats */
     1707        run = 0;
     1708        if (s->strstart > 0) {      /* if there is a previous byte, that is */
     1709            max = s->lookahead < MAX_MATCH ? s->lookahead : MAX_MATCH;
     1710            scan = s->window + s->strstart - 1;
     1711            prev = *scan++;
     1712            do {
     1713                if (*scan++ != prev)
     1714                    break;
     1715            } while (++run < max);
     1716        }
     1717
     1718        /* Emit match if have run of MIN_MATCH or longer, else emit literal */
     1719        if (run >= MIN_MATCH) {
     1720            check_match(s, s->strstart, s->strstart - 1, run);
     1721            _tr_tally_dist(s, 1, run - MIN_MATCH, bflush);
     1722            s->lookahead -= run;
     1723            s->strstart += run;
     1724        } else {
     1725            /* No match, output a literal byte */
     1726            Tracevv((stderr,"%c", s->window[s->strstart]));
     1727            _tr_tally_lit (s, s->window[s->strstart], bflush);
     1728            s->lookahead--;
     1729            s->strstart++;
     1730        }
     1731        if (bflush) FLUSH_BLOCK(s, 0);
     1732    }
     1733    FLUSH_BLOCK(s, flush == Z_FINISH);
     1734    return flush == Z_FINISH ? finish_done : block_done;
     1735}
     1736#endif
  • cpukit/zlib/deflate.h

    r1162b7a rb4983fe4  
    99 */
    1010
    11 /* $Id$ */
     11/* @(#) $Id$ */
    1212
    1313#ifndef DEFLATE_H
     
    9898    ulg   pending_buf_size; /* size of pending_buf */
    9999    Bytef *pending_out;  /* next pending byte to output to the stream */
    100     int   pending;       /* nb of bytes in the pending buffer */
     100    uInt   pending;      /* nb of bytes in the pending buffer */
    101101    int   wrap;          /* bit 0 true for zlib, bit 1 true for gzip */
    102102    gz_headerp  gzhead;  /* gzip header information to write */
    103     int   gzindex;       /* where in extra, name, or comment */
     103    uInt   gzindex;      /* where in extra, name, or comment */
    104104    Byte  method;        /* STORED (for zip only) or DEFLATED */
    105105    int   last_flush;    /* value of flush param for previous deflate call */
  • cpukit/zlib/gzio.c

    r1162b7a rb4983fe4  
    11/* gzio.c -- IO on .gz files
    2  * Copyright (C) 1995-2004 Jean-loup Gailly.
     2 * Copyright (C) 1995-2005 Jean-loup Gailly.
    33 * For conditions of distribution and use, see copyright notice in zlib.h
    44 *
     
    66 */
    77
    8 /* $Id$ */
     8/* @(#) $Id$ */
    99
    1010#include <stdio.h>
     
    265265    if (s->stream.avail_in == 0) {
    266266        errno = 0;
    267         s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
     267        s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
    268268        if (s->stream.avail_in == 0) {
    269269            s->z_eof = 1;
     
    301301        if (len) s->inbuf[0] = s->stream.next_in[0];
    302302        errno = 0;
    303         len = fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);
     303        len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);
    304304        if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO;
    305305        s->stream.avail_in += len;
     
    416416        s->back = EOF;
    417417        s->out++;
     418        start++;
    418419        if (s->last) {
    419420            s->z_err = Z_STREAM_END;
     
    437438            }
    438439            if (s->stream.avail_out > 0) {
    439                 s->stream.avail_out -= fread(next_out, 1, s->stream.avail_out,
    440                                             s->file);
     440                s->stream.avail_out -=
     441                    (uInt)fread(next_out, 1, s->stream.avail_out, s->file);
    441442            }
    442443            len -= s->stream.avail_out;
     
    449450
    450451            errno = 0;
    451             s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
     452            s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
    452453            if (s->stream.avail_in == 0) {
    453454                s->z_eof = 1;
    454455                if (ferror(s->file)) {
    455456                    s->z_err = Z_ERRNO;
    456                     break;
    457                 }
    458                 if (feof(s->file)) {        /* avoid error for empty file */
    459                     s->z_err = Z_STREAM_END;
    460457                    break;
    461458                }
     
    493490    s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
    494491
     492    if (len == s->stream.avail_out &&
     493        (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO))
     494        return -1;
    495495    return (int)(len - s->stream.avail_out);
    496496}
     
    904904
    905905/* ===========================================================================
     906     Returns 1 if reading and doing so transparently, otherwise zero.
     907*/
     908int ZEXPORT gzdirect (file)
     909    gzFile file;
     910{
     911    gz_stream *s = (gz_stream*)file;
     912
     913    if (s == NULL || s->mode != 'r') return 0;
     914    return s->transparent;
     915}
     916
     917/* ===========================================================================
    906918   Outputs a long in LSB order to the given file
    907919*/
     
    967979
    968980/* ===========================================================================
    969      Returns the error message for the last error which occured on the
     981     Returns the error message for the last error which occurred on the
    970982   given compressed file. errnum is set to zlib error number. If an
    971    error occured in the file system and not in the compression library,
     983   error occurred in the file system and not in the compression library,
    972984   errnum is set to Z_ERRNO and the application may consult errno
    973985   to get the exact error code.
  • cpukit/zlib/infback.c

    r1162b7a rb4983fe4  
    11/* infback.c -- inflate using a call-back interface
    2  * Copyright (C) 1995-2004 Mark Adler
     2 * Copyright (C) 1995-2005 Mark Adler
    33 * For conditions of distribution and use, see copyright notice in zlib.h
    44 */
     
    5151    if (state == Z_NULL) return Z_MEM_ERROR;
    5252    Tracev((stderr, "inflate: allocated\n"));
    53     strm->state = (voidpf)state;
     53    strm->state = (struct internal_state FAR *)state;
    5454    state->dmax = 32768U;
    5555    state->wbits = windowBits;
  • cpukit/zlib/inflate.c

    r1162b7a rb4983fe4  
    11/* inflate.c -- zlib decompression
    2  * Copyright (C) 1995-2004 Mark Adler
     2 * Copyright (C) 1995-2005 Mark Adler
    33 * For conditions of distribution and use, see copyright notice in zlib.h
    44 */
     
    118118    state->wsize = 0;
    119119    state->whave = 0;
     120    state->write = 0;
    120121    state->hold = 0;
    121122    state->bits = 0;
    122123    state->lencode = state->distcode = state->next = state->codes;
    123124    Tracev((stderr, "inflate: reset\n"));
     125    return Z_OK;
     126}
     127
     128int ZEXPORT inflatePrime(strm, bits, value)
     129z_streamp strm;
     130int bits;
     131int value;
     132{
     133    struct inflate_state FAR *state;
     134
     135    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
     136    state = (struct inflate_state FAR *)strm->state;
     137    if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
     138    value &= (1L << bits) - 1;
     139    state->hold += value << state->bits;
     140    state->bits += bits;
    124141    return Z_OK;
    125142}
     
    147164    if (state == Z_NULL) return Z_MEM_ERROR;
    148165    Tracev((stderr, "inflate: allocated\n"));
    149     strm->state = (voidpf)state;
     166    strm->state = (struct internal_state FAR *)state;
    150167    if (windowBits < 0) {
    151168        state->wrap = 0;
     
    13111328    struct inflate_state FAR *copy;
    13121329    unsigned char FAR *window;
     1330    unsigned wsize;
    13131331
    13141332    /* check input */
     
    13351353    zmemcpy(dest, source, sizeof(z_stream));
    13361354    zmemcpy(copy, state, sizeof(struct inflate_state));
    1337     copy->lencode = copy->codes + (state->lencode - state->codes);
    1338     copy->distcode = copy->codes + (state->distcode - state->codes);
     1355    if (state->lencode >= state->codes &&
     1356        state->lencode <= state->codes + ENOUGH - 1) {
     1357        copy->lencode = copy->codes + (state->lencode - state->codes);
     1358        copy->distcode = copy->codes + (state->distcode - state->codes);
     1359    }
    13391360    copy->next = copy->codes + (state->next - state->codes);
    1340     if (window != Z_NULL)
    1341         zmemcpy(window, state->window, 1U << state->wbits);
     1361    if (window != Z_NULL) {
     1362        wsize = 1U << state->wbits;
     1363        zmemcpy(window, state->window, wsize);
     1364    }
    13421365    copy->window = window;
    1343     dest->state = (voidpf)copy;
     1366    dest->state = (struct internal_state FAR *)copy;
    13441367    return Z_OK;
    13451368}
  • cpukit/zlib/inftrees.c

    r1162b7a rb4983fe4  
    11/* inftrees.c -- generate Huffman trees for efficient decoding
    2  * Copyright (C) 1995-2004 Mark Adler
     2 * Copyright (C) 1995-2005 Mark Adler
    33 * For conditions of distribution and use, see copyright notice in zlib.h
    44 */
     
    1010
    1111const char inflate_copyright[] =
    12    " inflate 1.2.2.2 Copyright 1995-2004 Mark Adler ";
     12   " inflate 1.2.3 Copyright 1995-2005 Mark Adler ";
    1313/*
    1414  If you use the zlib library in a product, an acknowledgment is welcome
     
    6363    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
    6464        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
    65         19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 199};
     65        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196};
    6666    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
    6767        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
     
    233233        incr = 1U << (len - drop);
    234234        fill = 1U << curr;
     235        min = fill;                 /* save offset to next table */
    235236        do {
    236237            fill -= incr;
     
    263264
    264265            /* increment past last table */
    265             next += 1U << curr;
     266            next += min;            /* here min is 1 << curr */
    266267
    267268            /* determine length of next table */
  • cpukit/zlib/inftrees.h

    r1162b7a rb4983fe4  
    11/* inftrees.h -- header to use inftrees.c
    2  * Copyright (C) 1995-2003 Mark Adler
     2 * Copyright (C) 1995-2005 Mark Adler
    33 * For conditions of distribution and use, see copyright notice in zlib.h
    44 */
  • cpukit/zlib/trees.c

    r1162b7a rb4983fe4  
    11/* trees.c -- output deflated data using Huffman coding
    2  * Copyright (C) 1995-2004 Jean-loup Gailly
     2 * Copyright (C) 1995-2005 Jean-loup Gailly
    33 * For conditions of distribution and use, see copyright notice in zlib.h
    44 */
     
    3030 */
    3131
    32 /* $Id$ */
     32/* @(#) $Id$ */
    3333
    3434/* #define GEN_TREES_H */
     
    556556            m = s->heap[--h];
    557557            if (m > max_code) continue;
    558             if (tree[m].Len != (unsigned) bits) {
     558            if ((unsigned) tree[m].Len != (unsigned) bits) {
    559559                Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
    560560                s->opt_len += ((long)bits - (long)tree[m].Len)
  • cpukit/zlib/uncompr.c

    r1162b7a rb4983fe4  
    44 */
    55
    6 /* $Id$ */
     6/* @(#) $Id$ */
    77
    88#define ZLIB_INTERNAL
  • cpukit/zlib/zconf.h

    r1162b7a rb4983fe4  
    11/* zconf.h -- configuration of the zlib compression library
    2  * Copyright (C) 1995-2004 Jean-loup Gailly.
     2 * Copyright (C) 1995-2005 Jean-loup Gailly.
    33 * For conditions of distribution and use, see copyright notice in zlib.h
    44 */
    55
    6 /* $Id$ */
     6/* @(#) $Id$ */
    77
    88#ifndef ZCONF_H
     
    7171#  define WINDOWS
    7272#endif
    73 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
    74 #  define WIN32
     73#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
     74#  ifndef WIN32
     75#    define WIN32
     76#  endif
    7577#endif
    7678#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
  • cpukit/zlib/zlib.3

    r1162b7a rb4983fe4  
    1 .TH ZLIB 3 "30 December 2004"
     1.TH ZLIB 3 "18 July 2005"
    22.SH NAME
    33zlib \- compression/decompression library
     
    134134or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
    135135.SH AUTHORS
    136 Version 1.2.2.2
    137 Copyright (C) 1995-2004 Jean-loup Gailly (jloup@gzip.org)
     136Version 1.2.3
     137Copyright (C) 1995-2005 Jean-loup Gailly (jloup@gzip.org)
    138138and Mark Adler (madler@alumni.caltech.edu).
    139139.LP
  • cpukit/zlib/zlib.h

    r1162b7a rb4983fe4  
    11/* zlib.h -- interface of the 'zlib' general purpose compression library
    2   version 1.2.2.2, December 30th, 2004
    3 
    4   Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler
     2  version 1.2.3, July 18th, 2005
     3
     4  Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
    55
    66  This software is provided 'as-is', without any express or implied
     
    3838#endif
    3939
    40 #define ZLIB_VERSION "1.2.2.2"
    41 #define ZLIB_VERNUM 0x1222
     40#define ZLIB_VERSION "1.2.3"
     41#define ZLIB_VERNUM 0x1230
    4242
    4343/*
     
    557557   discarded, for example if the dictionary is larger than the window size in
    558558   deflate or deflate2. Thus the strings most likely to be useful should be
    559    put at the end of the dictionary, not at the front.
     559   put at the end of the dictionary, not at the front. In addition, the
     560   current implementation of deflate will use at most the window size minus
     561   262 bytes of the provided dictionary.
    560562
    561563     Upon return of this function, strm->adler is set to the adler32 value
     
    622624   if strm->avail_out was zero.
    623625*/
     626
     627ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
     628                                    int good_length,
     629                                    int max_lazy,
     630                                    int nice_length,
     631                                    int max_chain));
     632/*
     633     Fine tune deflate's internal compression parameters.  This should only be
     634   used by someone who understands the algorithm used by zlib's deflate for
     635   searching for the best matching string, and even then only by the most
     636   fanatic optimizer trying to squeeze out the last compressed bit for their
     637   specific input data.  Read the deflate.c source code for the meaning of the
     638   max_lazy, good_length, nice_length, and max_chain parameters.
     639
     640     deflateTune() can be called after deflateInit() or deflateInit2(), and
     641   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
     642 */
    624643
    625644ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
     
    704723   32 to windowBits to enable zlib and gzip decoding with automatic header
    705724   detection, or add 16 to decode only the gzip format (the zlib format will
    706    return a Z_DATA_ERROR.  If a gzip stream is being decoded, strm->adler is
     725   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is
    707726   a crc32 instead of an adler32.
    708727
    709728     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
    710    memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
    711    memLevel). msg is set to null if there is no error message.  inflateInit2
    712    does not perform any decompression apart from reading the zlib header if
    713    present: this will be done by inflate(). (So next_in and avail_in may be
    714    modified, but next_out and avail_out are unchanged.)
     729   memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
     730   is set to null if there is no error message.  inflateInit2 does not perform
     731   any decompression apart from reading the zlib header if present: this will
     732   be done by inflate(). (So next_in and avail_in may be modified, but next_out
     733   and avail_out are unchanged.)
    715734*/
    716735
     
    776795      inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
    777796   stream state was inconsistent (such as zalloc or state being NULL).
     797*/
     798
     799ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
     800                                     int bits,
     801                                     int value));
     802/*
     803     This function inserts bits in the inflate input stream.  The intent is
     804  that this function is used to start inflating at a bit position in the
     805  middle of a byte.  The provided bits will be used before any bytes are used
     806  from next_in.  This function should only be used with raw inflate, and
     807  should be used before the first inflate() call after inflateInit2() or
     808  inflateReset().  bits must be less than or equal to 16, and that many of the
     809  least significant bits of value will be inserted in the input.
     810
     811      inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
     812   stream state was inconsistent.
    778813*/
    779814
     
    11841219     Returns 1 when EOF has previously been detected reading the given
    11851220   input stream, otherwise zero.
     1221*/
     1222
     1223ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
     1224/*
     1225     Returns 1 if file is being read directly without decompression, otherwise
     1226   zero.
    11861227*/
    11871228
  • cpukit/zlib/zutil.c

    r1162b7a rb4983fe4  
    11/* zutil.c -- target dependent utility functions for the compression library
    2  * Copyright (C) 1995-2004 Jean-loup Gailly.
     2 * Copyright (C) 1995-2005 Jean-loup Gailly.
    33 * For conditions of distribution and use, see copyright notice in zlib.h
    44 */
    55
    6 /* $Id$ */
     6/* @(#) $Id$ */
    77
    88#include "zutil.h"
     
    7575#endif
    7676#ifdef NO_GZCOMPRESS
    77     flags += 1 << 16;
     77    flags += 1L << 16;
    7878#endif
    7979#ifdef NO_GZIP
    80     flags += 1 << 17;
     80    flags += 1L << 17;
    8181#endif
    8282#ifdef PKZIP_BUG_WORKAROUND
    83     flags += 1 << 20;
     83    flags += 1L << 20;
    8484#endif
    8585#ifdef FASTEST
    86     flags += 1 << 21;
     86    flags += 1L << 21;
    8787#endif
    8888#ifdef STDC
    8989#  ifdef NO_vsnprintf
    90         flags += 1 << 25;
     90        flags += 1L << 25;
    9191#    ifdef HAS_vsprintf_void
    92         flags += 1 << 26;
     92        flags += 1L << 26;
    9393#    endif
    9494#  else
    9595#    ifdef HAS_vsnprintf_void
    96         flags += 1 << 26;
     96        flags += 1L << 26;
    9797#    endif
    9898#  endif
    9999#else
    100         flags += 1 << 24;
     100        flags += 1L << 24;
    101101#  ifdef NO_snprintf
    102         flags += 1 << 25;
     102        flags += 1L << 25;
    103103#    ifdef HAS_sprintf_void
    104         flags += 1 << 26;
     104        flags += 1L << 26;
    105105#    endif
    106106#  else
    107107#    ifdef HAS_snprintf_void
    108         flags += 1 << 26;
     108        flags += 1L << 26;
    109109#    endif
    110110#  endif
     
    300300voidpf zcalloc (opaque, items, size)
    301301    voidpf opaque;
    302     uInt items;
    303     uInt size;
     302    unsigned items;
     303    unsigned size;
    304304{
    305305    if (opaque) items += size - size; /* make compiler happy */
  • cpukit/zlib/zutil.h

    r1162b7a rb4983fe4  
    11/* zutil.h -- internal interface and configuration of the compression library
    2  * Copyright (C) 1995-2004 Jean-loup Gailly.
     2 * Copyright (C) 1995-2005 Jean-loup Gailly.
    33 * For conditions of distribution and use, see copyright notice in zlib.h
    44 */
     
    99 */
    1010
    11 /* $Id$ */
     11/* @(#) $Id$ */
    1212
    1313#ifndef ZUTIL_H
     
    1818
    1919#ifdef STDC
    20 #  include <stddef.h>
     20#  ifndef _WIN32_WCE
     21#    include <stddef.h>
     22#  endif
    2123#  include <string.h>
    2224#  include <stdlib.h>
     
    3335    extern int errno;
    3436#else
    35 #   include <errno.h>
     37#  ifndef _WIN32_WCE
     38#    include <errno.h>
     39#  endif
    3640#endif
    3741
     
    114118#ifdef OS2
    115119#  define OS_CODE  0x06
     120#  ifdef M_I86
     121     #include <malloc.h>
     122#  endif
    116123#endif
    117124
     
    252259
    253260
    254 voidpf zcalloc OF((voidpf opaque, uInt items, uInt size));
     261voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
    255262void   zcfree  OF((voidpf opaque, voidpf ptr));
    256263
Note: See TracChangeset for help on using the changeset viewer.