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>
diff --git a/archival/cpio.c b/archival/cpio.c
index 067d6e8..b21ba6e 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -412,14 +412,14 @@
}
/* 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;
}