mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
zlib: minimize diffs with upstream to prepare zlib upgrade
This commit is contained in:
parent
f30511f1a2
commit
b6d074cc9f
19 changed files with 122 additions and 128 deletions
|
@ -1,15 +1,6 @@
|
||||||
|
|
||||||
ChangeLog file for zlib
|
ChangeLog file for zlib
|
||||||
|
|
||||||
Changes in 1.2.8.f-Proxmark3 (for Proxmark3 project only) (26 May 2015)
|
|
||||||
- disable decoding of fixed code blocks in deflate (eliminates the need
|
|
||||||
to store the fixed tree in RAM or ROM)
|
|
||||||
- disable generating fixed code blocks in inflate
|
|
||||||
- look harder for local optimum of consecutive matches and single literals
|
|
||||||
in inflate.
|
|
||||||
- stripped down version - unnecessary files from original distribution
|
|
||||||
are not included
|
|
||||||
|
|
||||||
Changes in 1.2.8 (28 Apr 2013)
|
Changes in 1.2.8 (28 Apr 2013)
|
||||||
- Update contrib/minizip/iowin32.c for Windows RT [Vollant]
|
- Update contrib/minizip/iowin32.c for Windows RT [Vollant]
|
||||||
- Do not force Z_CONST for C++
|
- Do not force Z_CONST for C++
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// 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.
|
|
||||||
//
|
|
||||||
// The rest of this file consists of the original README content
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ZLIB DATA COMPRESSION LIBRARY
|
ZLIB DATA COMPRESSION LIBRARY
|
||||||
|
|
||||||
zlib 1.2.8 is a general purpose data compression library. All the code is
|
zlib 1.2.8 is a general purpose data compression library. All the code is
|
||||||
|
|
19
common/zlib/README_proxmark3
Normal file
19
common/zlib/README_proxmark3
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
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.
|
||||||
|
|
||||||
|
Current zlib base version is 1.2.8
|
||||||
|
|
||||||
|
|
||||||
|
ChangeLog for Proxmark3 project only
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
Changes in 1.2.8.f-Proxmark3 (26 May 2015)
|
||||||
|
- disable decoding of fixed code blocks in deflate (eliminates the need
|
||||||
|
to store the fixed tree in RAM or ROM)
|
||||||
|
- disable generating fixed code blocks in inflate
|
||||||
|
- look harder for local optimum of consecutive matches and single literals
|
||||||
|
in inflate.
|
||||||
|
- stripped down version - unnecessary files from original distribution
|
||||||
|
are not included
|
|
@ -177,3 +177,4 @@ z_off64_t len2;
|
||||||
{
|
{
|
||||||
return adler32_combine_(adler1, adler2, len2);
|
return adler32_combine_(adler1, adler2, len2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,11 @@
|
||||||
#include "deflate.h"
|
#include "deflate.h"
|
||||||
|
|
||||||
const char deflate_copyright[] =
|
const char deflate_copyright[] =
|
||||||
|
#ifdef ZLIB_PM3_TUNED
|
||||||
" deflate 1.2.8.f-Proxmark3 Copyright 1995-2013 Jean-loup Gailly and Mark Adler ";
|
" deflate 1.2.8.f-Proxmark3 Copyright 1995-2013 Jean-loup Gailly and Mark Adler ";
|
||||||
|
#else
|
||||||
|
" deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler ";
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
If you use the zlib library in a product, an acknowledgment is welcome
|
If you use the zlib library in a product, an acknowledgment is welcome
|
||||||
in the documentation of your product. If for some reason you cannot
|
in the documentation of your product. If for some reason you cannot
|
||||||
|
@ -60,15 +64,6 @@ const char deflate_copyright[] =
|
||||||
copyright string in the executable of your product.
|
copyright string in the executable of your product.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// 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.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ===========================================================================
|
/* ===========================================================================
|
||||||
* Function prototypes.
|
* Function prototypes.
|
||||||
*/
|
*/
|
||||||
|
@ -1552,13 +1547,13 @@ deflate_state *s;
|
||||||
s->block_start = s->strstart; \
|
s->block_start = s->strstart; \
|
||||||
flush_pending(s->strm); \
|
flush_pending(s->strm); \
|
||||||
Tracev((stderr,"[FLUSH]")); \
|
Tracev((stderr,"[FLUSH]")); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Same but force premature exit if necessary. */
|
/* Same but force premature exit if necessary. */
|
||||||
#define FLUSH_BLOCK(s, last) { \
|
#define FLUSH_BLOCK(s, last) { \
|
||||||
FLUSH_BLOCK_ONLY(s, last); \
|
FLUSH_BLOCK_ONLY(s, last); \
|
||||||
if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
|
if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===========================================================================
|
/* ===========================================================================
|
||||||
* Copy without compression as much as possible from the input stream, return
|
* Copy without compression as much as possible from the input stream, return
|
||||||
|
@ -1840,7 +1835,8 @@ int flush;
|
||||||
INSERT_STRING(s, s->strstart, hash_head);
|
INSERT_STRING(s, s->strstart, hash_head);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the longest match, discarding those <= prev_length. */
|
/* Find the longest match, discarding those <= prev_length.
|
||||||
|
*/
|
||||||
s->prev_length = s->match_length, s->prev_match = s->match_start;
|
s->prev_length = s->match_length, s->prev_match = s->match_start;
|
||||||
s->match_length = MIN_MATCH - 1;
|
s->match_length = MIN_MATCH - 1;
|
||||||
|
|
||||||
|
@ -2054,3 +2050,4 @@ int flush;
|
||||||
FLUSH_BLOCK(s, 0);
|
FLUSH_BLOCK(s, 0);
|
||||||
return block_done;
|
return block_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -344,3 +344,4 @@ extern const uch ZLIB_INTERNAL _dist_code[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* DEFLATE_H */
|
#endif /* DEFLATE_H */
|
||||||
|
|
||||||
|
|
|
@ -329,3 +329,4 @@ dodist:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif /* !ASMINF */
|
#endif /* !ASMINF */
|
||||||
|
|
||||||
|
|
|
@ -9,3 +9,4 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
|
void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
|
||||||
|
|
||||||
|
|
|
@ -92,3 +92,4 @@ static const code distfix[32] = {
|
||||||
{16, 5, 4}, {24, 5, 769}, {20, 5, 49}, {28, 5, 12289}, {18, 5, 13}, {26, 5, 3073},
|
{16, 5, 4}, {24, 5, 769}, {20, 5, 49}, {28, 5, 12289}, {18, 5, 13}, {26, 5, 3073},
|
||||||
{22, 5, 193}, {64, 5, 0}
|
{22, 5, 193}, {64, 5, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -80,15 +80,6 @@
|
||||||
* The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
|
* 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 "zutil.h"
|
||||||
#include "inftrees.h"
|
#include "inftrees.h"
|
||||||
#include "inflate.h"
|
#include "inflate.h"
|
||||||
|
@ -1520,3 +1511,4 @@ z_streamp strm;
|
||||||
(state->mode == COPY ? state->length :
|
(state->mode == COPY ? state->length :
|
||||||
(state->mode == MATCH ? state->was - state->length : 0));
|
(state->mode == MATCH ? state->was - state->length : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,3 +120,4 @@ struct inflate_state {
|
||||||
int back; /* bits back of last unprocessed length/lit */
|
int back; /* bits back of last unprocessed length/lit */
|
||||||
unsigned was; /* initial length of match */
|
unsigned was; /* initial length of match */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,11 @@
|
||||||
#define MAXBITS 15
|
#define MAXBITS 15
|
||||||
|
|
||||||
const char inflate_copyright[] =
|
const char inflate_copyright[] =
|
||||||
|
#ifdef ZLIB_PM3_TUNED
|
||||||
" inflate 1.2.8.f-Proxmark3 Copyright 1995-2013 Mark Adler ";
|
" inflate 1.2.8.f-Proxmark3 Copyright 1995-2013 Mark Adler ";
|
||||||
|
#else
|
||||||
|
" inflate 1.2.8 Copyright 1995-2013 Mark Adler ";
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
If you use the zlib library in a product, an acknowledgment is welcome
|
If you use the zlib library in a product, an acknowledgment is welcome
|
||||||
in the documentation of your product. If for some reason you cannot
|
in the documentation of your product. If for some reason you cannot
|
||||||
|
@ -300,3 +304,4 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
|
||||||
*bits = root;
|
*bits = root;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,3 +60,4 @@ typedef enum {
|
||||||
int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
|
int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
|
||||||
unsigned codes, code FAR *FAR *table,
|
unsigned codes, code FAR *FAR *table,
|
||||||
unsigned FAR *bits, unsigned short FAR *work));
|
unsigned FAR *bits, unsigned short FAR *work));
|
||||||
|
|
||||||
|
|
|
@ -32,16 +32,8 @@
|
||||||
|
|
||||||
/* @(#) $Id$ */
|
/* @(#) $Id$ */
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// 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.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/* #define GEN_TREES_H */
|
/* #define GEN_TREES_H */
|
||||||
|
|
||||||
|
|
||||||
#include "deflate.h"
|
#include "deflate.h"
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -184,7 +176,7 @@ local void gen_trees_header OF((void));
|
||||||
#define put_short(s, w) { \
|
#define put_short(s, w) { \
|
||||||
put_byte(s, (uch)((w) & 0xff)); \
|
put_byte(s, (uch)((w) & 0xff)); \
|
||||||
put_byte(s, (uch)((ush)(w) >> 8)); \
|
put_byte(s, (uch)((ush)(w) >> 8)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===========================================================================
|
/* ===========================================================================
|
||||||
* Send a value on a given number of bits.
|
* Send a value on a given number of bits.
|
||||||
|
@ -219,7 +211,7 @@ int length; /* number of bits */
|
||||||
#else /* !DEBUG */
|
#else /* !DEBUG */
|
||||||
|
|
||||||
#define send_bits(s, value, length) \
|
#define send_bits(s, value, length) \
|
||||||
{ int len = length;\
|
{ int len = length;\
|
||||||
if (s->bi_valid > (int)Buf_size - len) {\
|
if (s->bi_valid > (int)Buf_size - len) {\
|
||||||
int val = value;\
|
int val = value;\
|
||||||
s->bi_buf |= (ush)val << s->bi_valid;\
|
s->bi_buf |= (ush)val << s->bi_valid;\
|
||||||
|
@ -230,7 +222,7 @@ int length; /* number of bits */
|
||||||
s->bi_buf |= (ush)(value) << s->bi_valid;\
|
s->bi_buf |= (ush)(value) << s->bi_valid;\
|
||||||
s->bi_valid += len;\
|
s->bi_valid += len;\
|
||||||
}\
|
}\
|
||||||
}
|
}
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
|
||||||
|
@ -436,11 +428,11 @@ deflate_state *s;
|
||||||
* one less element. Updates heap and heap_len.
|
* one less element. Updates heap and heap_len.
|
||||||
*/
|
*/
|
||||||
#define pqremove(s, tree, top) \
|
#define pqremove(s, tree, top) \
|
||||||
{\
|
{\
|
||||||
top = s->heap[SMALLEST]; \
|
top = s->heap[SMALLEST]; \
|
||||||
s->heap[SMALLEST] = s->heap[s->heap_len--]; \
|
s->heap[SMALLEST] = s->heap[s->heap_len--]; \
|
||||||
pqdownheap(s, tree, SMALLEST); \
|
pqdownheap(s, tree, SMALLEST); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===========================================================================
|
/* ===========================================================================
|
||||||
* Compares to subtrees, using the tree depth as tie breaker when
|
* Compares to subtrees, using the tree depth as tie breaker when
|
||||||
|
@ -1021,7 +1013,8 @@ int last; /* one if this is the last block for a file */
|
||||||
s->compressed_len += 7; /* align on byte boundary */
|
s->compressed_len += 7; /* align on byte boundary */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
Tracev((stderr, "\ncomprlen %lu(%lu) ", s->compressed_len >> 3, s->compressed_len - 7 * last));
|
Tracev((stderr, "\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
|
||||||
|
s->compressed_len - 7 * last));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===========================================================================
|
/* ===========================================================================
|
||||||
|
@ -1245,3 +1238,4 @@ int header; /* true if block header must be written */
|
||||||
put_byte(s, *buf++);
|
put_byte(s, *buf++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,3 +126,4 @@ local const int base_dist[D_CODES] = {
|
||||||
1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
|
1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -509,3 +509,4 @@ typedef unsigned long z_crc_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* ZCONF_H */
|
#endif /* ZCONF_H */
|
||||||
|
|
||||||
|
|
|
@ -28,13 +28,6 @@
|
||||||
(zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
|
(zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// 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.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifndef ZLIB_H
|
#ifndef ZLIB_H
|
||||||
#define ZLIB_H
|
#define ZLIB_H
|
||||||
|
|
||||||
|
@ -1784,3 +1777,4 @@ ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* ZLIB_H */
|
#endif /* ZLIB_H */
|
||||||
|
|
||||||
|
|
|
@ -341,3 +341,4 @@ voidpf ptr;
|
||||||
#endif /* MY_ZCALLOC */
|
#endif /* MY_ZCALLOC */
|
||||||
|
|
||||||
#endif /* !Z_SOLO */
|
#endif /* !Z_SOLO */
|
||||||
|
|
||||||
|
|
|
@ -251,3 +251,4 @@ void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
|
||||||
(((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
|
(((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
|
||||||
|
|
||||||
#endif /* ZUTIL_H */
|
#endif /* ZUTIL_H */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue