diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2021-04-09 10:43:07 +0200 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2021-04-09 11:05:54 +0200 |
commit | 69e9138080ae39236de48561cf8923a86104eb35 (patch) | |
tree | ad605c6a312bcfd159bc6256fe17839826228919 /tools/firmware-utils/src/dns313-header.c | |
parent | 052a30d65e90ac9b3359f4a23aa3024d102c178c (diff) | |
download | upstream-69e9138080ae39236de48561cf8923a86104eb35.tar.gz upstream-69e9138080ae39236de48561cf8923a86104eb35.tar.bz2 upstream-69e9138080ae39236de48561cf8923a86104eb35.zip |
firmware-utils: fix -Wpointer-sign warnings
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
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; |