Update format.h

To prevent the following compiler message:
[...]/include/fmt/format.h:392:20: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion]
  392 |     unsigned value[size];
      |                    ^~~~
This commit is contained in:
Juraj 2022-02-19 11:10:45 +01:00 committed by Victor Zverovich
parent cbc59ca893
commit 70dc3de053

View File

@ -389,7 +389,7 @@ template <typename To, typename From, FMT_ENABLE_IF(sizeof(To) > sizeof(From))>
inline auto bit_cast(const From& from) -> To {
constexpr auto size = static_cast<int>(sizeof(From) / sizeof(unsigned));
struct data_t {
unsigned value[size];
unsigned value[static_cast<unsigned>(size)];
} data = bit_cast<data_t>(from);
auto result = To();
if (const_check(is_big_endian())) {