Commit 86105f69 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Update libvgz and neuter the adler32 bits we do not use.

parent 5d48d91e
......@@ -7,6 +7,7 @@
#include "zutil.h"
#ifdef NOVGZ
local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
#define BASE 65521U /* largest prime smaller than 65536 */
......@@ -184,3 +185,15 @@ uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
{
return adler32_combine_(adler1, adler2, len2);
}
#else
uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
{
(void)adler;
(void)buf;
(void)len;
abort();
}
#endif
......@@ -511,7 +511,7 @@ int ZEXPORT deflateResetKeep (strm)
s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
#endif
adler32(0L, Z_NULL, 0);
s->last_flush = Z_NO_FLUSH;
s->last_flush = -2;
_tr_init(s);
......@@ -606,12 +606,12 @@ int ZEXPORT deflateParams(strm, level, strategy)
func = configuration_table[s->level].func;
if ((strategy != s->strategy || func != configuration_table[level].func) &&
s->high_water) {
s->last_flush != -2) {
/* Flush the last buffer: */
int err = deflate(strm, Z_BLOCK);
if (err == Z_STREAM_ERROR)
return err;
if (strm->avail_out == 0)
if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead)
return Z_BUF_ERROR;
}
if (s->level != level) {
......
......@@ -122,13 +122,13 @@ struct static_tree_desc_s {
int max_length; /* max bit length for the codes */
};
local static_tree_desc static_l_desc =
local const static_tree_desc static_l_desc =
{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
local static_tree_desc static_d_desc =
local const static_tree_desc static_d_desc =
{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
local static_tree_desc static_bl_desc =
local const static_tree_desc static_bl_desc =
{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
/* ===========================================================================
......
......@@ -716,11 +716,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different strategy.
If the compression approach (which is a function of the level) or the
strategy is changed, and if any input has been consumed in a previous
deflate() call, then the input available so far is compressed with the old
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
for the compression levels 0, 1..3, and 4..9 respectively. The new level
and strategy will take effect at the next call of deflate().
strategy is changed, and if there have been any deflate() calls since the
state was initialized or reset, then the input available so far is
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
There are three approaches for the compression levels 0, 1..3, and 4..9
respectively. The new level and strategy will take effect at the next call
of deflate().
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
not have enough output space to complete, then the parameter change will not
......
#!/bin/sh
# This script compares libvgz to zlib in FreeBSD source tree
LZ=/usr/src/contrib/zlib
if [ ! -d lib/libvgz ] ; then
echo "Run this from to of tree" 1>&2
exit 2
fi
for i in lib/libvgz/*.[ch]
do
b=`basename $i`
if [ "$b" == "vgz.h" ] ; then
b="zlib.h"
fi
if [ -f ${LZ}/$b ] ; then
echo "==== $b"
sed '
s/vgz.h/zlib.h/
/strm->msg =/s/"/(char *)"/
' $i |
diff -u ${LZ}/$b -
else
echo "#### $b #### NOT FOUND ####"
fi
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment