From 7a3a49e99bd90579e102eb5fc1a97510fc6ad5ea Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 7 Jan 2021 18:18:15 +0100 Subject: [PATCH] reverted changes to 3rd party code all algorithms/* stuff needs to be fixed upstream. we just copy the files from there now and then. https://github.com/lz4/lz4 https://github.com/facebook/zstd https://github.com/Cyan4973/xxHash --- src/borg/algorithms/lz4/lib/lz4.c | 10 +++++----- src/borg/algorithms/lz4/lib/lz4.h | 2 +- src/borg/algorithms/xxh64/xxhash.h | 10 +++++----- .../zstd/lib/compress/zstd_compress_superblock.c | 2 +- src/borg/algorithms/zstd/lib/compress/zstd_cwksp.h | 2 +- src/borg/algorithms/zstd/lib/compress/zstd_fast.c | 2 +- src/borg/algorithms/zstd/lib/compress/zstd_ldm.c | 2 +- src/borg/algorithms/zstd/lib/dictBuilder/divsufsort.c | 2 +- src/borg/algorithms/zstd/lib/zstd.h | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/borg/algorithms/lz4/lib/lz4.c b/src/borg/algorithms/lz4/lib/lz4.c index 45bde04a5..9808d70ae 100644 --- a/src/borg/algorithms/lz4/lib/lz4.c +++ b/src/borg/algorithms/lz4/lib/lz4.c @@ -986,7 +986,7 @@ LZ4_FORCE_INLINE int LZ4_compress_generic( _next_match: /* at this stage, the following variables must be correctly set : * - ip : at start of LZ operation - * - match : at start of previous pattern occurrence; can be within current prefix, or within extDict + * - match : at start of previous pattern occurence; can be within current prefix, or within extDict * - offset : if maybe_ext_memSegment==1 (constant) * - lowLimit : must be == dictionary to mean "match is within extDict"; must be == source otherwise * - token and *token : position to write 4-bits for match length; higher 4-bits for literal length supposed already written @@ -1340,8 +1340,8 @@ LZ4_stream_t* LZ4_createStream(void) return lz4s; } -#ifndef _MSC_VER /* for some reason, Visual fails the alignment test on 32-bit x86 : - it reports an alignment of 8-bytes, +#ifndef _MSC_VER /* for some reason, Visual fails the aligment test on 32-bit x86 : + it reports an aligment of 8-bytes, while actually aligning LZ4_stream_t on 4 bytes. */ static size_t LZ4_stream_t_alignment(void) { @@ -1355,8 +1355,8 @@ LZ4_stream_t* LZ4_initStream (void* buffer, size_t size) DEBUGLOG(5, "LZ4_initStream"); if (buffer == NULL) { return NULL; } if (size < sizeof(LZ4_stream_t)) { return NULL; } -#ifndef _MSC_VER /* for some reason, Visual fails the alignment test on 32-bit x86 : - it reports an alignment of 8-bytes, +#ifndef _MSC_VER /* for some reason, Visual fails the aligment test on 32-bit x86 : + it reports an aligment of 8-bytes, while actually aligning LZ4_stream_t on 4 bytes. */ if (((size_t)buffer) & (LZ4_stream_t_alignment() - 1)) { return NULL; } /* alignment check */ #endif diff --git a/src/borg/algorithms/lz4/lib/lz4.h b/src/borg/algorithms/lz4/lib/lz4.h index ba6353d05..32108e232 100644 --- a/src/borg/algorithms/lz4/lib/lz4.h +++ b/src/borg/algorithms/lz4/lib/lz4.h @@ -480,7 +480,7 @@ LZ4LIB_STATIC_API void LZ4_attach_dictionary(LZ4_stream_t* workingStream, const /*! In-place compression and decompression * * It's possible to have input and output sharing the same buffer, - * for highly constrained memory environments. + * for highly contrained memory environments. * In both cases, it requires input to lay at the end of the buffer, * and decompression to start at beginning of the buffer. * Buffer size must feature some margin, hence be larger than final size. diff --git a/src/borg/algorithms/xxh64/xxhash.h b/src/borg/algorithms/xxh64/xxhash.h index e037eb73b..2d56d23c5 100644 --- a/src/borg/algorithms/xxh64/xxhash.h +++ b/src/borg/algorithms/xxh64/xxhash.h @@ -299,7 +299,7 @@ XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, XXH32_hash_ /******* Streaming *******/ /* - * Streaming functions generate the xxHash value from an incremental input. + * Streaming functions generate the xxHash value from an incrememtal input. * This method is slower than single-call functions, due to state management. * For small inputs, prefer `XXH32()` and `XXH64()`, which are better optimized. * @@ -835,7 +835,7 @@ XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, XXH64_hash_t s * * The check costs one initial branch per hash, which is generally negligible, but not zero. * Moreover, it's not useful to generate binary for an additional code path - * if memory access uses same instruction for both aligned and unaligned addresses. + * if memory access uses same instruction for both aligned and unaligned adresses. * * In these cases, the alignment check can be removed by setting this macro to 0. * Then the code will always use unaligned memory access. @@ -1044,7 +1044,7 @@ static xxh_u32 XXH_read32(const void* memPtr) #endif /* XXH_FORCE_DIRECT_MEMORY_ACCESS */ -/* *** Endianness *** */ +/* *** Endianess *** */ typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess; /*! @@ -1212,7 +1212,7 @@ static xxh_u32 XXH32_round(xxh_u32 acc, xxh_u32 input) * UGLY HACK: * This inline assembly hack forces acc into a normal register. This is the * only thing that prevents GCC and Clang from autovectorizing the XXH32 - * loop (pragmas and attributes don't work for some reason) without globally + * loop (pragmas and attributes don't work for some resason) without globally * disabling SSE4.1. * * The reason we want to avoid vectorization is because despite working on @@ -4629,7 +4629,7 @@ XXH128(const void* input, size_t len, XXH64_hash_t seed) /* * All the functions are actually the same as for 64-bit streaming variant. - * The only difference is the finalization routine. + * The only difference is the finalizatiom routine. */ static void diff --git a/src/borg/algorithms/zstd/lib/compress/zstd_compress_superblock.c b/src/borg/algorithms/zstd/lib/compress/zstd_compress_superblock.c index fceded125..b693866c0 100644 --- a/src/borg/algorithms/zstd/lib/compress/zstd_compress_superblock.c +++ b/src/borg/algorithms/zstd/lib/compress/zstd_compress_superblock.c @@ -304,7 +304,7 @@ ZSTD_buildSuperBlockEntropy(seqStore_t* seqStorePtr, * before we know the table size + compressed size, so we have a bound on the * table size. If we guessed incorrectly, we fall back to uncompressed literals. * - * We write the header when writeEntropy=1 and set entropyWritten=1 when we succeeded + * We write the header when writeEntropy=1 and set entropyWrriten=1 when we succeeded * in writing the header, otherwise it is set to 0. * * hufMetadata->hType has literals block type info. diff --git a/src/borg/algorithms/zstd/lib/compress/zstd_cwksp.h b/src/borg/algorithms/zstd/lib/compress/zstd_cwksp.h index 3a7b0217c..a25c9263b 100644 --- a/src/borg/algorithms/zstd/lib/compress/zstd_cwksp.h +++ b/src/borg/algorithms/zstd/lib/compress/zstd_cwksp.h @@ -472,7 +472,7 @@ MEM_STATIC void ZSTD_cwksp_free(ZSTD_cwksp* ws, ZSTD_customMem customMem) { /** * Moves the management of a workspace from one cwksp to another. The src cwksp - * is left in an invalid state (src must be re-init()'ed before it's used again). + * is left in an invalid state (src must be re-init()'ed before its used again). */ MEM_STATIC void ZSTD_cwksp_move(ZSTD_cwksp* dst, ZSTD_cwksp* src) { *dst = *src; diff --git a/src/borg/algorithms/zstd/lib/compress/zstd_fast.c b/src/borg/algorithms/zstd/lib/compress/zstd_fast.c index f9f4df83b..85a3a7a91 100644 --- a/src/borg/algorithms/zstd/lib/compress/zstd_fast.c +++ b/src/borg/algorithms/zstd/lib/compress/zstd_fast.c @@ -242,7 +242,7 @@ size_t ZSTD_compressBlock_fast_dictMatchState_generic( assert(endIndex - prefixStartIndex <= maxDistance); (void)maxDistance; (void)endIndex; /* these variables are not used when assert() is disabled */ - /* ensure there will be no underflow + /* ensure there will be no no underflow * when translating a dict index into a local index */ assert(prefixStartIndex >= (U32)(dictEnd - dictBase)); diff --git a/src/borg/algorithms/zstd/lib/compress/zstd_ldm.c b/src/borg/algorithms/zstd/lib/compress/zstd_ldm.c index e16b7eafe..8c4794835 100644 --- a/src/borg/algorithms/zstd/lib/compress/zstd_ldm.c +++ b/src/borg/algorithms/zstd/lib/compress/zstd_ldm.c @@ -579,7 +579,7 @@ size_t ZSTD_ldm_blockCompress(rawSeqStore_t* rawSeqStore, DEBUGLOG(5, "ZSTD_ldm_blockCompress: srcSize=%zu", srcSize); assert(rawSeqStore->pos <= rawSeqStore->size); assert(rawSeqStore->size <= rawSeqStore->capacity); - /* Loop through each sequence and apply the block compressor to the lists */ + /* Loop through each sequence and apply the block compressor to the lits */ while (rawSeqStore->pos < rawSeqStore->size && ip < iend) { /* maybeSplitSequence updates rawSeqStore->pos */ rawSeq const sequence = maybeSplitSequence(rawSeqStore, diff --git a/src/borg/algorithms/zstd/lib/dictBuilder/divsufsort.c b/src/borg/algorithms/zstd/lib/dictBuilder/divsufsort.c index a2870fb3b..ead922044 100644 --- a/src/borg/algorithms/zstd/lib/dictBuilder/divsufsort.c +++ b/src/borg/algorithms/zstd/lib/dictBuilder/divsufsort.c @@ -1576,7 +1576,7 @@ note: /* Construct the inverse suffix array of type B* suffixes using trsort. */ trsort(ISAb, SA, m, 1); - /* Set the sorted order of type B* suffixes. */ + /* Set the sorted order of tyoe B* suffixes. */ for(i = n - 1, j = m, c0 = T[n - 1]; 0 <= i;) { for(--i, c1 = c0; (0 <= i) && ((c0 = T[i]) >= c1); --i, c1 = c0) { } if(0 <= i) { diff --git a/src/borg/algorithms/zstd/lib/zstd.h b/src/borg/algorithms/zstd/lib/zstd.h index 9856310b2..8c6fc6ae9 100644 --- a/src/borg/algorithms/zstd/lib/zstd.h +++ b/src/borg/algorithms/zstd/lib/zstd.h @@ -924,7 +924,7 @@ ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, s * Reference a prepared dictionary, to be used for all next compressed frames. * Note that compression parameters are enforced from within CDict, * and supersede any compression parameter previously set within CCtx. - * The parameters ignored are labelled as "superseded-by-cdict" in the ZSTD_cParameter enum docs. + * The parameters ignored are labled as "superseded-by-cdict" in the ZSTD_cParameter enum docs. * The ignored parameters will be used again if the CCtx is returned to no-dictionary mode. * The dictionary will remain valid for future compressed frames using same CCtx. * @result : 0, or an error code (which can be tested with ZSTD_isError()). @@ -1237,7 +1237,7 @@ ZSTDLIB_API unsigned long long ZSTD_findDecompressedSize(const void* src, size_t * `srcSize` must be the _exact_ size of this series * (i.e. there should be a frame boundary at `src + srcSize`) * @return : - upper-bound for the decompressed size of all data in all successive frames - * - if an error occurred: ZSTD_CONTENTSIZE_ERROR + * - if an error occured: ZSTD_CONTENTSIZE_ERROR * * note 1 : an error can occur if `src` contains an invalid or incorrectly formatted frame. * note 2 : the upper-bound is exact when the decompressed size field is available in every ZSTD encoded frame of `src`.