From: Tobias Stoeckmann Date: Thu, 11 Jun 2026 16:57:36 +0000 (+0200) Subject: filters: Remove unneeded counters X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3d3bed74ba6ce5ae9931355ec3dedb09e4ea2f1;p=thirdparty%2Flibarchive.git filters: Remove unneeded counters These counters are written to, but they are never read. Remove them for easier code audits. Signed-off-by: Tobias Stoeckmann --- diff --git a/libarchive/archive_write_add_filter_bzip2.c b/libarchive/archive_write_add_filter_bzip2.c index 94b342d41..209b15285 100644 --- a/libarchive/archive_write_add_filter_bzip2.c +++ b/libarchive/archive_write_add_filter_bzip2.c @@ -57,7 +57,6 @@ struct private_data { int compression_level; #if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) bz_stream stream; - int64_t total_in; char *compressed; size_t compressed_buffer_size; #else @@ -239,9 +238,6 @@ archive_compressor_bzip2_write(struct archive_write_filter *f, { struct private_data *data = (struct private_data *)f->data; - /* Update statistics */ - data->total_in += length; - /* Compress input data to output buffer */ SET_NEXT_IN(data, buff); data->stream.avail_in = (uint32_t)length; diff --git a/libarchive/archive_write_add_filter_lz4.c b/libarchive/archive_write_add_filter_lz4.c index 3bd5f2058..de5283f15 100644 --- a/libarchive/archive_write_add_filter_lz4.c +++ b/libarchive/archive_write_add_filter_lz4.c @@ -61,7 +61,6 @@ struct private_data { unsigned preset_dictionary:1; unsigned block_maximum_size:3; #if defined(HAVE_LIBLZ4) && LZ4_VERSION_MAJOR >= 1 && LZ4_VERSION_MINOR >= 2 - int64_t total_in; char *out; char *out_buffer; size_t out_buffer_size; @@ -306,9 +305,6 @@ archive_filter_lz4_write(struct archive_write_filter *f, data->header_written = 1; } - /* Update statistics */ - data->total_in += length; - p = (const char *)buff; remaining = length; while (remaining) { diff --git a/libarchive/archive_write_add_filter_zstd.c b/libarchive/archive_write_add_filter_zstd.c index 7149abb2b..2c6b91eba 100644 --- a/libarchive/archive_write_add_filter_zstd.c +++ b/libarchive/archive_write_add_filter_zstd.c @@ -73,7 +73,6 @@ struct private_data { size_t cur_frame; size_t cur_frame_in; size_t cur_frame_out; - size_t total_in; ZSTD_CStream *cstream; ZSTD_outBuffer out; #else @@ -505,7 +504,6 @@ drive_compressor(struct archive_write_filter *f, data->state = running; break; } - data->total_in += in.pos - ipos; data->cur_frame_in += in.pos - ipos; data->cur_frame_out += data->out.pos - opos; if (data->state == running) {