summaryrefslogtreecommitdiffstats
path: root/Utilities/cmliblzma
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-24 14:51:21 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-29 12:45:36 (GMT)
commit73eab246fbfad22bcc1b0bb5599f8e0cffb79c0d (patch)
treed3358ae784286a14a0bafb60e6c413f7f204c4eb /Utilities/cmliblzma
parent90e7a4d41f588d87415381fdb507735e6438992c (diff)
downloadCMake-73eab246fbfad22bcc1b0bb5599f8e0cffb79c0d.zip
CMake-73eab246fbfad22bcc1b0bb5599f8e0cffb79c0d.tar.gz
CMake-73eab246fbfad22bcc1b0bb5599f8e0cffb79c0d.tar.bz2
liblzma: Avoid defining a 'restrict' macro
Any "#define restrict ..." line may conflict with MSVC header files that use "__declspec(restrict)". Define our own LZMA_RESTRICT macro in "Utilities/cmliblzma/config.h.in" and transform liblzma code to use it: git grep -lE '\<restrict\>' Utilities/cmliblzma/liblzma | xargs sed -i 's/\<restrict\>/LZMA_RESTRICT/g'
Diffstat (limited to 'Utilities/cmliblzma')
-rw-r--r--Utilities/cmliblzma/config.h.in6
-rw-r--r--Utilities/cmliblzma/liblzma/common/alone_decoder.c6
-rw-r--r--Utilities/cmliblzma/liblzma/common/alone_encoder.c6
-rw-r--r--Utilities/cmliblzma/liblzma/common/auto_decoder.c6
-rw-r--r--Utilities/cmliblzma/liblzma/common/block_decoder.c6
-rw-r--r--Utilities/cmliblzma/liblzma/common/block_encoder.c6
-rw-r--r--Utilities/cmliblzma/liblzma/common/common.c6
-rw-r--r--Utilities/cmliblzma/liblzma/common/common.h12
-rw-r--r--Utilities/cmliblzma/liblzma/common/index.c2
-rw-r--r--Utilities/cmliblzma/liblzma/common/index_decoder.c6
-rw-r--r--Utilities/cmliblzma/liblzma/common/index_encoder.c6
-rw-r--r--Utilities/cmliblzma/liblzma/common/stream_decoder.c6
-rw-r--r--Utilities/cmliblzma/liblzma/common/stream_encoder.c6
-rw-r--r--Utilities/cmliblzma/liblzma/common/vli_decoder.c4
-rw-r--r--Utilities/cmliblzma/liblzma/common/vli_encoder.c2
-rw-r--r--Utilities/cmliblzma/liblzma/delta/delta_decoder.c6
-rw-r--r--Utilities/cmliblzma/liblzma/delta/delta_encoder.c8
-rw-r--r--Utilities/cmliblzma/liblzma/lz/lz_decoder.c12
-rw-r--r--Utilities/cmliblzma/liblzma/lz/lz_decoder.h12
-rw-r--r--Utilities/cmliblzma/liblzma/lz/lz_encoder.c4
-rw-r--r--Utilities/cmliblzma/liblzma/lz/lz_encoder.h6
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c4
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma2_encoder.c4
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma_decoder.c6
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma_encoder.c8
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma_encoder.h6
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_fast.c4
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c12
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma_encoder_private.h10
-rw-r--r--Utilities/cmliblzma/liblzma/rangecoder/range_decoder.h4
-rw-r--r--Utilities/cmliblzma/liblzma/simple/simple_coder.c12
31 files changed, 103 insertions, 101 deletions
diff --git a/Utilities/cmliblzma/config.h.in b/Utilities/cmliblzma/config.h.in
index 391bb87..b197f27 100644
--- a/Utilities/cmliblzma/config.h.in
+++ b/Utilities/cmliblzma/config.h.in
@@ -188,10 +188,12 @@ typedef uint64_t uintmax_t;
#ifndef HAVE_RESTRICT
# ifdef HAVE___RESTRICT
-# define restrict __restrict
+# define LZMA_RESTRICT __restrict
# else
-# define restrict
+# define LZMA_RESTRICT
# endif
+#else
+# define LZMA_RESTRICT restrict
#endif /* HAVE_RESTRICT */
#ifndef HAVE_INLINE
diff --git a/Utilities/cmliblzma/liblzma/common/alone_decoder.c b/Utilities/cmliblzma/liblzma/common/alone_decoder.c
index a20cf49..5f5e564 100644
--- a/Utilities/cmliblzma/liblzma/common/alone_decoder.c
+++ b/Utilities/cmliblzma/liblzma/common/alone_decoder.c
@@ -52,9 +52,9 @@ struct lzma_coder_s {
static lzma_ret
alone_decode(lzma_coder *coder,
lzma_allocator *allocator lzma_attribute((__unused__)),
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size,
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size,
lzma_action action)
{
while (*out_pos < out_size
diff --git a/Utilities/cmliblzma/liblzma/common/alone_encoder.c b/Utilities/cmliblzma/liblzma/common/alone_encoder.c
index 62df126..4207b4a 100644
--- a/Utilities/cmliblzma/liblzma/common/alone_encoder.c
+++ b/Utilities/cmliblzma/liblzma/common/alone_encoder.c
@@ -33,9 +33,9 @@ struct lzma_coder_s {
static lzma_ret
alone_encode(lzma_coder *coder,
lzma_allocator *allocator lzma_attribute((__unused__)),
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size,
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size,
lzma_action action)
{
while (*out_pos < out_size)
diff --git a/Utilities/cmliblzma/liblzma/common/auto_decoder.c b/Utilities/cmliblzma/liblzma/common/auto_decoder.c
index 6f3c862..24cf489 100644
--- a/Utilities/cmliblzma/liblzma/common/auto_decoder.c
+++ b/Utilities/cmliblzma/liblzma/common/auto_decoder.c
@@ -31,9 +31,9 @@ struct lzma_coder_s {
static lzma_ret
auto_decode(lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size, lzma_action action)
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
{
switch (coder->sequence) {
case SEQ_INIT:
diff --git a/Utilities/cmliblzma/liblzma/common/block_decoder.c b/Utilities/cmliblzma/liblzma/common/block_decoder.c
index 3de3851..35996e7 100644
--- a/Utilities/cmliblzma/liblzma/common/block_decoder.c
+++ b/Utilities/cmliblzma/liblzma/common/block_decoder.c
@@ -72,9 +72,9 @@ is_size_valid(lzma_vli size, lzma_vli reference)
static lzma_ret
block_decode(lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size, lzma_action action)
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
{
switch (coder->sequence) {
case SEQ_CODE: {
diff --git a/Utilities/cmliblzma/liblzma/common/block_encoder.c b/Utilities/cmliblzma/liblzma/common/block_encoder.c
index 63e2687..ed74827 100644
--- a/Utilities/cmliblzma/liblzma/common/block_encoder.c
+++ b/Utilities/cmliblzma/liblzma/common/block_encoder.c
@@ -46,9 +46,9 @@ struct lzma_coder_s {
static lzma_ret
block_encode(lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size, lzma_action action)
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
{
// Check that our amount of input stays in proper limits.
if (LZMA_VLI_MAX - coder->uncompressed_size < in_size - *in_pos)
diff --git a/Utilities/cmliblzma/liblzma/common/common.c b/Utilities/cmliblzma/liblzma/common/common.c
index d0105e1..2e723c8 100644
--- a/Utilities/cmliblzma/liblzma/common/common.c
+++ b/Utilities/cmliblzma/liblzma/common/common.c
@@ -70,9 +70,9 @@ lzma_free(void *ptr, lzma_allocator *allocator)
//////////
extern size_t
-lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size)
+lzma_bufcpy(const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size)
{
const size_t in_avail = in_size - *in_pos;
const size_t out_avail = out_size - *out_pos;
diff --git a/Utilities/cmliblzma/liblzma/common/common.h b/Utilities/cmliblzma/liblzma/common/common.h
index a1a1591..a6a2818 100644
--- a/Utilities/cmliblzma/liblzma/common/common.h
+++ b/Utilities/cmliblzma/liblzma/common/common.h
@@ -88,9 +88,9 @@ typedef lzma_ret (*lzma_init_function)(
/// function prototype.
typedef lzma_ret (*lzma_code_function)(
lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size,
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size,
lzma_action action);
/// Type of a function to free the memory allocated for the coder
@@ -234,9 +234,9 @@ extern void lzma_next_end(lzma_next_coder *next, lzma_allocator *allocator);
/// Copy as much data as possible from in[] to out[] and update *in_pos
/// and *out_pos accordingly. Returns the number of bytes copied.
-extern size_t lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size);
+extern size_t lzma_bufcpy(const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size);
/// \brief Return if expression doesn't evaluate to LZMA_OK
diff --git a/Utilities/cmliblzma/liblzma/common/index.c b/Utilities/cmliblzma/liblzma/common/index.c
index f0f67ca..26135d2 100644
--- a/Utilities/cmliblzma/liblzma/common/index.c
+++ b/Utilities/cmliblzma/liblzma/common/index.c
@@ -780,7 +780,7 @@ index_cat_helper(const index_cat_info *info, index_stream *this)
extern LZMA_API(lzma_ret)
-lzma_index_cat(lzma_index *restrict dest, lzma_index *restrict src,
+lzma_index_cat(lzma_index *LZMA_RESTRICT dest, lzma_index *LZMA_RESTRICT src,
lzma_allocator *allocator)
{
index_cat_info info;
diff --git a/Utilities/cmliblzma/liblzma/common/index_decoder.c b/Utilities/cmliblzma/liblzma/common/index_decoder.c
index 6c91f10..943cfd5 100644
--- a/Utilities/cmliblzma/liblzma/common/index_decoder.c
+++ b/Utilities/cmliblzma/liblzma/common/index_decoder.c
@@ -55,10 +55,10 @@ struct lzma_coder_s {
static lzma_ret
index_decode(lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
size_t in_size,
- uint8_t *restrict out lzma_attribute((__unused__)),
- size_t *restrict out_pos lzma_attribute((__unused__)),
+ uint8_t *LZMA_RESTRICT out lzma_attribute((__unused__)),
+ size_t *LZMA_RESTRICT out_pos lzma_attribute((__unused__)),
size_t out_size lzma_attribute((__unused__)),
lzma_action action lzma_attribute((__unused__)))
{
diff --git a/Utilities/cmliblzma/liblzma/common/index_encoder.c b/Utilities/cmliblzma/liblzma/common/index_encoder.c
index a6f8598..194bf21 100644
--- a/Utilities/cmliblzma/liblzma/common/index_encoder.c
+++ b/Utilities/cmliblzma/liblzma/common/index_encoder.c
@@ -43,10 +43,10 @@ struct lzma_coder_s {
static lzma_ret
index_encode(lzma_coder *coder,
lzma_allocator *allocator lzma_attribute((__unused__)),
- const uint8_t *restrict in lzma_attribute((__unused__)),
- size_t *restrict in_pos lzma_attribute((__unused__)),
+ const uint8_t *LZMA_RESTRICT in lzma_attribute((__unused__)),
+ size_t *LZMA_RESTRICT in_pos lzma_attribute((__unused__)),
size_t in_size lzma_attribute((__unused__)),
- uint8_t *restrict out, size_t *restrict out_pos,
+ uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
size_t out_size,
lzma_action action lzma_attribute((__unused__)))
{
diff --git a/Utilities/cmliblzma/liblzma/common/stream_decoder.c b/Utilities/cmliblzma/liblzma/common/stream_decoder.c
index 56a009b..5e9a220 100644
--- a/Utilities/cmliblzma/liblzma/common/stream_decoder.c
+++ b/Utilities/cmliblzma/liblzma/common/stream_decoder.c
@@ -97,9 +97,9 @@ stream_decoder_reset(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret
stream_decode(lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size, lzma_action action)
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
{
// When decoding the actual Block, it may be able to produce more
// output even if we don't give it any new input.
diff --git a/Utilities/cmliblzma/liblzma/common/stream_encoder.c b/Utilities/cmliblzma/liblzma/common/stream_encoder.c
index e2f2e10..1ba45ac 100644
--- a/Utilities/cmliblzma/liblzma/common/stream_encoder.c
+++ b/Utilities/cmliblzma/liblzma/common/stream_encoder.c
@@ -80,9 +80,9 @@ block_encoder_init(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret
stream_encode(lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size, lzma_action action)
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
{
// Main loop
while (*out_pos < out_size)
diff --git a/Utilities/cmliblzma/liblzma/common/vli_decoder.c b/Utilities/cmliblzma/liblzma/common/vli_decoder.c
index c181828..1c66384 100644
--- a/Utilities/cmliblzma/liblzma/common/vli_decoder.c
+++ b/Utilities/cmliblzma/liblzma/common/vli_decoder.c
@@ -14,8 +14,8 @@
extern LZMA_API(lzma_ret)
-lzma_vli_decode(lzma_vli *restrict vli, size_t *vli_pos,
- const uint8_t *restrict in, size_t *restrict in_pos,
+lzma_vli_decode(lzma_vli *LZMA_RESTRICT vli, size_t *vli_pos,
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
size_t in_size)
{
// If we haven't been given vli_pos, work in single-call mode.
diff --git a/Utilities/cmliblzma/liblzma/common/vli_encoder.c b/Utilities/cmliblzma/liblzma/common/vli_encoder.c
index f864269..09e90cb 100644
--- a/Utilities/cmliblzma/liblzma/common/vli_encoder.c
+++ b/Utilities/cmliblzma/liblzma/common/vli_encoder.c
@@ -15,7 +15,7 @@
extern LZMA_API(lzma_ret)
lzma_vli_encode(lzma_vli vli, size_t *vli_pos,
- uint8_t *restrict out, size_t *restrict out_pos,
+ uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
size_t out_size)
{
// If we haven't been given vli_pos, work in single-call mode.
diff --git a/Utilities/cmliblzma/liblzma/delta/delta_decoder.c b/Utilities/cmliblzma/liblzma/delta/delta_decoder.c
index 582e58e..28df727 100644
--- a/Utilities/cmliblzma/liblzma/delta/delta_decoder.c
+++ b/Utilities/cmliblzma/liblzma/delta/delta_decoder.c
@@ -29,9 +29,9 @@ decode_buffer(lzma_coder *coder, uint8_t *buffer, size_t size)
static lzma_ret
delta_decode(lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size, lzma_action action)
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
{
const size_t out_start = *out_pos;
lzma_ret ret;
diff --git a/Utilities/cmliblzma/liblzma/delta/delta_encoder.c b/Utilities/cmliblzma/liblzma/delta/delta_encoder.c
index 8b9e4a8..a39c154 100644
--- a/Utilities/cmliblzma/liblzma/delta/delta_encoder.c
+++ b/Utilities/cmliblzma/liblzma/delta/delta_encoder.c
@@ -19,7 +19,7 @@
/// encoder's filter stack).
static void
copy_and_encode(lzma_coder *coder,
- const uint8_t *restrict in, uint8_t *restrict out, size_t size)
+ const uint8_t *LZMA_RESTRICT in, uint8_t *LZMA_RESTRICT out, size_t size)
{
size_t i;
const size_t distance = coder->distance;
@@ -52,9 +52,9 @@ encode_in_place(lzma_coder *coder, uint8_t *buffer, size_t size)
static lzma_ret
delta_encode(lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size, lzma_action action)
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
{
lzma_ret ret;
diff --git a/Utilities/cmliblzma/liblzma/lz/lz_decoder.c b/Utilities/cmliblzma/liblzma/lz/lz_decoder.c
index f45984e..9fa1bdc 100644
--- a/Utilities/cmliblzma/liblzma/lz/lz_decoder.c
+++ b/Utilities/cmliblzma/liblzma/lz/lz_decoder.c
@@ -64,9 +64,9 @@ lz_decoder_reset(lzma_coder *coder)
static lzma_ret
decode_buffer(lzma_coder *coder,
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size)
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size)
{
while (true) {
size_t copy_size;
@@ -131,9 +131,9 @@ decode_buffer(lzma_coder *coder,
static lzma_ret
lz_decode(lzma_coder *coder,
lzma_allocator *allocator lzma_attribute((__unused__)),
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size,
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size,
lzma_action action)
{
if (coder->next.code == NULL)
diff --git a/Utilities/cmliblzma/liblzma/lz/lz_decoder.h b/Utilities/cmliblzma/liblzma/lz/lz_decoder.h
index 2d19cac..76011f2 100644
--- a/Utilities/cmliblzma/liblzma/lz/lz_decoder.h
+++ b/Utilities/cmliblzma/liblzma/lz/lz_decoder.h
@@ -56,9 +56,9 @@ typedef struct {
lzma_coder *coder;
/// Function to decode from in[] to *dict
- lzma_ret (*code)(lzma_coder *restrict coder,
- lzma_dict *restrict dict, const uint8_t *restrict in,
- size_t *restrict in_pos, size_t in_size);
+ lzma_ret (*code)(lzma_coder *LZMA_RESTRICT coder,
+ lzma_dict *LZMA_RESTRICT dict, const uint8_t *LZMA_RESTRICT in,
+ size_t *LZMA_RESTRICT in_pos, size_t in_size);
void (*reset)(lzma_coder *coder, const void *options);
@@ -202,9 +202,9 @@ dict_put(lzma_dict *dict, uint8_t byte)
/// Copies arbitrary amount of data into the dictionary.
static inline void
-dict_write(lzma_dict *restrict dict, const uint8_t *restrict in,
- size_t *restrict in_pos, size_t in_size,
- size_t *restrict left)
+dict_write(lzma_dict *LZMA_RESTRICT dict, const uint8_t *LZMA_RESTRICT in,
+ size_t *LZMA_RESTRICT in_pos, size_t in_size,
+ size_t *LZMA_RESTRICT left)
{
// NOTE: If we are being given more data than the size of the
// dictionary, it could be possible to optimize the LZ decoder
diff --git a/Utilities/cmliblzma/liblzma/lz/lz_encoder.c b/Utilities/cmliblzma/liblzma/lz/lz_encoder.c
index a735c21..1dae924 100644
--- a/Utilities/cmliblzma/liblzma/lz/lz_encoder.c
+++ b/Utilities/cmliblzma/liblzma/lz/lz_encoder.c
@@ -153,9 +153,9 @@ fill_window(lzma_coder *coder, lzma_allocator *allocator, const uint8_t *in,
static lzma_ret
lz_encode(lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
size_t in_size,
- uint8_t *restrict out, size_t *restrict out_pos,
+ uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
size_t out_size, lzma_action action)
{
while (*out_pos < out_size
diff --git a/Utilities/cmliblzma/liblzma/lz/lz_encoder.h b/Utilities/cmliblzma/liblzma/lz/lz_encoder.h
index 647f5e2..dcb4b2c 100644
--- a/Utilities/cmliblzma/liblzma/lz/lz_encoder.h
+++ b/Utilities/cmliblzma/liblzma/lz/lz_encoder.h
@@ -194,9 +194,9 @@ typedef struct {
lzma_coder *coder;
/// Function to encode from *dict to out[]
- lzma_ret (*code)(lzma_coder *restrict coder,
- lzma_mf *restrict mf, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size);
+ lzma_ret (*code)(lzma_coder *LZMA_RESTRICT coder,
+ lzma_mf *LZMA_RESTRICT mf, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size);
/// Free allocated resources
void (*end)(lzma_coder *coder, lzma_allocator *allocator);
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c b/Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c
index ca14c4a..bd2a737 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c
@@ -54,8 +54,8 @@ struct lzma_coder_s {
static lzma_ret
-lzma2_decode(lzma_coder *restrict coder, lzma_dict *restrict dict,
- const uint8_t *restrict in, size_t *restrict in_pos,
+lzma2_decode(lzma_coder *LZMA_RESTRICT coder, lzma_dict *LZMA_RESTRICT dict,
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
size_t in_size)
{
// With SEQ_LZMA it is possible that no new input is needed to do
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma2_encoder.c b/Utilities/cmliblzma/liblzma/lzma/lzma2_encoder.c
index 8784f5d..a3651a7 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma2_encoder.c
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma2_encoder.c
@@ -134,8 +134,8 @@ lzma2_header_uncompressed(lzma_coder *coder)
static lzma_ret
-lzma2_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
- uint8_t *restrict out, size_t *restrict out_pos,
+lzma2_encode(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+ uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
size_t out_size)
{
while (*out_pos < out_size)
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_decoder.c b/Utilities/cmliblzma/liblzma/lzma/lzma_decoder.c
index 1bee2a9..3c0f393 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma_decoder.c
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma_decoder.c
@@ -281,9 +281,9 @@ struct lzma_coder_s {
static lzma_ret
-lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
- const uint8_t *restrict in,
- size_t *restrict in_pos, size_t in_size)
+lzma_decode(lzma_coder *LZMA_RESTRICT coder, lzma_dict *LZMA_RESTRICT dictptr,
+ const uint8_t *LZMA_RESTRICT in,
+ size_t *LZMA_RESTRICT in_pos, size_t in_size)
{
///////////////
// Variables //
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder.c b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder.c
index 6186f83..e8738f4 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder.c
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder.c
@@ -318,8 +318,8 @@ encode_eopm(lzma_coder *coder, uint32_t position)
extern lzma_ret
-lzma_lzma_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
- uint8_t *restrict out, size_t *restrict out_pos,
+lzma_lzma_encode(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+ uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
size_t out_size, uint32_t limit)
{
uint32_t position;
@@ -414,8 +414,8 @@ lzma_lzma_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
static lzma_ret
-lzma_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
- uint8_t *restrict out, size_t *restrict out_pos,
+lzma_encode(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+ uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
size_t out_size)
{
// Plain LZMA has no support for sync-flushing.
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder.h b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder.h
index 835e1f5..abb8d8b 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder.h
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder.h
@@ -44,9 +44,9 @@ extern lzma_ret lzma_lzma_encoder_reset(
lzma_coder *coder, const lzma_options_lzma *options);
-extern lzma_ret lzma_lzma_encode(lzma_coder *restrict coder,
- lzma_mf *restrict mf, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size,
+extern lzma_ret lzma_lzma_encode(lzma_coder *LZMA_RESTRICT coder,
+ lzma_mf *LZMA_RESTRICT mf, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size,
uint32_t read_limit);
#endif
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_fast.c b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_fast.c
index 52c26e4..f983126 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_fast.c
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_fast.c
@@ -17,8 +17,8 @@
extern void
-lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
- uint32_t *restrict back_res, uint32_t *restrict len_res)
+lzma_lzma_optimum_fast(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+ uint32_t *LZMA_RESTRICT back_res, uint32_t *LZMA_RESTRICT len_res)
{
const uint8_t *buf;
uint32_t buf_avail;
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
index d2829a2..d3a6348 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
@@ -230,8 +230,8 @@ make_short_rep(lzma_optimal *optimal)
static void
-backward(lzma_coder *restrict coder, uint32_t *restrict len_res,
- uint32_t *restrict back_res, uint32_t cur)
+backward(lzma_coder *LZMA_RESTRICT coder, uint32_t *LZMA_RESTRICT len_res,
+ uint32_t *LZMA_RESTRICT back_res, uint32_t cur)
{
uint32_t pos_mem = coder->opts[cur].pos_prev;
uint32_t back_mem = coder->opts[cur].back_prev;
@@ -278,8 +278,8 @@ backward(lzma_coder *restrict coder, uint32_t *restrict len_res,
//////////
static inline uint32_t
-helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
- uint32_t *restrict back_res, uint32_t *restrict len_res,
+helper1(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+ uint32_t *LZMA_RESTRICT back_res, uint32_t *LZMA_RESTRICT len_res,
uint32_t position)
{
uint32_t buf_avail;
@@ -865,8 +865,8 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
extern void
-lzma_lzma_optimum_normal(lzma_coder *restrict coder, lzma_mf *restrict mf,
- uint32_t *restrict back_res, uint32_t *restrict len_res,
+lzma_lzma_optimum_normal(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+ uint32_t *LZMA_RESTRICT back_res, uint32_t *LZMA_RESTRICT len_res,
uint32_t position)
{
uint32_t reps[REP_DISTANCES];
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_private.h b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_private.h
index 6847452..04fb29e 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_private.h
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_private.h
@@ -138,11 +138,11 @@ struct lzma_coder_s {
extern void lzma_lzma_optimum_fast(
- lzma_coder *restrict coder, lzma_mf *restrict mf,
- uint32_t *restrict back_res, uint32_t *restrict len_res);
+ lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+ uint32_t *LZMA_RESTRICT back_res, uint32_t *LZMA_RESTRICT len_res);
-extern void lzma_lzma_optimum_normal(lzma_coder *restrict coder,
- lzma_mf *restrict mf, uint32_t *restrict back_res,
- uint32_t *restrict len_res, uint32_t position);
+extern void lzma_lzma_optimum_normal(lzma_coder *LZMA_RESTRICT coder,
+ lzma_mf *LZMA_RESTRICT mf, uint32_t *LZMA_RESTRICT back_res,
+ uint32_t *LZMA_RESTRICT len_res, uint32_t position);
#endif
diff --git a/Utilities/cmliblzma/liblzma/rangecoder/range_decoder.h b/Utilities/cmliblzma/liblzma/rangecoder/range_decoder.h
index fb96180..199e7b5 100644
--- a/Utilities/cmliblzma/liblzma/rangecoder/range_decoder.h
+++ b/Utilities/cmliblzma/liblzma/rangecoder/range_decoder.h
@@ -26,8 +26,8 @@ typedef struct {
/// Reads the first five bytes to initialize the range decoder.
static inline bool
-rc_read_init(lzma_range_decoder *rc, const uint8_t *restrict in,
- size_t *restrict in_pos, size_t in_size)
+rc_read_init(lzma_range_decoder *rc, const uint8_t *LZMA_RESTRICT in,
+ size_t *LZMA_RESTRICT in_pos, size_t in_size)
{
while (rc->init_bytes_left > 0) {
if (*in_pos == in_size)
diff --git a/Utilities/cmliblzma/liblzma/simple/simple_coder.c b/Utilities/cmliblzma/liblzma/simple/simple_coder.c
index d147d4b..f3bbdd7 100644
--- a/Utilities/cmliblzma/liblzma/simple/simple_coder.c
+++ b/Utilities/cmliblzma/liblzma/simple/simple_coder.c
@@ -19,9 +19,9 @@
/// Copied or encodes/decodes more data to out[].
static lzma_ret
copy_or_code(lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size, lzma_action action)
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
{
assert(!coder->end_was_reached);
@@ -67,9 +67,9 @@ call_filter(lzma_coder *coder, uint8_t *buffer, size_t size)
static lzma_ret
simple_code(lzma_coder *coder, lzma_allocator *allocator,
- const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out,
- size_t *restrict out_pos, size_t out_size, lzma_action action)
+ const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+ size_t in_size, uint8_t *LZMA_RESTRICT out,
+ size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
{
size_t out_avail;
size_t buf_avail;