]> git.ipfire.org Git - thirdparty/zlib-ng.git/log
thirdparty/zlib-ng.git
4 years agoFix dfltcc_deflate.c build
Ilya Leoshkevich [Tue, 21 Jul 2020 11:15:17 +0000 (13:15 +0200)] 
Fix dfltcc_deflate.c build

bi_windup and send_bits were moved to tree_emit.h, so include it.

4 years agoFix DFLTCC detection
Ilya Leoshkevich [Fri, 14 Aug 2020 11:50:39 +0000 (13:50 +0200)] 
Fix DFLTCC detection

On some Z machines ARCH is determined to be s390, not s390x, which
prevents DFLTCC support from being built. In general, it is safe to
build zlib-ng with DFLTCC support on any SystemZ machine, because its
usage is guarded by STFLE.

4 years agoAdd toolchain files for cross-compiling MinGW on Linux.
Mika Lindqvist [Thu, 20 Aug 2020 12:50:33 +0000 (15:50 +0300)] 
Add toolchain files for cross-compiling MinGW on Linux.

4 years agoRemove return value from insert_string, since it is always ignored and
Hans Kristian Rosbach [Thu, 20 Aug 2020 14:09:23 +0000 (16:09 +0200)] 
Remove return value from insert_string, since it is always ignored and
quick_insert_string is being used instead.

4 years agoNow that the check is out of the loop, it is also safe to remove it
Hans Kristian Rosbach [Wed, 19 Aug 2020 08:50:44 +0000 (10:50 +0200)] 
Now that the check is out of the loop, it is also safe to remove it
and unconditionally return head.

4 years agoMinor optimization of insert_string template.
Hans Kristian Rosbach [Tue, 18 Aug 2020 16:17:45 +0000 (18:17 +0200)] 
Minor optimization of insert_string template.

4 years agoStore hash_mask in local variable for insert_string loop.
Nathan Moinvaziri [Wed, 19 Aug 2020 00:46:55 +0000 (17:46 -0700)] 
Store hash_mask in local variable for insert_string loop.

4 years agoMove zero check for insert_string count to fill_window since it is the only place...
Nathan Moinvaziri [Wed, 19 Aug 2020 00:45:48 +0000 (17:45 -0700)] 
Move zero check for insert_string count to fill_window since it is the only place where count is ever passed as zero.

4 years agoFix if statements in cmake failing because variables are unquoted.
Hans Kristian Rosbach [Thu, 20 Aug 2020 14:10:57 +0000 (16:10 +0200)] 
Fix if statements in cmake failing because variables are unquoted.
Exposed by #729, but does not fix the real problems there.

4 years agoFix testsuite warnings on Windows, using PRIu64
Josh Triplett [Sun, 16 Aug 2020 23:12:13 +0000 (16:12 -0700)] 
Fix testsuite warnings on Windows, using PRIu64

zlib-ng already counts on inttypes.h and stdint.h, so use those to avoid
printf-related warnings by casting integer fields whose size may vary to
uint64_t and printing them that way.

4 years agozlib.h: Use unsigned long for totals, for compatibility with zlib on 64-bit Windows
Josh Triplett [Sun, 16 Aug 2020 17:39:24 +0000 (10:39 -0700)] 
zlib.h: Use unsigned long for totals, for compatibility with zlib on 64-bit Windows

Stock zlib uses unsigned long for total_in and total_out. On 64-bit
Windows, that isn't the same as size_t.

4 years agoHarmonize the CPU architecture preprocessor definitions.
Nathan Moinvaziri [Sun, 16 Aug 2020 03:45:41 +0000 (20:45 -0700)] 
Harmonize the CPU architecture preprocessor definitions.

4 years agoPrevent unaligned double word access on ARMv7 in put_uint64
NiLuJe [Sun, 2 Aug 2020 18:22:04 +0000 (20:22 +0200)] 
Prevent unaligned double word access on ARMv7 in put_uint64

By implementing a (UNALIGNED_OK && !UNALIGNED64_OK) codepath.

4 years agoPrevent unaligned double word accesses on ARMv7 in chunkset_c
NiLuJe [Sun, 2 Aug 2020 18:20:56 +0000 (20:20 +0200)] 
Prevent unaligned double word accesses on ARMv7 in chunkset_c

Requires some mild trickery to walk the edge between readability and
doing what it needs to.

4 years agoCorrect some typos in README.md
Andrea Canciani [Thu, 20 Aug 2020 09:25:07 +0000 (11:25 +0200)] 
Correct some typos in README.md

Jus some minor typos :)

4 years agoHonor CFLAGS when linking
NiLuJe [Sun, 2 Aug 2020 18:15:52 +0000 (20:15 +0200)] 
Honor CFLAGS when linking

It's the GCC driver, honor CFLAGS to make stuff consistent.
(Allows one to actually get an LTO build w/ debug info, for
instance).

4 years agoRemove NO_DIVIDE from adler32.
Nathan Moinvaziri [Sun, 16 Aug 2020 03:06:26 +0000 (20:06 -0700)] 
Remove NO_DIVIDE from adler32.

4 years agoOptimize inflate_fast for a 0.8% speedup
Josh Triplett [Fri, 14 Aug 2020 03:59:17 +0000 (20:59 -0700)] 
Optimize inflate_fast for a 0.8% speedup

When inflate_fast checks for extra length bits, it first checks if the
number of extra length bits (in op) is non-zero. However, if the number
of extra length bits is 0, the `bits < op` check will be false, BITS(op)
will be 0, and DROPBITS(op) will do nothing. So, drop the conditional,
for a speedup of about 0.8%.

This makes the handling of extra length bits match the handling of extra
dist bits, which already lacks the extra conditional.

4 years agoDon't let the compiler switch to 64bit vectors behind our back.
NiLuJe [Sun, 2 Aug 2020 18:18:57 +0000 (20:18 +0200)] 
Don't let the compiler switch to 64bit vectors behind our back.

On ARMv7, they have more stringent alignment requirements,
which aren't accounted for.

4 years agoFix inconsistent wildcards in CHOST canonicalization script
NiLuJe [Sun, 2 Aug 2020 18:14:03 +0000 (20:14 +0200)] 
Fix inconsistent wildcards in CHOST canonicalization script

Should prevent mangling actually sane four-part CHOSTs,
while not regressing #666

4 years agoUpdate clang static analyzer to version 12
Gabriel A. Devenyi [Fri, 14 Aug 2020 13:23:38 +0000 (09:23 -0400)] 
Update clang static analyzer to version 12

4 years agoStyle cleanup.
Mika Lindqvist [Fri, 17 Jul 2020 18:03:52 +0000 (21:03 +0300)] 
Style cleanup.

* Remove space between function name and opening parenthesis
* Remove space closing parenthesis of cast and variable name

4 years agoFix signature of crc32_combine(), crc32_combine64() and crc32_z() in compat mode.
Mika Lindqvist [Fri, 17 Jul 2020 00:52:29 +0000 (03:52 +0300)] 
Fix signature of crc32_combine(), crc32_combine64() and crc32_z() in compat mode.

4 years agoCast wsize as early as possible in slide_hash for AVX2 and SSE2.
Nathan Moinvaziri [Sun, 2 Aug 2020 18:20:43 +0000 (11:20 -0700)] 
Cast wsize as early as possible in slide_hash for AVX2 and SSE2.

4 years agoFixed possible loss of data warning in h2b in infcover on Windows.
Nathan Moinvaziri [Sat, 4 Jul 2020 03:38:36 +0000 (20:38 -0700)] 
Fixed possible loss of data warning in h2b in infcover on Windows.

    infcover.c(247,35): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data

4 years agoFixed many possible loss of data warnings where insert_string and quick_insert_string...
Nathan Moinvaziri [Sat, 4 Jul 2020 03:37:11 +0000 (20:37 -0700)] 
Fixed many possible loss of data warnings where insert_string and quick_insert_string function used on Windows.

4 years agoFixed possible loss of data warning in LONGEST_MATCH.
Nathan Moinvaziri [Sat, 4 Jul 2020 03:31:36 +0000 (20:31 -0700)] 
Fixed possible loss of data warning in LONGEST_MATCH.

    match_tpl.h(69,64): warning C4244: '=': conversion from 'unsigned int' to 'Pos', possible loss of data

4 years agoFixed conversion from unsigned int to short warning in slide_hash_sse2 and slide_hash...
Nathan Moinvaziri [Sat, 4 Jul 2020 03:28:33 +0000 (20:28 -0700)] 
Fixed conversion from unsigned int to short warning in slide_hash_sse2 and slide_hash_avx2.

    slide_sse.c(20,51): warning C4244: 'function': conversion from 'unsigned int' to 'short', possible loss of data
    slide_avx.c(21,54): warning C4244: 'function': conversion from 'unsigned int' to 'short', possible loss of data

4 years agoFixed warning about indexing literal string in GCC macOS
Nathan Moinvaziri [Sat, 4 Jul 2020 03:24:38 +0000 (20:24 -0700)] 
Fixed warning about indexing literal string in GCC macOS

    infcover.c:378:56: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
    infcover.c:378:56: note: use array indexing to silence this warning

4 years agoRemoved unnecessary header guards in adler32 source files.
Nathan Moinvaziri [Sat, 4 Jul 2020 03:18:01 +0000 (20:18 -0700)] 
Removed unnecessary header guards in adler32 source files.

4 years agoFixed warning about no newline at the end of adler32_ssse3.c.
Nathan Moinvaziri [Sat, 4 Jul 2020 03:16:56 +0000 (20:16 -0700)] 
Fixed warning about no newline at the end of adler32_ssse3.c.

    adler32_ssse3.c:123:7: warning: no newline at end of file [-Wnewline-eof]

5 years agoRemove ARM crc instruction set from NEONFLAG. The crc instruction set is not used...
Nathan Moinvaziri [Sun, 12 Jul 2020 17:24:33 +0000 (10:24 -0700)] 
Remove ARM crc instruction set from NEONFLAG. The crc instruction set is not used for neon source files. It may have been necessary back when the NEONFLAG was applied to all source files in CMake. Configure script does not apply crc instruction set when setting neon flags.

5 years agoFixed extra symbols added to ABI when zlib-compat specified.
Nathan Moinvaziri [Sun, 5 Jul 2020 18:13:20 +0000 (11:13 -0700)] 
Fixed extra symbols added to ABI when zlib-compat specified.

5 years agoRemove forward declarations for stub functions and have one forward declaration for...
Nathan Moinvaziri [Mon, 13 Jul 2020 23:02:47 +0000 (16:02 -0700)] 
Remove forward declarations for stub functions and have one forward declaration for functable instead.

5 years agoStyle cleanup.
Mika Lindqvist [Fri, 17 Jul 2020 17:55:25 +0000 (20:55 +0300)] 
Style cleanup.
* Remove space between function name and opening parenthesis
* Remove space closing parenthesis of cast and variable name

5 years agoFix signature of adler32(), adler32_combine(), adler32_combine64() and adler32_z...
Mika Lindqvist [Fri, 17 Jul 2020 00:29:35 +0000 (03:29 +0300)] 
Fix signature of adler32(), adler32_combine(), adler32_combine64() and adler32_z() in compat mode.
* See #700

5 years agoChange ctest to test all the files in test/data.
Nathan Moinvaziri [Tue, 14 Jul 2020 22:42:57 +0000 (15:42 -0700)] 
Change ctest to test all the files in test/data.
Improved minigzip test configurations in ctest.
Added corpora repository to test/data to test for each run.

5 years agoAllow for CMake to run tests in parallel.
Nathan Moinvaziri [Mon, 13 Jul 2020 02:18:34 +0000 (19:18 -0700)] 
Allow for CMake to run tests in parallel.
Seperate minigzip and switchlevels set of tests into test-compress.cmake.
Create run-and-compare.cmake for tests that need to run a command and compare output.

5 years agoCMakeLists.txt, configure: match source order; .so's now identical on more platforms.
Dan Kegel [Thu, 2 Jul 2020 17:21:50 +0000 (10:21 -0700)] 
CMakeLists.txt, configure: match source order; .so's now identical on more platforms.

Also:
- use same name for .so on CMake and configure in --zlib-compat case
- configure: merge i686 and x86_64 sections, since they were essentially identical
- pkgcheck.sh: verify resulting shared libraries are bit-for-bit identical
- pkgcheck.sh: use diffoscope if present to show differences in shared libraries

Don't install diffoscope in ci, since that slows down successful
runs; we can add it later if failures become common.

Fixes #638 (at least for the systems tested)

5 years agoconfigure: move config.sub to tools subdir
Dan Kegel [Wed, 15 Jul 2020 22:35:23 +0000 (15:35 -0700)] 
configure: move config.sub to tools subdir

5 years agocmake: mac: don't use @rpath (since configure doesn't); for #638
Dan Kegel [Wed, 15 Jul 2020 19:31:19 +0000 (12:31 -0700)] 
cmake: mac: don't use @rpath (since configure doesn't); for #638

5 years agoconfigure: canonicalize CHOST.
Dan Kegel [Tue, 30 Jun 2020 21:05:04 +0000 (14:05 -0700)] 
configure: canonicalize CHOST.

Fixes https://github.com/zlib-ng/zlib-ng/issues/666
for all the CHOST values currently used in
.github/workflows/*.yml.

Also make ci's shellcheck happy by avoiding backticks in the changed lines.

5 years agoconfigure: don't link shared libraries explicitly with -lc
Dan Kegel [Sun, 21 Jun 2020 00:26:00 +0000 (17:26 -0700)] 
configure: don't link shared libraries explicitly with -lc

The -lc was introduced by d6231142d2b883a8c3b253fa34992b5cdb4ac2fe :
which said in part
"Changes in 1.2.3.2 (3 September 2006)
...
- Rig configure --shared to build both shared and static [Teredesai, Truta]"

It's not clear why it was needed.  On powerpc, linking -lc explicitly
causes __moddi3 and __stack_chk_fail_local to swap location in the
binary.
If we want configure and cmake to generate identical shared libraries,
either we need to link -lc explicitly in both configure and cmake,
or in neither.   Occam's Razor suggests omitting it from configure
rather than adding it to cmake.

5 years agoReturn proper exit code after flushing end block in deflate_quick when no available...
Nathan Moinvaziri [Mon, 6 Jul 2020 23:46:18 +0000 (16:46 -0700)] 
Return proper exit code after flushing end block in deflate_quick when no available output.

5 years agoMake static libraries produced by cmake and configure identical.
Dan Kegel [Fri, 19 Jun 2020 15:50:13 +0000 (08:50 -0700)] 
Make static libraries produced by cmake and configure identical.

Also make compat mode .pc files identical.

- cmake: don't do runtime feature checks when doing native builds.
- test/pkgcheck.sh: also compare .a, check compat mode, and handle mac better
- CMakeLists.txt: get Version right in compat mode .pc file
- .github/workflows/pkgcheck.sh: test on more systems, including mac

Fixes #681

5 years agoFixed warning about implicit declaration of function fileno().
Nathan Moinvaziri [Fri, 10 Jul 2020 21:06:38 +0000 (14:06 -0700)] 
Fixed warning about implicit declaration of function fileno().

5 years agoRemoved legacy typedef caddr_t from gz_compress_mmap.
Nathan Moinvaziri [Fri, 10 Jul 2020 20:59:25 +0000 (13:59 -0700)] 
Removed legacy typedef caddr_t from gz_compress_mmap.

5 years agoAdded CI instance and coverage for USE_MMAP define in minigzip.
Nathan Moinvaziri [Fri, 10 Jul 2020 20:51:41 +0000 (13:51 -0700)] 
Added CI instance and coverage for USE_MMAP define in minigzip.

5 years agoDefault to optimization level 2 in cmake for release mode. Can be overwritten by...
Nathan Moinvaziri [Thu, 2 Jul 2020 05:45:21 +0000 (22:45 -0700)] 
Default to optimization level 2 in cmake for release mode. Can be overwritten by setting the optimization level with CMAKE_C_FLAGS. MSVC does not have optimization level 3.

5 years agoAdded missing switch for configure script --native to readme.
Nathan Moinvaziri [Thu, 9 Jul 2020 01:55:13 +0000 (18:55 -0700)] 
Added missing switch for configure script --native to readme.

5 years agoAdded SSE4.2 inline assembly check for configure script.
Nathan Moinvaziri [Thu, 9 Jul 2020 01:46:11 +0000 (18:46 -0700)] 
Added SSE4.2 inline assembly check for configure script.

5 years agoFixed chunksize not being initialized when using inflateBack.
Nathan Moinvaziri [Tue, 7 Jul 2020 00:23:01 +0000 (17:23 -0700)] 
Fixed chunksize not being initialized when using inflateBack.

5 years agoFix long string warning on adler32_test
Matheus Castanho [Mon, 6 Jul 2020 13:12:27 +0000 (10:12 -0300)] 
Fix long string warning on adler32_test

Since the introduction of test/adler32_test.c there has been a new
warning about too long strings:

 /home/runner/work/zlib-ng/zlib-ng/test/adler32_test.c:178:5: warning: string
length ‘5552’ is greater than the length ‘4095’ ISO C99 compilers are required
to support [-Woverlength-strings]
     "byRKqAu3J", 5552, 0x8b81718f},
     ^~~~~~~~~~~
/home/runner/work/zlib-ng/zlib-ng/test/adler32_test.c:321:5: warning: string
length ‘5552’ is greater than the length ‘4095’ ISO C99 compilers are required
to support [-Woverlength-strings]
     "byRKqAu3J", 5552, 0x7dc51be2},
     ^~~~~~~~~~~

Declaring the long string as a static byte array fixes the issue.

5 years agoMerge pull request #683 from nmoinvaz/fixes/config-cwd-lib-path
Hans Kristian Rosbach [Fri, 10 Jul 2020 13:41:59 +0000 (15:41 +0200)] 
Merge pull request #683 from nmoinvaz/fixes/config-cwd-lib-path

Remove current directory library include path in configure not in cmake

5 years agoFixed const warning in deflate prime tests.
Nathan Moinvaziri [Sat, 4 Jul 2020 03:12:11 +0000 (20:12 -0700)] 
Fixed const warning in deflate prime tests.

     zlib-ng.h:1726:10: note: expected ‘const uint8_t * {aka const unsigned char *}’ but argument is of type ‘const char *’

5 years agoFixed signed integer comparison warning in deflatePrime bits check.
Nathan Moinvaziri [Sat, 4 Jul 2020 03:10:25 +0000 (20:10 -0700)] 
Fixed signed integer comparison warning in deflatePrime bits check.

    deflate.c:589:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

5 years agoFixed ubsan error in deflatePrime when bits is 32.
Nathan Moinvaziri [Sat, 4 Jul 2020 03:05:53 +0000 (20:05 -0700)] 
Fixed ubsan error in deflatePrime when bits is 32.

    deflate.c:602:15: runtime error: shift exponent 32 is too large for 32-bit type 'int32_t' (aka 'int')
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /src/zlib-ng/deflate.c:602:15

5 years agoAdd options to install minigzip and minideflate.
Nathan Moinvaziri [Fri, 19 Jun 2020 03:31:25 +0000 (20:31 -0700)] 
Add options to install minigzip and minideflate.

5 years agoAdded GitHub Actions workflow to create releases when commits are tagged.
Nathan Moinvaziri [Wed, 17 Jun 2020 15:45:47 +0000 (08:45 -0700)] 
Added GitHub Actions workflow to create releases when commits are tagged.

5 years agoconfigure: fix typo (.o in shared library)
Dan Kegel [Fri, 3 Jul 2020 16:57:27 +0000 (09:57 -0700)] 
configure: fix typo (.o in shared library)

Linking .o into a shared library could be bad.
In this case it seems to have been harmless, but it should be fixed anyway.

5 years agoRemove current directory library include path in configure not present in cmake. 683/head
Nathan Moinvaziri [Sun, 5 Jul 2020 18:29:18 +0000 (11:29 -0700)] 
Remove current directory library include path in configure not present in cmake.

5 years agoAdd likely/unlikely hinting to all deflate algorithms.
Hans Kristian Rosbach [Wed, 1 Jul 2020 13:06:37 +0000 (15:06 +0200)] 
Add likely/unlikely hinting to all deflate algorithms.

5 years agoAdded CI instances for ARM/AARCH64 without acle/neon.
Nathan Moinvaziri [Wed, 1 Jul 2020 23:45:50 +0000 (16:45 -0700)] 
Added CI instances for ARM/AARCH64 without acle/neon.

5 years agoFixed configure applying -march flags globally for ARM.
Nathan Moinvaziri [Wed, 1 Jul 2020 23:39:47 +0000 (16:39 -0700)] 
Fixed configure applying -march flags globally for ARM.
Fixed -mfpu=neon not being applied on arm|arm7 if available.

5 years agoRemove duplicate Windows GCC CI instance.
Nathan Moinvaziri [Thu, 2 Jul 2020 05:00:22 +0000 (22:00 -0700)] 
Remove duplicate Windows GCC CI instance.

5 years agoAdded powerpc instances to CI for configure.
Nathan Moinvaziri [Thu, 2 Jul 2020 01:39:22 +0000 (18:39 -0700)] 
Added powerpc instances to CI for configure.

5 years agoMerge pull request #668 from nmoinvaz/fixes/apply-float-abi-c-flags
Hans Kristian Rosbach [Thu, 2 Jul 2020 11:10:49 +0000 (13:10 +0200)] 
Merge pull request #668 from nmoinvaz/fixes/apply-float-abi-c-flags

Fixed issues with float abi in cmake

5 years agoClean up comments about setting C flags.
Nathan Moinvaziri [Tue, 30 Jun 2020 02:59:12 +0000 (19:59 -0700)] 
Clean up comments about setting C flags.

5 years agoModify cmake to apply native flag when using intrinsic flags same as configure.
Nathan Moinvaziri [Sun, 28 Jun 2020 19:37:50 +0000 (12:37 -0700)] 
Modify cmake to apply native flag when using intrinsic flags same as configure.

5 years agoApply float abi flag to all files in cmake (same as configure). 668/head
Nathan Moinvaziri [Wed, 1 Jul 2020 03:57:47 +0000 (20:57 -0700)] 
Apply float abi flag to all files in cmake (same as configure).
Don't override -mfloat-abi if set via -DCMAKE_C_FLAGS in cmake.
Only set -mfloat-abi=softfp if compiler ends in eabi in cmake. (same as configure).

5 years agoRemove some extra ci configurations.
Nathan Moinvaziri [Wed, 1 Jul 2020 03:27:08 +0000 (20:27 -0700)] 
Remove some extra ci configurations.

5 years agoApply neonflag only to files using neon instructions with configure.
Nathan Moinvaziri [Wed, 1 Jul 2020 04:13:43 +0000 (21:13 -0700)] 
Apply neonflag only to files using neon instructions with configure.

5 years agoFixed integer casting and signed comparison warning in test_gzio.
Nathan Moinvaziri [Wed, 1 Jul 2020 03:00:30 +0000 (20:00 -0700)] 
Fixed integer casting and signed comparison warning in test_gzio.

    example.c(199,57): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
    example.c:207:32: warning: comparison between signed and unsigned integer expressions

5 years agoImprove deflatePrime test by wrapping gzip header and footer around deflate stream.
Nathan Moinvaziri [Wed, 1 Jul 2020 02:58:46 +0000 (19:58 -0700)] 
Improve deflatePrime test by wrapping gzip header and footer around deflate stream.

5 years agoFixed bad shift operation warning in deflatePrime.
Nathan Moinvaziri [Sun, 28 Jun 2020 20:05:11 +0000 (13:05 -0700)] 
Fixed bad shift operation warning in deflatePrime.
Check that bits value is not greater than bits allowed by value type.

  CID 293475 (#2-4 of 4): Bad bit shift operation (BAD_SHIFT)
  In expression 1UL << put, left shifting by more than 63 bits has undefined behavior.

5 years agoFixed whitespace in adler32_avx and adler32_ssse3.
Nathan Moinvaziri [Tue, 30 Jun 2020 02:28:33 +0000 (19:28 -0700)] 
Fixed whitespace in adler32_avx and adler32_ssse3.

5 years agoFixed unsigned integer overflow in adler32_avx and adler32_ssse3 when len is zero.
Nathan Moinvaziri [Tue, 30 Jun 2020 00:51:52 +0000 (17:51 -0700)] 
Fixed unsigned integer overflow in adler32_avx and adler32_ssse3 when len is zero.

    adler32_avx.c:108:15: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long')

5 years agoUse local match_len variable in deflate_slow.
Nathan Moinvaziri [Sun, 28 Jun 2020 21:14:24 +0000 (14:14 -0700)] 
Use local match_len variable in deflate_slow.
Remove match_len from deflate internal_state.

5 years agoFixed wrong size being used in calloc in test_deflate_set_header.
Nathan Moinvaziri [Sun, 28 Jun 2020 20:32:00 +0000 (13:32 -0700)] 
Fixed wrong size being used in calloc in test_deflate_set_header.

    CID 293478 (#1 of 1): Wrong size argument (SIZEOF_MISMATCH)
    suspicious_sizeof: Passing argument 1UL to function calloc that returns a pointer of type zng_gz_header * is suspicious because a multiple of sizeof (zng_gz_header) /*80*/ is expected.

5 years agoUse calloc to allocate memory and set to zero for memory sanitizer.
Nathan Moinvaziri [Sun, 28 Jun 2020 21:45:22 +0000 (14:45 -0700)] 
Use calloc to allocate memory and set to zero for memory sanitizer.

5 years agoSupport larger BUFLEN sizes by dynamically allocating buf.
Nathan Moinvaziri [Fri, 29 May 2020 16:10:13 +0000 (09:10 -0700)] 
Support larger BUFLEN sizes by dynamically allocating buf.

5 years agoAdded ZLIB_REGISTER to disable register keyword for C++.
Nathan Moinvaziri [Fri, 19 Jun 2020 04:09:30 +0000 (21:09 -0700)] 
Added ZLIB_REGISTER to disable register keyword for C++.

Co-authored-by: pps83 <pps83@users.noreply.github.com>
5 years agoDon't write end of last block when returning finish_started.
Nathan Moinvaziri [Sat, 27 Jun 2020 15:55:40 +0000 (08:55 -0700)] 
Don't write end of last block when returning finish_started.

5 years agoFixed avail_out == 0 conditional not returning need_more in deflate_quick.
Nathan Moinvaziri [Fri, 26 Jun 2020 05:52:59 +0000 (22:52 -0700)] 
Fixed avail_out == 0 conditional not returning need_more in deflate_quick.
Fixed ending block when returning need_more caused problems with inflate.

So instead of ending the block each time the function returns to finish the last block, we check upon start to see if it is the last block and if the last block has been started, and if not it will close the previous block and start the last block.

5 years agoRename from memchunk to chunkset.
Nathan Moinvaziri [Fri, 26 Jun 2020 18:00:15 +0000 (11:00 -0700)] 
Rename from memchunk to chunkset.

5 years agoRename add_intrinsics_option to set_intrinsics_option.
Nathan Moinvaziri [Fri, 26 Jun 2020 17:31:59 +0000 (10:31 -0700)] 
Rename add_intrinsics_option to set_intrinsics_option.

5 years agoClean up header includes for Win32 and ARM.
Nathan Moinvaziri [Fri, 26 Jun 2020 07:25:45 +0000 (00:25 -0700)] 
Clean up header includes for Win32 and ARM.
Fixed MSVC compiler warning in storechunk for ARM Neon.
Fixed arm_neon.h include for memchunk for ARM Neon.

5 years agoOnly calculate inflate chunk size once and store it for future use for performance.
Nathan Moinvaziri [Fri, 19 Jun 2020 03:22:09 +0000 (20:22 -0700)] 
Only calculate inflate chunk size once and store it for future use for performance.

5 years agoSplit memcopy by architecture.
Nathan Moinvaziri [Wed, 18 Mar 2020 01:03:15 +0000 (18:03 -0700)] 
Split memcopy by architecture.
Use uint8_t[8] struct on big-endian machines for speed.

5 years agoApply compiler flags only to source files that require them in CMake.
Nathan Moinvaziri [Sat, 14 Mar 2020 04:15:50 +0000 (22:15 -0600)] 
Apply compiler flags only to source files that require them in CMake.

5 years agoAdd POWER8_VSX_SLIDEHASH macro
Matheus Castanho [Mon, 22 Jun 2020 14:02:10 +0000 (11:02 -0300)] 
Add POWER8_VSX_SLIDEHASH macro

The slide_hash optimization for POWER currently depends on POWER8 macro
to be enabled. Switch this to use POWER8_VSX_SLIDEHASH instead to better
match the naming scheme used by other archs.

5 years agocmake: Use consistent arch names for POWER targets
Matheus Castanho [Tue, 9 Jun 2020 18:25:16 +0000 (15:25 -0300)] 
cmake: Use consistent arch names for POWER targets

The arch detection code used by cmake build exports ppc arch names in an
abbreviated way, e.g. ppc64le instead of powerpc64le. Some parts of
CMakeLists.txt are using the longer form instead, which will not
properly match the desired subarch as expected. Switch to using the
longer form everywhere for consistency with 'configure' script and with
arch names obtained when running under QEMU.

5 years agoDo not set s->prev_length in deflate_medium, it is previously set in lm_init already.
Nathan Moinvaziri [Wed, 10 Jun 2020 06:00:36 +0000 (23:00 -0700)] 
Do not set s->prev_length in deflate_medium, it is previously set in lm_init already.

5 years agoDon't set bflush to zero since it is assigned before used.
Nathan Moinvaziri [Wed, 10 Jun 2020 05:58:18 +0000 (22:58 -0700)] 
Don't set bflush to zero since it is assigned before used.

5 years agoDon't need to set s->match_length to zero in deflate_huff.
Nathan Moinvaziri [Fri, 5 Jun 2020 00:31:40 +0000 (17:31 -0700)] 
Don't need to set s->match_length to zero in deflate_huff.

5 years agoUse local variable to store match_len in deflate_rle.
Nathan Moinvaziri [Fri, 5 Jun 2020 00:30:50 +0000 (17:30 -0700)] 
Use local variable to store match_len in deflate_rle.

5 years agoOnly set current_match to literal if hash_head == 0.
Nathan Moinvaziri [Thu, 4 Jun 2020 19:57:24 +0000 (12:57 -0700)] 
Only set current_match to literal if hash_head == 0.

5 years agoFixed whitespace in deflate_quick.
Nathan Moinvaziri [Thu, 4 Jun 2020 18:20:38 +0000 (11:20 -0700)] 
Fixed whitespace in deflate_quick.

5 years agoUse local variable to store match_len in deflate_fast.
Nathan Moinvaziri [Thu, 4 Jun 2020 18:19:24 +0000 (11:19 -0700)] 
Use local variable to store match_len in deflate_fast.

5 years agoMove check for hash_head != 0 directly after quick_insert_string.
Nathan Moinvaziri [Thu, 4 Jun 2020 18:17:04 +0000 (11:17 -0700)] 
Move check for hash_head != 0 directly after quick_insert_string.