From 1a9b67bd5ae02901cf989173deb8609923d483d9 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:49:09 +0100 Subject: [PATCH] Reformat state match block --- decompress.rs | 160 +++++++++++++------------------------------------- 1 file changed, 40 insertions(+), 120 deletions(-) diff --git a/decompress.rs b/decompress.rs index 838481afb..323526050 100644 --- a/decompress.rs +++ b/decompress.rs @@ -315,126 +315,46 @@ pub fn BZ2_decompress(strm: &mut bz_stream, s: &mut DState) -> ReturnCode { current_block = BZ_X_MAGIC_2; } - State::BZ_X_MAGIC_2 => { - current_block = BZ_X_MAGIC_2; - } - State::BZ_X_MAGIC_3 => { - current_block = BZ_X_MAGIC_3; - } - State::BZ_X_MAGIC_4 => { - current_block = BZ_X_MAGIC_4; - } - State::BZ_X_BLKHDR_1 => { - current_block = BZ_X_BLKHDR_1; - } - State::BZ_X_BLKHDR_2 => { - current_block = BZ_X_BLKHDR_2; - } - State::BZ_X_BLKHDR_3 => { - current_block = BZ_X_BLKHDR_3; - } - State::BZ_X_BLKHDR_4 => { - current_block = BZ_X_BLKHDR_4; - } - State::BZ_X_BLKHDR_5 => { - current_block = BZ_X_BLKHDR_5; - } - State::BZ_X_BLKHDR_6 => { - current_block = BZ_X_BLKHDR_6; - } - State::BZ_X_BCRC_1 => { - current_block = BZ_X_BCRC_1; - } - State::BZ_X_BCRC_2 => { - current_block = BZ_X_BCRC_2; - } - State::BZ_X_BCRC_3 => { - current_block = BZ_X_BCRC_3; - } - State::BZ_X_BCRC_4 => { - current_block = BZ_X_BCRC_4; - } - State::BZ_X_RANDBIT => { - current_block = BZ_X_RANDBIT; - } - State::BZ_X_ORIGPTR_1 => { - current_block = BZ_X_ORIGPTR_1; - } - State::BZ_X_ORIGPTR_2 => { - current_block = BZ_X_ORIGPTR_2; - } - State::BZ_X_ORIGPTR_3 => { - current_block = BZ_X_ORIGPTR_3; - } - State::BZ_X_MAPPING_1 => { - current_block = BZ_X_MAPPING_1; - } - State::BZ_X_MAPPING_2 => { - current_block = BZ_X_MAPPING_2; - } - State::BZ_X_SELECTOR_1 => { - current_block = BZ_X_SELECTOR_1; - } - State::BZ_X_SELECTOR_2 => { - current_block = BZ_X_SELECTOR_2; - } - State::BZ_X_SELECTOR_3 => { - current_block = BZ_X_SELECTOR_3; - } - State::BZ_X_CODING_1 => { - current_block = BZ_X_CODING_1; - } - State::BZ_X_CODING_2 => { - current_block = BZ_X_CODING_2; - } - State::BZ_X_CODING_3 => { - current_block = BZ_X_CODING_3; - } - State::BZ_X_MTF_1 => { - current_block = BZ_X_MTF_1; - } - State::BZ_X_MTF_2 => { - current_block = BZ_X_MTF_2; - } - State::BZ_X_MTF_3 => { - current_block = BZ_X_MTF_3; - } - State::BZ_X_MTF_4 => { - current_block = BZ_X_MTF_4; - } - State::BZ_X_MTF_5 => { - current_block = BZ_X_MTF_5; - } - State::BZ_X_MTF_6 => { - current_block = BZ_X_MTF_6; - } - State::BZ_X_ENDHDR_2 => { - current_block = BZ_X_ENDHDR_2; - } - State::BZ_X_ENDHDR_3 => { - current_block = BZ_X_ENDHDR_3; - } - State::BZ_X_ENDHDR_4 => { - current_block = BZ_X_ENDHDR_4; - } - State::BZ_X_ENDHDR_5 => { - current_block = BZ_X_ENDHDR_5; - } - State::BZ_X_ENDHDR_6 => { - current_block = BZ_X_ENDHDR_6; - } - State::BZ_X_CCRC_1 => { - current_block = BZ_X_CCRC_1; - } - State::BZ_X_CCRC_2 => { - current_block = BZ_X_CCRC_2; - } - State::BZ_X_CCRC_3 => { - current_block = BZ_X_CCRC_3; - } - State::BZ_X_CCRC_4 => { - current_block = BZ_X_CCRC_4; - } + State::BZ_X_MAGIC_2 => current_block = BZ_X_MAGIC_2, + State::BZ_X_MAGIC_3 => current_block = BZ_X_MAGIC_3, + State::BZ_X_MAGIC_4 => current_block = BZ_X_MAGIC_4, + State::BZ_X_BLKHDR_1 => current_block = BZ_X_BLKHDR_1, + State::BZ_X_BLKHDR_2 => current_block = BZ_X_BLKHDR_2, + State::BZ_X_BLKHDR_3 => current_block = BZ_X_BLKHDR_3, + State::BZ_X_BLKHDR_4 => current_block = BZ_X_BLKHDR_4, + State::BZ_X_BLKHDR_5 => current_block = BZ_X_BLKHDR_5, + State::BZ_X_BLKHDR_6 => current_block = BZ_X_BLKHDR_6, + State::BZ_X_BCRC_1 => current_block = BZ_X_BCRC_1, + State::BZ_X_BCRC_2 => current_block = BZ_X_BCRC_2, + State::BZ_X_BCRC_3 => current_block = BZ_X_BCRC_3, + State::BZ_X_BCRC_4 => current_block = BZ_X_BCRC_4, + State::BZ_X_RANDBIT => current_block = BZ_X_RANDBIT, + State::BZ_X_ORIGPTR_1 => current_block = BZ_X_ORIGPTR_1, + State::BZ_X_ORIGPTR_2 => current_block = BZ_X_ORIGPTR_2, + State::BZ_X_ORIGPTR_3 => current_block = BZ_X_ORIGPTR_3, + State::BZ_X_MAPPING_1 => current_block = BZ_X_MAPPING_1, + State::BZ_X_MAPPING_2 => current_block = BZ_X_MAPPING_2, + State::BZ_X_SELECTOR_1 => current_block = BZ_X_SELECTOR_1, + State::BZ_X_SELECTOR_2 => current_block = BZ_X_SELECTOR_2, + State::BZ_X_SELECTOR_3 => current_block = BZ_X_SELECTOR_3, + State::BZ_X_CODING_1 => current_block = BZ_X_CODING_1, + State::BZ_X_CODING_2 => current_block = BZ_X_CODING_2, + State::BZ_X_CODING_3 => current_block = BZ_X_CODING_3, + State::BZ_X_MTF_1 => current_block = BZ_X_MTF_1, + State::BZ_X_MTF_2 => current_block = BZ_X_MTF_2, + State::BZ_X_MTF_3 => current_block = BZ_X_MTF_3, + State::BZ_X_MTF_4 => current_block = BZ_X_MTF_4, + State::BZ_X_MTF_5 => current_block = BZ_X_MTF_5, + State::BZ_X_MTF_6 => current_block = BZ_X_MTF_6, + State::BZ_X_ENDHDR_2 => current_block = BZ_X_ENDHDR_2, + State::BZ_X_ENDHDR_3 => current_block = BZ_X_ENDHDR_3, + State::BZ_X_ENDHDR_4 => current_block = BZ_X_ENDHDR_4, + State::BZ_X_ENDHDR_5 => current_block = BZ_X_ENDHDR_5, + State::BZ_X_ENDHDR_6 => current_block = BZ_X_ENDHDR_6, + State::BZ_X_CCRC_1 => current_block = BZ_X_CCRC_1, + State::BZ_X_CCRC_2 => current_block = BZ_X_CCRC_2, + State::BZ_X_CCRC_3 => current_block = BZ_X_CCRC_3, + State::BZ_X_CCRC_4 => current_block = BZ_X_CCRC_4, State::BZ_X_IDLE | State::BZ_X_OUTPUT => unreachable!(), } if current_block == BZ_X_MAGIC_2 {