return ok;
}
-static void lzo_check(uint32_t FAST_FUNC (*fn)(uint32_t, const uint8_t*, unsigned),
- uint32_t ref, uint32_t init,
- uint8_t* buf, unsigned len)
+static FAST_FUNC void lzo_check(
+ uint32_t init,
+ uint8_t* buf, unsigned len,
+ uint32_t FAST_FUNC (*fn)(uint32_t, const uint8_t*, unsigned),
+ uint32_t ref)
{
+ /* This function, by having the same order of parameters
+ * as fn, and by being marked FAST_FUNC (same as fn),
+ * saves a dozen bytes of code.
+ */
uint32_t c = fn(init, buf, len);
if (c != ref)
bb_error_msg_and_die("checksum error");
if (dst_len > block_size) {
if (b2) {
-//FIXME!
- b2 = NULL;
free(b2);
+ b2 = NULL;
}
block_size = dst_len;
mcs_block_size = MAX_COMPRESSED_SIZE(block_size);
if (!(option_mask32 & OPT_F)) {
/* verify checksum of compressed block */
if (h->flags & F_ADLER32_C)
- lzo_check(lzo_adler32, c_adler32,
- ADLER32_INIT_VALUE,
- b1, src_len);
+ lzo_check(ADLER32_INIT_VALUE,
+ b1, src_len,
+ lzo_adler32, c_adler32);
if (h->flags & F_CRC32_C)
- lzo_check(lzo_crc32, c_crc32,
- CRC32_INIT_VALUE,
- b1, src_len);
+ lzo_check(CRC32_INIT_VALUE,
+ b1, src_len,
+ lzo_crc32, c_crc32);
}
/* decompress */
if (!(option_mask32 & OPT_F)) {
/* verify checksum of uncompressed block */
if (h->flags & F_ADLER32_D)
- lzo_check(lzo_adler32, d_adler32, ADLER32_INIT_VALUE,
- dst, dst_len);
+ lzo_check(ADLER32_INIT_VALUE,
+ dst, dst_len,
+ lzo_adler32, d_adler32);
if (h->flags & F_CRC32_D)
- lzo_check(lzo_crc32, d_crc32, CRC32_INIT_VALUE,
- dst, dst_len);
+ lzo_check(CRC32_INIT_VALUE,
+ dst, dst_len,
+ lzo_crc32, d_crc32);
}
/* write uncompressed block data */