Changeset 3472


Ignore:
Timestamp:
2006-03-24T11:40:43+01:00 (11 years ago)
Author:
kaloz
Message:

mea culpa, I was too busy with the Atheros port and broke squashfs-lzma. Oleg sent me a fixed patch, thanks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openwrt/target/lzma/lzma-zlib.patch

    r3459 r3472  
    1 diff -Nur lzma432/C/7zip/Compress/LZMA_Lib/makefile lzma432-owrt/C/7zip/Compress/LZMA_Lib/makefile 
    2 --- lzma432/C/7zip/Compress/LZMA_Lib/makefile   1970-01-01 01:00:00.000000000 +0100 
    3 +++ lzma432-owrt/C/7zip/Compress/LZMA_Lib/makefile      2006-03-22 14:23:38.000000000 +0100 
     1diff -urN lzma432/C/7zip/Compress/LZMA/LZMADecoder.cpp lzma/C/7zip/Compress/LZMA/LZMADecoder.cpp 
     2--- lzma432/C/7zip/Compress/LZMA/LZMADecoder.cpp        2005-09-22 12:55:34.000000000 +0400 
     3+++ lzma/C/7zip/Compress/LZMA/LZMADecoder.cpp   2006-03-24 13:23:09.634551840 +0300 
     4@@ -274,12 +274,17 @@ 
     5   Byte remainder = (Byte)(properties[0] / 9); 
     6   int lp = remainder % 5; 
     7   int pb = remainder / 5; 
     8-  if (pb > NLength::kNumPosStatesBitsMax) 
     9-    return E_INVALIDARG; 
     10-  _posStateMask = (1 << pb) - 1; 
     11   UInt32 dictionarySize = 0; 
     12   for (int i = 0; i < 4; i++) 
     13     dictionarySize += ((UInt32)(properties[1 + i])) << (i * 8); 
     14+  return SetDecoderPropertiesRaw(lc, lp, pb, dictionarySize); 
     15+} 
     16+ 
     17+STDMETHODIMP CDecoder::SetDecoderPropertiesRaw(int lc, int lp, int pb, UInt32 dictionarySize) 
     18+{ 
     19+  if (pb > NLength::kNumPosStatesBitsMax) 
     20+    return E_INVALIDARG; 
     21+  _posStateMask = (1 << pb) - 1; 
     22   if (!_outWindowStream.Create(dictionarySize)) 
     23     return E_OUTOFMEMORY; 
     24   if (!_literalDecoder.Create(lp, lc)) 
     25diff -urN lzma432/C/7zip/Compress/LZMA/LZMADecoder.h lzma/C/7zip/Compress/LZMA/LZMADecoder.h 
     26--- lzma432/C/7zip/Compress/LZMA/LZMADecoder.h  2005-09-19 10:10:06.000000000 +0400 
     27+++ lzma/C/7zip/Compress/LZMA/LZMADecoder.h     2006-03-24 13:23:09.635551552 +0300 
     28@@ -228,6 +228,7 @@ 
     29       ICompressProgressInfo *progress); 
     30  
     31   STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size); 
     32+  STDMETHOD(SetDecoderPropertiesRaw)(int lc, int lp, int pb, UInt32 dictionarySize); 
     33  
     34   STDMETHOD(GetInStreamProcessedSize)(UInt64 *value); 
     35  
     36diff -urN lzma432/C/7zip/Compress/LZMA_Lib/makefile lzma/C/7zip/Compress/LZMA_Lib/makefile 
     37--- lzma432/C/7zip/Compress/LZMA_Lib/makefile   1970-01-01 03:00:00.000000000 +0300 
     38+++ lzma/C/7zip/Compress/LZMA_Lib/makefile      2006-03-24 13:26:58.254841791 +0300 
    439@@ -0,0 +1,88 @@ 
    540+PROG = liblzma.a 
     
    742+AR = ar 
    843+RM = rm -f 
    9 +CFLAGS = -c 
     44+CFLAGS = -c  -I ../../../ 
    1045+ 
    1146+OBJS = \ 
     
    91126+       -$(RM) $(PROG) $(OBJS) 
    92127+ 
    93 diff -Nur lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma432-owrt/C/7zip/Compress/LZMA_Lib/ZLib.cpp 
    94 --- lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp   1970-01-01 01:00:00.000000000 +0100 
    95 +++ lzma432-owrt/C/7zip/Compress/LZMA_Lib/ZLib.cpp      2006-03-22 14:23:38.000000000 +0100 
    96 @@ -0,0 +1,283 @@ 
     128diff -urN lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma/C/7zip/Compress/LZMA_Lib/ZLib.cpp 
     129--- lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp   1970-01-01 03:00:00.000000000 +0300 
     130+++ lzma/C/7zip/Compress/LZMA_Lib/ZLib.cpp      2006-03-24 13:23:09.638550690 +0300 
     131@@ -0,0 +1,273 @@ 
    97132+/* 
    98133+ * lzma zlib simplified wrapper 
    99134+ * 
    100 + * Copyright (c) 2005 Oleg I. Vdovikin <oleg@cs.msu.su> 
    101 + * Modified for LZMA 4.27 SDK Craig.Peacock@beyondlogic.org 
     135+ * Copyright (c) 2005-2006 Oleg I. Vdovikin <oleg@cs.msu.su> 
    102136+ * 
    103137+ * This library is free software; you can redistribute  
     
    285319+       CMyComPtr<ISequentialInStream> inStream = inStreamSpec; 
    286320+        
    287 +       COutMemoryStream *outStreamSpec = new COutMemoryStream(dest+4, (*destLen)-4); 
     321+       COutMemoryStream *outStreamSpec = new COutMemoryStream(dest, *destLen); 
    288322+       CMyComPtr<ISequentialOutStream> outStream = outStreamSpec; 
    289 +                
     323+        
    290324+       NCompress::NLZMA::CEncoder *encoderSpec =  
    291325+               new NCompress::NLZMA::CEncoder; 
     
    308342+       for (int p = 0; p < 6; p++) 
    309343+               properties[p].vt = VT_UI4; 
    310 +       properties[0].ulVal = UInt32(1 << 15); 
     344+       properties[0].ulVal = UInt32(1 << (level + 14)); 
    311345+       properties[1].ulVal = UInt32(ZLIB_PB); 
    312346+       properties[2].ulVal = UInt32(ZLIB_LC); // for normal files 
    313347+       properties[3].ulVal = UInt32(ZLIB_LP); // for normal files 
    314 +       properties[4].ulVal = UInt32(0); 
    315 +       properties[5].ulVal = UInt32(0x28); 
     348+       properties[4].ulVal = UInt32(2); 
     349+       properties[5].ulVal = UInt32(128); 
    316350+        
    317351+       properties[6].vt = VT_BSTR; 
     
    324358+               return Z_MEM_ERROR; // should not happen 
    325359+        
    326 +       if (encoderSpec->WriteCoderProperties(outStream) != S_OK) 
    327 +               return Z_MEM_ERROR; 
    328 +                
    329360+       HRESULT result = encoder->Code(inStream, outStream, 0, 0, 0); 
    330361+       if (result == E_OUTOFMEMORY) 
     
    341372+       *destLen = fileSize; 
    342373+        
    343 +       /* Copy size of uncompressed string into first four bytes */ 
    344 +       memcpy(dest, &sourceLen, 4); 
    345 +                
    346374+       return Z_OK; 
    347375+} 
     
    350378+                                   const Bytef *source, uLong sourceLen)) 
    351379+{ 
    352 +       CInMemoryStream *inStreamSpec = new CInMemoryStream(source+9, sourceLen-9); 
     380+       CInMemoryStream *inStreamSpec = new CInMemoryStream(source, sourceLen); 
    353381+       CMyComPtr<ISequentialInStream> inStream = inStreamSpec; 
    354382+        
     
    360388+       CMyComPtr<ICompressCoder> decoder = decoderSpec; 
    361389+        
    362 +       //if (decoderSpec->SetDecoderPropertiesRaw(ZLIB_LC,  
    363 +       //      ZLIB_LP, ZLIB_PB, (1 << 23)) != S_OK) return Z_DATA_ERROR; 
    364 +        
    365 +       if (decoderSpec->SetDecoderProperties2(source+4, 5) != S_OK)  
    366 +               return Z_DATA_ERROR; 
     390+       if (decoderSpec->SetDecoderPropertiesRaw(ZLIB_LC,  
     391+               ZLIB_LP, ZLIB_PB, (1 << 23)) != S_OK) return Z_DATA_ERROR; 
    367392+        
    368393+       UInt64 fileSize = *destLen; 
     
    378403+       return Z_OK; 
    379404+} 
    380 diff -Nur lzma432/C/Common/CommandLineParser.h lzma432-owrt/C/Common/CommandLineParser.h 
    381 --- lzma432/C/Common/CommandLineParser.h        2005-03-07 17:03:46.000000000 +0100 
    382 +++ lzma432-owrt/C/Common/CommandLineParser.h   2006-03-22 14:23:38.000000000 +0100 
    383 @@ -3,7 +3,7 @@ 
    384  #ifndef __COMMON_COMMANDLINEPARSER_H 
    385  #define __COMMON_COMMANDLINEPARSER_H 
    386   
    387 -#include "Common/String.h" 
    388 +#include "String.h" 
    389   
    390  namespace NCommandLineParser { 
    391   
    392 diff -Nur lzma432/C/Common/StringConvert.h lzma432-owrt/C/Common/StringConvert.h 
    393 --- lzma432/C/Common/StringConvert.h    2005-09-16 10:19:44.000000000 +0200 
    394 +++ lzma432-owrt/C/Common/StringConvert.h       2006-03-22 14:23:38.000000000 +0100 
    395 @@ -4,7 +4,7 @@ 
    396  #define __COMMON_STRINGCONVERT_H 
    397   
    398  #include "MyWindows.h" 
    399 -#include "Common/String.h" 
    400 +#include "String.h" 
    401  #include "Types.h" 
    402   
    403  UString MultiByteToUnicodeString(const AString &srcString, UINT codePage = CP_ACP); 
    404 diff -Nur lzma432/C/Common/String.cpp lzma432-owrt/C/Common/String.cpp 
    405 --- lzma432/C/Common/String.cpp 2005-09-28 11:44:06.000000000 +0200 
    406 +++ lzma432-owrt/C/Common/String.cpp    2006-03-22 14:23:38.000000000 +0100 
    407 @@ -8,7 +8,7 @@ 
    408  #include <ctype.h> 
    409  #endif 
    410   
    411 -#include "Common/String.h" 
    412 +#include "String.h" 
    413   
    414   
    415  #ifdef _WIN32 
Note: See TracChangeset for help on using the changeset viewer.