diff options
Diffstat (limited to 'src/lodepng.cpp')
-rw-r--r-- | src/lodepng.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lodepng.cpp b/src/lodepng.cpp index 638dbf4..df8378e 100644 --- a/src/lodepng.cpp +++ b/src/lodepng.cpp @@ -1765,13 +1765,13 @@ static unsigned Crc32_crc_table[256]; /*Make the table for a fast CRC.*/ static void Crc32_make_crc_table(void) { - unsigned c, k, n; + unsigned int c, k, n; for(n = 0; n < 256; n++) { c = n; for(k = 0; k < 8; k++) { - if(c & 1) c = 0xedb88320L ^ (c >> 1); + if(c & 1) c = (unsigned int)(0xedb88320L ^ (c >> 1)); else c = c >> 1; } Crc32_crc_table[n] = c; @@ -1782,9 +1782,9 @@ static void Crc32_make_crc_table(void) /*Update a running CRC with the bytes buf[0..len-1]--the CRC should be initialized to all 1's, and the transmitted value is the 1's complement of the final running CRC (see the crc() routine below).*/ -static unsigned Crc32_update_crc(const unsigned char* buf, unsigned crc, size_t len) +static unsigned Crc32_update_crc(const unsigned char* buf, unsigned int crc, size_t len) { - unsigned c = crc; + unsigned int c = crc; size_t n; if(!Crc32_crc_table_computed) Crc32_make_crc_table(); @@ -1798,7 +1798,7 @@ static unsigned Crc32_update_crc(const unsigned char* buf, unsigned crc, size_t /*Return the CRC of the bytes buf[0..len-1].*/ static unsigned Crc32_crc(const unsigned char* buf, size_t len) { - return Crc32_update_crc(buf, 0xffffffffL, len) ^ 0xffffffffL; + return Crc32_update_crc(buf, 0xffffffffu, len) ^ 0xffffffffu; } /* ////////////////////////////////////////////////////////////////////////// */ |