summaryrefslogtreecommitdiffstats
path: root/src/lodepng.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2012-09-30 13:51:29 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2012-09-30 13:51:29 (GMT)
commitceb4115c7b941039411e1793e01239610ff112a2 (patch)
treed18c06222e0f84d6077b586e5633053a8bc09da8 /src/lodepng.cpp
parentf6d511e52eb55c5d5b980c4d226f2ea80b396095 (diff)
downloadDoxygen-ceb4115c7b941039411e1793e01239610ff112a2.zip
Doxygen-ceb4115c7b941039411e1793e01239610ff112a2.tar.gz
Doxygen-ceb4115c7b941039411e1793e01239610ff112a2.tar.bz2
Release-1.8.2-20120930
Diffstat (limited to 'src/lodepng.cpp')
-rw-r--r--src/lodepng.cpp10
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;
}
/* ////////////////////////////////////////////////////////////////////////// */