[PATCH 2/2] lib/zstd: mark some internal functions as static with ZSTD_STATIC

From: Adeodato SimÃ
Date: Wed Nov 14 2018 - 19:27:31 EST


Use ZSTD_STATIC instead of vanilla static because the functions are
actually unused, and the macro adds the unused attribute.

This silences -Wmissing-prototypes when defining.

Signed-off-by: Adeodato Simà <dato@xxxxxxxxxxxxxx>
---
I separated these two functions into a separate patch because they
are actually unused.

If you'd rather have them removed, we may do that as well.

Note that the ZSTD_STATIC macro adds the unused attribute in addition
to static, but it adds __inline as well.

lib/zstd/compress.c | 2 +-
lib/zstd/fse_compress.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/zstd/compress.c b/lib/zstd/compress.c
index 3eee699e1fd6..c572d064775f 100644
--- a/lib/zstd/compress.c
+++ b/lib/zstd/compress.c
@@ -431,7 +431,7 @@ static void ZSTD_reduceIndex(ZSTD_CCtx *zc, const U32 reducerValue)

/* See doc/zstd_compression_format.md for detailed format description */

-size_t ZSTD_noCompressBlock(void *dst, size_t dstCapacity, const void *src, size_t srcSize)
+ZSTD_STATIC size_t ZSTD_noCompressBlock(void *dst, size_t dstCapacity, const void *src, size_t srcSize)
{
if (srcSize + ZSTD_blockHeaderSize > dstCapacity)
return ERROR(dstSize_tooSmall);
diff --git a/lib/zstd/fse_compress.c b/lib/zstd/fse_compress.c
index ef3d1741d532..05a148eabd09 100644
--- a/lib/zstd/fse_compress.c
+++ b/lib/zstd/fse_compress.c
@@ -474,7 +474,7 @@ size_t FSE_count_wksp(unsigned *count, unsigned *maxSymbolValuePtr, const void *
`FSE_symbolCompressionTransform symbolTT[maxSymbolValue+1];` // This size is variable
Allocation is manual (C standard does not support variable-size structures).
*/
-size_t FSE_sizeof_CTable(unsigned maxSymbolValue, unsigned tableLog)
+ZSTD_STATIC size_t FSE_sizeof_CTable(unsigned maxSymbolValue, unsigned tableLog)
{
if (tableLog > FSE_MAX_TABLELOG)
return ERROR(tableLog_tooLarge);
--
2.19.1