summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <klto@zhaw.ch>2009-12-10 14:24:22 +0100
committerTobias Klauser <klto@zhaw.ch>2009-12-10 14:24:22 +0100
commit7ac7375df3cd40717b27e5c4fb92052ee6730c7b (patch)
tree4bb129c1297eee8426549f54338f0087eb0c5629
parent1f96bb1eda77de338fcd8b2af1a70a3c2cf37f18 (diff)
crc32: Remove useless BIT_MASK macro and replace only user by constant
-rw-r--r--crc32.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/crc32.c b/crc32.c
index 14920a2..e07bbed 100644
--- a/crc32.c
+++ b/crc32.c
@@ -3,8 +3,6 @@
#include "crc32.h"
-#define BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL << (n)) - 1))
-
/* Table computed with Mark Adler's makecrc.c utility. */
static const uint32_t crc32_table[256] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
@@ -67,7 +65,7 @@ uint32_t crc32(uint32_t crc, uint8_t *buf, size_t len)
crc = ~crc;
for (end = buf + len; buf < end; buf++)
- crc = crc32_table[(crc ^ *buf) & BIT_MASK(8)] ^ (crc >> 8);
+ crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8);
return ~crc;
}