diff options
Diffstat (limited to 'source/blender/blenlib/BLI_hash.h')
-rw-r--r-- | source/blender/blenlib/BLI_hash.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenlib/BLI_hash.h b/source/blender/blenlib/BLI_hash.h index 50c7a7f9f0f..e849e5f8f61 100644 --- a/source/blender/blenlib/BLI_hash.h +++ b/source/blender/blenlib/BLI_hash.h @@ -27,7 +27,7 @@ BLI_INLINE unsigned int BLI_hash_int_2d(unsigned int kx, unsigned int ky) { -#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) +#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k)))) unsigned int a, b, c; @@ -35,13 +35,13 @@ BLI_INLINE unsigned int BLI_hash_int_2d(unsigned int kx, unsigned int ky) a += kx; b += ky; - c ^= b; c -= rot(b,14); - a ^= c; a -= rot(c,11); - b ^= a; b -= rot(a,25); - c ^= b; c -= rot(b,16); - a ^= c; a -= rot(c,4); - b ^= a; b -= rot(a,14); - c ^= b; c -= rot(b,24); + c ^= b; c -= rot(b, 14); + a ^= c; a -= rot(c, 11); + b ^= a; b -= rot(a, 25); + c ^= b; c -= rot(b, 16); + a ^= c; a -= rot(c, 4); + b ^= a; b -= rot(a, 14); + c ^= b; c -= rot(b, 24); return c; @@ -52,9 +52,9 @@ BLI_INLINE unsigned int BLI_hash_string(const char *str) { unsigned int i = 0, c; - while((c = *str++)) + while ((c = *str++)) { i = i * 37 + c; - + } return i; } |