]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
change return type to ULL
authorshakeelrao <shakeelrao79@gmail.com>
Thu, 28 Feb 2019 09:52:01 +0000 (01:52 -0800)
committershakeelrao <shakeelrao79@gmail.com>
Thu, 28 Feb 2019 09:52:01 +0000 (01:52 -0800)
doc/zstd_manual.html
lib/decompress/zstd_decompress.c
lib/zstd.h
tests/fuzzer.c

index a11a958922945d06c4e7fa06d9df6ddb2f82c07b..426c6cf2436e1ede1c42dfa2c9a197d0aef0d9c2 100644 (file)
@@ -127,11 +127,11 @@ unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);
 </p></pre><BR>
 
 <h3>Helper functions</h3><pre></pre><b><pre>#define ZSTD_COMPRESSBOUND(srcSize)   ((srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) </b>/* margin, from 64 to 0 */ : 0))  /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */<b>
-size_t      ZSTD_compressBound(size_t srcSize);                    </b>/*!< maximum compressed size in worst case single-pass scenario */<b>
-size_t      ZSTD_decompressBound(const void* src, size_t srcSice); </b>/*!< maximum decompressed size of the compressed source */<b>
-unsigned    ZSTD_isError(size_t code);                             </b>/*!< tells if a `size_t` function result is an error code */<b>
-const char* ZSTD_getErrorName(size_t code);                        </b>/*!< provides readable string from an error code */<b>
-int         ZSTD_maxCLevel(void);                                  </b>/*!< maximum compression level available */<b>
+size_t             ZSTD_compressBound(size_t srcSize);                    </b>/*!< maximum compressed size in worst case single-pass scenario */<b>
+unsigned long long ZSTD_decompressBound(const void* src, size_t srcSice); </b>/*!< maximum decompressed size of the compressed source */<b>
+unsigned           ZSTD_isError(size_t code);                             </b>/*!< tells if a `size_t` function result is an error code */<b>
+const char*        ZSTD_getErrorName(size_t code);                        </b>/*!< provides readable string from an error code */<b>
+int                ZSTD_maxCLevel(void);                                  </b>/*!< maximum compression level available */<b>
 </pre></b><BR>
 <a name="Chapter5"></a><h2>Explicit context</h2><pre></pre>
 
index a1f656ea4c34e66a2a220dddb92a17b1cb2a65e7..6d56b08c845e6718f09054ffbc5f2fafee4a5519 100644 (file)
@@ -503,9 +503,9 @@ size_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize)
  *  `srcSize` must be at least as large as the frame contained
  *  @return : maximum decompressed size of the compressed source
  */
-size_t ZSTD_decompressBound(const void* src, size_t srcSize)
+unsigned long long ZSTD_decompressBound(const void* src, size_t srcSize)
 {
-    size_t totalDstSize = 0;
+    unsigned long long totalDstSize = 0;
 #if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
     if (ZSTD_isLegacy(src, srcSize))
         return ERROR(version_unsupported);
index 31341101773757206fa638fac51832d8afb1b51b..4d764680e981e61581f3c0d893a9cb689ba8dd17 100644 (file)
@@ -148,11 +148,11 @@ ZSTDLIB_API unsigned long long ZSTD_getDecompressedSize(const void* src, size_t
 
 /*======  Helper functions  ======*/
 #define ZSTD_COMPRESSBOUND(srcSize)   ((srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0))  /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */
-ZSTDLIB_API size_t      ZSTD_compressBound(size_t srcSize);                    /*!< maximum compressed size in worst case single-pass scenario */
-ZSTDLIB_API size_t      ZSTD_decompressBound(const void* src, size_t srcSice); /*!< maximum decompressed size of the compressed source */
-ZSTDLIB_API unsigned    ZSTD_isError(size_t code);                             /*!< tells if a `size_t` function result is an error code */
-ZSTDLIB_API const char* ZSTD_getErrorName(size_t code);                        /*!< provides readable string from an error code */
-ZSTDLIB_API int         ZSTD_maxCLevel(void);                                  /*!< maximum compression level available */
+ZSTDLIB_API size_t             ZSTD_compressBound(size_t srcSize);                    /*!< maximum compressed size in worst case single-pass scenario */
+ZSTDLIB_API unsigned long long ZSTD_decompressBound(const void* src, size_t srcSice); /*!< maximum decompressed size of the compressed source */
+ZSTDLIB_API unsigned           ZSTD_isError(size_t code);                             /*!< tells if a `size_t` function result is an error code */
+ZSTDLIB_API const char*        ZSTD_getErrorName(size_t code);                        /*!< provides readable string from an error code */
+ZSTDLIB_API int                ZSTD_maxCLevel(void);                                  /*!< maximum compression level available */
 
 
 /***************************************
index 00e7f5442a8aa7da95ae1583c6a39f0d0b7ef33d..c64fff8839037727320daf59e421370d2350276c 100644 (file)
@@ -378,14 +378,7 @@ static int basicUnitTests(U32 seed, double compressibility)
 
     DISPLAYLEVEL(3, "test%3i : tight ZSTD_decompressBound test : ", testNb++);
     {
-        size_t bound = ZSTD_decompressBound(compressedBuffer, cSize);
-        if (bound != CNBuffSize) goto _output_error;
-    }
-    DISPLAYLEVEL(3, "OK \n");
-
-    DISPLAYLEVEL(3, "test%3i : ZSTD_decompressBound test missing Frame_Content_Size : ", testNb++);
-    {
-        size_t bound = ZSTD_decompressBound(compressedBuffer, cSize);
+        unsigned long long bound = ZSTD_decompressBound(compressedBuffer, cSize);
         if (bound != CNBuffSize) goto _output_error;
     }
     DISPLAYLEVEL(3, "OK \n");