Add cast operator for compatibility with C++

This commit is contained in:
Takayuki Matsuoka 2021-09-07 01:02:23 +09:00
parent d2334731c3
commit 1b0a501a19

View File

@ -78,7 +78,7 @@ void test_compress(FILE* outFp, FILE* inpFp, void *dict, int dictSize)
} }
/* Forget previously compressed data and load the dictionary */ /* Forget previously compressed data and load the dictionary */
LZ4_loadDict(lz4Stream, dict, dictSize); LZ4_loadDict(lz4Stream, (const char*) dict, dictSize);
{ {
char cmpBuf[LZ4_COMPRESSBOUND(BLOCK_BYTES)]; char cmpBuf[LZ4_COMPRESSBOUND(BLOCK_BYTES)];
const int cmpBytes = LZ4_compress_fast_continue( const int cmpBytes = LZ4_compress_fast_continue(
@ -153,7 +153,7 @@ void test_decompress(FILE* outFp, FILE* inpFp, void *dict, int dictSize, int off
} }
/* Load the dictionary */ /* Load the dictionary */
LZ4_setStreamDecode(lz4StreamDecode, dict, dictSize); LZ4_setStreamDecode(lz4StreamDecode, (const char*) dict, dictSize);
{ {
const int decBytes = LZ4_decompress_safe_continue( const int decBytes = LZ4_decompress_safe_continue(
lz4StreamDecode, cmpBuf, decBuf, cmpBytes, BLOCK_BYTES); lz4StreamDecode, cmpBuf, decBuf, cmpBytes, BLOCK_BYTES);