diff options
author | Jacques Lucke <jacques@blender.org> | 2022-09-25 18:39:45 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-09-25 18:39:45 +0300 |
commit | c6e70e7bacf82b38ca7125d6821713a711489c0b (patch) | |
tree | 3679590f6254b7fbbd6623080edafe217f20c7b6 /source/blender/blenlib/BLI_rand.hh | |
parent | 0419ee871ff960f62e28a2a9fed764f66c616d71 (diff) |
Cleanup: follow C++ type cast style guide in some files
https://wiki.blender.org/wiki/Style_Guide/C_Cpp#C.2B.2B_Type_Cast
This was discussed in https://devtalk.blender.org/t/rfc-style-guide-for-type-casts-in-c-code/25907.
Diffstat (limited to 'source/blender/blenlib/BLI_rand.hh')
-rw-r--r-- | source/blender/blenlib/BLI_rand.hh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_rand.hh b/source/blender/blenlib/BLI_rand.hh index 2c4484bd63f..e4f35bef217 100644 --- a/source/blender/blenlib/BLI_rand.hh +++ b/source/blender/blenlib/BLI_rand.hh @@ -29,7 +29,7 @@ class RandomNumberGenerator { void seed(uint32_t seed) { constexpr uint64_t lowseed = 0x330E; - x_ = (static_cast<uint64_t>(seed) << 16) | lowseed; + x_ = (uint64_t(seed) << 16) | lowseed; } /** @@ -40,13 +40,13 @@ class RandomNumberGenerator { uint32_t get_uint32() { this->step(); - return static_cast<uint32_t>(x_ >> 17); + return uint32_t(x_ >> 17); } int32_t get_int32() { this->step(); - return static_cast<int32_t>(x_ >> 17); + return int32_t(x_ >> 17); } /** @@ -63,7 +63,7 @@ class RandomNumberGenerator { */ double get_double() { - return (double)this->get_int32() / 0x80000000; + return double(this->get_int32()) / 0x80000000; } /** |