Skip to content

Commit

Permalink
Visual Studio 2022: fmt/format-inl.h(1145,60): warning C4310: cast tr…
Browse files Browse the repository at this point in the history
…uncates constant value #3287 (#3288)
  • Loading branch information
chronoxor authored Jan 26, 2023
1 parent a2c05a1 commit 70db193
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fmt/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 70db193

Please sign in to comment.