LRN's patch argument order
[oweals/gnunet.git] / src / util / crypto_crc.c
index 8f5cfc800e44a3da7bf0e432ba62fe5782070487..698d8d450cf7b546ea4913842b0512ca3ebb5b34 100644 (file)
@@ -32,6 +32,8 @@
 #include "gnunet_common.h"
 #include "gnunet_crypto_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
 /* Avoid wasting space on 8-byte longs. */
 #if UINT_MAX >= 0xffffffff
 typedef unsigned int uLong;
@@ -52,7 +54,7 @@ static uLong crc_table[256];
  * with the ccorrect final value.  Thus, it is safe to call
  * even on a table that someone else is using concurrently.
  */
-static void 
+static void
 crc_init ()
 {
   static int once;
@@ -64,12 +66,12 @@ crc_init ()
   once = 1;
   crc_table[0] = 0;
   for (i = 128; i; i >>= 1)
-    {
-      h = (h >> 1) ^ ((h & 1) ? POLYNOMIAL : 0);
-      /* h is now crc_table[i] */
-      for (j = 0; j < 256; j += 2 * i)
-        crc_table[i + j] = crc_table[j] ^ h;
-    }
+  {
+    h = (h >> 1) ^ ((h & 1) ? POLYNOMIAL : 0);
+    /* h is now crc_table[i] */
+    for (j = 0; j < 256; j += 2 * i)
+      crc_table[i + j] = crc_table[j] ^ h;
+  }
 }
 
 /*
@@ -105,6 +107,7 @@ int32_t
 GNUNET_CRYPTO_crc32_n (const void *buf, size_t len)
 {
   uLong crc;
+
   crc = crc32 (0L, Z_NULL, 0);
   crc = crc32 (crc, (char *) buf, len);
   return crc;