X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fhash%2Fhash.h;h=217068406af701b74257d4066c5bdf39d41f41e8;hp=0400e6a3b29bbc4505e707ed5231ed197ad6f22a;hb=7d1f0c73e4d321561abb74f82c8be97f10d69836;hpb=97648992fdd50535fe276261368c179df993202b diff --git a/ccan/hash/hash.h b/ccan/hash/hash.h index 0400e6a3..21706840 100644 --- a/ccan/hash/hash.h +++ b/ccan/hash/hash.h @@ -1,3 +1,4 @@ +/* CC0 (Public domain) - see LICENSE file for details */ #ifndef CCAN_HASH_H #define CCAN_HASH_H #include "config.h" @@ -301,11 +302,11 @@ static inline uint32_t hash_pointer(const void *p, uint32_t base) 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); }