Update vendored libs
This commit is contained in:
42
vendor/github.com/DataDog/zstd/zstd_legacy.h
generated
vendored
42
vendor/github.com/DataDog/zstd/zstd_legacy.h
generated
vendored
@@ -1,6 +1,5 @@
|
||||
#ifndef USE_EXTERNAL_ZSTD
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under both the BSD-style license (found in the
|
||||
@@ -125,20 +124,6 @@ MEM_STATIC size_t ZSTD_decompressLegacy(
|
||||
const void* dict,size_t dictSize)
|
||||
{
|
||||
U32 const version = ZSTD_isLegacy(src, compressedSize);
|
||||
char x;
|
||||
/* Avoid passing NULL to legacy decoding. */
|
||||
if (dst == NULL) {
|
||||
assert(dstCapacity == 0);
|
||||
dst = &x;
|
||||
}
|
||||
if (src == NULL) {
|
||||
assert(compressedSize == 0);
|
||||
src = &x;
|
||||
}
|
||||
if (dict == NULL) {
|
||||
assert(dictSize == 0);
|
||||
dict = &x;
|
||||
}
|
||||
(void)dst; (void)dstCapacity; (void)dict; (void)dictSize; /* unused when ZSTD_LEGACY_SUPPORT >= 8 */
|
||||
switch(version)
|
||||
{
|
||||
@@ -257,13 +242,6 @@ MEM_STATIC ZSTD_frameSizeInfo ZSTD_findFrameSizeInfoLegacy(const void *src, size
|
||||
frameSizeInfo.compressedSize = ERROR(srcSize_wrong);
|
||||
frameSizeInfo.decompressedBound = ZSTD_CONTENTSIZE_ERROR;
|
||||
}
|
||||
/* In all cases, decompressedBound == nbBlocks * ZSTD_BLOCKSIZE_MAX.
|
||||
* So we can compute nbBlocks without having to change every function.
|
||||
*/
|
||||
if (frameSizeInfo.decompressedBound != ZSTD_CONTENTSIZE_ERROR) {
|
||||
assert((frameSizeInfo.decompressedBound & (ZSTD_BLOCKSIZE_MAX - 1)) == 0);
|
||||
frameSizeInfo.nbBlocks = (size_t)(frameSizeInfo.decompressedBound / ZSTD_BLOCKSIZE_MAX);
|
||||
}
|
||||
return frameSizeInfo;
|
||||
}
|
||||
|
||||
@@ -302,12 +280,6 @@ MEM_STATIC size_t ZSTD_freeLegacyStreamContext(void* legacyContext, U32 version)
|
||||
MEM_STATIC size_t ZSTD_initLegacyStream(void** legacyContext, U32 prevVersion, U32 newVersion,
|
||||
const void* dict, size_t dictSize)
|
||||
{
|
||||
char x;
|
||||
/* Avoid passing NULL to legacy decoding. */
|
||||
if (dict == NULL) {
|
||||
assert(dictSize == 0);
|
||||
dict = &x;
|
||||
}
|
||||
DEBUGLOG(5, "ZSTD_initLegacyStream for v0.%u", newVersion);
|
||||
if (prevVersion != newVersion) ZSTD_freeLegacyStreamContext(*legacyContext, prevVersion);
|
||||
switch(newVersion)
|
||||
@@ -367,16 +339,6 @@ MEM_STATIC size_t ZSTD_initLegacyStream(void** legacyContext, U32 prevVersion, U
|
||||
MEM_STATIC size_t ZSTD_decompressLegacyStream(void* legacyContext, U32 version,
|
||||
ZSTD_outBuffer* output, ZSTD_inBuffer* input)
|
||||
{
|
||||
static char x;
|
||||
/* Avoid passing NULL to legacy decoding. */
|
||||
if (output->dst == NULL) {
|
||||
assert(output->size == 0);
|
||||
output->dst = &x;
|
||||
}
|
||||
if (input->src == NULL) {
|
||||
assert(input->size == 0);
|
||||
input->src = &x;
|
||||
}
|
||||
DEBUGLOG(5, "ZSTD_decompressLegacyStream for v0.%u", version);
|
||||
switch(version)
|
||||
{
|
||||
@@ -451,5 +413,3 @@ MEM_STATIC size_t ZSTD_decompressLegacyStream(void* legacyContext, U32 version,
|
||||
#endif
|
||||
|
||||
#endif /* ZSTD_LEGACY_H */
|
||||
|
||||
#endif /* USE_EXTERNAL_ZSTD */
|
||||
|
||||
Reference in New Issue
Block a user