From: Yann Collet Date: Sat, 30 Sep 2017 22:34:44 +0000 (-0700) Subject: macro compatible with scenario where windowSize = 1024 (minimum) X-Git-Tag: v1.3.2~3^2~13^2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76ac0b2d999b0d0d47a2ef3078a2d8cf4dea1080;p=thirdparty%2Fzstd.git macro compatible with scenario where windowSize = 1024 (minimum) --- diff --git a/lib/zstd.h b/lib/zstd.h index 5f3c0585f..02491ed40 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -131,7 +131,7 @@ ZSTDLIB_API unsigned long long ZSTD_getDecompressedSize(const void* src, size_t /*====== Helper functions ======*/ -#define ZSTD_COMPRESSBOUND(srcSize) ((srcSize) + ((srcSize)>>9) + (((srcSize) < 128 KB) ? ((128 KB - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0)) +#define ZSTD_COMPRESSBOUND(srcSize) ((srcSize) + ((srcSize)>>8) + (((srcSize) < 128 KB) ? ((128 KB - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0)) ZSTDLIB_API size_t ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case scenario */ 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 */