libunarchive: clean up dirty hacks. code shrank as a result

function                                             old     new   delta
cpio_main                                            526     539     +13
init_handle                                           57      58      +1
init_archive_deb_ar                                   34      35      +1
get_header_ar                                        408     409      +1
dpkg_main                                           3900    3901      +1
unpack_package                                       516     515      -1
rpm_main                                            1673    1672      -1
tar_main                                             774     767      -7
get_header_cpio                                      990     972     -18
data_extract_all                                     750     727     -23
get_header_tar                                      1631    1576     -55
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/6 up/down: 17/-105)           Total: -88 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-01-06 10:53:17 +01:00
parent 86350f8d5f
commit aa4977d8e5
10 changed files with 95 additions and 102 deletions

View File

@@ -412,14 +412,14 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
}
/* see get_header_cpio */
archive_handle->ah_priv[2] = (void*) ~(ptrdiff_t)0;
archive_handle->cpio__blocks = (off_t)-1;
while (get_header_cpio(archive_handle) == EXIT_SUCCESS)
continue;
if (archive_handle->ah_priv[2] != (void*) ~(ptrdiff_t)0
if (archive_handle->cpio__blocks != (off_t)-1
&& !(opt & CPIO_OPT_QUIET)
)
printf("%lu blocks\n", (unsigned long)(ptrdiff_t)(archive_handle->ah_priv[2]));
printf("%"OFF_FMT"u blocks\n", archive_handle->cpio__blocks);
return EXIT_SUCCESS;
}