]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fix clang -Wcast-align warning
authorinikep <inikep@gmail.com>
Wed, 2 Mar 2016 18:17:13 +0000 (19:17 +0100)
committerinikep <inikep@gmail.com>
Wed, 2 Mar 2016 18:17:13 +0000 (19:17 +0100)
lib/zstd_compress.c

index 2eb1e6d2c4636b611d3f86321ff26c383ae3ffcb..6a4cfe4cb80f2afa24c8f407d8e70bf062b90c4d 100644 (file)
@@ -202,13 +202,13 @@ static size_t ZSTD_resetCCtx_advanced (ZSTD_CCtx* zc,
     zc->blockSize = blockSize;
 
     zc->seqStore.offsetStart = (U32*) (zc->seqStore.buffer);
-    zc->seqStore.offCodeStart = (BYTE*) (zc->seqStore.offsetStart + (blockSize>>2));
+    zc->seqStore.offCodeStart = (BYTE*) (zc->seqStore.offsetStart) + blockSize;
     zc->seqStore.litStart = zc->seqStore.offCodeStart + (blockSize>>2);
     zc->seqStore.litLengthStart =  zc->seqStore.litStart + blockSize;
     zc->seqStore.matchLengthStart = zc->seqStore.litLengthStart + (blockSize>>2);
-    zc->seqStore.dumpsStart = zc->seqStore.matchLengthStart + (blockSize>>2); 
-
-    zc->seqStore.litFreq = (U32*)(zc->seqStore.dumpsStart + (blockSize>>2)); 
+    zc->seqStore.dumpsStart = zc->seqStore.matchLengthStart + (blockSize>>2);
+    BYTE* dumpsEnd = zc->seqStore.dumpsStart + (blockSize>>2);
+    zc->seqStore.litFreq = (U32*)(dumpsEnd);
     zc->seqStore.litLengthFreq = zc->seqStore.litFreq + (1<<Litbits);
     zc->seqStore.matchLengthFreq = zc->seqStore.litLengthFreq + (1<<LLbits);
     zc->seqStore.offCodeFreq = zc->seqStore.matchLengthFreq + (1<<MLbits);