summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <klto@zhaw.ch>2009-10-23 16:20:06 +0200
committerTobias Klauser <klto@zhaw.ch>2009-10-23 16:20:06 +0200
commit0ec89ae925aa63355a530f8b83b51914e8aa0756 (patch)
treed9ddf3c7c8b3308cbb5c5ed7591144b70783c264
parentc5b2f669a1da34e43a1964cf24a6f22442cdcbba (diff)
Use C99 type for byte in crc32.c
-rw-r--r--crc32.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/crc32.c b/crc32.c
index 5d41211..4ee251a 100644
--- a/crc32.c
+++ b/crc32.c
@@ -61,14 +61,13 @@ static const uint32_t crc32_table[256] = {
0x2d02ef8d
};
-uint32_t crc32(uint32_t crc, unsigned char *buf, size_t len)
+uint32_t crc32(uint32_t crc, uint8_t *buf, size_t len)
{
- unsigned char *end;
+ uint8_t *end;
crc = ~crc;
- for (end = buf + len; buf < end; ++buf)
+ for (end = buf + len; buf < end; buf++)
crc = crc32_table[(crc ^ *buf) & BIT_MASK(8)] ^ (crc >> 8);
return ~crc;
}
-