X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/25056d8b470d9e4b71c9205faf617e4b3f80df33..b8208bda888214f0e0981683c266883adc10e3cb:/zlib/inflate.c?ds=sidebyside diff --git a/zlib/inflate.c b/zlib/inflate.c index 870f89bb..df2f9d66 100644 --- a/zlib/inflate.c +++ b/zlib/inflate.c @@ -80,6 +80,15 @@ * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. */ +//----------------------------------------------------------------------------- +// This version of zlib is modified for use within the Proxmark3 project. +// Files from the original distribution which are not required for this +// purpose are not included. All modifications can easily be found +// by searching for #ifdef ZLIB_PM3_TUNED and #ifndef ZLIB_PM3_TUNED. +//----------------------------------------------------------------------------- + + + #include "zutil.h" #include "inftrees.h" #include "inflate.h" @@ -92,7 +101,11 @@ #endif /* function prototypes */ +#ifdef ZLIB_PM3_TUNED +extern void Dbprintf(const char *fmt, ...); +#else local void fixedtables OF((struct inflate_state FAR *state)); +#endif local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, unsigned copy)); #ifdef BUILDFIXED @@ -258,6 +271,7 @@ int value; used for threaded applications, since the rewriting of the tables and virgin may not be thread-safe. */ +#ifndef ZLIB_PM3_TUNED local void fixedtables(state) struct inflate_state FAR *state; { @@ -361,7 +375,7 @@ void makefixed() puts("\n };"); } #endif /* MAKEFIXED */ - +#endif /* ZLIB_PM3_TUNED */ /* Update the window with the last wsize (normally 32K) bytes written before returning. If window does not exist yet, create it. This is only called @@ -841,6 +855,10 @@ int flush; state->mode = STORED; break; case 1: /* fixed block */ +#ifdef ZLIB_PM3_TUNED + strm->msg = (char *)"fixed block coding not supported"; + state->mode = BAD; +#else fixedtables(state); Tracev((stderr, "inflate: fixed codes block%s\n", state->last ? " (last)" : "")); @@ -849,6 +867,7 @@ int flush; DROPBITS(2); goto inf_leave; } +#endif break; case 2: /* dynamic block */ Tracev((stderr, "inflate: dynamic codes block%s\n", @@ -1504,7 +1523,7 @@ z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; + if (strm == Z_NULL || strm->state == Z_NULL) return ~0UL << 16; state = (struct inflate_state FAR *)strm->state; return ((long)(state->back) << 16) + (state->mode == COPY ? state->length :