From: Yann Collet Date: Sun, 1 Oct 2017 18:32:38 +0000 (-0700) Subject: added comment on ZSTD_COMPRESSBOUND() X-Git-Tag: v1.3.2~3^2~13^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5db19b8685e4287de4a3231f31c4bf0e649783db;p=thirdparty%2Fzstd.git added comment on ZSTD_COMPRESSBOUND() as requested by @terrelln --- diff --git a/lib/zstd.h b/lib/zstd.h index 02491ed40..4e225bb5e 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)>>8) + (((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)) /* 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 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 */