diff options
| author | Sven Fischer | 2024-05-23 16:49:57 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2024-10-14 21:37:35 +0200 |
| commit | 0b2af562710d1bac7fd32ca3f05bf1d713bb97e4 (patch) | |
| tree | c3dd2afbc4d83e4476dcb8cdb25ddae6e89788bf /src/catch2/internal | |
| parent | 69d62abc9a48033177b99ae79c13a6f1b280e94c (diff) | |
| download | catch3-0b2af562710d1bac7fd32ca3f05bf1d713bb97e4.tar.gz | |
Explicitly cast values of different types
In case the warning -Werror=conversion is active with GCC, the warnings
about "conversion from A to B may change value" lead to a compilation
error. This explicitly convert the values to address these warnings.
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_random_number_generator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/catch2/internal/catch_random_number_generator.cpp b/src/catch2/internal/catch_random_number_generator.cpp index 6a79dff3..c88cd8f2 100644 --- a/src/catch2/internal/catch_random_number_generator.cpp +++ b/src/catch2/internal/catch_random_number_generator.cpp @@ -52,7 +52,7 @@ namespace { SimplePcg32::result_type SimplePcg32::operator()() { // prepare the output value const uint32_t xorshifted = static_cast<uint32_t>(((m_state >> 18u) ^ m_state) >> 27u); - const auto output = rotate_right(xorshifted, m_state >> 59u); + const auto output = rotate_right(xorshifted, static_cast<uint32_t>(m_state >> 59u)); // advance state m_state = m_state * 6364136223846793005ULL + s_inc; |