elf.c: section limit inference for linux, fixes for stb_ds.h hashing, more compilation flags
This commit is contained in:
6
third-party/stb/stb_ds.h
vendored
6
third-party/stb/stb_ds.h
vendored
@ -1121,7 +1121,7 @@ size_t stbds_hash_bytes(void *p, size_t len, size_t seed)
|
||||
unsigned char *d = (unsigned char *) p;
|
||||
|
||||
if (len == 4) {
|
||||
unsigned int hash = d[0] | (d[1] << 8) | (d[2] << 16) | (d[3] << 24);
|
||||
uint32_t hash = (uint32_t)d[0] | ((uint32_t)d[1] << 8) | ((uint32_t)d[2] << 16) | ((uint32_t)d[3] << 24);
|
||||
#if 0
|
||||
// HASH32-A Bob Jenkin's hash function w/o large constants
|
||||
hash ^= seed;
|
||||
@ -1177,8 +1177,8 @@ size_t stbds_hash_bytes(void *p, size_t len, size_t seed)
|
||||
|
||||
return (((size_t) hash << 16 << 16) | hash) ^ seed;
|
||||
} else if (len == 8 && sizeof(size_t) == 8) {
|
||||
size_t hash = d[0] | (d[1] << 8) | (d[2] << 16) | (d[3] << 24);
|
||||
hash |= (size_t) (d[4] | (d[5] << 8) | (d[6] << 16) | (d[7] << 24)) << 16 << 16; // avoid warning if size_t == 4
|
||||
size_t hash = (size_t)d[0] | ((size_t)d[1] << 8) | ((size_t)d[2] << 16) | ((size_t)d[3] << 24);
|
||||
hash |= ((size_t)d[4] | ((size_t)d[5] << 8) | ((size_t)d[6] << 16) | ((size_t)d[7] << 24)) << 16 << 16;
|
||||
hash ^= seed;
|
||||
hash = (~hash) + (hash << 21);
|
||||
hash ^= STBDS_ROTATE_RIGHT(hash,24);
|
||||
|
Reference in New Issue
Block a user