#ifndef CCAN_HASH_H
#define CCAN_HASH_H
+#include "config.h"
#include <stdint.h>
#include <stdlib.h>
-#include "config.h"
#include <ccan/build_assert/build_assert.h>
/* Stolen mostly from: lookup3.c, by Bob Jenkins, May 2006, Public Domain.
if (sizeof(p) % sizeof(uint32_t) == 0) {
/* This convoluted union is the right way of aliasing. */
union {
- uint32_t u32[sizeof(p) / sizeof(uint32_t)];
+ uint32_t a[sizeof(p) / sizeof(uint32_t)];
const void *p;
} u;
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
return hash(&p, 1, base);
}