Commit Graph

103 Commits

Author SHA1 Message Date
Yann Collet
e2e8d9b06b rename USERCFLAGS for consistency 2023-12-24 16:07:10 -08:00
Yann Collet
631cd0f6fd minor adjustments for examples/Makefile 2023-12-23 13:22:41 -08:00
Yann Collet
6bdfc56c9a fix minor conversion warnings on macos 2023-12-22 20:11:12 -08:00
Yann Collet
8586d6a1b2 fix example for low resolution timers 2023-09-26 12:56:56 -07:00
Yann Collet
65d3772592 fix minor c++ compat warning 2023-09-26 12:56:56 -07:00
Yann Collet
67532ae3c5 fix examples
streamlined Makefile.
avoid usage of -lrt (problematic for portability).
now bench_functions (renamed) can be part of `make test`.

fix #1276
2023-09-26 12:56:56 -07:00
Takayuki Matsuoka
ccef95b821 fix: issue #1248
Fix issue #1248, reported by @BojackMa.
2023-07-11 18:17:11 +09:00
Dimitri Papadopoulos
13c508ea15
Discard trailing spaces 2023-06-25 17:43:56 +02:00
Dominique Pelle
3347485307 fix: various typos 2022-07-31 17:47:00 +02:00
Yann Collet
4da5c4dd30
Merge pull request #1094 from alexmohr/add-uncompressed-api
frame-api: add function to insert uncomressed data
2022-07-05 15:07:36 -07:00
Alexander Mohr
5c7382798e
review: Fix review findings
This commit fixes the review findings

Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
2022-06-10 06:37:57 +00:00
Alexander Mohr
4aeb5020c3
frame-api: add method to insert uncomressed data
new method `uncompressed_update` allows to insert blocks without
compression into the lz4 stream.
The usage is documented in the frameCompress example

Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
2022-06-09 17:08:01 +02:00
Qi Wang
51be2943b3
docs: fix some typo
Signed-off-by: Qi Wang <wangqi@linux.alibaba.com>
2022-06-06 10:29:37 +08:00
anjiahao
f5625f260e add file operation and examples
operate lz4 compressed files as a general files

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-03-10 13:28:34 +08:00
Dimitri Papadopoulos
4bdfb08b95
Fix typos found by codespell 2021-11-25 15:32:37 +01:00
Takayuki Matsuoka
2fbf12add7 Add C++ compatibility test for examples/ 2021-09-07 01:03:04 +09:00
Takayuki Matsuoka
1b0a501a19 Add cast operator for compatibility with C++ 2021-09-07 01:02:23 +09:00
kmou424
a3960899f4 examples: simple_buffer: We must explicit convert pointer after malloc in c++
Aim: To adapt C++

Compilation errors:
simple_buffer.c:47:9: error: cannot initialize a variable of type 'char *' with an rvalue of type 'void *'
  char* compressed_data = malloc((size_t)max_dst_size);
        ^                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simple_buffer.c:76:15: error: cannot initialize a variable of type 'char *const' with an rvalue of type 'void *'
  char* const regen_buffer = malloc(src_size);
              ^              ~~~~~~~~~~~~~~~~
2 errors generated.
2021-09-05 02:52:57 +08:00
a1346054
eb23590d13 fix spelling 2021-08-21 20:50:38 +00:00
Takayuki Matsuoka
28cb94f53a Fix -Wshorten-64-to-32 warning
Fix -Wshorten-64-to-32 warning

The following CI test (macOS) reports "-Wshorten-64-to-32" warning

make V=1 clean test MOREFLAGS='-Werror -Wconversion -Wno-sign-conversion'

```
blockStreaming_lineByLine.c:68:54: error: implicit conversion loses integer precision: 'const size_t' (aka 'const unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
                lz4Stream, inpPtr, cmpBuf, inpBytes, cmpBufBytes, 1);
                                                     ^~~~~~~~~~~
```
2021-05-30 16:49:24 +09:00
Takayuki Matsuoka
4a9bbc2480 Fix -Wshorten-64-to-32 warning 2021-05-27 21:12:39 +09:00
Yann Collet
87a80acbe7 updated license & header dates 2020-11-25 14:45:14 -08:00
Yann Collet
0760724577 update doc 2020-11-15 01:31:09 -08:00
Andrew Martin
059682fb01
Fix typos in streaming_api_basics.md 2019-11-30 06:58:54 -05:00
Yann Collet
28964f4bea fixed #778
fixed assert() when divisor == 0
2019-08-21 13:44:24 +02:00
Yann Collet
f1e8e806e0 keep the "lorem ipsum" topic of the example string
but make it compressible
2019-07-11 17:29:16 -07:00
Hamid Zare
771a7192d6 print the compression ratio 2019-07-11 14:39:29 -07:00
Hamid Zare
658ab8fca1 changed the input text to something more compression friendly 2019-07-11 14:35:51 -07:00
Amine Choukir
0e6ff83d09
Update blockStreaming_doubleBuffer.md 2019-07-03 11:50:38 +02:00
Yann Collet
3b917ef6e6 travisCI: added ASAN fuzzer tests
and fixed minor formatting warnings
2019-06-28 20:55:47 -07:00
Yann Collet
798301b4e1 update simple_buffer example
there were a few tiny inaccuracies, especially in error conditions.
2019-06-06 14:17:44 -07:00
JPeterMugaas
b48f823f90 Try to put some tests I made in ONE place. I also moved a test for "install" in one place to try to isolate it. 2019-04-22 15:48:48 -04:00
JPeterMugaas
773b66547f Initial commits from diff I submitted earlier 2019-04-22 13:48:59 -04:00
Yann Collet
2ece0d8380 created LZ4_initStream()
- promoted LZ4_resetStream_fast() to stable
- moved LZ4_resetStream() into deprecate, but without triggering a compiler warning
- update all sources to no longer rely on LZ4_resetStream()

note : LZ4_initStream() proposal is slightly different :
it's able to initialize any buffer, provided that it's large enough.
To this end, it accepts a void*, and returns an LZ4_stream_t*.
2019-04-05 12:56:26 -07:00
Yann Collet
7a39fb8fb6 make _fast*() decoder generate a deprecation warning
updated modification
2019-04-04 12:47:36 -07:00
Yann Collet
b2215f2a89 tried to clean another bunch of cppcheck warnings
so "funny" thing with cppcheck
is that no 2 versions give the same list of warnings.

On Mac, I'm using v1.81, which had all warnings fixed.
On Travis CI, it's v1.61, and it complains about a dozen more/different things.
On Linux, it's v1.72, and it finds a completely different list of a half dozen warnings.

Some of these seems to be bugs/limitations in cppcheck itself.
The TravisCI version v1.61 seems unable to understand %zu correctly, and seems to assume it means %u.
2018-09-19 12:12:49 -07:00
Yann Collet
697bd904b2 fixed minor cppcheck warnings in examples 2018-09-18 16:30:31 -07:00
Yann Collet
86023f01f2 avoid final trailing comma for enum lists
as detected in #485 by @JoachimSchneider.

Refactored the c_standards tests
so that these issues get automatically detected in CI tests.
2018-09-13 14:29:41 -07:00
Yann Collet
858b6ad7f3 frameCompress : added an error detection case
check for potential input data not consumed.
2018-09-05 16:45:46 -07:00
Yann Collet
0d1ced5b0c Merge branch 'dev' into lz4f_init 2018-09-05 16:43:46 -07:00
Yann Collet
b2e56d82bf Introduced constants LZ4F_INIT_*
to simplify initialization of lz4frame.h structures.
Partially in response to #546.
2018-09-05 16:06:37 -07:00
Cedric De Brito
98c0c7cf9d Fix bug in frame decompress example
The decompression was failing as the srcEnd pointer in
decompress_file_internal was wrongly computed beyond
the end of the memory block.
We need to account for the fact that the header ("info")
was already read in the calling function ("alreadyConsumed").
2018-07-02 14:35:04 +02:00
Yann Collet
0fb3a3b199 fixed a number of minor cast warnings 2018-04-26 18:08:28 -07:00
Yann Collet
550b40849f merge lz4opt.h into lz4hc.c
Having a dedicated file for optimal parser
made sense during its creation,
it allowed Przemyslaw to work more freely on lz4opt, with less dependency on lz4hc,
moreover, the optimal parser was more complex, with its own search functions.

Since the optimal was rewritten last year, it's now a lot lighter.
It makes more sense now to integrate it directly inside lz4hc.c,
making it easier to edit (editors are a bit "lost" inside a `*.h` dependent on its #include position),
it also reduces the number of files in the project,
which fits pretty well with lz4 objectives.
(adding lz4hc requires "just" lz4hc.h and lz4hc.c).
2018-02-25 00:32:09 -08:00
Yann Collet
3ce289bcce modified decompression part of frameCompress.c
using same logic as prior modifications for compression part.
2018-02-01 02:48:20 -08:00
Yann Collet
25efdd80c5 refactored ressource allocation to avoid goto 2018-02-01 01:38:14 -08:00
Yann Collet
886a485845 examples/Makefile : changed dependency order
static library *.a must come after source files *.c on linux
2018-01-31 23:17:52 -08:00
Yann Collet
b515ae9c99 refactored frameCompress.c example code
compression function returns a struct.
Also : nested structure ressources->computation
to make it easier to manage multiple exit points.
2018-01-31 16:39:37 -08:00
Yann Collet
ff3c67fdb2 fixed read size, as noticed by @terrelln 2018-01-31 16:13:02 -08:00
Yann Collet
1acca240a9 ensure proper dependencies are built for /examples
also : use liblz4.a static lib to share compilation time
2018-01-31 16:11:45 -08:00