]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
filters: Remove unneeded counters 3136/head
authorTobias Stoeckmann <tobias@stoeckmann.org>
Thu, 11 Jun 2026 16:57:36 +0000 (18:57 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Thu, 11 Jun 2026 16:57:36 +0000 (18:57 +0200)
These counters are written to, but they are never read. Remove them for
easier code audits.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
libarchive/archive_write_add_filter_bzip2.c
libarchive/archive_write_add_filter_lz4.c
libarchive/archive_write_add_filter_zstd.c

index 94b342d41b74a8014b22e59447c4cb291ce89e20..209b15285415b4e7f3fb78ecd644b26b456373a0 100644 (file)
@@ -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;
index 3bd5f20585ce8b25cc5f71ef7d00328c845459de..de5283f15658188afe95fa6cb0a48fd1d1018d97 100644 (file)
@@ -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) {
index 7149abb2b8a8506bb75263bc05018d14b39acf44..2c6b91eba18a1a84586145b5ee7d5a1502bf3395 100644 (file)
@@ -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) {