From 86ca02290d7ecba80070417ca2924547559b9e52 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Henson" Date: Tue, 23 Jan 2024 16:33:03 -0800 Subject: [PATCH] msvc compiler errors. --- tests/crc64_test.c | 2 +- tests/crc_test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/crc64_test.c b/tests/crc64_test.c index 2282b47..5e61e8c 100644 --- a/tests/crc64_test.c +++ b/tests/crc64_test.c @@ -11,7 +11,7 @@ static const uint64_t POLY_CRC64XZ = 0xc96c5795d7870f42; // Any input with the CRC of that input appended should produce this CRC value. (Note: inverting the bits) -static const uint64_t RESIDUE_CRC64XZ = ~0x49958c9abd7d353f; +static const uint64_t RESIDUE_CRC64XZ = (uint64_t)~0x49958c9abd7d353f; static const uint8_t DATA_32_ZEROS[32] = {0}; static const uint64_t KNOWN_CRC64XZ_32_ZEROES = 0xC95AF8617CD5330C; diff --git a/tests/crc_test.c b/tests/crc_test.c index c6be67c..34d60a3 100644 --- a/tests/crc_test.c +++ b/tests/crc_test.c @@ -73,7 +73,7 @@ static int s_test_known_crc_32( ASSERT_HEX_EQUALS(expected_crc, result, "%s(%s)", func_name, data_name); // Compute the residue of the buffer (the CRC of the buffer plus its CRC) - will always be a constant value - uint32_t residue = func((const uint8_t *)&result, 4, result); // assuming little endian + uint32_t residue = (uint32_t)func((const uint8_t *)&result, 4, result); // assuming little endian ASSERT_HEX_EQUALS(expected_residue, residue, "len %d residue %s(%s)", length, func_name, data_name); // chain the crc computation so 2 calls each operate on about 1/2 of the buffer