]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[trace] Minor fixes found during integration 2496/head
authorNick Terrell <terrelln@fb.com>
Fri, 12 Feb 2021 00:20:04 +0000 (16:20 -0800)
committerNick Terrell <terrelln@fb.com>
Fri, 12 Feb 2021 00:20:04 +0000 (16:20 -0800)
* Mark `ZSTD_CCtx_getParameter()` as const
* Add `extern "C"` guards to `zstd_trace.h`

lib/common/zstd_trace.h
lib/compress/zstd_compress.c
lib/zstd.h

index f2fa7f79e66f831f1af63b009d0068c586edb9c2..487617cf6341f369163c655d0690567c68c9e057 100644 (file)
 #ifndef ZSTD_TRACE_H
 #define ZSTD_TRACE_H
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 #include <stddef.h>
 
 /* weak symbol support */
@@ -141,4 +145,8 @@ void ZSTD_trace_decompress_end(
 
 #endif /* ZSTD_TRACE */
 
+#if defined (__cplusplus)
+}
+#endif
+
 #endif /* ZSTD_TRACE_H */
index ac11c3ddba7681d2d03824aadb3cb1f4b61b276c..5b054a72ea1b1602ca58860763ddcc3ef202d66a 100644 (file)
@@ -797,7 +797,7 @@ size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* CCtxParams,
     }
 }
 
-size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value)
+size_t ZSTD_CCtx_getParameter(ZSTD_CCtx const* cctx, ZSTD_cParameter param, int* value)
 {
     return ZSTD_CCtxParams_getParameter(&cctx->requestedParams, param, value);
 }
index 230adee34bcd270fa221ff054f56165924718e73..64265f68286dfa5cde1f320ce0ddc5591d2f1cf6 100644 (file)
@@ -1837,7 +1837,7 @@ ZSTDLIB_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* pre
  *  and store it into int* value.
  * @return : 0, or an error code (which can be tested with ZSTD_isError()).
  */
-ZSTDLIB_API size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value);
+ZSTDLIB_API size_t ZSTD_CCtx_getParameter(const ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value);
 
 
 /*! ZSTD_CCtx_params :