Skip to content

Commit

Permalink
Update zlib sources to zlib-1.2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
pmqs committed Oct 16, 2022
1 parent 666c558 commit eafe29c
Show file tree
Hide file tree
Showing 13 changed files with 228 additions and 195 deletions.
14 changes: 7 additions & 7 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
and/or modify it under the same terms as Perl itself.

The directory zlib-src contains a subset of the
source files copied directly from zlib version 1.2.11.
These files are Copyright(C) 1995-2017
source files copied directly from zlib version 1.2.13.
These files are Copyright(C) 1995-2022
Jean-loup Gailly and Mark Adler.
Full source for the zlib library is available at
http://www.zlib.org
Expand Down Expand Up @@ -98,16 +98,16 @@ before building this module.

For option 2, fetch a copy of the zlib source distribution from
http://www.zlib.org and unpack it into the Compress-Raw-Zlib source
directory. Assuming you have fetched zlib 1.2.11,
it will create a directory called zlib-1.2.11.
directory. Assuming you have fetched zlib 1.2.13,
it will create a directory called zlib-1.2.13.

Now set the variables in the file config.in as follows (if the version
you have fetched isn't 1.2.11, change the INCLUDE and LIB
you have fetched isn't 1.2.13, change the INCLUDE and LIB
variables appropriately):

BUILD_ZLIB = True
INCLUDE = ./zlib-1.2.11
LIB = ./zlib-1.2.11
INCLUDE = ./zlib-1.2.13
LIB = ./zlib-1.2.13
OLD_ZLIB = False
GZIP_OS_CODE = AUTO_DETECT

Expand Down
23 changes: 16 additions & 7 deletions zlib-src/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,22 @@
# endif
#endif

/* If available, use the ARM processor CRC32 instruction. */
#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
# define ARMCRC32
#endif

/* Local functions. */
local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));

/* If available, use the ARM processor CRC32 instruction. */
#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
# define ARMCRC32
#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
local z_word_t byte_swap OF((z_word_t word));
#endif

#if defined(W) && !defined(ARMCRC32)
local z_crc_t crc_word OF((z_word_t data));
local z_word_t crc_word_big OF((z_word_t data));
#endif

#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
Expand Down Expand Up @@ -645,8 +654,8 @@ unsigned long ZEXPORT crc32_z(
len &= 7;

/* Do three interleaved CRCs to realize the throughput of one crc32x
instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three
CRCs are combined into a single CRC after each set of batches. */
instruction per cycle. Each CRC is calculated on Z_BATCH words. The
three CRCs are combined into a single CRC after each set of batches. */
while (num >= 3 * Z_BATCH) {
crc1 = 0;
crc2 = 0;
Expand Down Expand Up @@ -1086,7 +1095,7 @@ uLong ZEXPORT crc32_combine(
uLong crc2,
z_off_t len2)
{
return crc32_combine64(crc1, crc2, len2);
return crc32_combine64(crc1, crc2, (z_off64_t)len2);
}

/* ========================================================================= */
Expand All @@ -1103,7 +1112,7 @@ uLong ZEXPORT crc32_combine_gen64(
uLong ZEXPORT crc32_combine_gen(
z_off_t len2)
{
return crc32_combine_gen64(len2);
return crc32_combine_gen64((z_off64_t)len2);
}

/* ========================================================================= */
Expand Down
Loading

0 comments on commit eafe29c

Please sign in to comment.