1
0
mirror of https://github.com/facebook/zstd.git synced 2025-04-26 14:49:18 +03:00

17 Commits

Author SHA1 Message Date
Alex Murkoff
75d0f66c87 reverted the addition of free at the gz_init() 2024-04-13 12:51:20 +07:00
Alex Murkoff
1d5e9705db fixed memory leaks and almost all undefined behaviour 2024-04-13 02:24:14 +07:00
Piotr Paweł Stefaniak
71def59890 Fix zlibWrapper build
Just after a clone I'm getting this:

~/zstd/zlibWrapper$ cc -c zstd_zlibwrapper.o gz*.c -lz -lzstd -DSTDC
gzwrite.c: In function ‘gz_write’:
gzwrite.c:226:43: error: ‘z_uInt’ undeclared (first use in this
                         function); did you mean ‘uInt’?
  226 |             state.state->strm.avail_in = (z_uInt)n;
      |                                           ^~~~~~
      |                                           uInt
gzwrite.c:226:43: note: each undeclared identifier is reported only
                        once for each function it appears in
gzwrite.c:226:50: error: expected ‘;’ before ‘n’
  226 |             state.state->strm.avail_in = (z_uInt)n;
      |                                                  ^
      |                                                  ;

z_uInt is never used directly, zconf.h redefines uInt to z_uInt under
the condition that Z_PREFIX is set. All examples use uInt, and the type
of avail_in is also uInt.

In this commit I modify the cast to refer to the same type as the type
of lvalue.

Arguably, the real fix here is to handle possible overflows, but that's
beyond the scope of this commit.
2024-04-07 13:04:26 +02:00
Ed Maste
2ce0290e4d zlibWrapper: convert to C89 / ANSI C
Clang 16 (which is the system compiler in FreeBSD 14.0) no longer allows
K&R function definitions.  Formatting of the changes matches current
zlib.
2023-12-14 08:45:04 -05:00
Danielle Rozenblit
4dffc35f2e Convert references to https from http 2022-12-14 06:58:35 -08:00
orbea
1e09cffd9b
zlibWrapper: Update for zlib 1.2.12 (#3217)
In zlib 1.2.12 the OF macro was changed to _Z_OF breaking any
project that used zlibWrapper. To fix this the OF has been
changed to _Z_OF everywhere and _Z_OF is defined as OF in the
case it is not yet defined for zlib 1.2.11 and older.

Fixes: https://github.com/facebook/zstd/issues/3216
2022-07-29 12:22:10 -07:00
Yann Collet
cb18fffe65 enforce C90 compatibility for zlibWrapper 2019-09-24 17:50:58 -07:00
Yann Collet
da55865e47 ensure dependency for zlib wrapper 2018-08-15 16:43:13 -07:00
Yann Collet
32fb407c9d updated a bunch of headers
for the new license
2017-08-18 16:52:05 -07:00
Przemyslaw Skibinski
957a6d596b updated link to copyright notice 2017-01-18 19:04:00 +01:00
Przemyslaw Skibinski
c3a04deda2 fixed clang warnings in gzread.c and gzwrite.c 2017-01-18 14:36:10 +01:00
Przemyslaw Skibinski
3805a00904 gzwrite.c updated to zlib 1.2.11 2017-01-18 12:47:32 +01:00
Yann Collet
9ceb49e097 fixed zlib_wrapper conversion warnings 2016-12-22 15:26:33 +01:00
Przemyslaw Skibinski
622d741a67 updated zlib copyright notice 2016-12-13 19:44:07 +01:00
Przemyslaw Skibinski
f0d7da79de updated headers in gz* files 2016-11-29 18:02:34 +01:00
Przemyslaw Skibinski
0feb24a2fa gzread.c, gzwrite.c: gz_statep is union 2016-11-29 16:05:52 +01:00
Przemyslaw Skibinski
3bf9a72d95 experimental support for gz* functions 2016-11-24 18:26:30 +01:00