From 426e7437e10719b215dc5aeb46e48bcf90ae3831 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Mon, 9 Jun 2014 02:49:20 +0100 Subject: removed old stream structure --- lz4.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/lz4.c b/lz4.c index 6eff9b9..c264cc3 100755 --- a/lz4.c +++ b/lz4.c @@ -1076,37 +1076,31 @@ int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, /* Obsolete Streaming functions */ -typedef struct { - LZ4_dict_t_internal dict; - const BYTE* bufferStart; -} LZ4_Data_Structure; +int LZ4_sizeofStreamState() { return LZ4_DICTSIZE; } -int LZ4_sizeofStreamState() { return sizeof(LZ4_Data_Structure); } - -void LZ4_init(LZ4_Data_Structure* lz4ds, const BYTE* base) +void LZ4_init(LZ4_dict_t_internal* lz4ds, const BYTE* base) { - MEM_INIT(lz4ds->dict.hashTable, 0, sizeof(lz4ds->dict.hashTable)); + MEM_INIT(lz4ds->hashTable, 0, LZ4_DICTSIZE); lz4ds->bufferStart = base; } int LZ4_resetStreamState(void* state, const char* inputBuffer) { if ((((size_t)state) & 3) != 0) return 1; /* Error : pointer is not aligned on 4-bytes boundary */ - LZ4_init((LZ4_Data_Structure*)state, (const BYTE*)inputBuffer); + LZ4_init((LZ4_dict_t_internal*)state, (const BYTE*)inputBuffer); return 0; } void* LZ4_create (const char* inputBuffer) { - void* lz4ds = ALLOCATOR(1, sizeof(LZ4_Data_Structure)); - LZ4_init ((LZ4_Data_Structure*)lz4ds, (const BYTE*)inputBuffer); + void* lz4ds = ALLOCATOR(4, LZ4_DICTSIZE_U32); + LZ4_init ((LZ4_dict_t_internal*)lz4ds, (const BYTE*)inputBuffer); return lz4ds; } - char* LZ4_slideInputBuffer (void* LZ4_Data) { - LZ4_Data_Structure* lz4ds = (LZ4_Data_Structure*)LZ4_Data; + LZ4_dict_t_internal* lz4ds = (LZ4_dict_t_internal*)LZ4_Data; LZ4_moveDict((LZ4_dict_t*)LZ4_Data, (char*)lz4ds->bufferStart, 64 KB); -- cgit v0.12