lzop: code shrink
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 1 Feb 2018 00:41:31 +0000 (01:41 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 1 Feb 2018 00:41:31 +0000 (01:41 +0100)
function                                             old     new   delta
lzo_decompress                                       526     524      -2
lzo_compress                                         473     470      -3

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/libarchive/lzo1x_d.c
archival/lzop.c
include/liblzo_interface.h

index 40b167e688e2218b0333f917c060630238afb5b9..43cf4a04e93fbaf0858d15767a8e06ea77b189e4 100644 (file)
@@ -31,8 +31,7 @@
 ************************************************************************/
 /* safe decompression with overrun testing */
 int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len,
-               uint8_t* out, unsigned* out_len,
-               void* wrkmem UNUSED_PARAM)
+               uint8_t* out, unsigned* out_len /*, void* wrkmem */)
 {
        register uint8_t* op;
        register const uint8_t* ip;
index da09b7a8276983b0b0caf20e85252f8e0b3543c2..ba27aeff0113fd7e2d83be367510a1627259fad1 100644 (file)
@@ -141,8 +141,7 @@ static void copy3(uint8_t* ip, const uint8_t* m_pos, unsigned off)
 #define TEST_OP                (op <= op_end)
 
 static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len,
-               uint8_t *out, unsigned *out_len,
-               void* wrkmem UNUSED_PARAM)
+               uint8_t *out, unsigned *out_len /*, void* wrkmem */)
 {
        uint8_t* op;
        uint8_t* ip;
@@ -724,7 +723,7 @@ static NOINLINE int lzo_compress(const header_t *h)
                        /* optimize */
                        if (h->method == M_LZO1X_999) {
                                unsigned new_len = src_len;
-                               r = lzo1x_optimize(b2, dst_len, b1, &new_len, NULL);
+                               r = lzo1x_optimize(b2, dst_len, b1, &new_len /*, NULL*/);
                                if (r != 0 /*LZO_E_OK*/ || new_len != src_len)
                                        bb_error_msg_and_die("internal error - optimization failed");
                        }
@@ -859,9 +858,9 @@ static NOINLINE int lzo_decompress(const header_t *h)
 
                        /* decompress */
 //                     if (option_mask32 & OPT_F)
-//                             r = lzo1x_decompress(b1, src_len, b2, &d, NULL);
+//                             r = lzo1x_decompress(b1, src_len, b2, &d /*, NULL*/);
 //                     else
-                               r = lzo1x_decompress_safe(b1, src_len, b2, &d, NULL);
+                               r = lzo1x_decompress_safe(b1, src_len, b2, &d /*, NULL*/);
 
                        if (r != 0 /*LZO_E_OK*/ || dst_len != d) {
                                bb_error_msg_and_die("corrupted data");
index b7f1b639babf3cb9f927179df071726e2c9b6b9f..1e194b944872bb0d8d9424ffef3319aeeb31769b 100644 (file)
@@ -49,12 +49,10 @@ int lzo1x_999_compress_level(const uint8_t* in, unsigned in_len,
 
 /* decompression */
 //int lzo1x_decompress(const uint8_t* src, unsigned src_len,
-//             uint8_t* dst, unsigned* dst_len,
-//             void* wrkmem /* NOT USED */);
+//             uint8_t* dst, unsigned* dst_len /*, void* wrkmem */);
 /* safe decompression with overrun testing */
 int lzo1x_decompress_safe(const uint8_t* src, unsigned src_len,
-               uint8_t* dst, unsigned* dst_len,
-               void* wrkmem /* NOT USED */);
+               uint8_t* dst, unsigned* dst_len /*, void* wrkmem */);
 
 #define LZO_E_OK                    0
 #define LZO_E_ERROR                 (-1)