changed filed order

This commit is contained in:
Yann Collet
2016-07-22 14:37:09 +02:00
parent 198e6aac44
commit 5288ac0cb7
2 changed files with 12 additions and 15 deletions
+11 -14
View File
@@ -472,32 +472,29 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
if (srcSize < 5) return ERROR(corruption_detected); /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for lhSize, + cSize (+nbSeq) */ if (srcSize < 5) return ERROR(corruption_detected); /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for lhSize, + cSize (+nbSeq) */
switch(lhlCode) switch(lhlCode)
{ {
case 1: case 0: case 1: default: /* note : default is impossible, since lhlCode into [0..3] */
singleStream = 1;
/* fall through */
case 0: default: /* note : default is impossible, since lhlCode into [0..3] */
/* 2 - 2 - 10 - 10 */ /* 2 - 2 - 10 - 10 */
{ U32 const lhc = MEM_readLE24(istart) >> 4; { U32 const lhc = MEM_readLE32(istart);
singleStream = lhlCode;
lhSize = 3; lhSize = 3;
litSize = lhc & 0x3FF; litSize = (lhc >> 4) & 0x3FF;
litCSize = lhc >> 10; litCSize = (lhc >> 14) & 0x3FF;
break; break;
} }
case 2: case 2:
/* 2 - 2 - 14 - 14 */ /* 2 - 2 - 14 - 14 */
{ U32 const lhc = MEM_readLE32(istart) >> 4; { U32 const lhc = MEM_readLE32(istart);
lhSize = 4; lhSize = 4;
litSize = lhc & 0x3FFF; litSize = (lhc >> 4) & 0x3FFF;
litCSize = lhc >> 14; litCSize = lhc >> 18;
break; break;
} }
case 3: case 3:
/* 2 - 2 - 18 - 18 */ /* 2 - 2 - 18 - 18 */
{ U64 const lhc = (MEM_readLE32(istart) + (((U64)istart[4]) << 32)) >> 4; { U32 const lhc = MEM_readLE32(istart);
lhSize = 5; lhSize = 5;
litSize = lhc & 0x3FFFF; litSize = (lhc >> 4) & 0x3FFFF;
litCSize = lhc >> 18; litCSize = (lhc >> 22) + (istart[4] << 10);
break; break;
} }
} }
+1 -1
View File
@@ -46,7 +46,7 @@ FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MOREFLAGS)
ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c
ZSTDCOMP_FILES := $(ZSTDDIR)/compress/zstd_compress.c $(ZSTDDIR)/compress/fse_compress.c $(ZSTDDIR)/compress/huf_compress.c ZSTDCOMP_FILES := $(ZSTDDIR)/compress/zstd_compress.c $(ZSTDDIR)/compress/fse_compress.c $(ZSTDDIR)/compress/huf_compress.c
ZSTDDECOMP_FILES := $(ZSTDDIR)/decompress/huf_decompress.c $(ZSTDDIR)/decompress/zstd_decompress.c ZSTDDECOMP_FILES := $(ZSTDDIR)/decompress/zstd_decompress.c $(ZSTDDIR)/decompress/huf_decompress.c
ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES)
ZBUFF_FILES := $(ZSTDDIR)/compress/zbuff_compress.c $(ZSTDDIR)/decompress/zbuff_decompress.c ZBUFF_FILES := $(ZSTDDIR)/compress/zbuff_compress.c $(ZSTDDIR)/decompress/zbuff_decompress.c
ZDICT_FILES := $(ZSTDDIR)/dictBuilder/*.c ZDICT_FILES := $(ZSTDDIR)/dictBuilder/*.c