summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--programs/lz4cli.c2
-rw-r--r--programs/lz4io.c11
-rw-r--r--tests/Makefile1
3 files changed, 8 insertions, 6 deletions
diff --git a/programs/lz4cli.c b/programs/lz4cli.c
index 55f3133..dede834 100644
--- a/programs/lz4cli.c
+++ b/programs/lz4cli.c
@@ -144,7 +144,7 @@ static int usage_advanced(const char* exeName)
DISPLAY( " -l : compress using Legacy format (Linux kernel compression)\n");
DISPLAY( " -B# : Block size [4-7] (default : 7) \n");
DISPLAY( " -BD : Block dependency (improve compression ratio) \n");
- /* DISPLAY( " -BX : enable block checksum (default:disabled)\n"); *//* Option currently inactive */
+ DISPLAY( " -BX : enable block checksum (default:disabled) \n");
DISPLAY( "--no-frame-crc : disable stream checksum (default:enabled) \n");
DISPLAY( "--content-size : compressed frame includes original size (default:not present)\n");
DISPLAY( "--[no-]sparse : sparse mode (default:enabled on file, disabled on stdout)\n");
diff --git a/programs/lz4io.c b/programs/lz4io.c
index 1e6b437..06741b4 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -173,17 +173,17 @@ int LZ4IO_setBlockMode(LZ4IO_blockMode_t blockMode)
return g_blockIndependence;
}
-/* Default setting : no checksum */
-int LZ4IO_setBlockChecksumMode(int xxhash)
+/* Default setting : no block checksum */
+int LZ4IO_setBlockChecksumMode(int enable)
{
- g_blockChecksum = (xxhash != 0);
+ g_blockChecksum = (enable != 0);
return g_blockChecksum;
}
/* Default setting : checksum enabled */
-int LZ4IO_setStreamChecksumMode(int xxhash)
+int LZ4IO_setStreamChecksumMode(int enable)
{
- g_streamChecksum = (xxhash != 0);
+ g_streamChecksum = (enable != 0);
return g_streamChecksum;
}
@@ -455,6 +455,7 @@ static int LZ4IO_compressFilename_extRess(cRess_t ress, const char* srcFileName,
prefs.compressionLevel = compressionLevel;
prefs.frameInfo.blockMode = (LZ4F_blockMode_t)g_blockIndependence;
prefs.frameInfo.blockSizeID = (LZ4F_blockSizeID_t)g_blockSizeId;
+ prefs.frameInfo.blockChecksumFlag = (LZ4F_blockChecksum_t)g_blockChecksum;
prefs.frameInfo.contentChecksumFlag = (LZ4F_contentChecksum_t)g_streamChecksum;
if (g_contentSizeFlag) {
U64 const fileSize = UTIL_getFileSize(srcFileName);
diff --git a/tests/Makefile b/tests/Makefile
index 5d2532f..f00778f 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -263,6 +263,7 @@ test-lz4-basic: lz4 datagen unlz4 lz4cat
$(LZ4) -f tmp
cat tmp >> tmp.lz4
$(LZ4) -f tmp.lz4 # uncompress valid frame followed by invalid data
+ $(LZ4) -BX tmp -c -q | $(LZ4) -tv # test block checksum
@$(RM) tmp*
test-lz4-hugefile: lz4 datagen