diff options
| author | Xin LI <delphij@FreeBSD.org> | 2014-10-23 00:33:25 +0000 | 
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2014-10-23 00:33:25 +0000 | 
| commit | c47078d5ef70001fd681fea19beadbfaf17cbbc6 (patch) | |
| tree | ff50110925e3587c48a81f205a43df0120b33edc /src | |
| parent | 694e3aa4ba65ac91d68de02d541339d59affd402 (diff) | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/liblzma/api/lzma/block.h | 3 | ||||
| -rw-r--r-- | src/liblzma/api/lzma/version.h | 2 | ||||
| -rw-r--r-- | src/liblzma/check/crc32_fast.c | 2 | ||||
| -rw-r--r-- | src/liblzma/check/sha256.c | 2 | ||||
| -rw-r--r-- | src/liblzma/lzma/lzma_encoder_presets.c | 8 | ||||
| -rw-r--r-- | src/xz/coder.c | 4 | ||||
| -rw-r--r-- | src/xz/signals.c | 12 | ||||
| -rw-r--r-- | src/xz/suffix.c | 2 | 
8 files changed, 21 insertions, 14 deletions
| diff --git a/src/liblzma/api/lzma/block.h b/src/liblzma/api/lzma/block.h index 8a4bf2323ccc..e6710a7bc816 100644 --- a/src/liblzma/api/lzma/block.h +++ b/src/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/src/liblzma/api/lzma/version.h b/src/liblzma/api/lzma/version.h index 66e93965dcab..beec18e20440 100644 --- a/src/liblzma/api/lzma/version.h +++ b/src/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 7  #define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE  #ifndef LZMA_VERSION_COMMIT diff --git a/src/liblzma/check/crc32_fast.c b/src/liblzma/check/crc32_fast.c index 94da85592d8a..3de02638d776 100644 --- a/src/liblzma/check/crc32_fast.c +++ b/src/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/src/liblzma/check/sha256.c b/src/liblzma/check/sha256.c index 23bda9222dda..f2cc0d71ac63 100644 --- a/src/liblzma/check/sha256.c +++ b/src/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/src/liblzma/lzma/lzma_encoder_presets.c b/src/liblzma/lzma/lzma_encoder_presets.c index 21e427a8d027..8484b77444b1 100644 --- a/src/liblzma/lzma/lzma_encoder_presets.c +++ b/src/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; diff --git a/src/xz/coder.c b/src/xz/coder.c index e0867e2aa295..017e04127e95 100644 --- a/src/xz/coder.c +++ b/src/xz/coder.c @@ -200,9 +200,9 @@ coder_set_compression_settings(void)  	}  	if (memory_usage > memory_limit) { -		// If --no-auto-adjust was used or we didn't find LZMA1 or +		// If --no-adjust was used or we didn't find LZMA1 or  		// LZMA2 as the last filter, give an error immediately. -		// --format=raw implies --no-auto-adjust. +		// --format=raw implies --no-adjust.  		if (!opt_auto_adjust || opt_format == FORMAT_RAW)  			memlimit_too_small(memory_usage); diff --git a/src/xz/signals.c b/src/xz/signals.c index de213644d00b..322811f472b5 100644 --- a/src/xz/signals.c +++ b/src/xz/signals.c @@ -77,17 +77,19 @@ signals_init(void)  		sigaddset(&hooked_signals, message_progress_sigs[i]);  #endif -	struct sigaction sa; +	// Using "my_sa" because "sa" may conflict with a sockaddr variable +	// from system headers on Solaris. +	struct sigaction my_sa;  	// All the signals that we handle we also blocked while the signal  	// handler runs. -	sa.sa_mask = hooked_signals; +	my_sa.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; +	my_sa.sa_flags = 0; +	my_sa.sa_handler = &signal_handler;  	for (size_t i = 0; i < ARRAY_SIZE(sigs); ++i) {  		// If the parent process has left some signals ignored, @@ -98,7 +100,7 @@ signals_init(void)  			continue;  		// Establish the signal handler. -		if (sigaction(sigs[i], &sa, NULL)) +		if (sigaction(sigs[i], &my_sa, NULL))  			message_signal_handler();  	} diff --git a/src/xz/suffix.c b/src/xz/suffix.c index c89f67fe853e..8e331a7022a3 100644 --- a/src/xz/suffix.c +++ b/src/xz/suffix.c @@ -232,7 +232,7 @@ suffix_set(const char *suffix)  	// Empty suffix and suffixes having a directory separator are  	// rejected. Such suffixes would break things later.  	if (suffix[0] == '\0' || has_dir_sep(suffix)) -		message_fatal(_("%s: Invalid filename suffix"), optarg); +		message_fatal(_("%s: Invalid filename suffix"), suffix);  	// Replace the old custom_suffix (if any) with the new suffix.  	free(custom_suffix); | 
