From 01b2d09a9805b87972856bb6c07069d9d0d6fe41 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 21 Sep 2017 19:43:01 +0200 Subject: [PATCH] Avoid some warnings with Griffin --- deps/7zip/7zTypes.h | 4 ++++ deps/7zip/LzFind.c | 4 ++-- deps/7zip/LzmaEnc.c | 7 ++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/deps/7zip/7zTypes.h b/deps/7zip/7zTypes.h index a64abaa671..7d2217d891 100644 --- a/deps/7zip/7zTypes.h +++ b/deps/7zip/7zTypes.h @@ -19,6 +19,10 @@ EXTERN_C_BEGIN +#ifndef _7ZIP_ST +#define _7ZIP_ST +#endif + #define SZ_OK 0 #define SZ_ERROR_DATA 1 diff --git a/deps/7zip/LzFind.c b/deps/7zip/LzFind.c index 6eef8730d9..e41014e65f 100644 --- a/deps/7zip/LzFind.c +++ b/deps/7zip/LzFind.c @@ -12,7 +12,7 @@ #define kMaxValForNormalize ((uint32_t)0xFFFFFFFF) #define kNormalizeStepMin (1 << 10) /* it must be power of 2 */ #define kNormalizeMask (~(uint32_t)(kNormalizeStepMin - 1)) -#define kMaxHistorySize ((uint32_t)7 << 29) +#define LzFindkMaxHistorySize ((uint32_t)7 << 29) #define kStartMaxLen 3 @@ -180,7 +180,7 @@ int MatchFinder_Create(CMatchFinder *p, uint32_t historySize, { uint32_t sizeReserv; - if (historySize > kMaxHistorySize) + if (historySize > LzFindkMaxHistorySize) { MatchFinder_Free(p, alloc); return 0; diff --git a/deps/7zip/LzmaEnc.c b/deps/7zip/LzmaEnc.c index ba8a0d5612..6ea4395a3b 100644 --- a/deps/7zip/LzmaEnc.c +++ b/deps/7zip/LzmaEnc.c @@ -9,14 +9,11 @@ #include "LzFind.h" -#define _7ZIP_ST - #ifndef _7ZIP_ST #include "LzFindMt.h" #endif -#define kMaxHistorySize ((uint32_t)3 << 29) -/* #define kMaxHistorySize ((uint32_t)7 << 29) */ +#define LzmaEnckMaxHistorySize ((uint32_t)3 << 29) #define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1) @@ -392,7 +389,7 @@ SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX || props.dictSize > ((uint64_t)1 << kDicLogSizeMaxCompress) - || props.dictSize > kMaxHistorySize) + || props.dictSize > LzmaEnckMaxHistorySize) return SZ_ERROR_PARAM; p->dictSize = props.dictSize;