--- deliantra/server/include/util.h 2010/07/06 20:00:46 1.111 +++ deliantra/server/include/util.h 2011/04/22 02:03:11 1.113 @@ -116,6 +116,7 @@ template static inline T sign0 (T v) { return v ? sign (v) : 0; } +//clashes with C++0x template static inline T copysign (T a, U b) { return a > 0 ? b : -b; } @@ -513,12 +514,13 @@ // with good distribution. // FNV-1a is faster on many cpus because the multiplication // runs concurrently with the looping logic. + // we modify the hash a bit to improve its distribution uint32_t hash = STRHSH_NULL; while (*s) hash = (hash ^ *s++) * 16777619U; - return hash; + return hash ^ (hash >> 16); } static inline uint32_t