Code replicated in compression and decompression moved to shared headers

`CHECK_F` macro moved to `error_private.h` (shared between `fse_compress.c` and `fse_decompress.c`). `ZSTD_limitCopy()` moved to `zstd_internal.h` (shared between `zstd_compress.c` and `zstd_decompress.c`). Erroneous build artefact `zstd.h` removed from repo.
This commit is contained in:
Carl Woffenden
2020-04-07 11:02:06 +02:00
parent 88da79b42e
commit edd9a07322
8 changed files with 13 additions and 2085 deletions
+8
View File
@@ -248,6 +248,14 @@ void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e
}
}
MEM_STATIC size_t ZSTD_limitCopy(void* dst, size_t dstCapacity, const void* src, size_t srcSize)
{
size_t const length = MIN(dstCapacity, srcSize);
if (length > 0) {
memcpy(dst, src, length);
}
return length;
}
/*-*******************************************
* Private declarations