fix cppchecker

This commit is contained in:
iceman1001 2021-05-07 13:42:57 +02:00
parent f2b3f2d632
commit 7cd278290a
2 changed files with 26 additions and 26 deletions

View file

@ -557,8 +557,8 @@ LZ4_FORCE_INLINE int LZ4HC_encodeSequence(
LZ4_FORCE_INLINE int LZ4HC_compress_hashChain(
LZ4HC_CCtx_internal *const ctx,
const char *const source,
char *const dest,
const char *const src,
char *const dst,
int *srcSizePtr,
int const maxOutputSize,
int maxNbAttempts,
@ -568,14 +568,14 @@ LZ4_FORCE_INLINE int LZ4HC_compress_hashChain(
const int inputSize = *srcSizePtr;
const int patternAnalysis = (maxNbAttempts > 128); /* levels 9+ */
const BYTE *ip = (const BYTE *) source;
const BYTE *ip = (const BYTE *) src;
const BYTE *anchor = ip;
const BYTE *const iend = ip + inputSize;
const BYTE *const mflimit = iend - MFLIMIT;
const BYTE *const matchlimit = (iend - LASTLITERALS);
BYTE *optr = (BYTE *) dest;
BYTE *op = (BYTE *) dest;
BYTE *optr = (BYTE *) dst;
BYTE *op = (BYTE *) dst;
BYTE *oend = op + maxOutputSize;
int ml0, ml, ml2, ml3;
@ -774,8 +774,8 @@ _last_literals:
}
/* End */
*srcSizePtr = (int)(((const char *)ip) - source);
return (int)(((char *)op) - dest);
*srcSizePtr = (int)(((const char *)ip) - src);
return (int)(((char *)op) - dst);
_dest_overflow:
if (limit == fillOutput) {
@ -805,7 +805,7 @@ _dest_overflow:
static int LZ4HC_compress_optimal(LZ4HC_CCtx_internal *ctx,
const char *const source, char *dst,
const char *const src, char *dst,
int *srcSizePtr, int dstCapacity,
int const nbSearches, size_t sufficient_len,
const limitedOutput_directive limit, int const fullUpdate,
@ -985,12 +985,12 @@ int LZ4_compress_HC(const char *src, char *dst, int srcSize, int dstCapacity, in
}
/* state is presumed sized correctly (>= sizeof(LZ4_streamHC_t)) */
int LZ4_compress_HC_destSize(void *state, const char *source, char *dest, int *sourceSizePtr, int targetDestSize, int cLevel) {
int LZ4_compress_HC_destSize(void *state, const char *src, char *dst, int *sourceSizePtr, int targetDestSize, int cLevel) {
LZ4_streamHC_t *const ctx = LZ4_initStreamHC(state, sizeof(*ctx));
if (ctx == NULL) return 0; /* init failure */
LZ4HC_init_internal(&ctx->internal_donotuse, (const BYTE *) source);
LZ4HC_init_internal(&ctx->internal_donotuse, (const BYTE *) src);
LZ4_setCompressionLevel(ctx, cLevel);
return LZ4HC_compress_generic(&ctx->internal_donotuse, source, dest, sourceSizePtr, targetDestSize, cLevel, fillOutput);
return LZ4HC_compress_generic(&ctx->internal_donotuse, src, dst, sourceSizePtr, targetDestSize, cLevel, fillOutput);
}
@ -1313,7 +1313,7 @@ LZ4HC_FindLongerMatch(LZ4HC_CCtx_internal *const ctx,
static int LZ4HC_compress_optimal(LZ4HC_CCtx_internal *ctx,
const char *const source,
const char *const src,
char *dst,
int *srcSizePtr,
int dstCapacity,
@ -1331,7 +1331,7 @@ static int LZ4HC_compress_optimal(LZ4HC_CCtx_internal *ctx,
LZ4HC_optimal_t opt[LZ4_OPT_NUM + TRAILING_LITERALS]; /* ~64 KB, which is a bit large for stack... */
#endif
const BYTE *ip = (const BYTE *) source;
const BYTE *ip = (const BYTE *) src;
const BYTE *anchor = ip;
const BYTE *const iend = ip + *srcSizePtr;
const BYTE *const mflimit = iend - MFLIMIT;
@ -1600,7 +1600,7 @@ _last_literals:
}
/* End */
*srcSizePtr = (int)(((const char *)ip) - source);
*srcSizePtr = (int)(((const char *)ip) - src);
retval = (int)((char *)op - dst);
goto _return_label;

View file

@ -276,16 +276,16 @@ LZ4LIB_API LZ4_streamHC_t *LZ4_initStreamHC(void *buffer, size_t size);
/* see lz4.h LZ4_DISABLE_DEPRECATE_WARNINGS to turn off deprecation warnings */
/* deprecated compression functions */
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC(const char *source, char *dest, int inputSize);
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput(const char *source, char *dest, int inputSize, int maxOutputSize);
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC2(const char *source, char *dest, int inputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput(const char *source, char *dest, int inputSize, int maxOutputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC_withStateHC(void *state, const char *source, char *dest, int inputSize);
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput_withStateHC(void *state, const char *source, char *dest, int inputSize, int maxOutputSize);
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC2_withStateHC(void *state, const char *source, char *dest, int inputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput_withStateHC(void *state, const char *source, char *dest, int inputSize, int maxOutputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC_continue(LZ4_streamHC_t *LZ4_streamHCPtr, const char *source, char *dest, int inputSize);
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput_continue(LZ4_streamHC_t *LZ4_streamHCPtr, const char *source, char *dest, int inputSize, int maxOutputSize);
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC(const char *src, char *dst, int inputSize);
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput(const char *src, char *dst, int inputSize, int maxOutputSize);
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC2(const char *src, char *dst, int inputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput(const char *src, char *dst, int inputSize, int maxOutputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC_withStateHC(void *state, const char *src, char *dst, int inputSize);
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput_withStateHC(void *state, const char *src, char *dst, int inputSize, int maxOutputSize);
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC2_withStateHC(void *state, const char *src, char *dst, int inputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput_withStateHC(void *state, const char *src, char *dst, int inputSize, int maxOutputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC_continue(LZ4_streamHC_t *LZ4_streamHCPtr, const char *src, char *dst, int inputSize);
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput_continue(LZ4_streamHC_t *LZ4_streamHCPtr, const char *src, char *dst, int inputSize, int maxOutputSize);
/* Obsolete streaming functions; degraded functionality; do not use!
*
@ -298,8 +298,8 @@ LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_comp
LZ4_DEPRECATED("use LZ4_createStreamHC() instead") LZ4LIB_API void *LZ4_createHC(const char *inputBuffer);
LZ4_DEPRECATED("use LZ4_saveDictHC() instead") LZ4LIB_API char *LZ4_slideInputBufferHC(void *LZ4HC_Data);
LZ4_DEPRECATED("use LZ4_freeStreamHC() instead") LZ4LIB_API int LZ4_freeHC(void *LZ4HC_Data);
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC2_continue(void *LZ4HC_Data, const char *source, char *dest, int inputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput_continue(void *LZ4HC_Data, const char *source, char *dest, int inputSize, int maxOutputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC2_continue(void *LZ4HC_Data, const char *src, char *dst, int inputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput_continue(void *LZ4HC_Data, const char *src, char *dst, int inputSize, int maxOutputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_createStreamHC() instead") LZ4LIB_API int LZ4_sizeofStreamStateHC(void);
LZ4_DEPRECATED("use LZ4_initStreamHC() instead") LZ4LIB_API int LZ4_resetStreamStateHC(void *state, char *inputBuffer);