diff options
author | Florian Dold <florian.dold@gmail.com> | 2014-03-10 10:36:59 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2014-03-10 10:36:59 +0000 |
commit | a2540528ac3ec7d2c7f46ce01922cee64c22ad3a (patch) | |
tree | ef29c9fda8fe23a28d12323c48f1c93cb42334e4 | |
parent | d7e93896db27fbc49e1dbb13b2f57b247c7b8f33 (diff) | |
download | gnunet-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.c | 16 |
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 |
37 | typedef unsigned int uLong; | 37 | typedef unsigned int GNUNET_uLong; |
38 | #elif ULONG_MAX >= 0xffffffff | 38 | #elif ULONG_MAX >= 0xffffffff |
39 | typedef unsigned long uLong; | 39 | typedef 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 |
48 | static uLong crc_table[256]; | 48 | static 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 | */ |
85 | static uLong | 85 | static GNUNET_uLong |
86 | crc32 (uLong crc, const char *buf, size_t len) | 86 | crc32 (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) | |||
104 | int32_t | 104 | int32_t |
105 | GNUNET_CRYPTO_crc32_n (const void *buf, size_t len) | 105 | GNUNET_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); |