Skip to content
Myr

stb_ds: fix shift warnings in later VS compilers

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parent e704ed0 · Browse files · 1 file+5 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−4 removed

  • other:+5 added−4 removed

1 file+5 added−4 removed

modified:stb_ds.h+5 added-4 removed
914 unmodified lines
915 v0 ^= data;916 }917 data = len << (STBDS_SIZE_T_BITS-8);918 switch (len - i) {919 case 7: data |= ((size_t) d[6] << 48);920 case 6: data |= ((size_t) d[5] << 40);921 case 5: data |= ((size_t) d[4] << 32);919 case 7: data |= ((size_t) d[6] << 24) << 24;920 case 6: data |= ((size_t) d[5] << 20) << 20;921 case 5: data |= ((size_t) d[4] << 16) << 16;922 case 4: data |= (d[3] << 24);923 case 3: data |= (d[2] << 16);924 case 2: data |= (d[1] << 8);925 case 1: data |= d[0];
73 unmodified lines
999 // 15.58ms // 14.79ms // 15.52ms : 200,000 inserts creating 200K table with varying key spacing10001001 return (((size_t) hash << 16 << 16) | hash) ^ seed;1002 } else if (len == 8 && sizeof(size_t) == 8) {1003 size_t hash = d[0] | (d[1] << 8) | (d[2] << 16) | (d[3] << 24) | ((size_t)d[4] << 32) | ((size_t)d[5] << 40) | ((size_t)d[6] << 48) | ((size_t)d[7] << 56);1003 size_t hash = d[0] | (d[1] << 8) | (d[2] << 16) | (d[3] << 24);1004 hash |= (size_t) (d[4] | (d[5] << 8) | (d[6] << 16) | (d[7] << 24)) << 16 << 16; // avoid warning if size_t == 41005 hash ^= seed ^ len;1006 hash = (~hash) + (hash << 21);1007 hash ^= STBDS_ROTATE_RIGHT(hash,24);1008 hash *= 265;
619 unmodified lines