Commit 0a8d854a authored by Alessandro Guido's avatar Alessandro Guido

Avoid compiler errors if u32 is defined as a type

Fixes this error:
	/hash.h:304:13: error: two or more data types in
	declaration specifiers
parent 48b70095
...@@ -301,11 +301,11 @@ static inline uint32_t hash_pointer(const void *p, uint32_t base) ...@@ -301,11 +301,11 @@ static inline uint32_t hash_pointer(const void *p, uint32_t base)
if (sizeof(p) % sizeof(uint32_t) == 0) { if (sizeof(p) % sizeof(uint32_t) == 0) {
/* This convoluted union is the right way of aliasing. */ /* This convoluted union is the right way of aliasing. */
union { union {
uint32_t u32[sizeof(p) / sizeof(uint32_t)]; uint32_t a[sizeof(p) / sizeof(uint32_t)];
const void *p; const void *p;
} u; } u;
u.p = p; u.p = p;
return hash_u32(u.u32, sizeof(p) / sizeof(uint32_t), base); return hash_u32(u.a, sizeof(p) / sizeof(uint32_t), base);
} else } else
return hash(&p, 1, base); return hash(&p, 1, base);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment