]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed silent conversion warnings in GZDECOMPRESS path
authorYann Collet <cyan@fb.com>
Fri, 3 Feb 2017 01:12:50 +0000 (17:12 -0800)
committerYann Collet <cyan@fb.com>
Fri, 3 Feb 2017 01:12:50 +0000 (17:12 -0800)
programs/fileio.c

index 960c6e3d9bcbb2ce23f2c34b086157797edcddc4..5b9c91bc49f2b8be373be8638d74c99a6a9cef10 100644 (file)
@@ -743,8 +743,8 @@ static unsigned long long FIO_decompressGzFrame(dRess_t* ress, FILE* srcFile, co
     if (inflateInit2(&strm, 15 /* maxWindowLogSize */ + 16 /* gzip only */) != Z_OK) return 0;  /* see http://www.zlib.net/manual.html */
 
     strm.next_out = ress->dstBuffer;
-    strm.avail_out = ress->dstBufferSize;
-    strm.avail_in = ress->srcBufferLoaded;
+    strm.avail_out = (uInt)ress->dstBufferSize;
+    strm.avail_in = (uInt)ress->srcBufferLoaded;
     strm.next_in = (z_const unsigned char*)ress->srcBuffer;
 
     for ( ; ; ) {
@@ -753,7 +753,7 @@ static unsigned long long FIO_decompressGzFrame(dRess_t* ress, FILE* srcFile, co
             ress->srcBufferLoaded = fread(ress->srcBuffer, 1, ress->srcBufferSize, srcFile);
             if (ress->srcBufferLoaded == 0) break;
             strm.next_in = (z_const unsigned char*)ress->srcBuffer;
-            strm.avail_in = ress->srcBufferLoaded;
+            strm.avail_in = (uInt)ress->srcBufferLoaded;
         }
         ret = inflate(&strm, Z_NO_FLUSH);
         if (ret != Z_OK && ret != Z_STREAM_END) { DISPLAY("zstd: %s: inflate error %d \n", srcFileName, ret); return 0; }
@@ -762,7 +762,7 @@ static unsigned long long FIO_decompressGzFrame(dRess_t* ress, FILE* srcFile, co
                 if (fwrite(ress->dstBuffer, 1, decompBytes, ress->dstFile) != decompBytes) EXM_THROW(31, "Write error : cannot write to output file");
                 outFileSize += decompBytes;
                 strm.next_out = ress->dstBuffer;
-                strm.avail_out = ress->dstBufferSize;
+                strm.avail_out = (uInt)ress->dstBufferSize;
             }
         }
         if (ret == Z_STREAM_END) break;