diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-31 14:18:57 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-31 14:18:57 +0200 |
commit | 39a04f71ca8ccf81de2cdbd538df519cf34ef2e6 (patch) | |
tree | 01b85baa36d95c48924c3688f8a8f9e0c96ba04a /archival/lzop.c | |
parent | b8b72f02f01017d0f9584666fa572221f2b58613 (diff) | |
download | busybox-w32-39a04f71ca8ccf81de2cdbd538df519cf34ef2e6.tar.gz busybox-w32-39a04f71ca8ccf81de2cdbd538df519cf34ef2e6.tar.bz2 busybox-w32-39a04f71ca8ccf81de2cdbd538df519cf34ef2e6.zip |
archival/*: shrink by reusing sufficiently similar functions
function old new delta
append_ext - 16 +16
unxz_main 77 83 +6
unlzma_main 77 83 +6
uncompress_main 42 48 +6
gzip_main 184 190 +6
bzip2_main 114 120 +6
bunzip2_main 61 67 +6
bbunpack 469 475 +6
send_tree 355 360 +5
lzop_main 89 92 +3
gunzip_main 61 64 +3
make_new_name_lzop 84 82 -2
make_new_name_gunzip 114 112 -2
make_new_name_unxz 14 - -14
make_new_name_unlzma 14 - -14
make_new_name_uncompress 14 - -14
make_new_name_bunzip2 14 - -14
make_new_name_gzip 17 - -17
make_new_name_bzip2 17 - -17
------------------------------------------------------------------------------
(add/remove: 1/6 grow/shrink: 10/2 up/down: 69/-94) Total: -25 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/lzop.c')
-rw-r--r-- | archival/lzop.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/archival/lzop.c b/archival/lzop.c index ceace0436..ab4d34c88 100644 --- a/archival/lzop.c +++ b/archival/lzop.c | |||
@@ -1042,7 +1042,7 @@ static smallint do_lzo_decompress(void) | |||
1042 | return lzo_decompress(&header); | 1042 | return lzo_decompress(&header); |
1043 | } | 1043 | } |
1044 | 1044 | ||
1045 | static char* make_new_name_lzop(char *filename) | 1045 | static char* FAST_FUNC make_new_name_lzop(char *filename, const char *expected_ext UNUSED_PARAM) |
1046 | { | 1046 | { |
1047 | if (option_mask32 & OPT_DECOMPRESS) { | 1047 | if (option_mask32 & OPT_DECOMPRESS) { |
1048 | char *extension = strrchr(filename, '.'); | 1048 | char *extension = strrchr(filename, '.'); |
@@ -1054,7 +1054,7 @@ static char* make_new_name_lzop(char *filename) | |||
1054 | return xasprintf("%s.lzo", filename); | 1054 | return xasprintf("%s.lzo", filename); |
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | static IF_DESKTOP(long long) int pack_lzop(unpack_info_t *info UNUSED_PARAM) | 1057 | static IF_DESKTOP(long long) int FAST_FUNC pack_lzop(unpack_info_t *info UNUSED_PARAM) |
1058 | { | 1058 | { |
1059 | if (option_mask32 & OPT_DECOMPRESS) | 1059 | if (option_mask32 & OPT_DECOMPRESS) |
1060 | return do_lzo_decompress(); | 1060 | return do_lzo_decompress(); |
@@ -1074,5 +1074,5 @@ int lzop_main(int argc UNUSED_PARAM, char **argv) | |||
1074 | option_mask32 |= OPT_DECOMPRESS; | 1074 | option_mask32 |= OPT_DECOMPRESS; |
1075 | 1075 | ||
1076 | G.lzo_crc32_table = crc32_filltable(NULL, 0); | 1076 | G.lzo_crc32_table = crc32_filltable(NULL, 0); |
1077 | return bbunpack(argv, make_new_name_lzop, pack_lzop); | 1077 | return bbunpack(argv, pack_lzop, make_new_name_lzop, /*unused:*/ NULL); |
1078 | } | 1078 | } |