decompress: conditionally remove legacy members from context
Remove the then unneeded variables from the struct, and all accesses to them.
This commit is contained in:
@@ -255,8 +255,10 @@ static void ZSTD_initDCtx_internal(ZSTD_DCtx* dctx)
|
|||||||
dctx->inBuffSize = 0;
|
dctx->inBuffSize = 0;
|
||||||
dctx->outBuffSize = 0;
|
dctx->outBuffSize = 0;
|
||||||
dctx->streamStage = zdss_init;
|
dctx->streamStage = zdss_init;
|
||||||
|
#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
|
||||||
dctx->legacyContext = NULL;
|
dctx->legacyContext = NULL;
|
||||||
dctx->previousLegacyVersion = 0;
|
dctx->previousLegacyVersion = 0;
|
||||||
|
#endif
|
||||||
dctx->noForwardProgress = 0;
|
dctx->noForwardProgress = 0;
|
||||||
dctx->oversizedDuration = 0;
|
dctx->oversizedDuration = 0;
|
||||||
dctx->bmi2 = ZSTD_cpuid_bmi2(ZSTD_cpuid());
|
dctx->bmi2 = ZSTD_cpuid_bmi2(ZSTD_cpuid());
|
||||||
@@ -1947,7 +1949,9 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB
|
|||||||
DEBUGLOG(5, "stage zdss_init => transparent reset ");
|
DEBUGLOG(5, "stage zdss_init => transparent reset ");
|
||||||
zds->streamStage = zdss_loadHeader;
|
zds->streamStage = zdss_loadHeader;
|
||||||
zds->lhSize = zds->inPos = zds->outStart = zds->outEnd = 0;
|
zds->lhSize = zds->inPos = zds->outStart = zds->outEnd = 0;
|
||||||
|
#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
|
||||||
zds->legacyVersion = 0;
|
zds->legacyVersion = 0;
|
||||||
|
#endif
|
||||||
zds->hostageByte = 0;
|
zds->hostageByte = 0;
|
||||||
zds->expectedOutBuffer = *output;
|
zds->expectedOutBuffer = *output;
|
||||||
ZSTD_FALLTHROUGH;
|
ZSTD_FALLTHROUGH;
|
||||||
|
|||||||
@@ -158,9 +158,11 @@ struct ZSTD_DCtx_s
|
|||||||
size_t outStart;
|
size_t outStart;
|
||||||
size_t outEnd;
|
size_t outEnd;
|
||||||
size_t lhSize;
|
size_t lhSize;
|
||||||
|
#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
|
||||||
void* legacyContext;
|
void* legacyContext;
|
||||||
U32 previousLegacyVersion;
|
U32 previousLegacyVersion;
|
||||||
U32 legacyVersion;
|
U32 legacyVersion;
|
||||||
|
#endif
|
||||||
U32 hostageByte;
|
U32 hostageByte;
|
||||||
int noForwardProgress;
|
int noForwardProgress;
|
||||||
ZSTD_bufferMode_e outBufferMode;
|
ZSTD_bufferMode_e outBufferMode;
|
||||||
|
|||||||
Reference in New Issue
Block a user