summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/tuklib_physmem.c14
-rw-r--r--src/liblzma/api/lzma.h18
-rw-r--r--src/liblzma/api/lzma/version.h2
-rw-r--r--src/liblzma/common/index.c4
-rw-r--r--src/liblzma/lz/lz_encoder.c2
-rw-r--r--src/liblzma/lzma/lzma_encoder.c2
-rw-r--r--src/xz/args.h2
-rw-r--r--src/xz/file_io.c9
-rw-r--r--src/xz/main.c2
-rw-r--r--src/xz/message.c5
-rw-r--r--src/xz/options.c12
-rw-r--r--src/xz/xz.110
12 files changed, 53 insertions, 29 deletions
diff --git a/src/common/tuklib_physmem.c b/src/common/tuklib_physmem.c
index 3cc7d12a171f4..cd2437d8c7d59 100644
--- a/src/common/tuklib_physmem.c
+++ b/src/common/tuklib_physmem.c
@@ -37,7 +37,10 @@
# define __USE_INLINE__
# include <proto/exec.h>
-// AIX
+#elif defined(__QNX__)
+# include <sys/syspage.h>
+# include <string.h>
+
#elif defined(TUKLIB_PHYSMEM_AIX)
# include <sys/systemcfg.h>
@@ -126,6 +129,15 @@ tuklib_physmem(void)
#elif defined(AMIGA) || defined(__AROS__)
ret = AvailMem(MEMF_TOTAL);
+#elif defined(__QNX__)
+ const struct asinfo_entry *entries = SYSPAGE_ENTRY(asinfo);
+ size_t count = SYSPAGE_ENTRY_SIZE(asinfo) / sizeof(struct asinfo_entry);
+ const char *strings = SYSPAGE_ENTRY(strings)->data;
+
+ for (size_t i = 0; i < count; ++i)
+ if (strcmp(strings + entries[i].name, "ram") == 0)
+ ret += entries[i].end - entries[i].start + 1;
+
#elif defined(TUKLIB_PHYSMEM_AIX)
ret = _system_configuration.physmem;
diff --git a/src/liblzma/api/lzma.h b/src/liblzma/api/lzma.h
index 72c51b2411c30..ce675a7887164 100644
--- a/src/liblzma/api/lzma.h
+++ b/src/liblzma/api/lzma.h
@@ -82,12 +82,20 @@
# if !defined(UINT32_C) || !defined(UINT64_C) \
|| !defined(UINT32_MAX) || !defined(UINT64_MAX)
/*
- * MSVC has no C99 support, and thus it cannot be used to
- * compile liblzma. The liblzma API has to still be usable
- * from MSVC, so we need to define the required standard
- * integer types here.
+ * MSVC versions older than 2013 have no C99 support, and
+ * thus they cannot be used to compile liblzma. Using an
+ * existing liblzma.dll with old MSVC can work though(*),
+ * but we need to define the required standard integer
+ * types here in a MSVC-specific way.
+ *
+ * (*) If you do this, the existing liblzma.dll probably uses
+ * a different runtime library than your MSVC-built
+ * application. Mixing runtimes is generally bad, but
+ * in this case it should work as long as you avoid
+ * the few rarely-needed liblzma functions that allocate
+ * memory and expect the caller to free it using free().
*/
-# if defined(_WIN32) && defined(_MSC_VER)
+# if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER < 1800
typedef unsigned __int8 uint8_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
diff --git a/src/liblzma/api/lzma/version.h b/src/liblzma/api/lzma/version.h
index 9682155a3a039..8bdc7f0b6e769 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 2
-#define LZMA_VERSION_PATCH 1
+#define LZMA_VERSION_PATCH 2
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE
#ifndef LZMA_VERSION_COMMIT
diff --git a/src/liblzma/common/index.c b/src/liblzma/common/index.c
index 11f45f4009ea7..e897646c0291e 100644
--- a/src/liblzma/common/index.c
+++ b/src/liblzma/common/index.c
@@ -339,7 +339,7 @@ index_tree_locate(const index_tree *tree, lzma_vli target)
/// Allocate and initialize a new Stream using the given base offsets.
static index_stream *
index_stream_init(lzma_vli compressed_base, lzma_vli uncompressed_base,
- lzma_vli stream_number, lzma_vli block_number_base,
+ uint32_t stream_number, lzma_vli block_number_base,
const lzma_allocator *allocator)
{
index_stream *s = lzma_alloc(sizeof(index_stream), allocator);
@@ -1008,6 +1008,8 @@ iter_set_info(lzma_index_iter *iter)
iter->internal[ITER_GROUP].p = NULL;
}
+ // NOTE: lzma_index_iter.stream.number is lzma_vli but we use uint32_t
+ // internally.
iter->stream.number = stream->number;
iter->stream.block_count = stream->record_count;
iter->stream.compressed_offset = stream->node.compressed_base;
diff --git a/src/liblzma/lz/lz_encoder.c b/src/liblzma/lz/lz_encoder.c
index 01dfc06f3eca7..48bc487d68537 100644
--- a/src/liblzma/lz/lz_encoder.c
+++ b/src/liblzma/lz/lz_encoder.c
@@ -139,7 +139,7 @@ fill_window(lzma_coder *coder, const lzma_allocator *allocator,
&& coder->mf.read_pos < coder->mf.read_limit) {
// Match finder may update coder->pending and expects it to
// start from zero, so use a temporary variable.
- const size_t pending = coder->mf.pending;
+ const uint32_t pending = coder->mf.pending;
coder->mf.pending = 0;
// Rewind read_pos so that the match finder can hash
diff --git a/src/liblzma/lzma/lzma_encoder.c b/src/liblzma/lzma/lzma_encoder.c
index 31cb4f044829f..4c5f99c3823db 100644
--- a/src/liblzma/lzma/lzma_encoder.c
+++ b/src/liblzma/lzma/lzma_encoder.c
@@ -464,7 +464,7 @@ length_encoder_reset(lzma_length_encoder *lencoder,
bittree_reset(lencoder->high, LEN_HIGH_BITS);
if (!fast_mode)
- for (size_t pos_state = 0; pos_state < num_pos_states;
+ for (uint32_t pos_state = 0; pos_state < num_pos_states;
++pos_state)
length_update_prices(lencoder, pos_state);
diff --git a/src/xz/args.h b/src/xz/args.h
index 1defad12e0dd5..46a8e8edfc978 100644
--- a/src/xz/args.h
+++ b/src/xz/args.h
@@ -15,7 +15,7 @@ typedef struct {
char **arg_names;
/// Number of filenames from command line
- size_t arg_count;
+ unsigned int arg_count;
/// Name of the file from which to read filenames. This is NULL
/// if --files or --files0 was not used.
diff --git a/src/xz/file_io.c b/src/xz/file_io.c
index 20f512a25a997..9bd515ddc8944 100644
--- a/src/xz/file_io.c
+++ b/src/xz/file_io.c
@@ -82,13 +82,7 @@ io_init(void)
// we are root.
warn_fchown = geteuid() == 0;
- // Create a pipe for the self-pipe trick. If pipe2() is available,
- // we can avoid the fcntl() calls.
-# ifdef HAVE_PIPE2
- if (pipe2(user_abort_pipe, O_NONBLOCK))
- message_fatal(_("Error creating a pipe: %s"),
- strerror(errno));
-# else
+ // Create a pipe for the self-pipe trick.
if (pipe(user_abort_pipe))
message_fatal(_("Error creating a pipe: %s"),
strerror(errno));
@@ -101,7 +95,6 @@ io_init(void)
message_fatal(_("Error creating a pipe: %s"),
strerror(errno));
}
-# endif
#endif
#ifdef __DJGPP__
diff --git a/src/xz/main.c b/src/xz/main.c
index a8f0683a47bd4..5608229d54c5a 100644
--- a/src/xz/main.c
+++ b/src/xz/main.c
@@ -212,7 +212,7 @@ main(int argc, char **argv)
// Process the files given on the command line. Note that if no names
// were given, args_parse() gave us a fake "-" filename.
- for (size_t i = 0; i < args.arg_count && !user_abort; ++i) {
+ for (unsigned i = 0; i < args.arg_count && !user_abort; ++i) {
if (strcmp("-", args.arg_names[i]) == 0) {
// Processing from stdin to stdout. Check that we
// aren't writing compressed data to a terminal or
diff --git a/src/xz/message.c b/src/xz/message.c
index 8a31b00ed89c5..f88c1231e7d5d 100644
--- a/src/xz/message.c
+++ b/src/xz/message.c
@@ -381,7 +381,7 @@ progress_speed(uint64_t uncompressed_pos, uint64_t elapsed)
}
-/// Make a string indicating elapsed or remaining time. The format is either
+/// Make a string indicating elapsed time. The format is either
/// M:SS or H:MM:SS depending on if the time is an hour or more.
static const char *
progress_time(uint64_t mseconds)
@@ -389,7 +389,8 @@ progress_time(uint64_t mseconds)
// 9999 hours = 416 days
static char buf[sizeof("9999:59:59")];
- uint32_t seconds = mseconds / 1000;
+ // 32-bit variable is enough for elapsed time (136 years).
+ uint32_t seconds = (uint32_t)(mseconds / 1000);
// Don't show anything if the time is zero or ridiculously big.
if (seconds == 0 || seconds > ((9999 * 60) + 59) * 60 + 59)
diff --git a/src/xz/options.c b/src/xz/options.c
index f9c7ab9e8535b..de05364ba1b03 100644
--- a/src/xz/options.c
+++ b/src/xz/options.c
@@ -59,7 +59,7 @@ typedef struct {
static void
parse_options(const char *str, const option_map *opts,
void (*set)(void *filter_options,
- uint32_t key, uint64_t value, const char *valuestr),
+ unsigned key, uint64_t value, const char *valuestr),
void *filter_options)
{
if (str == NULL || str[0] == '\0')
@@ -87,7 +87,7 @@ parse_options(const char *str, const option_map *opts,
"pairs separated with commas"), str);
// Look for the option name from the option map.
- size_t i = 0;
+ unsigned i = 0;
while (true) {
if (opts[i].name == NULL)
message_fatal(_("%s: Invalid option name"),
@@ -103,7 +103,7 @@ parse_options(const char *str, const option_map *opts,
if (opts[i].map != NULL) {
// value is a string which we should map
// to an integer.
- size_t j;
+ unsigned j;
for (j = 0; opts[i].map[j].name != NULL; ++j) {
if (strcmp(opts[i].map[j].name, value) == 0)
break;
@@ -149,7 +149,7 @@ enum {
static void
-set_delta(void *options, uint32_t key, uint64_t value,
+set_delta(void *options, unsigned key, uint64_t value,
const char *valuestr lzma_attribute((__unused__)))
{
lzma_options_delta *opt = options;
@@ -193,7 +193,7 @@ enum {
static void
-set_bcj(void *options, uint32_t key, uint64_t value,
+set_bcj(void *options, unsigned key, uint64_t value,
const char *valuestr lzma_attribute((__unused__)))
{
lzma_options_bcj *opt = options;
@@ -249,7 +249,7 @@ error_lzma_preset(const char *valuestr)
static void
-set_lzma(void *options, uint32_t key, uint64_t value, const char *valuestr)
+set_lzma(void *options, unsigned key, uint64_t value, const char *valuestr)
{
lzma_options_lzma *opt = options;
diff --git a/src/xz/xz.1 b/src/xz/xz.1
index 75aead3d04393..bc5514d534d08 100644
--- a/src/xz/xz.1
+++ b/src/xz/xz.1
@@ -5,7 +5,7 @@
.\" This file has been put into the public domain.
.\" You can do whatever you want with this file.
.\"
-.TH XZ 1 "2014-12-16" "Tukaani" "XZ Utils"
+.TH XZ 1 "2015-05-11" "Tukaani" "XZ Utils"
.
.SH NAME
xz, unxz, xzcat, lzma, unlzma, lzcat \- Compress or decompress .xz and .lzma files
@@ -1055,6 +1055,14 @@ The default block size depends on the compression level and
can be overriden with the
.BI \-\-block\-size= size
option.
+.IP ""
+Threaded decompression hasn't been implemented yet.
+It will only work on files that contain multiple blocks
+with size information in block headers.
+All files compressed in multi-threaded mode meet this condition,
+but files compressed in single-threaded mode don't even if
+.BI \-\-block\-size= size
+is used.
.
.SS "Custom compressor filter chains"
A custom filter chain allows specifying