41 #if defined(__ARM_FEATURE_UNALIGNED) || defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) 42 # define XXH_USE_UNALIGNED_ACCESS 1 59 #define XXH_FORCE_NATIVE_FORMAT 0 66 #ifdef _MSC_VER // Visual Studio 67 # pragma warning(disable : 4127) // disable: C4127: conditional expression is constant 70 #ifdef _MSC_VER // Visual Studio 71 # define FORCE_INLINE static __forceinline 74 # define FORCE_INLINE static inline __attribute__((always_inline)) 76 # define FORCE_INLINE static inline 98 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L // C99 100 typedef uint8_t
BYTE;
101 typedef uint16_t
U16;
102 typedef uint32_t
U32;
104 typedef uint64_t
U64;
107 typedef unsigned short U16;
110 typedef unsigned long long U64;
113 #if defined(__GNUC__) && !defined(XXH_USE_UNALIGNED_ACCESS) 114 # define _PACKED __attribute__ ((packed)) 119 #if !defined(XXH_USE_UNALIGNED_ACCESS) && !defined(__GNUC__) 123 # pragma pack(push, 1) 129 #if !defined(XXH_USE_UNALIGNED_ACCESS) && !defined(__GNUC__) 133 #define A32(x) (((U32_S *)(x))->v) 139 #define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) 142 #if defined(_MSC_VER) 143 # define XXH_rotl32(x,r) _rotl(x,r) 145 # define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r))) 148 #if defined(_MSC_VER) // Visual Studio 149 # define XXH_swap32 _byteswap_ulong 150 #elif GCC_VERSION >= 403 151 # define XXH_swap32 __builtin_bswap32 154 return ((x << 24) & 0xff000000 ) |
155 ((x << 8) & 0x00ff0000 ) |
156 ((x >> 8) & 0x0000ff00 ) |
157 ((x >> 24) & 0x000000ff );}
164 #define PRIME32_1 2654435761U 165 #define PRIME32_2 2246822519U 166 #define PRIME32_3 3266489917U 167 #define PRIME32_4 668265263U 168 #define PRIME32_5 374761393U 175 #ifndef XXH_CPU_LITTLE_ENDIAN // It is possible to define XXH_CPU_LITTLE_ENDIAN externally, for example using a compiler switch 177 # define XXH_CPU_LITTLE_ENDIAN (*(char*)(&one)) 184 #define XXH_STATIC_ASSERT(c) { enum { XXH_static_assert = 1/(!!(c)) }; } // use only *after* variable declarations 209 const BYTE*
const bEnd = p + len;
212 #ifdef XXH_ACCEPT_NULL_INPUT_POINTER 213 if (p==NULL) { len=0; p=(
const BYTE*)(
size_t)16; }
218 const BYTE*
const limit = bEnd - 16;
275 # if !defined(XXH_USE_UNALIGNED_ACCESS) 276 if ((((
size_t)input) & 3))
323 state->
v3 = seed + 0;
343 const BYTE*
const bEnd = p + len;
345 #ifdef XXH_ACCEPT_NULL_INPUT_POINTER 374 const BYTE*
const limit = bEnd - 16;
397 state->
memsize = (int)(bEnd-p);
U32 XXH32(const void *input, int len, U32 seed)
FORCE_INLINE U32 XXH32_endian_align(const void *input, int len, U32 seed, XXH_endianess endian, XXH_alignment align)
U32 XXH32_digest(void *state_in)
#define XXH32_SIZEOFSTATE
FORCE_INLINE U32 XXH32_intermediateDigest_endian(void *state_in, XXH_endianess endian)
void * XXH32_init(U32 seed)
XXH_errorcode XXH32_resetState(void *state_in, U32 seed)
#define XXH_CPU_LITTLE_ENDIAN
FORCE_INLINE void * XXH_memcpy(void *dest, const void *src, size_t size)
U32 XXH32_intermediateDigest(void *state_in)
FORCE_INLINE XXH_errorcode XXH32_update_endian(void *state_in, const void *input, int len, XXH_endianess endian)
XXH_errorcode XXH32_update(void *state_in, const void *input, int len)
#define XXH_STATIC_ASSERT(c)
FORCE_INLINE U32 XXH_readLE32_align(const U32 *ptr, XXH_endianess endian, XXH_alignment align)
FORCE_INLINE void XXH_free(void *p)
static U32 XXH_swap32(U32 x)
#define XXH_FORCE_NATIVE_FORMAT
FORCE_INLINE void * XXH_malloc(size_t s)
FORCE_INLINE U32 XXH_readLE32(const U32 *ptr, XXH_endianess endian)