Use 'restrict' on pointer arguments to all compress() and decompress() functions
authorEric Biggers <ebiggers3@gmail.com>
Sun, 16 Aug 2015 19:09:09 +0000 (14:09 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 18 Aug 2015 22:53:49 +0000 (17:53 -0500)
src/lzms_compress.c
src/lzx_compress.c
src/lzx_decompress.c
src/xpress_compress.c
src/xpress_decompress.c

index 385fa0502294b05f29a7eb7fc4113f1349fb4739..f438e91cd15156f48e8371f3bf5f1cc6aa044413 100644 (file)
@@ -2166,8 +2166,8 @@ oom0:
 }
 
 static size_t
-lzms_compress(const void *in, size_t in_nbytes,
-             void *out, size_t out_nbytes_avail, void *_c)
+lzms_compress(const void *restrict in, size_t in_nbytes,
+             void *restrict out, size_t out_nbytes_avail, void *restrict _c)
 {
        struct lzms_compressor *c = _c;
        size_t result;
index 28a2656fb45852006f529d3df2f686c67fd6bbd2..3f3b836c636f8dd2bbdac17ae6a7b2d97bb673e0 100644 (file)
@@ -2120,8 +2120,8 @@ oom0:
 }
 
 static size_t
-lzx_compress(const void *in, size_t in_nbytes,
-            void *out, size_t out_nbytes_avail, void *_c)
+lzx_compress(const void *restrict in, size_t in_nbytes,
+            void *restrict out, size_t out_nbytes_avail, void *restrict _c)
 {
        struct lzx_compressor *c = _c;
        struct lzx_output_bitstream os;
index d9ab5c3328b2366c731c80a16033be8f76383267..a8fbcd7d5e8325542537730ec7fef328754c53a8 100644 (file)
@@ -521,9 +521,9 @@ lzx_decompress_block(int block_type, u8 * const out_begin,
 }
 
 static int
-lzx_decompress(const void *compressed_data, size_t compressed_size,
-              void *uncompressed_data, size_t uncompressed_size,
-              void *_dec)
+lzx_decompress(const void *restrict compressed_data, size_t compressed_size,
+              void *restrict uncompressed_data, size_t uncompressed_size,
+              void *restrict _dec)
 {
        struct lzx_decompressor *dec = _dec;
        struct input_bitstream istream;
index cf29df99268d2801e97cdab246c44392d1bfdea9..6750160450ae76ec8fa4991f78867f89eea147fe 100644 (file)
@@ -1135,8 +1135,8 @@ oom0:
 }
 
 static size_t
-xpress_compress(const void *in, size_t in_nbytes,
-               void *out, size_t out_nbytes_avail, void *_c)
+xpress_compress(const void *restrict in, size_t in_nbytes,
+               void *restrict out, size_t out_nbytes_avail, void *restrict _c)
 {
        struct xpress_compressor *c = _c;
 
index 51e781a33bf6bd0057419b5d26bc49e95a4c6766..ec5b1831cd27f24c18bf32a6a329a96b9af4ca26 100644 (file)
@@ -76,8 +76,9 @@
 #define XPRESS_TABLEBITS 12
 
 static int
-xpress_decompress(const void *compressed_data, size_t compressed_size,
-                 void *uncompressed_data, size_t uncompressed_size, void *_ctx)
+xpress_decompress(const void *restrict compressed_data, size_t compressed_size,
+                 void *restrict uncompressed_data, size_t uncompressed_size,
+                 void *restrict _ctx)
 {
        const u8 * const in_begin = compressed_data;
        u8 * const out_begin = uncompressed_data;