From 991cbc9024b11068b0f9340b1f4a85cbfa3c57e2 Mon Sep 17 00:00:00 2001 From: bimbashrestha Date: Mon, 26 Aug 2019 15:00:50 -0700 Subject: [PATCH] Fixing mixed declaration compiler complaint --- lib/compress/zstd_compress.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 1bf3657d..9589b573 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -2284,6 +2284,12 @@ static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc, needs further investigation. */ const U32 rleMaxLength = 25; + /* + We don't want to emit our first block as a RLE even if it qualifies because + doing so will cause the decoder to throw a "should consume all input error." + https://github.com/facebook/zstd/blob/dev/programs/fileio.c#L1723 + */ + U32 isFirstBlock = zc->inBuffPos == srcSize; size_t cSize; const BYTE* ip = (const BYTE*)src; BYTE* op = (BYTE*)dst; @@ -2305,13 +2311,6 @@ static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc, zc->entropyWorkspace, HUF_WORKSPACE_SIZE /* statically allocated in resetCCtx */, zc->bmi2); - /* - We don't want to emit our first block as a RLE even if it qualifies because - doing so will cause the decoder to throw a "should consume all input error." - https://github.com/facebook/zstd/blob/dev/programs/fileio.c#L1723 - */ - U32 isFirstBlock = zc->inBuffPos == srcSize; - if (frame && !isFirstBlock && cSize < rleMaxLength &&