diff options
Diffstat (limited to 'source/blender/blenlib/BLI_rand.hh')
-rw-r--r-- | source/blender/blenlib/BLI_rand.hh | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/blenlib/BLI_rand.hh b/source/blender/blenlib/BLI_rand.hh index 7a98ee0f2bb..1b321bd7bcd 100644 --- a/source/blender/blenlib/BLI_rand.hh +++ b/source/blender/blenlib/BLI_rand.hh @@ -18,8 +18,7 @@ * \ingroup bli */ -#ifndef __BLI_RAND_HH__ -#define __BLI_RAND_HH__ +#pragma once #include "BLI_float2.hh" #include "BLI_float3.hh" @@ -45,7 +44,7 @@ class RandomNumberGenerator { void seed(uint32_t seed) { constexpr uint64_t lowseed = 0x330E; - x_ = (((uint64_t)seed) << 16) | lowseed; + x_ = (static_cast<uint64_t>(seed) << 16) | lowseed; } void seed_random(uint32_t seed); @@ -53,13 +52,13 @@ class RandomNumberGenerator { uint32_t get_uint32() { this->step(); - return (uint32_t)(x_ >> 17); + return static_cast<uint32_t>(x_ >> 17); } int32_t get_int32() { this->step(); - return (int32_t)(x_ >> 17); + return static_cast<int32_t>(x_ >> 17); } /** @@ -143,5 +142,3 @@ class RandomNumberGenerator { }; } // namespace blender - -#endif /* __BLI_RAND_HH__ */ |