diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-20 13:16:20 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-20 13:16:20 +0300 |
commit | 8cbbdedaf4dfec9e320e7e2be58b75d256950df1 (patch) | |
tree | 496b9620e11ac44e515b0bb4ca52c05834d557f9 /source/blender/blenlib/BLI_float3.hh | |
parent | 686ab4c9401a90b22fb17e46c992eb513fe4f693 (diff) |
Refactor: Update integer type usage
This updates the usage of integer types in code I wrote according to our new style guides.
Major changes:
* Use signed instead of unsigned integers in many places.
* C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`).
* Hash values for C++ containers are 64 bit wide now (instead of 32 bit).
I do hope that I broke no builds, but it is quite likely that some compiler reports
slightly different errors. Please let me know when there are any errors. If the fix
is small, feel free to commit it yourself.
I compiled successfully on linux with gcc and on windows.
Diffstat (limited to 'source/blender/blenlib/BLI_float3.hh')
-rw-r--r-- | source/blender/blenlib/BLI_float3.hh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_float3.hh b/source/blender/blenlib/BLI_float3.hh index a36cedad41d..b2633985ac7 100644 --- a/source/blender/blenlib/BLI_float3.hh +++ b/source/blender/blenlib/BLI_float3.hh @@ -188,11 +188,11 @@ struct float3 { z = -z; } - uint32_t hash() const + uint64_t hash() const { - uint32_t x1 = *(uint32_t *)&x; - uint32_t x2 = *(uint32_t *)&y; - uint32_t x3 = *(uint32_t *)&z; + uint64_t x1 = *(uint32_t *)&x; + uint64_t x2 = *(uint32_t *)&y; + uint64_t x3 = *(uint32_t *)&z; return (x1 * 435109) ^ (x2 * 380867) ^ (x3 * 1059217); } |