Kevin Wilson | 9 Nov 19:24 2014
Picon

How to compress a folder with xz ?

Hi, all,

The forum webpage give an error. So I hope you will forgive me
for sending to xz-devel, in the hope that someone may advice.

According to the man page of xz, it seems that
xz folderName or
xz folderName/
is enough.
However, when running:
xz /etc/
I get;
xz: /etc/: Is a directory, skipping

I saw that it is possible with the tar command, with soem command options,
but isn't it possible with xz ?

regards,
Kevin

Lasse Collin | 13 Oct 21:28 2014

Optimizing lzma_memcmplen for non-x86 processors

XZ Utils 5.1.4beta got a speed optimization for buffer comparisons
which improves encoding speed. It works on systems that support
unaligned memory access. The relevant code is in
src/liblzma/common/memcmplen.h:

    http://git.tukaani.org/?p=xz.git;a=blob;f=src/liblzma/common/memcmplen.h

Different architectures get the best performance with different code.
The code should be decent for x86-64 and maybe also for 32-bit x86 (at
least the SSE2 version). Those may still have some room left for
improvement and help is welcome to improve them. However, no one has
looked at how the code could be improved for non-x86 archs, so I'm
especially interested in finding people to help with that.

I have heard that the generic versions work on little endian 32-bit ARM
and 32-bit big endian PowerPC. On those the generic code is slightly
faster than the byte-by-byte buffer comparison, but perhaps
arch-specific code could do better. The method used for x86-64 could be
good for other 64-bit CPUs too if __builtin_ctzll maps to a fast
instruction.

Timing the speed of "xz -e" when compressing a fairly compressible file
(many source code tarballs are such) is a good way to test different
lzma_memcmplen implementations. The reason for using -e is that the
relative improvement tends to be bigger when that option is used. On
x86-64 I've seen even 25 % faster compression with some files compared
to the byte-by-byte method.

--

-- 
Lasse Collin  |  IRC: Larhzu  <at>  IRCnet & Freenode
(Continue reading)

Lasse Collin | 20 Sep 20:04 2014

XZ Utils 5.0.7

XZ Utils 5.0.7 is available at <http://tukaani.org/xz/>. Here is an 
extract from the NEWS file:

    * Fix regressions introduced in 5.0.6:

        - Fix building with non-GNU make.

        - Fix invalid Libs.private value in liblzma.pc which broke
          static linking against liblzma if the linker flags were
          taken from pkg-config.

--

-- 
Lasse Collin  |  IRC: Larhzu  <at>  IRCnet & Freenode

Lasse Collin | 14 Sep 21:46 2014

XZ Utils 5.0.6 and 5.1.4beta

XZ Utils 5.0.6 and 5.1.4beta are available at <http://tukaani.org/xz/>.
Here is an extract from the NEWS file:

5.0.6 (2014-09-14)

    * xzgrep now exits with status 0 if at least one file matched.

    * A few minor portability and build system fixes

5.1.4beta (2014-09-14)

    * All fixes from 5.0.6

    * liblzma: Fixed the use of presets in threaded encoder
      initialization.

    * xz --block-list and --block-size can now be used together
      in single-threaded mode. Previously the combination only
      worked in multi-threaded mode.

    * Added support for LZMA_IGNORE_CHECK to liblzma and made it
      available in xz as --ignore-check.

    * liblzma speed optimizations:

        - Initialization of a new LZMA1 or LZMA2 encoder has been
          optimized. (The speed of reinitializing an already-allocated
          encoder isn't affected.) This helps when compressing many
          small buffers with lzma_stream_buffer_encode() and other
          similar situations where an already-allocated encoder state
(Continue reading)

Florian Weimer | 31 Jul 16:40 2014
Picon

Disabling CRC/SHA-256 checks on decompression

Would it be possible to add a flag to disable these checks during 
decompression?  I have data format and lots of data encoded in it (RPMs, 
in case you wonder) which has its own integrity checking, and 
unfortunately, all the existing XZ streams have been built with SHA-256 
hashing.  Being able to disable hashing would result in a nice speed-up 
for me (based on preliminary tests using hand-crafted RPMs).

--

-- 
Florian Weimer / Red Hat Product Security

Pavel Raiskup | 11 Jun 16:22 2014
Picon

xzgrep should success if at least one file matches

Hi, in RHBZ, there was reported problem with xzgrep, we should exit 0 when
at lest one file contains matching string.  Grep behaves similarly.

Original bugreport:
https://bugzilla.redhat.com/show_bug.cgi?id=1108085

Patch is attached,
Pavel
Lasse Collin | 25 May 21:51 2014

Re: marking version 5.1 stable?

On 2014-05-23 Pavel Raiskup wrote:
> Looking at the http://tukaani.org/xz/ page for some time, I am curious
> whether we could "stabilize" the version 5.1.  Almost all
> distributions are shipping alpha/beta versions of xz* packages which
> is probably not what especially library users want.

Yes, the current situation isn't good.

> What are plans on this topic?  I checked the TODO file and didn't find
> what exactly we need to fix to mark xz 5.1 stable.

For the past year or more, the plan has been to just get the 5.2.0 out.
It's so horribly late that I don't plan to do anything except fix bugs
and possibly some do simple enhancements. The rest must wait past 5.2.0.

Somehow months just pass and I get little done (with xz or anything
else). Anyway, here are some things that I plan to do before 5.2.0:

  * Skim through some of the new code in case I can spot problems that
    should be fixed before 5.2.0.

  * Ensure that the new APIs look OK for long-term support (I like to
    keep API & ABI stable).

  * Check that the new xz features are correctly documented on
    the xz man page.

  * Once I'm sure I won't change any message strings, I need to ask
    for updated translations from the translators.

(Continue reading)

Lasse Collin | 8 Mar 12:43 2014

XZ for Java 1.5

XZ for Java 1.5 is available at <http://tukaani.org/xz/java.html> and
in the Maven Central (groupId = org.tukaani, artifactId = xz). Here is
an extract from the NEWS file:

    * Fix a wrong assertion in BCJ decoders.

    * Use a field instead of reallocating a temporary one-byte buffer
      in read() and write() implementations in several classes.

--

-- 
Lasse Collin  |  IRC: Larhzu  <at>  IRCnet & Freenode

Mark Ashley | 2 Mar 07:06 2014

Solaris packages (done) and C99 code removal

Hi folks,

I've compiled up xz 5.0.4 on the following machines:

xz.5.0.4.SPARC.32bit.Solaris.10.pkg
xz.5.0.4.SPARC.32bit.Solaris.8.pkg
xz.5.0.4.SPARC.32bit.Solaris.9.pkg
xz.5.0.4.SPARC.64bit.Solaris.10.pkg
xz.5.0.4.SPARC.64bit.Solaris.11.pkg
xz.5.0.4.SPARC.64bit.Solaris.7.pkg
xz.5.0.4.SPARC.64bit.Solaris.8.pkg
xz.5.0.4.SPARC.64bit.Solaris.9.pkg
xz.5.0.4.i86pc.64bit.Solaris.11.pkg
xz.5.0.4.i86pc.Solaris.10.pkg
xz.5.0.4.i86pc.Solaris.11.pkg

Compilers used (the highest version that will work on that O.S.):
Solaris 7: Sun Studio 8
Solaris 8: Sun Studio 11
Solaris 9: Solaris Studio 12
Solaris 10 and Solaris 11: Sun Studio 12.3

The Solaris 7 was more problematic, the C99 support is very minimal in Sun Studio 8. I took out the C99 specific code in the xz source tree, making it C89 friendly (and thus portable to a lot more compilers - you should do this to the main code base IMHO). See the attached diff. I didn't do this in the test/* files.

The packages are now on:
http://www.ibiblio.org/pub/packages/solaris/sparc/

ta,
Mark.
diff -ruN xz-5.0.4.orig/configure xz-5.0.4/configure
--- xz-5.0.4.orig/configure	2012-06-22 11:56:05.000000000 +0000
+++ xz-5.0.4/configure	2014-03-02 02:03:07.921913000 +0000
 <at>  <at>  -5661,22 +5661,6  <at>  <at> 
   for (int i = 0; i < ia->datasize; ++i)
     ia->data[i] = i * 1.234;

-  // Check named initializers.
-  struct named_init ni = {
-    .number = 34,
-    .name = L"Test wide string",
-    .average = 543.34343,
-  };
-
-  ni.number = 58;
-
-  int dynamic_array[ni.number];
-  dynamic_array[ni.number - 1] = 543;
-
-  // work around unused variable warnings
-  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
-	  || dynamic_array[ni.number - 1] != 543);
-
   ;
   return 0;
 }
diff -ruN xz-5.0.4.orig/debug/known_sizes.c xz-5.0.4/debug/known_sizes.c
--- xz-5.0.4.orig/debug/known_sizes.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/debug/known_sizes.c	2014-03-02 03:28:57.714970000 +0000
 <at>  <at>  -47,19 +47,19  <at>  <at> 

 	lzma_filter filters[] = {
 		{
-			.id = LZMA_FILTER_LZMA2,
-			.options = &opt_lzma
+			LZMA_FILTER_LZMA2,
+			&opt_lzma
 		},
 		{
-			.id = LZMA_VLI_UNKNOWN
+			LZMA_VLI_UNKNOWN
 		}
 	};

 	lzma_block block = {
-		.check = LZMA_CHECK_CRC32,
-		.compressed_size = BUFFER_SIZE, // Worst case reserve
-		.uncompressed_size = in_size,
-		.filters = filters,
+		LZMA_CHECK_CRC32,
+		BUFFER_SIZE, // Worst case reserve
+		in_size,
+		filters,
 	};

 	lzma_stream strm = LZMA_STREAM_INIT;
diff -ruN xz-5.0.4.orig/src/liblzma/common/alone_decoder.c xz-5.0.4/src/liblzma/common/alone_decoder.c
--- xz-5.0.4.orig/src/liblzma/common/alone_decoder.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/common/alone_decoder.c	2014-03-02 02:37:02.687316000 +0000
 <at>  <at>  -126,10 +126,10  <at>  <at> 

 		lzma_filter_info filters[2] = {
 			{
-				.init = &lzma_lzma_decoder_init,
-				.options = &coder->options,
+				&lzma_lzma_decoder_init,
+				&coder->options,
 			}, {
-				.init = NULL,
+				NULL,
 			}
 		};

diff -ruN xz-5.0.4.orig/src/liblzma/common/alone_encoder.c xz-5.0.4/src/liblzma/common/alone_encoder.c
--- xz-5.0.4.orig/src/liblzma/common/alone_encoder.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/common/alone_encoder.c	2014-03-02 02:25:40.335544000 +0000
 <at>  <at>  -122,12 +122,12  <at>  <at> 
 	memset(next->coder->header + 1 + 4, 0xFF, 8);

 	// Initialize the LZMA encoder.
-	const lzma_filter_info filters[2] = {
+	lzma_filter_info filters[2] = {
 		{
-			.init = &lzma_lzma_encoder_init,
-			.options = (void *)(options),
+			&lzma_lzma_encoder_init,
+			(void *)(options),
 		}, {
-			.init = NULL,
+			NULL,
 		}
 	};

diff -ruN xz-5.0.4.orig/src/liblzma/common/block_buffer_encoder.c xz-5.0.4/src/liblzma/common/block_buffer_encoder.c
--- xz-5.0.4.orig/src/liblzma/common/block_buffer_encoder.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/common/block_buffer_encoder.c	2014-03-02 02:26:09.805622000 +0000
 <at>  <at>  -89,7 +89,7  <at>  <at> 
 	// all, but LZMA2 always requires a dictionary, so use the minimum
 	// value to minimize memory usage of the decoder.
 	lzma_options_lzma lzma2 = {
-		.dict_size = LZMA_DICT_SIZE_MIN,
+		LZMA_DICT_SIZE_MIN,
 	};

 	lzma_filter filters[2];
diff -ruN xz-5.0.4.orig/src/liblzma/common/common.h xz-5.0.4/src/liblzma/common/common.h
--- xz-5.0.4.orig/src/liblzma/common/common.h	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/common/common.h	2014-03-02 02:13:17.033574000 +0000
 <at>  <at>  -155,18 +155,28  <at>  <at> 
 			const lzma_filter *reversed_filters);
 };

+///	(lzma_next_coder){ \
+///		.coder = NULL, \
+///		.id = LZMA_VLI_UNKNOWN, \
+///		.init = (uintptr_t)(NULL), \
+///		.code = NULL, \
+///		.end = NULL, \
+///		.get_check = NULL, \
+///		.memconfig = NULL, \
+///		.update = NULL, \
+///	}

 /// Macro to initialize lzma_next_coder structure
 #define LZMA_NEXT_CODER_INIT \
 	(lzma_next_coder){ \
-		.coder = NULL, \
-		.init = (uintptr_t)(NULL), \
-		.id = LZMA_VLI_UNKNOWN, \
-		.code = NULL, \
-		.end = NULL, \
-		.get_check = NULL, \
-		.memconfig = NULL, \
-		.update = NULL, \
+		NULL, \
+		LZMA_VLI_UNKNOWN, \
+		(uintptr_t)(NULL), \
+		NULL, \
+		NULL, \
+		NULL, \
+		NULL, \
+		NULL, \
 	}

 
diff -ruN xz-5.0.4.orig/src/liblzma/common/filter_common.c xz-5.0.4/src/liblzma/common/filter_common.c
--- xz-5.0.4.orig/src/liblzma/common/filter_common.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/common/filter_common.c	2014-03-02 02:20:29.894746000 +0000
 <at>  <at>  -36,87 +36,91  <at>  <at> 
 } features[] = {
 #if defined (HAVE_ENCODER_LZMA1) || defined(HAVE_DECODER_LZMA1)
 	{
-		.id = LZMA_FILTER_LZMA1,
-		.options_size = sizeof(lzma_options_lzma),
-		.non_last_ok = false,
-		.last_ok = true,
-		.changes_size = true,
+		LZMA_FILTER_LZMA1,
+		sizeof(lzma_options_lzma),
+		false,
+		true,
+		true,
 	},
 #endif
 #if defined(HAVE_ENCODER_LZMA2) || defined(HAVE_DECODER_LZMA2)
 	{
-		.id = LZMA_FILTER_LZMA2,
-		.options_size = sizeof(lzma_options_lzma),
-		.non_last_ok = false,
-		.last_ok = true,
-		.changes_size = true,
+		LZMA_FILTER_LZMA2,
+		sizeof(lzma_options_lzma),
+		false,
+		true,
+		true,
 	},
 #endif
 #if defined(HAVE_ENCODER_X86) || defined(HAVE_DECODER_X86)
 	{
-		.id = LZMA_FILTER_X86,
-		.options_size = sizeof(lzma_options_bcj),
-		.non_last_ok = true,
-		.last_ok = false,
-		.changes_size = false,
+		LZMA_FILTER_X86,
+		sizeof(lzma_options_bcj),
+		true,
+		false,
+		false,
 	},
 #endif
 #if defined(HAVE_ENCODER_POWERPC) || defined(HAVE_DECODER_POWERPC)
 	{
-		.id = LZMA_FILTER_POWERPC,
-		.options_size = sizeof(lzma_options_bcj),
-		.non_last_ok = true,
-		.last_ok = false,
-		.changes_size = false,
+		LZMA_FILTER_POWERPC,
+		sizeof(lzma_options_bcj),
+		true,
+		false,
+		false,
 	},
 #endif
 #if defined(HAVE_ENCODER_IA64) || defined(HAVE_DECODER_IA64)
 	{
-		.id = LZMA_FILTER_IA64,
-		.options_size = sizeof(lzma_options_bcj),
-		.non_last_ok = true,
-		.last_ok = false,
-		.changes_size = false,
+		LZMA_FILTER_IA64,
+		sizeof(lzma_options_bcj),
+		true,
+		false,
+		false,
 	},
 #endif
 #if defined(HAVE_ENCODER_ARM) || defined(HAVE_DECODER_ARM)
 	{
-		.id = LZMA_FILTER_ARM,
-		.options_size = sizeof(lzma_options_bcj),
-		.non_last_ok = true,
-		.last_ok = false,
-		.changes_size = false,
+		LZMA_FILTER_ARM,
+		sizeof(lzma_options_bcj),
+		true,
+		false,
+		false,
 	},
 #endif
 #if defined(HAVE_ENCODER_ARMTHUMB) || defined(HAVE_DECODER_ARMTHUMB)
 	{
-		.id = LZMA_FILTER_ARMTHUMB,
-		.options_size = sizeof(lzma_options_bcj),
-		.non_last_ok = true,
-		.last_ok = false,
-		.changes_size = false,
+		LZMA_FILTER_ARMTHUMB,
+		sizeof(lzma_options_bcj),
+		true,
+		false,
+		false,
 	},
 #endif
 #if defined(HAVE_ENCODER_SPARC) || defined(HAVE_DECODER_SPARC)
 	{
-		.id = LZMA_FILTER_SPARC,
-		.options_size = sizeof(lzma_options_bcj),
-		.non_last_ok = true,
-		.last_ok = false,
-		.changes_size = false,
+		LZMA_FILTER_SPARC,
+		sizeof(lzma_options_bcj),
+		true,
+		false,
+		false,
 	},
 #endif
 #if defined(HAVE_ENCODER_DELTA) || defined(HAVE_DECODER_DELTA)
 	{
-		.id = LZMA_FILTER_DELTA,
-		.options_size = sizeof(lzma_options_delta),
-		.non_last_ok = true,
-		.last_ok = false,
-		.changes_size = false,
+		LZMA_FILTER_DELTA,
+		sizeof(lzma_options_delta),
+		true,
+		false,
+		false,
 	},
 #endif
 	{
-		.id = LZMA_VLI_UNKNOWN
+		LZMA_VLI_UNKNOWN,
+		NULL,
+		0,
+		0,
+		0,
 	}
 };

diff -ruN xz-5.0.4.orig/src/liblzma/common/filter_decoder.c xz-5.0.4/src/liblzma/common/filter_decoder.c
--- xz-5.0.4.orig/src/liblzma/common/filter_decoder.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/common/filter_decoder.c	2014-03-02 02:38:01.287487000 +0000
 <at>  <at>  -44,74 +44,74  <at>  <at> 
 static const lzma_filter_decoder decoders[] = {
 #ifdef HAVE_DECODER_LZMA1
 	{
-		.id = LZMA_FILTER_LZMA1,
-		.init = &lzma_lzma_decoder_init,
-		.memusage = &lzma_lzma_decoder_memusage,
-		.props_decode = &lzma_lzma_props_decode,
+		LZMA_FILTER_LZMA1,
+		&lzma_lzma_decoder_init,
+		&lzma_lzma_decoder_memusage,
+		&lzma_lzma_props_decode,
 	},
 #endif
 #ifdef HAVE_DECODER_LZMA2
 	{
-		.id = LZMA_FILTER_LZMA2,
-		.init = &lzma_lzma2_decoder_init,
-		.memusage = &lzma_lzma2_decoder_memusage,
-		.props_decode = &lzma_lzma2_props_decode,
+		LZMA_FILTER_LZMA2,
+		&lzma_lzma2_decoder_init,
+		&lzma_lzma2_decoder_memusage,
+		&lzma_lzma2_props_decode,
 	},
 #endif
 #ifdef HAVE_DECODER_X86
 	{
-		.id = LZMA_FILTER_X86,
-		.init = &lzma_simple_x86_decoder_init,
-		.memusage = NULL,
-		.props_decode = &lzma_simple_props_decode,
+		LZMA_FILTER_X86,
+		&lzma_simple_x86_decoder_init,
+		NULL,
+		&lzma_simple_props_decode,
 	},
 #endif
 #ifdef HAVE_DECODER_POWERPC
 	{
-		.id = LZMA_FILTER_POWERPC,
-		.init = &lzma_simple_powerpc_decoder_init,
-		.memusage = NULL,
-		.props_decode = &lzma_simple_props_decode,
+		LZMA_FILTER_POWERPC,
+		&lzma_simple_powerpc_decoder_init,
+		NULL,
+		&lzma_simple_props_decode,
 	},
 #endif
 #ifdef HAVE_DECODER_IA64
 	{
-		.id = LZMA_FILTER_IA64,
-		.init = &lzma_simple_ia64_decoder_init,
-		.memusage = NULL,
-		.props_decode = &lzma_simple_props_decode,
+		LZMA_FILTER_IA64,
+		&lzma_simple_ia64_decoder_init,
+		NULL,
+		&lzma_simple_props_decode,
 	},
 #endif
 #ifdef HAVE_DECODER_ARM
 	{
-		.id = LZMA_FILTER_ARM,
-		.init = &lzma_simple_arm_decoder_init,
-		.memusage = NULL,
-		.props_decode = &lzma_simple_props_decode,
+		LZMA_FILTER_ARM,
+		&lzma_simple_arm_decoder_init,
+		NULL,
+		&lzma_simple_props_decode,
 	},
 #endif
 #ifdef HAVE_DECODER_ARMTHUMB
 	{
-		.id = LZMA_FILTER_ARMTHUMB,
-		.init = &lzma_simple_armthumb_decoder_init,
-		.memusage = NULL,
-		.props_decode = &lzma_simple_props_decode,
+		LZMA_FILTER_ARMTHUMB,
+		&lzma_simple_armthumb_decoder_init,
+		NULL,
+		&lzma_simple_props_decode,
 	},
 #endif
 #ifdef HAVE_DECODER_SPARC
 	{
-		.id = LZMA_FILTER_SPARC,
-		.init = &lzma_simple_sparc_decoder_init,
-		.memusage = NULL,
-		.props_decode = &lzma_simple_props_decode,
+		LZMA_FILTER_SPARC,
+		&lzma_simple_sparc_decoder_init,
+		NULL,
+		&lzma_simple_props_decode,
 	},
 #endif
 #ifdef HAVE_DECODER_DELTA
 	{
-		.id = LZMA_FILTER_DELTA,
-		.init = &lzma_delta_decoder_init,
-		.memusage = &lzma_delta_coder_memusage,
-		.props_decode = &lzma_delta_props_decode,
+		LZMA_FILTER_DELTA,
+		&lzma_delta_decoder_init,
+		&lzma_delta_coder_memusage,
+		&lzma_delta_props_decode,
 	},
 #endif
 };
diff -ruN xz-5.0.4.orig/src/liblzma/common/filter_encoder.c xz-5.0.4/src/liblzma/common/filter_encoder.c
--- xz-5.0.4.orig/src/liblzma/common/filter_encoder.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/common/filter_encoder.c	2014-03-02 02:34:20.856903000 +0000
 <at>  <at>  -53,98 +53,104  <at>  <at> 
 } lzma_filter_encoder;

 
-static const lzma_filter_encoder encoders[] = {
+lzma_filter_encoder encoders[] = {
 #ifdef HAVE_ENCODER_LZMA1
 	{
-		.id = LZMA_FILTER_LZMA1,
-		.init = &lzma_lzma_encoder_init,
-		.memusage = &lzma_lzma_encoder_memusage,
-		.chunk_size = NULL, // FIXME
-		.props_size_get = NULL,
-		.props_size_fixed = 5,
-		.props_encode = &lzma_lzma_props_encode,
+		LZMA_FILTER_LZMA1,
+		&lzma_lzma_encoder_init,
+		&lzma_lzma_encoder_memusage,
+		NULL, // FIXME
+		NULL,
+		5,
+		&lzma_lzma_props_encode,
 	},
 #endif
 #ifdef HAVE_ENCODER_LZMA2
 	{
-		.id = LZMA_FILTER_LZMA2,
-		.init = &lzma_lzma2_encoder_init,
-		.memusage = &lzma_lzma2_encoder_memusage,
-		.chunk_size = NULL, // FIXME
-		.props_size_get = NULL,
-		.props_size_fixed = 1,
-		.props_encode = &lzma_lzma2_props_encode,
+		LZMA_FILTER_LZMA2,
+		&lzma_lzma2_encoder_init,
+		&lzma_lzma2_encoder_memusage,
+		NULL, // FIXME
+		NULL,
+		1,
+		&lzma_lzma2_props_encode,
 	},
 #endif
 #ifdef HAVE_ENCODER_X86
 	{
-		.id = LZMA_FILTER_X86,
-		.init = &lzma_simple_x86_encoder_init,
-		.memusage = NULL,
-		.chunk_size = NULL,
-		.props_size_get = &lzma_simple_props_size,
-		.props_encode = &lzma_simple_props_encode,
+		LZMA_FILTER_X86,
+		&lzma_simple_x86_encoder_init,
+		NULL,
+		NULL,
+		&lzma_simple_props_size,
+		1,
+		&lzma_simple_props_encode,
 	},
 #endif
 #ifdef HAVE_ENCODER_POWERPC
 	{
-		.id = LZMA_FILTER_POWERPC,
-		.init = &lzma_simple_powerpc_encoder_init,
-		.memusage = NULL,
-		.chunk_size = NULL,
-		.props_size_get = &lzma_simple_props_size,
-		.props_encode = &lzma_simple_props_encode,
+		LZMA_FILTER_POWERPC,
+		&lzma_simple_powerpc_encoder_init,
+		NULL,
+		NULL,
+		&lzma_simple_props_size,
+		1,
+		&lzma_simple_props_encode,
 	},
 #endif
 #ifdef HAVE_ENCODER_IA64
 	{
-		.id = LZMA_FILTER_IA64,
-		.init = &lzma_simple_ia64_encoder_init,
-		.memusage = NULL,
-		.chunk_size = NULL,
-		.props_size_get = &lzma_simple_props_size,
-		.props_encode = &lzma_simple_props_encode,
+		LZMA_FILTER_IA64,
+		&lzma_simple_ia64_encoder_init,
+		NULL,
+		NULL,
+		&lzma_simple_props_size,
+		1,
+		&lzma_simple_props_encode,
 	},
 #endif
 #ifdef HAVE_ENCODER_ARM
 	{
-		.id = LZMA_FILTER_ARM,
-		.init = &lzma_simple_arm_encoder_init,
-		.memusage = NULL,
-		.chunk_size = NULL,
-		.props_size_get = &lzma_simple_props_size,
-		.props_encode = &lzma_simple_props_encode,
+		LZMA_FILTER_ARM,
+		&lzma_simple_arm_encoder_init,
+		NULL,
+		NULL,
+		&lzma_simple_props_size,
+		1,
+		&lzma_simple_props_encode,
 	},
 #endif
 #ifdef HAVE_ENCODER_ARMTHUMB
 	{
-		.id = LZMA_FILTER_ARMTHUMB,
-		.init = &lzma_simple_armthumb_encoder_init,
-		.memusage = NULL,
-		.chunk_size = NULL,
-		.props_size_get = &lzma_simple_props_size,
-		.props_encode = &lzma_simple_props_encode,
+		LZMA_FILTER_ARMTHUMB,
+		&lzma_simple_armthumb_encoder_init,
+		NULL,
+		NULL,
+		&lzma_simple_props_size,
+		1,
+		&lzma_simple_props_encode,
 	},
 #endif
 #ifdef HAVE_ENCODER_SPARC
 	{
-		.id = LZMA_FILTER_SPARC,
-		.init = &lzma_simple_sparc_encoder_init,
-		.memusage = NULL,
-		.chunk_size = NULL,
-		.props_size_get = &lzma_simple_props_size,
-		.props_encode = &lzma_simple_props_encode,
+		LZMA_FILTER_SPARC,
+		&lzma_simple_sparc_encoder_init,
+		NULL,
+		NULL,
+		&lzma_simple_props_size,
+		1,
+		&lzma_simple_props_encode,
 	},
 #endif
 #ifdef HAVE_ENCODER_DELTA
 	{
-		.id = LZMA_FILTER_DELTA,
-		.init = &lzma_delta_encoder_init,
-		.memusage = &lzma_delta_coder_memusage,
-		.chunk_size = NULL,
-		.props_size_get = NULL,
-		.props_size_fixed = 1,
-		.props_encode = &lzma_delta_props_encode,
+		LZMA_FILTER_DELTA,
+		&lzma_delta_encoder_init,
+		&lzma_delta_coder_memusage,
+		NULL,
+		NULL,
+		1,
+		&lzma_delta_props_encode,
 	},
 #endif
 };
diff -ruN xz-5.0.4.orig/src/liblzma/common/index.c xz-5.0.4/src/liblzma/common/index.c
--- xz-5.0.4.orig/src/liblzma/common/index.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/common/index.c	2014-03-02 02:23:35.705250000 +0000
 <at>  <at>  -834,12 +834,12  <at>  <at> 

 	// Add all the Streams from src to dest. Update the base offsets
 	// of each Stream from src.
-	const index_cat_info info = {
-		.uncompressed_size = dest->uncompressed_size,
-		.file_size = dest_file_size,
-		.stream_number_add = dest->streams.count,
-		.block_number_add = dest->record_count,
-		.streams = &dest->streams,
+	index_cat_info info= {
+		dest->uncompressed_size,
+		dest_file_size,
+		dest->streams.count,
+		dest->record_count,
+		&dest->streams,
 	};
 	index_cat_helper(&info, (index_stream *)(src->streams.root));

diff -ruN xz-5.0.4.orig/src/liblzma/common/index_hash.c xz-5.0.4/src/liblzma/common/index_hash.c
--- xz-5.0.4.orig/src/liblzma/common/index_hash.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/common/index_hash.c	2014-03-02 02:38:25.717558000 +0000
 <at>  <at>  -130,7 +130,7  <at>  <at> 
 			+ lzma_vli_size(uncompressed_size);
 	++info->count;

-	const lzma_vli sizes[2] = { unpadded_size, uncompressed_size };
+	lzma_vli sizes[2] = { unpadded_size, uncompressed_size };
 	lzma_check_update(&info->check, LZMA_CHECK_BEST,
 			(const uint8_t *)(sizes), sizeof(sizes));

diff -ruN xz-5.0.4.orig/src/liblzma/common/stream_buffer_encoder.c xz-5.0.4/src/liblzma/common/stream_buffer_encoder.c
--- xz-5.0.4.orig/src/liblzma/common/stream_buffer_encoder.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/common/stream_buffer_encoder.c	2014-03-02 02:35:03.147014000 +0000
 <at>  <at>  -74,8 +74,8  <at>  <at> 

 	// Encode the Stream Header.
 	lzma_stream_flags stream_flags = {
-		.version = 0,
-		.check = check,
+		0,
+		check,
 	};

 	if (lzma_stream_header_encode(&stream_flags, out + out_pos)
 <at>  <at>  -86,9 +86,9  <at>  <at> 

 	// Encode a Block but only if there is at least one byte of input.
 	lzma_block block = {
-		.version = 0,
-		.check = check,
-		.filters = filters,
+		0,
+		check,
+		filters,
 	};

 	if (in_size > 0)
diff -ruN xz-5.0.4.orig/src/liblzma/common/stream_encoder.c xz-5.0.4/src/liblzma/common/stream_encoder.c
--- xz-5.0.4.orig/src/liblzma/common/stream_encoder.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/common/stream_encoder.c	2014-03-02 02:36:12.297188000 +0000
 <at>  <at>  -184,10 +184,10  <at>  <at> 
 			return ret;

 		// Encode the Stream Footer into coder->buffer.
-		const lzma_stream_flags stream_flags = {
-			.version = 0,
-			.backward_size = lzma_index_size(coder->index),
-			.check = coder->block_options.check,
+		lzma_stream_flags stream_flags = {
+			0,
+			lzma_index_size(coder->index),
+			coder->block_options.check,
 		};

 		if (lzma_stream_footer_encode(&stream_flags, coder->buffer)
 <at>  <at>  -299,8 +299,8  <at>  <at> 

 	// Encode the Stream Header
 	lzma_stream_flags stream_flags = {
-		.version = 0,
-		.check = check,
+		0,
+		check,
 	};
 	return_if_error(lzma_stream_header_encode(
 			&stream_flags, next->coder->buffer));
Binary files xz-5.0.4.orig/src/liblzma/core and xz-5.0.4/src/liblzma/core differ
diff -ruN xz-5.0.4.orig/src/liblzma/lz/lz_decoder.h xz-5.0.4/src/liblzma/lz/lz_decoder.h
--- xz-5.0.4.orig/src/liblzma/lz/lz_decoder.h	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/lz/lz_decoder.h	2014-03-02 02:40:50.077977000 +0000
 <at>  <at>  -74,11 +74,11  <at>  <at> 

 #define LZMA_LZ_DECODER_INIT \
 	(lzma_lz_decoder){ \
-		.coder = NULL, \
-		.code = NULL, \
-		.reset = NULL, \
-		.set_uncompressed = NULL, \
-		.end = NULL, \
+		NULL, \
+		NULL, \
+		NULL, \
+		NULL, \
+		NULL, \
 	}

 
diff -ruN xz-5.0.4.orig/src/liblzma/lz/lz_encoder.c xz-5.0.4/src/liblzma/lz/lz_encoder.c
--- xz-5.0.4.orig/src/liblzma/lz/lz_encoder.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/lz/lz_encoder.c	2014-03-02 02:39:29.177754000 +0000
 <at>  <at>  -443,10 +443,10  <at>  <at> 
 {
 	// Old buffers must not exist when calling lz_encoder_prepare().
 	lzma_mf mf = {
-		.buffer = NULL,
-		.hash = NULL,
-		.hash_size_sum = 0,
-		.sons_count = 0,
+		NULL,
+		NULL,
+		0,
+		0,
 	};

 	// Setup the size information into mf.
diff -ruN xz-5.0.4.orig/src/liblzma/lzma/lzma_decoder.c xz-5.0.4/src/liblzma/lzma/lzma_decoder.c
--- xz-5.0.4.orig/src/liblzma/lzma/lzma_decoder.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/lzma/lzma_decoder.c	2014-03-02 03:16:38.853062000 +0000
 <at>  <at>  -853,6 +853,7  <at>  <at> 
 static void
 lzma_decoder_reset(lzma_coder *coder, const void *opt)
 {
+	uint32_t num_pos_states;
 	const lzma_options_lzma *options = opt;

 	// NOTE: We assume that lc/lp/pb are valid since they were
 <at>  <at>  -900,7 +901,7  <at>  <at> 
 	bittree_reset(coder->pos_align, ALIGN_BITS);

 	// Len decoders (also bit/bittree)
-	const uint32_t num_pos_states = 1U << options->pb;
+	num_pos_states = 1U << options->pb;
 	bit_reset(coder->match_len_decoder.choice);
 	bit_reset(coder->match_len_decoder.choice2);
 	bit_reset(coder->rep_len_decoder.choice);
diff -ruN xz-5.0.4.orig/src/liblzma/lzma/lzma_encoder_optimum_normal.c xz-5.0.4/src/liblzma/lzma/lzma_encoder_optimum_normal.c
--- xz-5.0.4.orig/src/liblzma/lzma/lzma_encoder_optimum_normal.c	2012-06-22
06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/lzma/lzma_encoder_optimum_normal.c	2014-03-02 03:15:47.112926000 +0000
 <at>  <at>  -276,6 +276,7  <at>  <at> 
 {
 	const uint32_t nice_len = mf->nice_len;

+	uint32_t len;
 	uint32_t len_main;
 	uint32_t matches_count;

 <at>  <at>  -384,7 +385,7  <at>  <at> 
 	for (uint32_t i = 0; i < REP_DISTANCES; ++i)
 		coder->opts[0].backs[i] = coder->reps[i];

-	uint32_t len = len_end;
+	len = len_end;
 	do {
 		coder->opts[len].price = RC_INFINITY_PRICE;
 	} while (--len >= 2);
 <at>  <at>  -456,6 +457,12  <at>  <at> 
 	uint32_t new_len = coder->longest_match_length;
 	uint32_t pos_prev = coder->opts[cur].pos_prev;
 	lzma_lzma_state state;
+	uint32_t cur_price;
+	uint32_t pos_state;
+	uint32_t cur_and_1_price;
+	uint8_t current_byte;
+	uint8_t match_byte;
+	bool next_is_literal;

 	if (coder->opts[cur].prev_1_is_literal) {
 		--pos_prev;
 <at>  <at>  -521,19 +528,19  <at>  <at> 
 	for (uint32_t i = 0; i < REP_DISTANCES; ++i)
 		coder->opts[cur].backs[i] = reps[i];

-	const uint32_t cur_price = coder->opts[cur].price;
+	cur_price = coder->opts[cur].price;

-	const uint8_t current_byte = *buf;
-	const uint8_t match_byte = *(buf - reps[0] - 1);
+	current_byte = *buf;
+	match_byte = *(buf - reps[0] - 1);

-	const uint32_t pos_state = position & coder->pos_mask;
+	pos_state = position & coder->pos_mask;

-	const uint32_t cur_and_1_price = cur_price
+	cur_and_1_price = cur_price
 			+ rc_bit_0_price(coder->is_match[state][pos_state])
 			+ get_literal_price(coder, position, buf[-1],
 			!is_literal_state(state), match_byte, current_byte);

-	bool next_is_literal = false;
+	next_is_literal = false;

 	if (cur_and_1_price < coder->opts[cur + 1].price) {
 		coder->opts[cur + 1].price = cur_and_1_price;
diff -ruN xz-5.0.4.orig/src/liblzma/simple/ia64.c xz-5.0.4/src/liblzma/simple/ia64.c
--- xz-5.0.4.orig/src/liblzma/simple/ia64.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/liblzma/simple/ia64.c	2014-03-02 03:18:04.443290000 +0000
 <at>  <at>  -19,6 +19,7  <at>  <at> 
 		uint32_t now_pos, bool is_encoder,
 		uint8_t *buffer, size_t size)
 {
+	uint64_t inst_norm;
 	static const uint32_t BRANCH_TABLE[32] = {
 		0, 0, 0, 0, 0, 0, 0, 0,
 		0, 0, 0, 0, 0, 0, 0, 0,
 <at>  <at>  -45,7 +46,7  <at>  <at> 
 						buffer[i + j + byte_pos])
 						<< (8 * j);

-			uint64_t inst_norm = instruction >> bit_res;
+			inst_norm = instruction >> bit_res;

 			if (((inst_norm >> 37) & 0xF) == 0x5
 					&& ((inst_norm >> 9) & 0x7) == 0
diff -ruN xz-5.0.4.orig/src/lzmainfo/lzmainfo.c xz-5.0.4/src/lzmainfo/lzmainfo.c
--- xz-5.0.4.orig/src/lzmainfo/lzmainfo.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/lzmainfo/lzmainfo.c	2014-03-02 03:25:41.314446000 +0000
 <at>  <at>  -100,6 +100,7  <at>  <at> 
 static bool
 lzmainfo(const char *name, FILE *f)
 {
+	lzma_options_lzma *opt;
 	uint8_t buf[13];
 	const size_t size = fread(buf, 1, sizeof(buf), f);
 	if (size != 13) {
 <at>  <at>  -109,7 +110,7  <at>  <at> 
 		return true;
 	}

-	lzma_filter filter = { .id = LZMA_FILTER_LZMA1 };
+	lzma_filter filter = { LZMA_FILTER_LZMA1 };

 	// Parse the first five bytes.
 	switch (lzma_properties_decode(&filter, NULL, buf, 5)) {
 <at>  <at>  -152,7 +153,7  <at>  <at> 
 					/ (1024 * 1024),
 				uncompressed_size);

-	lzma_options_lzma *opt = filter.options;
+	opt = filter.options;

 	printf("\nDictionary size:               "
 			"%" PRIu32 " MB (2^%" PRIu32 " bytes)\n"
diff -ruN xz-5.0.4.orig/src/xz/coder.c xz-5.0.4/src/xz/coder.c
--- xz-5.0.4.orig/src/xz/coder.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/xz/coder.c	2014-03-02 03:19:34.523542000 +0000
 <at>  <at>  -116,6 +116,8  <at>  <at> 
 coder_set_compression_settings(void)
 {
 	// Options for LZMA1 or LZMA2 in case we are using a preset.
+	uint64_t memory_limit;
+	uint64_t memory_usage;
 	static lzma_options_lzma opt_lzma;

 	if (filters_count == 0) {
 <at>  <at>  -171,8 +173,7  <at>  <at> 
 	// If using --format=raw, we can be decoding. The memusage function
 	// also validates the filter chain and the options used for the
 	// filters.
-	const uint64_t memory_limit = hardware_memlimit_get(opt_mode);
-	uint64_t memory_usage;
+	memory_limit = hardware_memlimit_get(opt_mode);
 	if (opt_mode == MODE_COMPRESS)
 		memory_usage = lzma_raw_encoder_memusage(filters);
 	else
 <at>  <at>  -300,7 +301,7  <at>  <at> 
 		return false;

 	// Decode the LZMA1 properties.
-	lzma_filter filter = { .id = LZMA_FILTER_LZMA1 };
+	lzma_filter filter = { LZMA_FILTER_LZMA1 };
 	if (lzma_properties_decode(&filter, NULL, in_buf.u8, 5) != LZMA_OK)
 		return false;

diff -ruN xz-5.0.4.orig/src/xz/file_io.c xz-5.0.4/src/xz/file_io.c
--- xz-5.0.4.orig/src/xz/file_io.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/xz/file_io.c	2014-03-02 03:19:58.713609000 +0000
 <at>  <at>  -518,13 +518,13  <at>  <at> 
 	static file_pair pair;

 	pair = (file_pair){
-		.src_name = src_name,
-		.dest_name = NULL,
-		.src_fd = -1,
-		.dest_fd = -1,
-		.src_eof = false,
-		.dest_try_sparse = false,
-		.dest_pending_sparse = 0,
+		src_name,
+		NULL,
+		-1,
+		-1,
+		false,
+		false,
+		0,
 	};

 	// Block the signals, for which we have a custom signal handler, so
diff -ruN xz-5.0.4.orig/src/xz/options.c xz-5.0.4/src/xz/options.c
--- xz-5.0.4.orig/src/xz/options.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/xz/options.c	2014-03-02 03:20:31.943696000 +0000
 <at>  <at>  -173,8 +173,8  <at>  <at> 
 	lzma_options_delta *options = xmalloc(sizeof(lzma_options_delta));
 	*options = (lzma_options_delta){
 		// It's hard to give a useful default for this.
-		.type = LZMA_DELTA_TYPE_BYTE,
-		.dist = LZMA_DELTA_DIST_MIN,
+		LZMA_DELTA_TYPE_BYTE,
+		LZMA_DELTA_DIST_MIN,
 	};

 	parse_options(str, opts, &set_delta, options);
 <at>  <at>  -215,7 +215,7  <at>  <at> 

 	lzma_options_bcj *options = xmalloc(sizeof(lzma_options_bcj));
 	*options = (lzma_options_bcj){
-		.start_offset = 0,
+		0,
 	};

 	parse_options(str, opts, &set_bcj, options);
diff -ruN xz-5.0.4.orig/src/xz/signals.c xz-5.0.4/src/xz/signals.c
--- xz-5.0.4.orig/src/xz/signals.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/src/xz/signals.c	2014-03-02 03:24:28.314262000 +0000
 <at>  <at>  -49,6 +49,7  <at>  <at> 
 signals_init(void)
 {
 	// List of signals for which we establish the signal handler.
+	struct sigaction mysa;
 	static const int sigs[] = {
 		SIGINT,
 		SIGTERM,
 <at>  <at>  -77,17 +78,16  <at>  <at> 
 		sigaddset(&hooked_signals, message_progress_sigs[i]);
 #endif

-	struct sigaction sa;

 	// All the signals that we handle we also blocked while the signal
 	// handler runs.
-	sa.sa_mask = hooked_signals;
+	mysa.sa_mask = hooked_signals;

 	// Don't set SA_RESTART, because we want EINTR so that we can check
 	// for user_abort and cleanup before exiting. We block the signals
 	// for which we have established a handler when we don't want EINTR.
-	sa.sa_flags = 0;
-	sa.sa_handler = &signal_handler;
+	mysa.sa_flags = 0;
+	mysa.sa_handler = &signal_handler;

 	for (size_t i = 0; i < ARRAY_SIZE(sigs); ++i) {
 		// If the parent process has left some signals ignored,
 <at>  <at>  -98,7 +98,7  <at>  <at> 
 			continue;

 		// Establish the signal handler.
-		if (sigaction(sigs[i], &sa, NULL))
+		if (sigaction(sigs[i], &mysa, NULL))
 			message_signal_handler();
 	}

diff -ruN xz-5.0.4.orig/stdbool.h xz-5.0.4/stdbool.h
--- xz-5.0.4.orig/stdbool.h	1970-01-01 00:00:00.000000000 +0000
+++ xz-5.0.4/stdbool.h	2014-03-02 02:03:08.061926000 +0000
 <at>  <at>  -0,0 +1,5  <at>  <at> 
+#if !defined(bool)
+#define bool int
+#endif
+#define false 0
+#define true 1
diff -ruN xz-5.0.4.orig/tests/test_block_header.c xz-5.0.4/tests/test_block_header.c
--- xz-5.0.4.orig/tests/test_block_header.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/tests/test_block_header.c	2014-03-02 03:28:09.384859000 +0000
 <at>  <at>  -21,58 +21,58  <at>  <at> 

 static lzma_filter filters_none[1] = {
 	{
-		.id = LZMA_VLI_UNKNOWN,
+		LZMA_VLI_UNKNOWN,
 	},
 };

 
 static lzma_filter filters_one[2] = {
 	{
-		.id = LZMA_FILTER_LZMA2,
-		.options = &opt_lzma,
+		LZMA_FILTER_LZMA2,
+		&opt_lzma,
 	}, {
-		.id = LZMA_VLI_UNKNOWN,
+		LZMA_VLI_UNKNOWN,
 	}
 };

 
 static lzma_filter filters_four[5] = {
 	{
-		.id = LZMA_FILTER_X86,
-		.options = NULL,
+		LZMA_FILTER_X86,
+		NULL,
 	}, {
-		.id = LZMA_FILTER_X86,
-		.options = NULL,
+		LZMA_FILTER_X86,
+		NULL,
 	}, {
-		.id = LZMA_FILTER_X86,
-		.options = NULL,
+		LZMA_FILTER_X86,
+		NULL,
 	}, {
-		.id = LZMA_FILTER_LZMA2,
-		.options = &opt_lzma,
+		LZMA_FILTER_LZMA2,
+		&opt_lzma,
 	}, {
-		.id = LZMA_VLI_UNKNOWN,
+		LZMA_VLI_UNKNOWN,
 	}
 };

 
 static lzma_filter filters_five[6] = {
 	{
-		.id = LZMA_FILTER_X86,
-		.options = NULL,
+		LZMA_FILTER_X86,
+		NULL,
 	}, {
-		.id = LZMA_FILTER_X86,
-		.options = NULL,
+		LZMA_FILTER_X86,
+		NULL,
 	}, {
-		.id = LZMA_FILTER_X86,
-		.options = NULL,
+		LZMA_FILTER_X86,
+		NULL,
 	}, {
-		.id = LZMA_FILTER_X86,
-		.options = NULL,
+		LZMA_FILTER_X86,
+		NULL,
 	}, {
-		.id = LZMA_FILTER_LZMA2,
-		.options = &opt_lzma,
+		LZMA_FILTER_LZMA2,
+		&opt_lzma,
 	}, {
-		.id = LZMA_VLI_UNKNOWN,
+		LZMA_VLI_UNKNOWN,
 	}
 };

 <at>  <at>  -110,10 +110,10  <at>  <at> 
 test1(void)
 {
 	known_options = (lzma_block){
-		.check = LZMA_CHECK_NONE,
-		.compressed_size = LZMA_VLI_UNKNOWN,
-		.uncompressed_size = LZMA_VLI_UNKNOWN,
-		.filters = NULL,
+		LZMA_CHECK_NONE,
+		LZMA_VLI_UNKNOWN,
+		LZMA_VLI_UNKNOWN,
+		NULL,
 	};

 	expect(lzma_block_header_size(&known_options) == LZMA_PROG_ERROR);
diff -ruN xz-5.0.4.orig/tests/test_filter_flags.c xz-5.0.4/tests/test_filter_flags.c
--- xz-5.0.4.orig/tests/test_filter_flags.c	2012-06-22 06:22:30.000000000 +0000
+++ xz-5.0.4/tests/test_filter_flags.c	2014-03-02 03:26:34.004613000 +0000
 <at>  <at>  -117,8 +117,8  <at>  <at> 

 	// Test 2
 	lzma_options_delta options = {
-		.type = LZMA_DELTA_TYPE_BYTE,
-		.dist = 0
+		LZMA_DELTA_TYPE_BYTE,
+		0
 	};
 	known_flags.options = &options;
 	expect(encode(99));
Stefan Bodewig | 28 Feb 12:32 2014
Picon

[java] assert in SimpleInputStream's constructor

Hi,

I'm in the process of adding BCJ support to Apache Commons Compress' 7z
package.  Basically I do something like

   X86Options.getInputStream(stream) 

with XZ's X86Options class.  Which leads to an AssertionError.

X86Options does

    public InputStream getInputStream(InputStream in) {
        return new SimpleInputStream(in, new X86(false, startOffset));
    }

and SimpleInputStream does

    SimpleInputStream(InputStream in, SimpleFilter simpleFilter) {
        ...
        assert simpleFilter == null;

which is obviously wrong.  I think != is intended (and matches the
comment right in front of the assert).

Cheers

        Stefan

Brandon Fergerson | 2 Feb 23:12 2014

Inserting Compressed Data Into Compressed File

Hello, I am trying to make a compressed map file for a game I’m working on but I’m having a bit of trouble with making changes to the compressed file. The map files that my game creates are very big but a lot of that data is repetitive so I what I do is I create a big empty map and then compress it. This allows me to have massive maps within tiny files. Now I realize they are only small because it is compressing repeated 0's but even when the actual values of the tiles of the map are implemented they will still be rather repetitive so the size should still remain somewhat small.

With that being said I've been trying to find out how to write compressed data to a compressed file. My game’s map structure is formatted in a way such that a collection of tiles is grouped into a block. So each XZ Block contains a certain amount of tiles. What I would like to do is when a player changes tiles of the map the map would find the XZ Block that the modified tile is in and rewrite that entire compressed block but with the new compressed data. From my understanding of how the block compression works, rewriting an entire block shouldn't be any trouble since each block is compressed separately. However, there doesn’t seem to be any way to do this. Something like SeekableXZInputStream’s “seekToBlock(int blockNumber)” function would be perfect. Is there any reason a SeekableXZOutputStream was not made or needed?

So my question is how possible is this and hard would it be? Are there indexes of the locations of the XZ Blocks somewhere that would have to be updated?

Thank you

--
Brandon J. Fergerson

Gmane