mea culpa, I was too busy with the Atheros port and broke squashfs-lzma. Oleg sent...
authorkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 24 Mar 2006 10:40:43 +0000 (10:40 +0000)
committerkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 24 Mar 2006 10:40:43 +0000 (10:40 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@3472 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/lzma/lzma-zlib.patch

index 4d0c548..c422757 100644 (file)
@@ -1,12 +1,47 @@
-diff -Nur lzma432/C/7zip/Compress/LZMA_Lib/makefile lzma432-owrt/C/7zip/Compress/LZMA_Lib/makefile
---- lzma432/C/7zip/Compress/LZMA_Lib/makefile  1970-01-01 01:00:00.000000000 +0100
-+++ lzma432-owrt/C/7zip/Compress/LZMA_Lib/makefile     2006-03-22 14:23:38.000000000 +0100
+diff -urN lzma432/C/7zip/Compress/LZMA/LZMADecoder.cpp lzma/C/7zip/Compress/LZMA/LZMADecoder.cpp
+--- lzma432/C/7zip/Compress/LZMA/LZMADecoder.cpp       2005-09-22 12:55:34.000000000 +0400
++++ lzma/C/7zip/Compress/LZMA/LZMADecoder.cpp  2006-03-24 13:23:09.634551840 +0300
+@@ -274,12 +274,17 @@
+   Byte remainder = (Byte)(properties[0] / 9);\r
+   int lp = remainder % 5;\r
+   int pb = remainder / 5;\r
+-  if (pb > NLength::kNumPosStatesBitsMax)\r
+-    return E_INVALIDARG;\r
+-  _posStateMask = (1 << pb) - 1;\r
+   UInt32 dictionarySize = 0;\r
+   for (int i = 0; i < 4; i++)\r
+     dictionarySize += ((UInt32)(properties[1 + i])) << (i * 8);\r
++  return SetDecoderPropertiesRaw(lc, lp, pb, dictionarySize);\r
++}\r
++\r
++STDMETHODIMP CDecoder::SetDecoderPropertiesRaw(int lc, int lp, int pb, UInt32 dictionarySize)\r
++{\r
++  if (pb > NLength::kNumPosStatesBitsMax)\r
++    return E_INVALIDARG;\r
++  _posStateMask = (1 << pb) - 1;\r
+   if (!_outWindowStream.Create(dictionarySize))\r
+     return E_OUTOFMEMORY;\r
+   if (!_literalDecoder.Create(lp, lc))\r
+diff -urN lzma432/C/7zip/Compress/LZMA/LZMADecoder.h lzma/C/7zip/Compress/LZMA/LZMADecoder.h
+--- lzma432/C/7zip/Compress/LZMA/LZMADecoder.h 2005-09-19 10:10:06.000000000 +0400
++++ lzma/C/7zip/Compress/LZMA/LZMADecoder.h    2006-03-24 13:23:09.635551552 +0300
+@@ -228,6 +228,7 @@
+       ICompressProgressInfo *progress);\r
\r
+   STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);\r
++  STDMETHOD(SetDecoderPropertiesRaw)(int lc, int lp, int pb, UInt32 dictionarySize);\r
\r
+   STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);\r
\r
+diff -urN lzma432/C/7zip/Compress/LZMA_Lib/makefile lzma/C/7zip/Compress/LZMA_Lib/makefile
+--- lzma432/C/7zip/Compress/LZMA_Lib/makefile  1970-01-01 03:00:00.000000000 +0300
++++ lzma/C/7zip/Compress/LZMA_Lib/makefile     2006-03-24 13:26:58.254841791 +0300
 @@ -0,0 +1,88 @@
 +PROG = liblzma.a\r
 +CXX = g++ -O3 -Wall\r
 +AR = ar
 +RM = rm -f\r
-+CFLAGS = -c\r
++CFLAGS = -c  -I ../../../\r
 +\r
 +OBJS = \\r
 +  ZLib.o \\r
@@ -90,15 +125,14 @@ diff -Nur lzma432/C/7zip/Compress/LZMA_Lib/makefile lzma432-owrt/C/7zip/Compress
 +clean:\r
 +      -$(RM) $(PROG) $(OBJS)\r
 +\r
-diff -Nur lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma432-owrt/C/7zip/Compress/LZMA_Lib/ZLib.cpp
---- lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp  1970-01-01 01:00:00.000000000 +0100
-+++ lzma432-owrt/C/7zip/Compress/LZMA_Lib/ZLib.cpp     2006-03-22 14:23:38.000000000 +0100
-@@ -0,0 +1,283 @@
+diff -urN lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma/C/7zip/Compress/LZMA_Lib/ZLib.cpp
+--- lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp  1970-01-01 03:00:00.000000000 +0300
++++ lzma/C/7zip/Compress/LZMA_Lib/ZLib.cpp     2006-03-24 13:23:09.638550690 +0300
+@@ -0,0 +1,273 @@
 +/*\r
 + * lzma zlib simplified wrapper\r
 + *\r
-+ * Copyright (c) 2005 Oleg I. Vdovikin <oleg@cs.msu.su>\r
-+ * Modified for LZMA 4.27 SDK Craig.Peacock@beyondlogic.org\r
++ * Copyright (c) 2005-2006 Oleg I. Vdovikin <oleg@cs.msu.su>\r
 + *\r
 + * This library is free software; you can redistribute \r
 + * it and/or modify it under the terms of the GNU Lesser \r
@@ -284,9 +318,9 @@ diff -Nur lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma432-owrt/C/7zip/Compress
 +      CInMemoryStream *inStreamSpec = new CInMemoryStream(source, sourceLen);\r
 +      CMyComPtr<ISequentialInStream> inStream = inStreamSpec;\r
 +      \r
-+      COutMemoryStream *outStreamSpec = new COutMemoryStream(dest+4, (*destLen)-4);\r
++      COutMemoryStream *outStreamSpec = new COutMemoryStream(dest, *destLen);\r
 +      CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;\r
-+              \r
++      \r
 +      NCompress::NLZMA::CEncoder *encoderSpec = \r
 +              new NCompress::NLZMA::CEncoder;\r
 +      CMyComPtr<ICompressCoder> encoder = encoderSpec;\r
@@ -307,12 +341,12 @@ diff -Nur lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma432-owrt/C/7zip/Compress
 +      PROPVARIANT properties[kNumProps];\r
 +      for (int p = 0; p < 6; p++)\r
 +              properties[p].vt = VT_UI4;\r
-+      properties[0].ulVal = UInt32(1 << 15);\r
++      properties[0].ulVal = UInt32(1 << (level + 14));\r
 +      properties[1].ulVal = UInt32(ZLIB_PB);\r
 +      properties[2].ulVal = UInt32(ZLIB_LC); // for normal files\r
 +      properties[3].ulVal = UInt32(ZLIB_LP); // for normal files\r
-+      properties[4].ulVal = UInt32(0);\r
-+      properties[5].ulVal = UInt32(0x28);\r
++      properties[4].ulVal = UInt32(2);\r
++      properties[5].ulVal = UInt32(128);\r
 +      \r
 +      properties[6].vt = VT_BSTR;\r
 +      properties[6].bstrVal = (BSTR)(const wchar_t *)L"BT4";\r
@@ -323,9 +357,6 @@ diff -Nur lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma432-owrt/C/7zip/Compress
 +      if (encoderSpec->SetCoderProperties(propIDs, properties, kNumProps) != S_OK)\r
 +              return Z_MEM_ERROR; // should not happen\r
 +      \r
-+      if (encoderSpec->WriteCoderProperties(outStream) != S_OK)\r
-+              return Z_MEM_ERROR;\r
-+              \r
 +      HRESULT result = encoder->Code(inStream, outStream, 0, 0, 0);\r
 +      if (result == E_OUTOFMEMORY)\r
 +      {\r
@@ -340,16 +371,13 @@ diff -Nur lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma432-owrt/C/7zip/Compress
 +      outStreamSpec->Seek(0, STREAM_SEEK_END, &fileSize);\r
 +      *destLen = fileSize;\r
 +      \r
-+      /* Copy size of uncompressed string into first four bytes */\r
-+      memcpy(dest, &sourceLen, 4);\r
-+              \r
 +      return Z_OK;\r
 +}\r
 +\r
 +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,\r
 +                                   const Bytef *source, uLong sourceLen))\r
 +{\r
-+      CInMemoryStream *inStreamSpec = new CInMemoryStream(source+9, sourceLen-9);\r
++      CInMemoryStream *inStreamSpec = new CInMemoryStream(source, sourceLen);\r
 +      CMyComPtr<ISequentialInStream> inStream = inStreamSpec;\r
 +      \r
 +      COutMemoryStream *outStreamSpec = new COutMemoryStream(dest, *destLen);\r
@@ -359,11 +387,8 @@ diff -Nur lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma432-owrt/C/7zip/Compress
 +              new NCompress::NLZMA::CDecoder;\r
 +      CMyComPtr<ICompressCoder> decoder = decoderSpec;\r
 +      \r
-+      //if (decoderSpec->SetDecoderPropertiesRaw(ZLIB_LC, \r
-+      //      ZLIB_LP, ZLIB_PB, (1 << 23)) != S_OK) return Z_DATA_ERROR;\r
-+      \r
-+      if (decoderSpec->SetDecoderProperties2(source+4, 5) != S_OK) \r
-+              return Z_DATA_ERROR;\r
++      if (decoderSpec->SetDecoderPropertiesRaw(ZLIB_LC, \r
++              ZLIB_LP, ZLIB_PB, (1 << 23)) != S_OK) return Z_DATA_ERROR;\r
 +      \r
 +      UInt64 fileSize = *destLen;\r
 +      \r
@@ -377,39 +402,3 @@ diff -Nur lzma432/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma432-owrt/C/7zip/Compress
 +      \r
 +      return Z_OK;\r
 +}\r
-diff -Nur lzma432/C/Common/CommandLineParser.h lzma432-owrt/C/Common/CommandLineParser.h
---- lzma432/C/Common/CommandLineParser.h       2005-03-07 17:03:46.000000000 +0100
-+++ lzma432-owrt/C/Common/CommandLineParser.h  2006-03-22 14:23:38.000000000 +0100
-@@ -3,7 +3,7 @@
- #ifndef __COMMON_COMMANDLINEPARSER_H\r
- #define __COMMON_COMMANDLINEPARSER_H\r
\r
--#include "Common/String.h"\r
-+#include "String.h"\r
\r
- namespace NCommandLineParser {\r
\r
-diff -Nur lzma432/C/Common/StringConvert.h lzma432-owrt/C/Common/StringConvert.h
---- lzma432/C/Common/StringConvert.h   2005-09-16 10:19:44.000000000 +0200
-+++ lzma432-owrt/C/Common/StringConvert.h      2006-03-22 14:23:38.000000000 +0100
-@@ -4,7 +4,7 @@
- #define __COMMON_STRINGCONVERT_H\r
\r
- #include "MyWindows.h"\r
--#include "Common/String.h"\r
-+#include "String.h"\r
- #include "Types.h"\r
\r
- UString MultiByteToUnicodeString(const AString &srcString, UINT codePage = CP_ACP);\r
-diff -Nur lzma432/C/Common/String.cpp lzma432-owrt/C/Common/String.cpp
---- lzma432/C/Common/String.cpp        2005-09-28 11:44:06.000000000 +0200
-+++ lzma432-owrt/C/Common/String.cpp   2006-03-22 14:23:38.000000000 +0100
-@@ -8,7 +8,7 @@
- #include <ctype.h>\r
- #endif\r
\r
--#include "Common/String.h"\r
-+#include "String.h"\r
\r
\r
- #ifdef _WIN32\r
This page took 0.030687 seconds and 4 git commands to generate.