aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_crc.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-11 09:43:04 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-11 09:43:04 +0000
commitd9d94d0e53d26af75ec8241383d166544ebd79f3 (patch)
tree9080b73624389403a198257fe0547bb4634e64d2 /src/util/crypto_crc.c
parent2d792ee2e9cc0c993b8907e2c8edb0c2b8465343 (diff)
downloadgnunet-d9d94d0e53d26af75ec8241383d166544ebd79f3.tar.gz
gnunet-d9d94d0e53d26af75ec8241383d166544ebd79f3.zip
converting to GNUNET_LOG_from*
Diffstat (limited to 'src/util/crypto_crc.c')
-rw-r--r--src/util/crypto_crc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/util/crypto_crc.c b/src/util/crypto_crc.c
index 543bc4c65..5920ddc93 100644
--- a/src/util/crypto_crc.c
+++ b/src/util/crypto_crc.c
@@ -32,6 +32,8 @@
32#include "gnunet_common.h" 32#include "gnunet_common.h"
33#include "gnunet_crypto_lib.h" 33#include "gnunet_crypto_lib.h"
34 34
35#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
36
35/* Avoid wasting space on 8-byte longs. */ 37/* Avoid wasting space on 8-byte longs. */
36#if UINT_MAX >= 0xffffffff 38#if UINT_MAX >= 0xffffffff
37typedef unsigned int uLong; 39typedef unsigned int uLong;
@@ -64,12 +66,12 @@ crc_init ()
64 once = 1; 66 once = 1;
65 crc_table[0] = 0; 67 crc_table[0] = 0;
66 for (i = 128; i; i >>= 1) 68 for (i = 128; i; i >>= 1)
67 { 69 {
68 h = (h >> 1) ^ ((h & 1) ? POLYNOMIAL : 0); 70 h = (h >> 1) ^ ((h & 1) ? POLYNOMIAL : 0);
69 /* h is now crc_table[i] */ 71 /* h is now crc_table[i] */
70 for (j = 0; j < 256; j += 2 * i) 72 for (j = 0; j < 256; j += 2 * i)
71 crc_table[i + j] = crc_table[j] ^ h; 73 crc_table[i + j] = crc_table[j] ^ h;
72 } 74 }
73} 75}
74 76
75/* 77/*