diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-02-01 01:41:31 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-02-01 01:41:31 +0100 |
commit | 99ac1759dd429bd7995feff33dc683589c016c8e (patch) | |
tree | 5041e213bb4c4653f6dac19ce059c48218df32f9 | |
parent | 97058d0585c29ed5fd57196f71642a419a53e546 (diff) | |
download | busybox-w32-99ac1759dd429bd7995feff33dc683589c016c8e.tar.gz busybox-w32-99ac1759dd429bd7995feff33dc683589c016c8e.tar.bz2 busybox-w32-99ac1759dd429bd7995feff33dc683589c016c8e.zip |
lzop: code shrink
function old new delta
lzo_decompress 526 524 -2
lzo_compress 473 470 -3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/libarchive/lzo1x_d.c | 3 | ||||
-rw-r--r-- | archival/lzop.c | 9 | ||||
-rw-r--r-- | include/liblzo_interface.h | 6 |
3 files changed, 7 insertions, 11 deletions
diff --git a/archival/libarchive/lzo1x_d.c b/archival/libarchive/lzo1x_d.c index 40b167e68..43cf4a04e 100644 --- a/archival/libarchive/lzo1x_d.c +++ b/archival/libarchive/lzo1x_d.c | |||
@@ -31,8 +31,7 @@ | |||
31 | ************************************************************************/ | 31 | ************************************************************************/ |
32 | /* safe decompression with overrun testing */ | 32 | /* safe decompression with overrun testing */ |
33 | int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len, | 33 | int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len, |
34 | uint8_t* out, unsigned* out_len, | 34 | uint8_t* out, unsigned* out_len /*, void* wrkmem */) |
35 | void* wrkmem UNUSED_PARAM) | ||
36 | { | 35 | { |
37 | register uint8_t* op; | 36 | register uint8_t* op; |
38 | register const uint8_t* ip; | 37 | register const uint8_t* ip; |
diff --git a/archival/lzop.c b/archival/lzop.c index da09b7a82..ba27aeff0 100644 --- a/archival/lzop.c +++ b/archival/lzop.c | |||
@@ -141,8 +141,7 @@ static void copy3(uint8_t* ip, const uint8_t* m_pos, unsigned off) | |||
141 | #define TEST_OP (op <= op_end) | 141 | #define TEST_OP (op <= op_end) |
142 | 142 | ||
143 | static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len, | 143 | static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len, |
144 | uint8_t *out, unsigned *out_len, | 144 | uint8_t *out, unsigned *out_len /*, void* wrkmem */) |
145 | void* wrkmem UNUSED_PARAM) | ||
146 | { | 145 | { |
147 | uint8_t* op; | 146 | uint8_t* op; |
148 | uint8_t* ip; | 147 | uint8_t* ip; |
@@ -724,7 +723,7 @@ static NOINLINE int lzo_compress(const header_t *h) | |||
724 | /* optimize */ | 723 | /* optimize */ |
725 | if (h->method == M_LZO1X_999) { | 724 | if (h->method == M_LZO1X_999) { |
726 | unsigned new_len = src_len; | 725 | unsigned new_len = src_len; |
727 | r = lzo1x_optimize(b2, dst_len, b1, &new_len, NULL); | 726 | r = lzo1x_optimize(b2, dst_len, b1, &new_len /*, NULL*/); |
728 | if (r != 0 /*LZO_E_OK*/ || new_len != src_len) | 727 | if (r != 0 /*LZO_E_OK*/ || new_len != src_len) |
729 | bb_error_msg_and_die("internal error - optimization failed"); | 728 | bb_error_msg_and_die("internal error - optimization failed"); |
730 | } | 729 | } |
@@ -859,9 +858,9 @@ static NOINLINE int lzo_decompress(const header_t *h) | |||
859 | 858 | ||
860 | /* decompress */ | 859 | /* decompress */ |
861 | // if (option_mask32 & OPT_F) | 860 | // if (option_mask32 & OPT_F) |
862 | // r = lzo1x_decompress(b1, src_len, b2, &d, NULL); | 861 | // r = lzo1x_decompress(b1, src_len, b2, &d /*, NULL*/); |
863 | // else | 862 | // else |
864 | r = lzo1x_decompress_safe(b1, src_len, b2, &d, NULL); | 863 | r = lzo1x_decompress_safe(b1, src_len, b2, &d /*, NULL*/); |
865 | 864 | ||
866 | if (r != 0 /*LZO_E_OK*/ || dst_len != d) { | 865 | if (r != 0 /*LZO_E_OK*/ || dst_len != d) { |
867 | bb_error_msg_and_die("corrupted data"); | 866 | bb_error_msg_and_die("corrupted data"); |
diff --git a/include/liblzo_interface.h b/include/liblzo_interface.h index b7f1b639b..1e194b944 100644 --- a/include/liblzo_interface.h +++ b/include/liblzo_interface.h | |||
@@ -49,12 +49,10 @@ int lzo1x_999_compress_level(const uint8_t* in, unsigned in_len, | |||
49 | 49 | ||
50 | /* decompression */ | 50 | /* decompression */ |
51 | //int lzo1x_decompress(const uint8_t* src, unsigned src_len, | 51 | //int lzo1x_decompress(const uint8_t* src, unsigned src_len, |
52 | // uint8_t* dst, unsigned* dst_len, | 52 | // uint8_t* dst, unsigned* dst_len /*, void* wrkmem */); |
53 | // void* wrkmem /* NOT USED */); | ||
54 | /* safe decompression with overrun testing */ | 53 | /* safe decompression with overrun testing */ |
55 | int lzo1x_decompress_safe(const uint8_t* src, unsigned src_len, | 54 | int lzo1x_decompress_safe(const uint8_t* src, unsigned src_len, |
56 | uint8_t* dst, unsigned* dst_len, | 55 | uint8_t* dst, unsigned* dst_len /*, void* wrkmem */); |
57 | void* wrkmem /* NOT USED */); | ||
58 | 56 | ||
59 | #define LZO_E_OK 0 | 57 | #define LZO_E_OK 0 |
60 | #define LZO_E_ERROR (-1) | 58 | #define LZO_E_ERROR (-1) |