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:
Diffstat (limited to 'source/blender/blenlib/BLI_color.hh')
-rw-r--r--source/blender/blenlib/BLI_color.hh12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenlib/BLI_color.hh b/source/blender/blenlib/BLI_color.hh
index c0d2f43645d..e57a5109a66 100644
--- a/source/blender/blenlib/BLI_color.hh
+++ b/source/blender/blenlib/BLI_color.hh
@@ -63,10 +63,10 @@ struct Color4f {
uint64_t hash() const
{
- uint64_t x1 = *(uint32_t *)&r;
- uint64_t x2 = *(uint32_t *)&g;
- uint64_t x3 = *(uint32_t *)&b;
- uint64_t x4 = *(uint32_t *)&a;
+ uint64_t x1 = *reinterpret_cast<const uint32_t *>(&r);
+ uint64_t x2 = *reinterpret_cast<const uint32_t *>(&g);
+ uint64_t x3 = *reinterpret_cast<const uint32_t *>(&b);
+ uint64_t x4 = *reinterpret_cast<const uint32_t *>(&a);
return (x1 * 1283591) ^ (x2 * 850177) ^ (x3 * 735391) ^ (x4 * 442319);
}
};
@@ -120,8 +120,8 @@ struct Color4b {
uint64_t hash() const
{
- return ((uint64_t)r * 1283591) ^ ((uint64_t)g * 850177) ^ ((uint64_t)b * 735391) ^
- ((uint64_t)a * 442319);
+ return static_cast<uint64_t>(r * 1283591) ^ static_cast<uint64_t>(g * 850177) ^
+ static_cast<uint64_t>(b * 735391) ^ static_cast<uint64_t>(a * 442319);
}
};