summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2019-04-05 19:54:13 (GMT)
committerYann Collet <cyan@fb.com>2019-04-05 19:56:26 (GMT)
commit2ece0d83809849e68e9c194ff3d340982b527256 (patch)
tree2f2692d37b98224bef70a1184c8511555e66b5f2 /examples
parent2a94faf462c53feb864c4ae4e857c4870a948da0 (diff)
downloadlz4-2ece0d83809849e68e9c194ff3d340982b527256.zip
lz4-2ece0d83809849e68e9c194ff3d340982b527256.tar.gz
lz4-2ece0d83809849e68e9c194ff3d340982b527256.tar.bz2
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*.
Diffstat (limited to 'examples')
-rw-r--r--examples/blockStreaming_doubleBuffer.c2
-rw-r--r--examples/dictionaryRandomAccess.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/blockStreaming_doubleBuffer.c b/examples/blockStreaming_doubleBuffer.c
index acb3455..3f719d3 100644
--- a/examples/blockStreaming_doubleBuffer.c
+++ b/examples/blockStreaming_doubleBuffer.c
@@ -44,7 +44,7 @@ void test_compress(FILE* outFp, FILE* inpFp)
char inpBuf[2][BLOCK_BYTES];
int inpBufIndex = 0;
- LZ4_resetStream(lz4Stream);
+ LZ4_initStream(lz4Stream, sizeof (*lz4Stream));
for(;;) {
char* const inpPtr = inpBuf[inpBufIndex];
diff --git a/examples/dictionaryRandomAccess.c b/examples/dictionaryRandomAccess.c
index 291fd08..ecb3b2d 100644
--- a/examples/dictionaryRandomAccess.c
+++ b/examples/dictionaryRandomAccess.c
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include <string.h>
-#define MIN(x, y) (x) < (y) ? (x) : (y)
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
enum {
BLOCK_BYTES = 1024, /* 1 KiB of uncompressed data in a block */
@@ -63,7 +63,7 @@ void test_compress(FILE* outFp, FILE* inpFp, void *dict, int dictSize)
int *offsetsEnd = offsets;
- LZ4_resetStream(lz4Stream);
+ LZ4_initStream(lz4Stream, sizeof(*lz4Stream));
/* Write header magic */
write_bin(outFp, kTestMagic, sizeof(kTestMagic));