From e4d3914639d1e7b41337c9626b91458c4fe6ae95 Mon Sep 17 00:00:00 2001 From: liblzma upstream Date: Sun, 21 Dec 2014 17:06:21 +0200 Subject: [PATCH] liblzma 2014-12-21 (265e5ffb) Code extracted from: http://git.tukaani.org/xz.git at commit 265e5ffb70d9c175b424621576294d28807efd9b (v5.0.8). --- liblzma/Makefile.am | 22 +++++++++++++++++++++- liblzma/api/lzma/block.h | 3 +++ liblzma/api/lzma/version.h | 2 +- liblzma/check/crc32_fast.c | 2 +- liblzma/check/sha256.c | 2 +- liblzma/lzma/lzma_encoder_presets.c | 8 +++++--- 6 files changed, 32 insertions(+), 7 deletions(-) diff --git a/liblzma/Makefile.am b/liblzma/Makefile.am index 0529ff848..c81990a94 100644 --- a/liblzma/Makefile.am +++ b/liblzma/Makefile.am @@ -24,7 +24,7 @@ liblzma_la_CPPFLAGS = \ -I$(top_srcdir)/src/liblzma/simple \ -I$(top_srcdir)/src/common \ -DTUKLIB_SYMBOL_PREFIX=lzma_ -liblzma_la_LDFLAGS = -no-undefined -version-info 5:5:0 +liblzma_la_LDFLAGS = -no-undefined -version-info 5:8:0 include $(srcdir)/common/Makefile.inc include $(srcdir)/check/Makefile.inc @@ -88,3 +88,23 @@ endif pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = liblzma.pc EXTRA_DIST += liblzma.pc.in + +pc_verbose = $(pc_verbose_@AM_V@) +pc_verbose_ = $(pc_verbose_@AM_DEFAULT_V@) +pc_verbose_0 = @echo " PC " $@; + +liblzma.pc: $(srcdir)/liblzma.pc.in + $(AM_V_at)rm -f $@ + $(pc_verbose)sed \ + -e 's,@prefix[@],$(prefix),g' \ + -e 's,@exec_prefix[@],$(exec_prefix),g' \ + -e 's,@libdir[@],$(libdir),g' \ + -e 's,@includedir[@],$(includedir),g' \ + -e 's,@PACKAGE_URL[@],$(PACKAGE_URL),g' \ + -e 's,@PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \ + -e 's,@PTHREAD_CFLAGS[@],$(PTHREAD_CFLAGS),g' \ + -e 's,@PTHREAD_LIBS[@],$(PTHREAD_LIBS),g' \ + < $(srcdir)/liblzma.pc.in > $@ || { rm -f $@; exit 1; } + +clean-local: + rm -f liblzma.pc diff --git a/liblzma/api/lzma/block.h b/liblzma/api/lzma/block.h index 8a4bf2323..e6710a7bc 100644 --- a/liblzma/api/lzma/block.h +++ b/liblzma/api/lzma/block.h @@ -318,6 +318,9 @@ extern LZMA_API(lzma_ret) lzma_block_header_encode( * The size of the Block Header must have already been decoded with * lzma_block_header_size_decode() macro and stored to block->header_size. * + * The integrity check type from Stream Header must have been stored + * to block->check. + * * block->filters must have been allocated, but they don't need to be * initialized (possible existing filter options are not freed). * diff --git a/liblzma/api/lzma/version.h b/liblzma/api/lzma/version.h index 66e93965d..09866b982 100644 --- a/liblzma/api/lzma/version.h +++ b/liblzma/api/lzma/version.h @@ -22,7 +22,7 @@ */ #define LZMA_VERSION_MAJOR 5 #define LZMA_VERSION_MINOR 0 -#define LZMA_VERSION_PATCH 5 +#define LZMA_VERSION_PATCH 8 #define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE #ifndef LZMA_VERSION_COMMIT diff --git a/liblzma/check/crc32_fast.c b/liblzma/check/crc32_fast.c index 94da85592..3de02638d 100644 --- a/liblzma/check/crc32_fast.c +++ b/liblzma/check/crc32_fast.c @@ -20,7 +20,7 @@ #include "crc_macros.h" -// If you make any changes, do some bench marking! Seemingly unrelated +// If you make any changes, do some benchmarking! Seemingly unrelated // changes can very easily ruin the performance (and very probably is // very compiler dependent). extern LZMA_API(uint32_t) diff --git a/liblzma/check/sha256.c b/liblzma/check/sha256.c index 23bda9222..f2cc0d71a 100644 --- a/liblzma/check/sha256.c +++ b/liblzma/check/sha256.c @@ -80,7 +80,7 @@ static const uint32_t SHA256_K[64] = { static void -transform(uint32_t state[static 8], const uint32_t data[static 16]) +transform(uint32_t state[8], const uint32_t data[16]) { uint32_t W[16]; uint32_t T[8]; diff --git a/liblzma/lzma/lzma_encoder_presets.c b/liblzma/lzma/lzma_encoder_presets.c index 21e427a8d..8484b7744 100644 --- a/liblzma/lzma/lzma_encoder_presets.c +++ b/liblzma/lzma/lzma_encoder_presets.c @@ -30,14 +30,16 @@ lzma_lzma_preset(lzma_options_lzma *options, uint32_t preset) options->lp = LZMA_LP_DEFAULT; options->pb = LZMA_PB_DEFAULT; - options->dict_size = UINT32_C(1) << (uint8_t []){ - 18, 20, 21, 22, 22, 23, 23, 24, 25, 26 }[level]; + static const uint8_t dict_pow2[] + = { 18, 20, 21, 22, 22, 23, 23, 24, 25, 26 }; + options->dict_size = UINT32_C(1) << dict_pow2[level]; if (level <= 3) { options->mode = LZMA_MODE_FAST; options->mf = level == 0 ? LZMA_MF_HC3 : LZMA_MF_HC4; options->nice_len = level <= 1 ? 128 : 273; - options->depth = (uint8_t []){ 4, 8, 24, 48 }[level]; + static const uint8_t depths[] = { 4, 8, 24, 48 }; + options->depth = depths[level]; } else { options->mode = LZMA_MODE_NORMAL; options->mf = LZMA_MF_BT4;