]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fixing mixed declaration compiler complaint
authorbimbashrestha <bshrestha.msae@gmail.com>
Mon, 26 Aug 2019 22:00:50 +0000 (15:00 -0700)
committerbimbashrestha <bshrestha.msae@gmail.com>
Mon, 26 Aug 2019 22:00:50 +0000 (15:00 -0700)
lib/compress/zstd_compress.c

index 1bf3657d76f402ecc94e3cebd1e221c0c46d087c..9589b573752bbba8fdfdbc204c06a6f664d4dc76 100644 (file)
@@ -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 &&