less problematic definitions

This commit is contained in:
van Hauser
2020-06-28 23:47:57 +02:00
parent 81974c4d5e
commit c25a602a03
7 changed files with 22 additions and 14 deletions

View File

@ -37,7 +37,7 @@ void rand_set_seed(afl_state_t *afl, s64 init_seed) {
afl->init_seed = init_seed;
afl->rand_seed[0] =
hash64((void *)&afl->init_seed, sizeof(afl->init_seed), HASH_CONST);
hash64((u8 *)&afl->init_seed, sizeof(afl->init_seed), HASH_CONST);
afl->rand_seed[1] = afl->rand_seed[0] ^ 0x1234567890abcdef;
afl->rand_seed[2] = afl->rand_seed[0] & 0x0123456789abcdef;
afl->rand_seed[3] = afl->rand_seed[0] | 0x01abcde43f567908;
@ -141,13 +141,17 @@ void long_jump(afl_state_t *afl) {
/* we switch from afl's murmur implementation to xxh3 as it is 30% faster -
and get 64 bit hashes instead of just 32 bit. Less collisions! :-) */
u32 inline hash32(const void *key, u32 len, u32 seed) {
u32 inline hash32(void *key, u32 len, u32 seed) {
return (u32)XXH64(key, len, seed);
}
u64 inline hash64(const void *key, u32 len, u64 seed) {
#ifdef _DEBUG
u64 hash64(u8 *key, u32 len, u64 seed) {
#else
u64 inline hash64(u8 *key, u32 len, u64 seed) {
#endif
return XXH64(key, len, seed);