diff options
Diffstat (limited to 'src/util/crypto_crc.c')
-rw-r--r-- | src/util/crypto_crc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/util/crypto_crc.c b/src/util/crypto_crc.c index a2ffdb543..8b0449d4b 100644 --- a/src/util/crypto_crc.c +++ b/src/util/crypto_crc.c | |||
@@ -56,18 +56,17 @@ static void | |||
56 | crc_init () | 56 | crc_init () |
57 | { | 57 | { |
58 | static int once; | 58 | static int once; |
59 | unsigned int i, j; | ||
60 | GNUNET_uLong h = 1; | 59 | GNUNET_uLong h = 1; |
61 | 60 | ||
62 | if (once) | 61 | if (once) |
63 | return; | 62 | return; |
64 | once = 1; | 63 | once = 1; |
65 | crc_table[0] = 0; | 64 | crc_table[0] = 0; |
66 | for (i = 128; i; i >>= 1) | 65 | for (unsigned int i = 128; i; i >>= 1) |
67 | { | 66 | { |
68 | h = (h >> 1) ^ ((h & 1) ? POLYNOMIAL : 0); | 67 | h = (h >> 1) ^ ((h & 1) ? POLYNOMIAL : 0); |
69 | /* h is now crc_table[i] */ | 68 | /* h is now crc_table[i] */ |
70 | for (j = 0; j < 256; j += 2 * i) | 69 | for (unsigned int j = 0; j < 256; j += 2 * i) |
71 | crc_table[i + j] = crc_table[j] ^ h; | 70 | crc_table[i + j] = crc_table[j] ^ h; |
72 | } | 71 | } |
73 | } | 72 | } |