From 570bc0607c76cbc5d0c99ca59d069ccf0a751794 Mon Sep 17 00:00:00 2001 From: DmitriyMusatkin Date: Thu, 5 Sep 2024 14:21:24 -0700 Subject: [PATCH] lint --- include/aws/checksums/private/crc_util.h | 26 +++++++++++------------- source/crc.c | 2 +- source/crc64.c | 2 +- tests/crc_test.c | 1 - 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/include/aws/checksums/private/crc_util.h b/include/aws/checksums/private/crc_util.h index ee36a36..7878d13 100644 --- a/include/aws/checksums/private/crc_util.h +++ b/include/aws/checksums/private/crc_util.h @@ -8,19 +8,17 @@ #include #include -#define large_buffer_apply_impl(Name, T) \ - T aws_large_buffer_apply_##Name(T (*checksum_fn)(const uint8_t *, int, T), \ - const uint8_t *buffer, \ - uint64_t length, \ - T previous) { \ - T val = previous; \ - while (length > INT_MAX) { \ - val = checksum_fn(buffer, INT_MAX, val); \ - buffer += (size_t)INT_MAX; \ - length -= (uint64_t)INT_MAX; \ - } \ - val = checksum_fn(buffer, (int)length, val); \ - return val; \ - } \ +#define large_buffer_apply_impl(Name, T) \ + T aws_large_buffer_apply_##Name( \ + T (*checksum_fn)(const uint8_t *, int, T), const uint8_t *buffer, uint64_t length, T previous) { \ + T val = previous; \ + while (length > INT_MAX) { \ + val = checksum_fn(buffer, INT_MAX, val); \ + buffer += (size_t)INT_MAX; \ + length -= (uint64_t)INT_MAX; \ + } \ + val = checksum_fn(buffer, (int)length, val); \ + return val; \ + } #endif /* AWS_CHECKSUMS_PRIVATE_CRC_UTIL_H */ diff --git a/source/crc.c b/source/crc.c index 70494a5..c2aa95a 100644 --- a/source/crc.c +++ b/source/crc.c @@ -10,7 +10,7 @@ large_buffer_apply_impl(crc32, uint32_t) -static uint32_t (*s_crc32c_fn_ptr)(const uint8_t *input, int length, uint32_t previous_crc32c) = 0; + static uint32_t (*s_crc32c_fn_ptr)(const uint8_t *input, int length, uint32_t previous_crc32c) = 0; static uint32_t (*s_crc32_fn_ptr)(const uint8_t *input, int length, uint32_t previous_crc32) = 0; uint32_t aws_checksums_crc32(const uint8_t *input, int length, uint32_t previous_crc32) { diff --git a/source/crc64.c b/source/crc64.c index 7021902..0cf0389 100644 --- a/source/crc64.c +++ b/source/crc64.c @@ -10,7 +10,7 @@ large_buffer_apply_impl(crc64, uint64_t) -AWS_ALIGNED_TYPEDEF(uint8_t, checksums_maxks_shifts_type[6][16], 16); + AWS_ALIGNED_TYPEDEF(uint8_t, checksums_maxks_shifts_type[6][16], 16); // Intel PSHUFB / ARM VTBL patterns for left/right shifts and masks checksums_maxks_shifts_type aws_checksums_masks_shifts = { {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, // diff --git a/tests/crc_test.c b/tests/crc_test.c index fee0b38..77f578b 100644 --- a/tests/crc_test.c +++ b/tests/crc_test.c @@ -184,7 +184,6 @@ static int s_test_crc32(struct aws_allocator *allocator, void *ctx) { } AWS_TEST_CASE(test_crc32, s_test_crc32) - static int s_test_large_buffer_crc32(struct aws_allocator *allocator, void *ctx) { (void)ctx; #if SIZE_BITS == 32