aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-10-28 15:33:19 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2015-10-28 15:33:19 +0100
commit4840325351911780a02f953f17b2eee919a36340 (patch)
tree45b4c9fa25be8683267ad2782b4f7cd5ed1e9828
parent82c2fad26c4134cc60eed9a3f05a9bbec70ab65b (diff)
downloadbusybox-w32-4840325351911780a02f953f17b2eee919a36340.tar.gz
busybox-w32-4840325351911780a02f953f17b2eee919a36340.tar.bz2
busybox-w32-4840325351911780a02f953f17b2eee919a36340.zip
lzop: eliminate variable, use "int" as return type
Based on patch by Maxin B. John <maxin.john@intel.com> function old new delta pack_lzop 870 859 -11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--archival/lzop.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/archival/lzop.c b/archival/lzop.c
index 73d11a705..a5fc01941 100644
--- a/archival/lzop.c
+++ b/archival/lzop.c
@@ -640,7 +640,7 @@ static int lzo_get_method(header_t *h)
640/**********************************************************************/ 640/**********************************************************************/
641// compress a file 641// compress a file
642/**********************************************************************/ 642/**********************************************************************/
643static NOINLINE smallint lzo_compress(const header_t *h) 643static NOINLINE int lzo_compress(const header_t *h)
644{ 644{
645 unsigned block_size = LZO_BLOCK_SIZE; 645 unsigned block_size = LZO_BLOCK_SIZE;
646 int r = 0; /* LZO_E_OK */ 646 int r = 0; /* LZO_E_OK */
@@ -650,7 +650,6 @@ static NOINLINE smallint lzo_compress(const header_t *h)
650 uint32_t d_adler32 = ADLER32_INIT_VALUE; 650 uint32_t d_adler32 = ADLER32_INIT_VALUE;
651 uint32_t d_crc32 = CRC32_INIT_VALUE; 651 uint32_t d_crc32 = CRC32_INIT_VALUE;
652 int l; 652 int l;
653 smallint ok = 1;
654 uint8_t *wrk_mem = NULL; 653 uint8_t *wrk_mem = NULL;
655 654
656 if (h->method == M_LZO1X_1) 655 if (h->method == M_LZO1X_1)
@@ -732,7 +731,7 @@ static NOINLINE smallint lzo_compress(const header_t *h)
732 free(wrk_mem); 731 free(wrk_mem);
733 free(b1); 732 free(b1);
734 free(b2); 733 free(b2);
735 return ok; 734 return 1;
736} 735}
737 736
738static FAST_FUNC void lzo_check( 737static FAST_FUNC void lzo_check(
@@ -753,7 +752,7 @@ static FAST_FUNC void lzo_check(
753/**********************************************************************/ 752/**********************************************************************/
754// decompress a file 753// decompress a file
755/**********************************************************************/ 754/**********************************************************************/
756static NOINLINE smallint lzo_decompress(const header_t *h) 755static NOINLINE int lzo_decompress(const header_t *h)
757{ 756{
758 unsigned block_size = LZO_BLOCK_SIZE; 757 unsigned block_size = LZO_BLOCK_SIZE;
759 int r; 758 int r;
@@ -761,7 +760,6 @@ static NOINLINE smallint lzo_decompress(const header_t *h)
761 uint32_t c_adler32 = ADLER32_INIT_VALUE; 760 uint32_t c_adler32 = ADLER32_INIT_VALUE;
762 uint32_t d_adler32 = ADLER32_INIT_VALUE; 761 uint32_t d_adler32 = ADLER32_INIT_VALUE;
763 uint32_t c_crc32 = CRC32_INIT_VALUE, d_crc32 = CRC32_INIT_VALUE; 762 uint32_t c_crc32 = CRC32_INIT_VALUE, d_crc32 = CRC32_INIT_VALUE;
764 smallint ok = 1;
765 uint8_t *b1; 763 uint8_t *b1;
766 uint32_t mcs_block_size = MAX_COMPRESSED_SIZE(block_size); 764 uint32_t mcs_block_size = MAX_COMPRESSED_SIZE(block_size);
767 uint8_t *b2 = NULL; 765 uint8_t *b2 = NULL;
@@ -865,7 +863,7 @@ static NOINLINE smallint lzo_decompress(const header_t *h)
865 } 863 }
866 864
867 free(b2); 865 free(b2);
868 return ok; 866 return 1;
869} 867}
870 868
871/**********************************************************************/ 869/**********************************************************************/
@@ -1050,7 +1048,7 @@ static void lzo_set_method(header_t *h)
1050 h->level = level; 1048 h->level = level;
1051} 1049}
1052 1050
1053static smallint do_lzo_compress(void) 1051static int do_lzo_compress(void)
1054{ 1052{
1055 header_t header; 1053 header_t header;
1056 1054
@@ -1078,7 +1076,7 @@ static smallint do_lzo_compress(void)
1078/**********************************************************************/ 1076/**********************************************************************/
1079// decompress 1077// decompress
1080/**********************************************************************/ 1078/**********************************************************************/
1081static smallint do_lzo_decompress(void) 1079static int do_lzo_decompress(void)
1082{ 1080{
1083 header_t header; 1081 header_t header;
1084 1082