Use size_t for length in wvcrc32

(This is a merge of http://go/wvgerrit/134311.)

This patch widens the variable type used for lengths in wvcrc32 from
int to size_t. This fixes code that would trigger -Wshorten-64-to-32 by
implicitly narrowing a variable from 64 to 32 bits.

Bug: 194971260
Test: x86-64
Change-Id: I2887c18ff2a2c6dd3d65f966d9d1203fb050f736
This commit is contained in:
John W. Bruce
2021-10-04 17:22:10 -07:00
parent fe23bc40dc
commit bbb023db26
2 changed files with 53 additions and 73 deletions

View File

@@ -11,12 +11,12 @@
namespace wvoec {
uint32_t wvcrc32(const uint8_t* p_begin, int i_count);
uint32_t wvcrc32(const uint8_t* p_begin, size_t i_count);
uint32_t wvcrc32Init();
uint32_t wvcrc32Cont(const uint8_t* p_begin, int i_count, uint32_t prev_crc);
uint32_t wvcrc32Cont(const uint8_t* p_begin, size_t i_count, uint32_t prev_crc);
// Convert to network byte order
uint32_t wvcrc32n(const uint8_t* p_begin, int i_count);
uint32_t wvcrc32n(const uint8_t* p_begin, size_t i_count);
} // namespace wvoec