diff options
Diffstat (limited to 'tools/firmware-utils/src/dns313-header.c')
-rw-r--r-- | tools/firmware-utils/src/dns313-header.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/firmware-utils/src/dns313-header.c b/tools/firmware-utils/src/dns313-header.c index c5c70e1bbc..42dd67771d 100644 --- a/tools/firmware-utils/src/dns313-header.c +++ b/tools/firmware-utils/src/dns313-header.c @@ -102,9 +102,11 @@ static const uint32_t crc32_table[256] = { }; static uint32_t crc32(uint32_t crc, - const unsigned char *buf, + const void *data, unsigned int len) { + const uint8_t *buf = data; + crc = crc ^ 0xffffffffUL; do { crc = crc32_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8); @@ -112,7 +114,7 @@ static uint32_t crc32(uint32_t crc, return crc ^ 0xffffffffUL; } -static void be_wr(unsigned char *buf, uint32_t val) +static void be_wr(char *buf, uint32_t val) { buf[0] = (val >> 24) & 0xFFU; buf[1] = (val >> 16) & 0xFFU; @@ -129,7 +131,7 @@ int main(int argc, char **argv) int ret = 0; const char *pathin; const char *pathout; - unsigned char *buffer; + char *buffer; uint32_t sum; size_t bufsize; size_t bytes; |