aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2014-03-10 10:36:59 +0000
committerFlorian Dold <florian.dold@gmail.com>2014-03-10 10:36:59 +0000
commita2540528ac3ec7d2c7f46ce01922cee64c22ad3a (patch)
treeef29c9fda8fe23a28d12323c48f1c93cb42334e4
parentd7e93896db27fbc49e1dbb13b2f57b247c7b8f33 (diff)
downloadgnunet-a2540528ac3ec7d2c7f46ce01922cee64c22ad3a.tar.gz
gnunet-a2540528ac3ec7d2c7f46ce01922cee64c22ad3a.zip
Rename uLong to GNUNET_uLong from crypto_crc so that it doesn't collide with the different uLong from zconf of zlib
-rw-r--r--src/util/crypto_crc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/util/crypto_crc.c b/src/util/crypto_crc.c
index cda6243be..db0b5bf63 100644
--- a/src/util/crypto_crc.c
+++ b/src/util/crypto_crc.c
@@ -34,9 +34,9 @@
34 34
35/* Avoid wasting space on 8-byte longs. */ 35/* Avoid wasting space on 8-byte longs. */
36#if UINT_MAX >= 0xffffffff 36#if UINT_MAX >= 0xffffffff
37typedef unsigned int uLong; 37typedef unsigned int GNUNET_uLong;
38#elif ULONG_MAX >= 0xffffffff 38#elif ULONG_MAX >= 0xffffffff
39typedef unsigned long uLong; 39typedef unsigned long GNUNET_uLong;
40#else 40#else
41#error This compiler is not ANSI-compliant! 41#error This compiler is not ANSI-compliant!
42#endif 42#endif
@@ -44,8 +44,8 @@ typedef unsigned long uLong;
44#define Z_NULL 0 44#define Z_NULL 0
45 45
46 46
47#define POLYNOMIAL (uLong)0xedb88320 47#define POLYNOMIAL (GNUNET_uLong)0xedb88320
48static uLong crc_table[256]; 48static GNUNET_uLong crc_table[256];
49 49
50/* 50/*
51 * This routine writes each crc_table entry exactly once, 51 * This routine writes each crc_table entry exactly once,
@@ -57,7 +57,7 @@ crc_init ()
57{ 57{
58 static int once; 58 static int once;
59 unsigned int i, j; 59 unsigned int i, j;
60 uLong h = 1; 60 GNUNET_uLong h = 1;
61 61
62 if (once) 62 if (once)
63 return; 63 return;
@@ -82,8 +82,8 @@ crc_init ()
82 * to data in little-endian byte and bit order to preserve the 82 * to data in little-endian byte and bit order to preserve the
83 * property of detecting all burst errors of length 32 bits or less. 83 * property of detecting all burst errors of length 32 bits or less.
84 */ 84 */
85static uLong 85static GNUNET_uLong
86crc32 (uLong crc, const char *buf, size_t len) 86crc32 (GNUNET_uLong crc, const char *buf, size_t len)
87{ 87{
88 crc_init (); 88 crc_init ();
89 GNUNET_assert (crc_table[255] != 0); 89 GNUNET_assert (crc_table[255] != 0);
@@ -104,7 +104,7 @@ crc32 (uLong crc, const char *buf, size_t len)
104int32_t 104int32_t
105GNUNET_CRYPTO_crc32_n (const void *buf, size_t len) 105GNUNET_CRYPTO_crc32_n (const void *buf, size_t len)
106{ 106{
107 uLong crc; 107 GNUNET_uLong crc;
108 108
109 crc = crc32 (0L, Z_NULL, 0); 109 crc = crc32 (0L, Z_NULL, 0);
110 crc = crc32 (crc, (char *) buf, len); 110 crc = crc32 (crc, (char *) buf, len);