Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /intern/cycles/util/util_hash.h
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'intern/cycles/util/util_hash.h')
-rw-r--r--intern/cycles/util/util_hash.h55
1 files changed, 31 insertions, 24 deletions
diff --git a/intern/cycles/util/util_hash.h b/intern/cycles/util/util_hash.h
index f343252eaca..785482967db 100644
--- a/intern/cycles/util/util_hash.h
+++ b/intern/cycles/util/util_hash.h
@@ -23,49 +23,56 @@ CCL_NAMESPACE_BEGIN
ccl_device_inline uint hash_int_2d(uint kx, uint ky)
{
-#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
-
- uint a, b, c;
-
- a = b = c = 0xdeadbeef + (2 << 2) + 13;
- 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);
-
- return c;
+#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
+
+ uint a, b, c;
+
+ a = b = c = 0xdeadbeef + (2 << 2) + 13;
+ 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);
+
+ return c;
#undef rot
}
ccl_device_inline uint hash_int(uint k)
{
- return hash_int_2d(k, 0);
+ return hash_int_2d(k, 0);
}
#ifndef __KERNEL_GPU__
static inline uint hash_string(const char *str)
{
- uint i = 0, c;
+ uint i = 0, c;
- while((c = *str++))
- i = i * 37 + c;
+ while ((c = *str++))
+ i = i * 37 + c;
- return i;
+ return i;
}
#endif
ccl_device_inline float hash_int_01(uint k)
{
- return (float)hash_int(k) * (1.0f/(float)0xFFFFFFFF);
+ return (float)hash_int(k) * (1.0f / (float)0xFFFFFFFF);
}
CCL_NAMESPACE_END
-#endif /* __UTIL_HASH_H__ */
+#endif /* __UTIL_HASH_H__ */