aboutsummaryrefslogtreecommitdiff
path: root/lib/comp
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-18 16:09:31 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-18 22:53:32 +0200
commit50385e06ec207af0171c021f1909e9ef38c00519 (patch)
tree690bfe53cef9f901c68f76f4fe50c1917e368fe2 /lib/comp
parent58c5d7c933a714096ef0dd42bd1446a6e1a25a16 (diff)
Replace update_crc32 helper function with crc32 from zlib
It is optimized to the maximum and if we already use zlib anyway, why not use zlib crc32? This also makes zlib a hard dependency which also means the whole "do we have a compressor" sanity check in the build system can be removed. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/comp')
-rw-r--r--lib/comp/process_block.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/comp/process_block.c b/lib/comp/process_block.c
index 76cd07d..0fcbae0 100644
--- a/lib/comp/process_block.c
+++ b/lib/comp/process_block.c
@@ -10,6 +10,7 @@
#include "util.h"
#include <string.h>
+#include <zlib.h>
int process_block(block_t *block, compressor_t *cmp,
uint8_t *scratch, size_t scratch_size)
@@ -17,7 +18,7 @@ int process_block(block_t *block, compressor_t *cmp,
ssize_t ret;
if (!(block->flags & BLK_DONT_CHECKSUM))
- block->checksum = update_crc32(0, block->data, block->size);
+ block->checksum = crc32(0, block->data, block->size);
if (!(block->flags & BLK_DONT_COMPRESS)) {
ret = cmp->do_block(cmp, block->data, block->size,