Visual Studio 2022: fmt/format-inl.h(1145,60): warning C4310: cast truncates constant value #3287 (#3288)

This commit is contained in:
Ivan Shynkarenka 2023-01-26 23:46:30 +04:00 committed by GitHub
parent a2c05a10ec
commit 70db193f09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1142,7 +1142,7 @@ FMT_INLINE int remove_trailing_zeros(uint32_t& n) noexcept {
// See https://github.com/fmtlib/fmt/issues/3163 for more details.
const uint32_t mod_inv_5 = 0xcccccccd;
// Casts are needed to workaround a bug in MSVC 19.22 and older.
const uint32_t mod_inv_25 = uint32_t(uint64_t(mod_inv_5) * mod_inv_5);
const uint32_t mod_inv_25 = static_cast<uint32_t>(uint64_t(mod_inv_5) * mod_inv_5);
int s = 0;
while (true) {