summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2016-11-21 23:00:50 (GMT)
committerYann Collet <cyan@fb.com>2016-11-21 23:00:50 (GMT)
commit2fe3aa9854ef761bb66b109d623b18b9bad91a67 (patch)
tree8585e8596213e75609a55854bb3ce0e9233045e9 /examples
parent742f2b683e948d837aff607a2cfff6f67b039f54 (diff)
downloadlz4-2fe3aa9854ef761bb66b109d623b18b9bad91a67.zip
lz4-2fe3aa9854ef761bb66b109d623b18b9bad91a67.tar.gz
lz4-2fe3aa9854ef761bb66b109d623b18b9bad91a67.tar.bz2
added examples to make all
Diffstat (limited to 'examples')
-rw-r--r--examples/HCStreaming_ringBuffer.c7
-rw-r--r--examples/blockStreaming_ringBuffer.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/examples/HCStreaming_ringBuffer.c b/examples/HCStreaming_ringBuffer.c
index cfae9d7..a9c00f4 100644
--- a/examples/HCStreaming_ringBuffer.c
+++ b/examples/HCStreaming_ringBuffer.c
@@ -68,8 +68,9 @@ void test_compress(FILE* outFp, FILE* inpFp)
if (0 == inpBytes) break;
{
- char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)];
- const int cmpBytes = LZ4_compressHC_continue(lz4Stream, inpPtr, cmpBuf, inpBytes);
+#define CMPBUFSIZE (LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES))
+ char cmpBuf[CMPBUFSIZE];
+ const int cmpBytes = LZ4_compress_HC_continue(lz4Stream, inpPtr, cmpBuf, inpBytes, CMPBUFSIZE);
if(cmpBytes <= 0) break;
write_int32(outFp, cmpBytes);
@@ -97,7 +98,7 @@ void test_decompress(FILE* outFp, FILE* inpFp)
for(;;)
{
int cmpBytes = 0;
- char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)];
+ char cmpBuf[CMPBUFSIZE];
{
const size_t r0 = read_int32(inpFp, &cmpBytes);
diff --git a/examples/blockStreaming_ringBuffer.c b/examples/blockStreaming_ringBuffer.c
index beb5e66..697d342 100644
--- a/examples/blockStreaming_ringBuffer.c
+++ b/examples/blockStreaming_ringBuffer.c
@@ -64,8 +64,9 @@ void test_compress(FILE* outFp, FILE* inpFp)
if (0 == inpBytes) break;
{
- char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)];
- const int cmpBytes = LZ4_compress_continue(lz4Stream, inpPtr, cmpBuf, inpBytes);
+#define CMPBUFSIZE (LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES))
+ char cmpBuf[CMPBUFSIZE];
+ const int cmpBytes = LZ4_compress_fast_continue(lz4Stream, inpPtr, cmpBuf, inpBytes, CMPBUFSIZE, 0);
if(cmpBytes <= 0) break;
write_int32(outFp, cmpBytes);
write_bin(outFp, cmpBuf, cmpBytes);
@@ -90,7 +91,7 @@ void test_decompress(FILE* outFp, FILE* inpFp)
for(;;) {
int cmpBytes = 0;
- char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)];
+ char cmpBuf[CMPBUFSIZE];
{
const size_t r0 = read_int32(inpFp, &cmpBytes);